const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BFeC9daR.js","assets/hooks.module-Cl6kuh_P.js","assets/index-CIwyOTPG.js"])))=>i.map(i=>d[i]);
var MS=Object.defineProperty;var zE=Fn=>{throw TypeError(Fn)};var DS=(Fn,Mn,rs)=>Mn in Fn?MS(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs;var _m=(Fn,Mn,rs)=>DS(Fn,typeof Mn!="symbol"?Mn+"":Mn,rs),Fw=(Fn,Mn,rs)=>Mn.has(Fn)||zE("Cannot "+rs);var Ep=(Fn,Mn,rs)=>(Fw(Fn,Mn,"read from private field"),rs?rs.call(Fn):Mn.get(Fn)),Nm=(Fn,Mn,rs)=>Mn.has(Fn)?zE("Cannot add the same private member more than once"):Mn instanceof WeakSet?Mn.add(Fn):Mn.set(Fn,rs),gm=(Fn,Mn,rs,is)=>(Fw(Fn,Mn,"write to private field"),is?is.call(Fn,rs):Mn.set(Fn,rs),rs),m1=(Fn,Mn,rs)=>(Fw(Fn,Mn,"access private method"),rs);var jx=(Fn,Mn,rs,is)=>({set _(os){gm(Fn,Mn,os,rs)},get _(){return Ep(Fn,Mn,is)}});function _mergeNamespaces(Fn,Mn){for(var rs=0;rs<Mn.length;rs++){const is=Mn[rs];if(typeof is!="string"&&!Array.isArray(is)){for(const os in is)if(os!=="default"&&!(os in Fn)){const as=Object.getOwnPropertyDescriptor(is,os);as&&Object.defineProperty(Fn,os,as.get?as:{enumerable:!0,get:()=>is[os]})}}}return Object.freeze(Object.defineProperty(Fn,Symbol.toStringTag,{value:"Module"}))}(function(){const Mn=document.createElement("link").relList;if(Mn&&Mn.supports&&Mn.supports("modulepreload"))return;for(const os of document.querySelectorAll('link[rel="modulepreload"]'))is(os);new MutationObserver(os=>{for(const as of os)if(as.type==="childList")for(const us of as.addedNodes)us.tagName==="LINK"&&us.rel==="modulepreload"&&is(us)}).observe(document,{childList:!0,subtree:!0});function rs(os){const as={};return os.integrity&&(as.integrity=os.integrity),os.referrerPolicy&&(as.referrerPolicy=os.referrerPolicy),os.crossOrigin==="use-credentials"?as.credentials="include":os.crossOrigin==="anonymous"?as.credentials="omit":as.credentials="same-origin",as}function is(os){if(os.ep)return;os.ep=!0;const as=rs(os);fetch(os.href,as)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(Fn){return Fn&&Fn.__esModule&&Object.prototype.hasOwnProperty.call(Fn,"default")?Fn.default:Fn}function getAugmentedNamespace(Fn){if(Fn.__esModule)return Fn;var Mn=Fn.default;if(typeof Mn=="function"){var rs=function is(){return this instanceof is?Reflect.construct(Mn,arguments,this.constructor):Mn.apply(this,arguments)};rs.prototype=Mn.prototype}else rs={};return Object.defineProperty(rs,"__esModule",{value:!0}),Object.keys(Fn).forEach(function(is){var os=Object.getOwnPropertyDescriptor(Fn,is);Object.defineProperty(rs,is,os.get?os:{enumerable:!0,get:function(){return Fn[is]}})}),rs}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react$2={exports:{}},react_production_min={};/**
 * @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 l$a=Symbol.for("react.element"),n$f=Symbol.for("react.portal"),p$b=Symbol.for("react.fragment"),q$8=Symbol.for("react.strict_mode"),r$f=Symbol.for("react.profiler"),t$9=Symbol.for("react.provider"),u$7=Symbol.for("react.context"),v$b=Symbol.for("react.forward_ref"),w$9=Symbol.for("react.suspense"),x$8=Symbol.for("react.memo"),y$8=Symbol.for("react.lazy"),z$b=Symbol.iterator;function A$5(Fn){return Fn===null||typeof Fn!="object"?null:(Fn=z$b&&Fn[z$b]||Fn["@@iterator"],typeof Fn=="function"?Fn:null)}var B$4={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$4=Object.assign,D$5={};function E$6(Fn,Mn,rs){this.props=Fn,this.context=Mn,this.refs=D$5,this.updater=rs||B$4}E$6.prototype.isReactComponent={};E$6.prototype.setState=function(Fn,Mn){if(typeof Fn!="object"&&typeof Fn!="function"&&Fn!=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,Fn,Mn,"setState")};E$6.prototype.forceUpdate=function(Fn){this.updater.enqueueForceUpdate(this,Fn,"forceUpdate")};function F$3(){}F$3.prototype=E$6.prototype;function G$4(Fn,Mn,rs){this.props=Fn,this.context=Mn,this.refs=D$5,this.updater=rs||B$4}var H$2=G$4.prototype=new F$3;H$2.constructor=G$4;C$4(H$2,E$6.prototype);H$2.isPureReactComponent=!0;var I$5=Array.isArray,J=Object.prototype.hasOwnProperty,K$5={current:null},L$4={key:!0,ref:!0,__self:!0,__source:!0};function M$5(Fn,Mn,rs){var is,os={},as=null,us=null;if(Mn!=null)for(is in Mn.ref!==void 0&&(us=Mn.ref),Mn.key!==void 0&&(as=""+Mn.key),Mn)J.call(Mn,is)&&!L$4.hasOwnProperty(is)&&(os[is]=Mn[is]);var ds=arguments.length-2;if(ds===1)os.children=rs;else if(1<ds){for(var hs=Array(ds),ps=0;ps<ds;ps++)hs[ps]=arguments[ps+2];os.children=hs}if(Fn&&Fn.defaultProps)for(is in ds=Fn.defaultProps,ds)os[is]===void 0&&(os[is]=ds[is]);return{$$typeof:l$a,type:Fn,key:as,ref:us,props:os,_owner:K$5.current}}function N$4(Fn,Mn){return{$$typeof:l$a,type:Fn.type,key:Mn,ref:Fn.ref,props:Fn.props,_owner:Fn._owner}}function O$7(Fn){return typeof Fn=="object"&&Fn!==null&&Fn.$$typeof===l$a}function escape$1(Fn){var Mn={"=":"=0",":":"=2"};return"$"+Fn.replace(/[=:]/g,function(rs){return Mn[rs]})}var P$5=/\/+/g;function Q$5(Fn,Mn){return typeof Fn=="object"&&Fn!==null&&Fn.key!=null?escape$1(""+Fn.key):Mn.toString(36)}function R$5(Fn,Mn,rs,is,os){var as=typeof Fn;(as==="undefined"||as==="boolean")&&(Fn=null);var us=!1;if(Fn===null)us=!0;else switch(as){case"string":case"number":us=!0;break;case"object":switch(Fn.$$typeof){case l$a:case n$f:us=!0}}if(us)return us=Fn,os=os(us),Fn=is===""?"."+Q$5(us,0):is,I$5(os)?(rs="",Fn!=null&&(rs=Fn.replace(P$5,"$&/")+"/"),R$5(os,Mn,rs,"",function(ps){return ps})):os!=null&&(O$7(os)&&(os=N$4(os,rs+(!os.key||us&&us.key===os.key?"":(""+os.key).replace(P$5,"$&/")+"/")+Fn)),Mn.push(os)),1;if(us=0,is=is===""?".":is+":",I$5(Fn))for(var ds=0;ds<Fn.length;ds++){as=Fn[ds];var hs=is+Q$5(as,ds);us+=R$5(as,Mn,rs,hs,os)}else if(hs=A$5(Fn),typeof hs=="function")for(Fn=hs.call(Fn),ds=0;!(as=Fn.next()).done;)as=as.value,hs=is+Q$5(as,ds++),us+=R$5(as,Mn,rs,hs,os);else if(as==="object")throw Mn=String(Fn),Error("Objects are not valid as a React child (found: "+(Mn==="[object Object]"?"object with keys {"+Object.keys(Fn).join(", ")+"}":Mn)+"). If you meant to render a collection of children, use an array instead.");return us}function S$7(Fn,Mn,rs){if(Fn==null)return Fn;var is=[],os=0;return R$5(Fn,is,"","",function(as){return Mn.call(rs,as,os++)}),is}function T$5(Fn){if(Fn._status===-1){var Mn=Fn._result;Mn=Mn(),Mn.then(function(rs){(Fn._status===0||Fn._status===-1)&&(Fn._status=1,Fn._result=rs)},function(rs){(Fn._status===0||Fn._status===-1)&&(Fn._status=2,Fn._result=rs)}),Fn._status===-1&&(Fn._status=0,Fn._result=Mn)}if(Fn._status===1)return Fn._result.default;throw Fn._result}var U$4={current:null},V$3={transition:null},W$2={ReactCurrentDispatcher:U$4,ReactCurrentBatchConfig:V$3,ReactCurrentOwner:K$5};function X$2(){throw Error("act(...) is not supported in production builds of React.")}react_production_min.Children={map:S$7,forEach:function(Fn,Mn,rs){S$7(Fn,function(){Mn.apply(this,arguments)},rs)},count:function(Fn){var Mn=0;return S$7(Fn,function(){Mn++}),Mn},toArray:function(Fn){return S$7(Fn,function(Mn){return Mn})||[]},only:function(Fn){if(!O$7(Fn))throw Error("React.Children.only expected to receive a single React element child.");return Fn}};react_production_min.Component=E$6;react_production_min.Fragment=p$b;react_production_min.Profiler=r$f;react_production_min.PureComponent=G$4;react_production_min.StrictMode=q$8;react_production_min.Suspense=w$9;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$2;react_production_min.act=X$2;react_production_min.cloneElement=function(Fn,Mn,rs){if(Fn==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Fn+".");var is=C$4({},Fn.props),os=Fn.key,as=Fn.ref,us=Fn._owner;if(Mn!=null){if(Mn.ref!==void 0&&(as=Mn.ref,us=K$5.current),Mn.key!==void 0&&(os=""+Mn.key),Fn.type&&Fn.type.defaultProps)var ds=Fn.type.defaultProps;for(hs in Mn)J.call(Mn,hs)&&!L$4.hasOwnProperty(hs)&&(is[hs]=Mn[hs]===void 0&&ds!==void 0?ds[hs]:Mn[hs])}var hs=arguments.length-2;if(hs===1)is.children=rs;else if(1<hs){ds=Array(hs);for(var ps=0;ps<hs;ps++)ds[ps]=arguments[ps+2];is.children=ds}return{$$typeof:l$a,type:Fn.type,key:os,ref:as,props:is,_owner:us}};react_production_min.createContext=function(Fn){return Fn={$$typeof:u$7,_currentValue:Fn,_currentValue2:Fn,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Fn.Provider={$$typeof:t$9,_context:Fn},Fn.Consumer=Fn};react_production_min.createElement=M$5;react_production_min.createFactory=function(Fn){var Mn=M$5.bind(null,Fn);return Mn.type=Fn,Mn};react_production_min.createRef=function(){return{current:null}};react_production_min.forwardRef=function(Fn){return{$$typeof:v$b,render:Fn}};react_production_min.isValidElement=O$7;react_production_min.lazy=function(Fn){return{$$typeof:y$8,_payload:{_status:-1,_result:Fn},_init:T$5}};react_production_min.memo=function(Fn,Mn){return{$$typeof:x$8,type:Fn,compare:Mn===void 0?null:Mn}};react_production_min.startTransition=function(Fn){var Mn=V$3.transition;V$3.transition={};try{Fn()}finally{V$3.transition=Mn}};react_production_min.unstable_act=X$2;react_production_min.useCallback=function(Fn,Mn){return U$4.current.useCallback(Fn,Mn)};react_production_min.useContext=function(Fn){return U$4.current.useContext(Fn)};react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(Fn){return U$4.current.useDeferredValue(Fn)};react_production_min.useEffect=function(Fn,Mn){return U$4.current.useEffect(Fn,Mn)};react_production_min.useId=function(){return U$4.current.useId()};react_production_min.useImperativeHandle=function(Fn,Mn,rs){return U$4.current.useImperativeHandle(Fn,Mn,rs)};react_production_min.useInsertionEffect=function(Fn,Mn){return U$4.current.useInsertionEffect(Fn,Mn)};react_production_min.useLayoutEffect=function(Fn,Mn){return U$4.current.useLayoutEffect(Fn,Mn)};react_production_min.useMemo=function(Fn,Mn){return U$4.current.useMemo(Fn,Mn)};react_production_min.useReducer=function(Fn,Mn,rs){return U$4.current.useReducer(Fn,Mn,rs)};react_production_min.useRef=function(Fn){return U$4.current.useRef(Fn)};react_production_min.useState=function(Fn){return U$4.current.useState(Fn)};react_production_min.useSyncExternalStore=function(Fn,Mn,rs){return U$4.current.useSyncExternalStore(Fn,Mn,rs)};react_production_min.useTransition=function(){return U$4.current.useTransition()};react_production_min.version="18.3.1";react$2.exports=react_production_min;var reactExports=react$2.exports;const React=getDefaultExportFromCjs(reactExports),React$1=_mergeNamespaces({__proto__:null,default:React},[reactExports]);/**
 * @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 f$a=reactExports,k$7=Symbol.for("react.element"),l$9=Symbol.for("react.fragment"),m$6=Object.prototype.hasOwnProperty,n$e=f$a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p$a={key:!0,ref:!0,__self:!0,__source:!0};function q$7(Fn,Mn,rs){var is,os={},as=null,us=null;rs!==void 0&&(as=""+rs),Mn.key!==void 0&&(as=""+Mn.key),Mn.ref!==void 0&&(us=Mn.ref);for(is in Mn)m$6.call(Mn,is)&&!p$a.hasOwnProperty(is)&&(os[is]=Mn[is]);if(Fn&&Fn.defaultProps)for(is in Mn=Fn.defaultProps,Mn)os[is]===void 0&&(os[is]=Mn[is]);return{$$typeof:k$7,type:Fn,key:as,ref:us,props:os,_owner:n$e.current}}reactJsxRuntime_production_min.Fragment=l$9;reactJsxRuntime_production_min.jsx=q$7;reactJsxRuntime_production_min.jsxs=q$7;jsxRuntime.exports=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime.exports,client={},reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
 * @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.
 */(function(Fn){function Mn(Xo,Al){var wl=Xo.length;Xo.push(Al);e:for(;0<wl;){var yl=wl-1>>>1,Il=Xo[yl];if(0<os(Il,Al))Xo[yl]=Al,Xo[wl]=Il,wl=yl;else break e}}function rs(Xo){return Xo.length===0?null:Xo[0]}function is(Xo){if(Xo.length===0)return null;var Al=Xo[0],wl=Xo.pop();if(wl!==Al){Xo[0]=wl;e:for(var yl=0,Il=Xo.length,Bl=Il>>>1;yl<Bl;){var Gl=2*(yl+1)-1,Nl=Xo[Gl],zl=Gl+1,Vl=Xo[zl];if(0>os(Nl,wl))zl<Il&&0>os(Vl,Nl)?(Xo[yl]=Vl,Xo[zl]=wl,yl=zl):(Xo[yl]=Nl,Xo[Gl]=wl,yl=Gl);else if(zl<Il&&0>os(Vl,wl))Xo[yl]=Vl,Xo[zl]=wl,yl=zl;else break e}}return Al}function os(Xo,Al){var wl=Xo.sortIndex-Al.sortIndex;return wl!==0?wl:Xo.id-Al.id}if(typeof performance=="object"&&typeof performance.now=="function"){var as=performance;Fn.unstable_now=function(){return as.now()}}else{var us=Date,ds=us.now();Fn.unstable_now=function(){return us.now()-ds}}var hs=[],ps=[],io=1,fo=null,mo=3,Ao=!1,$o=!1,Lo=!1,Go=typeof setTimeout=="function"?setTimeout:null,Yo=typeof clearTimeout=="function"?clearTimeout:null,Wo=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Jo(Xo){for(var Al=rs(ps);Al!==null;){if(Al.callback===null)is(ps);else if(Al.startTime<=Xo)is(ps),Al.sortIndex=Al.expirationTime,Mn(hs,Al);else break;Al=rs(ps)}}function xl(Xo){if(Lo=!1,Jo(Xo),!$o)if(rs(hs)!==null)$o=!0,Qo(_l);else{var Al=rs(ps);Al!==null&&El(xl,Al.startTime-Xo)}}function _l(Xo,Al){$o=!1,Lo&&(Lo=!1,Yo($l),$l=-1),Ao=!0;var wl=mo;try{for(Jo(Al),fo=rs(hs);fo!==null&&(!(fo.expirationTime>Al)||Xo&&!Ol());){var yl=fo.callback;if(typeof yl=="function"){fo.callback=null,mo=fo.priorityLevel;var Il=yl(fo.expirationTime<=Al);Al=Fn.unstable_now(),typeof Il=="function"?fo.callback=Il:fo===rs(hs)&&is(hs),Jo(Al)}else is(hs);fo=rs(hs)}if(fo!==null)var Bl=!0;else{var Gl=rs(ps);Gl!==null&&El(xl,Gl.startTime-Al),Bl=!1}return Bl}finally{fo=null,mo=wl,Ao=!1}}var Tl=!1,Sl=null,$l=-1,Pl=5,Dl=-1;function Ol(){return!(Fn.unstable_now()-Dl<Pl)}function Rl(){if(Sl!==null){var Xo=Fn.unstable_now();Dl=Xo;var Al=!0;try{Al=Sl(!0,Xo)}finally{Al?Vo():(Tl=!1,Sl=null)}}else Tl=!1}var Vo;if(typeof Wo=="function")Vo=function(){Wo(Rl)};else if(typeof MessageChannel<"u"){var jo=new MessageChannel,Ho=jo.port2;jo.port1.onmessage=Rl,Vo=function(){Ho.postMessage(null)}}else Vo=function(){Go(Rl,0)};function Qo(Xo){Sl=Xo,Tl||(Tl=!0,Vo())}function El(Xo,Al){$l=Go(function(){Xo(Fn.unstable_now())},Al)}Fn.unstable_IdlePriority=5,Fn.unstable_ImmediatePriority=1,Fn.unstable_LowPriority=4,Fn.unstable_NormalPriority=3,Fn.unstable_Profiling=null,Fn.unstable_UserBlockingPriority=2,Fn.unstable_cancelCallback=function(Xo){Xo.callback=null},Fn.unstable_continueExecution=function(){$o||Ao||($o=!0,Qo(_l))},Fn.unstable_forceFrameRate=function(Xo){0>Xo||125<Xo?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Pl=0<Xo?Math.floor(1e3/Xo):5},Fn.unstable_getCurrentPriorityLevel=function(){return mo},Fn.unstable_getFirstCallbackNode=function(){return rs(hs)},Fn.unstable_next=function(Xo){switch(mo){case 1:case 2:case 3:var Al=3;break;default:Al=mo}var wl=mo;mo=Al;try{return Xo()}finally{mo=wl}},Fn.unstable_pauseExecution=function(){},Fn.unstable_requestPaint=function(){},Fn.unstable_runWithPriority=function(Xo,Al){switch(Xo){case 1:case 2:case 3:case 4:case 5:break;default:Xo=3}var wl=mo;mo=Xo;try{return Al()}finally{mo=wl}},Fn.unstable_scheduleCallback=function(Xo,Al,wl){var yl=Fn.unstable_now();switch(typeof wl=="object"&&wl!==null?(wl=wl.delay,wl=typeof wl=="number"&&0<wl?yl+wl:yl):wl=yl,Xo){case 1:var Il=-1;break;case 2:Il=250;break;case 5:Il=1073741823;break;case 4:Il=1e4;break;default:Il=5e3}return Il=wl+Il,Xo={id:io++,callback:Al,priorityLevel:Xo,startTime:wl,expirationTime:Il,sortIndex:-1},wl>yl?(Xo.sortIndex=wl,Mn(ps,Xo),rs(hs)===null&&Xo===rs(ps)&&(Lo?(Yo($l),$l=-1):Lo=!0,El(xl,wl-yl))):(Xo.sortIndex=Il,Mn(hs,Xo),$o||Ao||($o=!0,Qo(_l))),Xo},Fn.unstable_shouldYield=Ol,Fn.unstable_wrapCallback=function(Xo){var Al=mo;return function(){var wl=mo;mo=Al;try{return Xo.apply(this,arguments)}finally{mo=wl}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.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 aa$1=reactExports,ca$1=schedulerExports;function p$9(Fn){for(var Mn="https://reactjs.org/docs/error-decoder.html?invariant="+Fn,rs=1;rs<arguments.length;rs++)Mn+="&args[]="+encodeURIComponent(arguments[rs]);return"Minified React error #"+Fn+"; visit "+Mn+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var da$1=new Set,ea$1={};function fa$1(Fn,Mn){ha$1(Fn,Mn),ha$1(Fn+"Capture",Mn)}function ha$1(Fn,Mn){for(ea$1[Fn]=Mn,Fn=0;Fn<Mn.length;Fn++)da$1.add(Mn[Fn])}var ia$1=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja$1=Object.prototype.hasOwnProperty,ka$1=/^[: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]*$/,la$1={},ma$1={};function oa$1(Fn){return ja$1.call(ma$1,Fn)?!0:ja$1.call(la$1,Fn)?!1:ka$1.test(Fn)?ma$1[Fn]=!0:(la$1[Fn]=!0,!1)}function pa$1(Fn,Mn,rs,is){if(rs!==null&&rs.type===0)return!1;switch(typeof Mn){case"function":case"symbol":return!0;case"boolean":return is?!1:rs!==null?!rs.acceptsBooleans:(Fn=Fn.toLowerCase().slice(0,5),Fn!=="data-"&&Fn!=="aria-");default:return!1}}function qa$2(Fn,Mn,rs,is){if(Mn===null||typeof Mn>"u"||pa$1(Fn,Mn,rs,is))return!0;if(is)return!1;if(rs!==null)switch(rs.type){case 3:return!Mn;case 4:return Mn===!1;case 5:return isNaN(Mn);case 6:return isNaN(Mn)||1>Mn}return!1}function v$a(Fn,Mn,rs,is,os,as,us){this.acceptsBooleans=Mn===2||Mn===3||Mn===4,this.attributeName=is,this.attributeNamespace=os,this.mustUseProperty=rs,this.propertyName=Fn,this.type=Mn,this.sanitizeURL=as,this.removeEmptyString=us}var z$a={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(Fn){z$a[Fn]=new v$a(Fn,0,!1,Fn,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(Fn){var Mn=Fn[0];z$a[Mn]=new v$a(Mn,1,!1,Fn[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(Fn){z$a[Fn]=new v$a(Fn,2,!1,Fn.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(Fn){z$a[Fn]=new v$a(Fn,2,!1,Fn,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(Fn){z$a[Fn]=new v$a(Fn,3,!1,Fn.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(Fn){z$a[Fn]=new v$a(Fn,3,!0,Fn,null,!1,!1)});["capture","download"].forEach(function(Fn){z$a[Fn]=new v$a(Fn,4,!1,Fn,null,!1,!1)});["cols","rows","size","span"].forEach(function(Fn){z$a[Fn]=new v$a(Fn,6,!1,Fn,null,!1,!1)});["rowSpan","start"].forEach(function(Fn){z$a[Fn]=new v$a(Fn,5,!1,Fn.toLowerCase(),null,!1,!1)});var ra$1=/[\-:]([a-z])/g;function sa$1(Fn){return Fn[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(Fn){var Mn=Fn.replace(ra$1,sa$1);z$a[Mn]=new v$a(Mn,1,!1,Fn,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(Fn){var Mn=Fn.replace(ra$1,sa$1);z$a[Mn]=new v$a(Mn,1,!1,Fn,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(Fn){var Mn=Fn.replace(ra$1,sa$1);z$a[Mn]=new v$a(Mn,1,!1,Fn,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(Fn){z$a[Fn]=new v$a(Fn,1,!1,Fn.toLowerCase(),null,!1,!1)});z$a.xlinkHref=new v$a("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(Fn){z$a[Fn]=new v$a(Fn,1,!1,Fn.toLowerCase(),null,!0,!0)});function ta$1(Fn,Mn,rs,is){var os=z$a.hasOwnProperty(Mn)?z$a[Mn]:null;(os!==null?os.type!==0:is||!(2<Mn.length)||Mn[0]!=="o"&&Mn[0]!=="O"||Mn[1]!=="n"&&Mn[1]!=="N")&&(qa$2(Mn,rs,os,is)&&(rs=null),is||os===null?oa$1(Mn)&&(rs===null?Fn.removeAttribute(Mn):Fn.setAttribute(Mn,""+rs)):os.mustUseProperty?Fn[os.propertyName]=rs===null?os.type===3?!1:"":rs:(Mn=os.attributeName,is=os.attributeNamespace,rs===null?Fn.removeAttribute(Mn):(os=os.type,rs=os===3||os===4&&rs===!0?"":""+rs,is?Fn.setAttributeNS(is,Mn,rs):Fn.setAttribute(Mn,rs))))}var ua$1=aa$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,va$1=Symbol.for("react.element"),wa$1=Symbol.for("react.portal"),ya$2=Symbol.for("react.fragment"),za$1=Symbol.for("react.strict_mode"),Aa$1=Symbol.for("react.profiler"),Ba$1=Symbol.for("react.provider"),Ca$1=Symbol.for("react.context"),Da$2=Symbol.for("react.forward_ref"),Ea$1=Symbol.for("react.suspense"),Fa$2=Symbol.for("react.suspense_list"),Ga$1=Symbol.for("react.memo"),Ha$2=Symbol.for("react.lazy"),Ia$1=Symbol.for("react.offscreen"),Ja$1=Symbol.iterator;function Ka$1(Fn){return Fn===null||typeof Fn!="object"?null:(Fn=Ja$1&&Fn[Ja$1]||Fn["@@iterator"],typeof Fn=="function"?Fn:null)}var A$4=Object.assign,La$2;function Ma$1(Fn){if(La$2===void 0)try{throw Error()}catch(rs){var Mn=rs.stack.trim().match(/\n( *(at )?)/);La$2=Mn&&Mn[1]||""}return`
`+La$2+Fn}var Na$2=!1;function Oa$2(Fn,Mn){if(!Fn||Na$2)return"";Na$2=!0;var rs=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(Mn)if(Mn=function(){throw Error()},Object.defineProperty(Mn.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Mn,[])}catch(ps){var is=ps}Reflect.construct(Fn,[],Mn)}else{try{Mn.call()}catch(ps){is=ps}Fn.call(Mn.prototype)}else{try{throw Error()}catch(ps){is=ps}Fn()}}catch(ps){if(ps&&is&&typeof ps.stack=="string"){for(var os=ps.stack.split(`
`),as=is.stack.split(`
`),us=os.length-1,ds=as.length-1;1<=us&&0<=ds&&os[us]!==as[ds];)ds--;for(;1<=us&&0<=ds;us--,ds--)if(os[us]!==as[ds]){if(us!==1||ds!==1)do if(us--,ds--,0>ds||os[us]!==as[ds]){var hs=`
`+os[us].replace(" at new "," at ");return Fn.displayName&&hs.includes("<anonymous>")&&(hs=hs.replace("<anonymous>",Fn.displayName)),hs}while(1<=us&&0<=ds);break}}}finally{Na$2=!1,Error.prepareStackTrace=rs}return(Fn=Fn?Fn.displayName||Fn.name:"")?Ma$1(Fn):""}function Pa$1(Fn){switch(Fn.tag){case 5:return Ma$1(Fn.type);case 16:return Ma$1("Lazy");case 13:return Ma$1("Suspense");case 19:return Ma$1("SuspenseList");case 0:case 2:case 15:return Fn=Oa$2(Fn.type,!1),Fn;case 11:return Fn=Oa$2(Fn.type.render,!1),Fn;case 1:return Fn=Oa$2(Fn.type,!0),Fn;default:return""}}function Qa$1(Fn){if(Fn==null)return null;if(typeof Fn=="function")return Fn.displayName||Fn.name||null;if(typeof Fn=="string")return Fn;switch(Fn){case ya$2:return"Fragment";case wa$1:return"Portal";case Aa$1:return"Profiler";case za$1:return"StrictMode";case Ea$1:return"Suspense";case Fa$2:return"SuspenseList"}if(typeof Fn=="object")switch(Fn.$$typeof){case Ca$1:return(Fn.displayName||"Context")+".Consumer";case Ba$1:return(Fn._context.displayName||"Context")+".Provider";case Da$2:var Mn=Fn.render;return Fn=Fn.displayName,Fn||(Fn=Mn.displayName||Mn.name||"",Fn=Fn!==""?"ForwardRef("+Fn+")":"ForwardRef"),Fn;case Ga$1:return Mn=Fn.displayName||null,Mn!==null?Mn:Qa$1(Fn.type)||"Memo";case Ha$2:Mn=Fn._payload,Fn=Fn._init;try{return Qa$1(Fn(Mn))}catch{}}return null}function Ra$2(Fn){var Mn=Fn.type;switch(Fn.tag){case 24:return"Cache";case 9:return(Mn.displayName||"Context")+".Consumer";case 10:return(Mn._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return Fn=Mn.render,Fn=Fn.displayName||Fn.name||"",Mn.displayName||(Fn!==""?"ForwardRef("+Fn+")":"ForwardRef");case 7:return"Fragment";case 5:return Mn;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa$1(Mn);case 8:return Mn===za$1?"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 Mn=="function")return Mn.displayName||Mn.name||null;if(typeof Mn=="string")return Mn}return null}function Sa$2(Fn){switch(typeof Fn){case"boolean":case"number":case"string":case"undefined":return Fn;case"object":return Fn;default:return""}}function Ta$2(Fn){var Mn=Fn.type;return(Fn=Fn.nodeName)&&Fn.toLowerCase()==="input"&&(Mn==="checkbox"||Mn==="radio")}function Ua$2(Fn){var Mn=Ta$2(Fn)?"checked":"value",rs=Object.getOwnPropertyDescriptor(Fn.constructor.prototype,Mn),is=""+Fn[Mn];if(!Fn.hasOwnProperty(Mn)&&typeof rs<"u"&&typeof rs.get=="function"&&typeof rs.set=="function"){var os=rs.get,as=rs.set;return Object.defineProperty(Fn,Mn,{configurable:!0,get:function(){return os.call(this)},set:function(us){is=""+us,as.call(this,us)}}),Object.defineProperty(Fn,Mn,{enumerable:rs.enumerable}),{getValue:function(){return is},setValue:function(us){is=""+us},stopTracking:function(){Fn._valueTracker=null,delete Fn[Mn]}}}}function Va$1(Fn){Fn._valueTracker||(Fn._valueTracker=Ua$2(Fn))}function Wa$2(Fn){if(!Fn)return!1;var Mn=Fn._valueTracker;if(!Mn)return!0;var rs=Mn.getValue(),is="";return Fn&&(is=Ta$2(Fn)?Fn.checked?"true":"false":Fn.value),Fn=is,Fn!==rs?(Mn.setValue(Fn),!0):!1}function Xa$1(Fn){if(Fn=Fn||(typeof document<"u"?document:void 0),typeof Fn>"u")return null;try{return Fn.activeElement||Fn.body}catch{return Fn.body}}function Ya$1(Fn,Mn){var rs=Mn.checked;return A$4({},Mn,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:rs??Fn._wrapperState.initialChecked})}function Za$1(Fn,Mn){var rs=Mn.defaultValue==null?"":Mn.defaultValue,is=Mn.checked!=null?Mn.checked:Mn.defaultChecked;rs=Sa$2(Mn.value!=null?Mn.value:rs),Fn._wrapperState={initialChecked:is,initialValue:rs,controlled:Mn.type==="checkbox"||Mn.type==="radio"?Mn.checked!=null:Mn.value!=null}}function ab(Fn,Mn){Mn=Mn.checked,Mn!=null&&ta$1(Fn,"checked",Mn,!1)}function bb(Fn,Mn){ab(Fn,Mn);var rs=Sa$2(Mn.value),is=Mn.type;if(rs!=null)is==="number"?(rs===0&&Fn.value===""||Fn.value!=rs)&&(Fn.value=""+rs):Fn.value!==""+rs&&(Fn.value=""+rs);else if(is==="submit"||is==="reset"){Fn.removeAttribute("value");return}Mn.hasOwnProperty("value")?cb(Fn,Mn.type,rs):Mn.hasOwnProperty("defaultValue")&&cb(Fn,Mn.type,Sa$2(Mn.defaultValue)),Mn.checked==null&&Mn.defaultChecked!=null&&(Fn.defaultChecked=!!Mn.defaultChecked)}function db(Fn,Mn,rs){if(Mn.hasOwnProperty("value")||Mn.hasOwnProperty("defaultValue")){var is=Mn.type;if(!(is!=="submit"&&is!=="reset"||Mn.value!==void 0&&Mn.value!==null))return;Mn=""+Fn._wrapperState.initialValue,rs||Mn===Fn.value||(Fn.value=Mn),Fn.defaultValue=Mn}rs=Fn.name,rs!==""&&(Fn.name=""),Fn.defaultChecked=!!Fn._wrapperState.initialChecked,rs!==""&&(Fn.name=rs)}function cb(Fn,Mn,rs){(Mn!=="number"||Xa$1(Fn.ownerDocument)!==Fn)&&(rs==null?Fn.defaultValue=""+Fn._wrapperState.initialValue:Fn.defaultValue!==""+rs&&(Fn.defaultValue=""+rs))}var eb=Array.isArray;function fb(Fn,Mn,rs,is){if(Fn=Fn.options,Mn){Mn={};for(var os=0;os<rs.length;os++)Mn["$"+rs[os]]=!0;for(rs=0;rs<Fn.length;rs++)os=Mn.hasOwnProperty("$"+Fn[rs].value),Fn[rs].selected!==os&&(Fn[rs].selected=os),os&&is&&(Fn[rs].defaultSelected=!0)}else{for(rs=""+Sa$2(rs),Mn=null,os=0;os<Fn.length;os++){if(Fn[os].value===rs){Fn[os].selected=!0,is&&(Fn[os].defaultSelected=!0);return}Mn!==null||Fn[os].disabled||(Mn=Fn[os])}Mn!==null&&(Mn.selected=!0)}}function gb(Fn,Mn){if(Mn.dangerouslySetInnerHTML!=null)throw Error(p$9(91));return A$4({},Mn,{value:void 0,defaultValue:void 0,children:""+Fn._wrapperState.initialValue})}function hb(Fn,Mn){var rs=Mn.value;if(rs==null){if(rs=Mn.children,Mn=Mn.defaultValue,rs!=null){if(Mn!=null)throw Error(p$9(92));if(eb(rs)){if(1<rs.length)throw Error(p$9(93));rs=rs[0]}Mn=rs}Mn==null&&(Mn=""),rs=Mn}Fn._wrapperState={initialValue:Sa$2(rs)}}function ib(Fn,Mn){var rs=Sa$2(Mn.value),is=Sa$2(Mn.defaultValue);rs!=null&&(rs=""+rs,rs!==Fn.value&&(Fn.value=rs),Mn.defaultValue==null&&Fn.defaultValue!==rs&&(Fn.defaultValue=rs)),is!=null&&(Fn.defaultValue=""+is)}function jb(Fn){var Mn=Fn.textContent;Mn===Fn._wrapperState.initialValue&&Mn!==""&&Mn!==null&&(Fn.value=Mn)}function kb(Fn){switch(Fn){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 lb(Fn,Mn){return Fn==null||Fn==="http://www.w3.org/1999/xhtml"?kb(Mn):Fn==="http://www.w3.org/2000/svg"&&Mn==="foreignObject"?"http://www.w3.org/1999/xhtml":Fn}var mb,nb=function(Fn){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(Mn,rs,is,os){MSApp.execUnsafeLocalFunction(function(){return Fn(Mn,rs,is,os)})}:Fn}(function(Fn,Mn){if(Fn.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in Fn)Fn.innerHTML=Mn;else{for(mb=mb||document.createElement("div"),mb.innerHTML="<svg>"+Mn.valueOf().toString()+"</svg>",Mn=mb.firstChild;Fn.firstChild;)Fn.removeChild(Fn.firstChild);for(;Mn.firstChild;)Fn.appendChild(Mn.firstChild)}});function ob(Fn,Mn){if(Mn){var rs=Fn.firstChild;if(rs&&rs===Fn.lastChild&&rs.nodeType===3){rs.nodeValue=Mn;return}}Fn.textContent=Mn}var pb={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},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(Fn){qb.forEach(function(Mn){Mn=Mn+Fn.charAt(0).toUpperCase()+Fn.substring(1),pb[Mn]=pb[Fn]})});function rb(Fn,Mn,rs){return Mn==null||typeof Mn=="boolean"||Mn===""?"":rs||typeof Mn!="number"||Mn===0||pb.hasOwnProperty(Fn)&&pb[Fn]?(""+Mn).trim():Mn+"px"}function sb(Fn,Mn){Fn=Fn.style;for(var rs in Mn)if(Mn.hasOwnProperty(rs)){var is=rs.indexOf("--")===0,os=rb(rs,Mn[rs],is);rs==="float"&&(rs="cssFloat"),is?Fn.setProperty(rs,os):Fn[rs]=os}}var tb=A$4({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 ub(Fn,Mn){if(Mn){if(tb[Fn]&&(Mn.children!=null||Mn.dangerouslySetInnerHTML!=null))throw Error(p$9(137,Fn));if(Mn.dangerouslySetInnerHTML!=null){if(Mn.children!=null)throw Error(p$9(60));if(typeof Mn.dangerouslySetInnerHTML!="object"||!("__html"in Mn.dangerouslySetInnerHTML))throw Error(p$9(61))}if(Mn.style!=null&&typeof Mn.style!="object")throw Error(p$9(62))}}function vb(Fn,Mn){if(Fn.indexOf("-")===-1)return typeof Mn.is=="string";switch(Fn){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 wb=null;function xb(Fn){return Fn=Fn.target||Fn.srcElement||window,Fn.correspondingUseElement&&(Fn=Fn.correspondingUseElement),Fn.nodeType===3?Fn.parentNode:Fn}var yb=null,zb=null,Ab=null;function Bb(Fn){if(Fn=Cb(Fn)){if(typeof yb!="function")throw Error(p$9(280));var Mn=Fn.stateNode;Mn&&(Mn=Db(Mn),yb(Fn.stateNode,Fn.type,Mn))}}function Eb(Fn){zb?Ab?Ab.push(Fn):Ab=[Fn]:zb=Fn}function Fb(){if(zb){var Fn=zb,Mn=Ab;if(Ab=zb=null,Bb(Fn),Mn)for(Fn=0;Fn<Mn.length;Fn++)Bb(Mn[Fn])}}function Gb(Fn,Mn){return Fn(Mn)}function Hb(){}var Ib=!1;function Jb(Fn,Mn,rs){if(Ib)return Fn(Mn,rs);Ib=!0;try{return Gb(Fn,Mn,rs)}finally{Ib=!1,(zb!==null||Ab!==null)&&(Hb(),Fb())}}function Kb(Fn,Mn){var rs=Fn.stateNode;if(rs===null)return null;var is=Db(rs);if(is===null)return null;rs=is[Mn];e:switch(Mn){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(is=!is.disabled)||(Fn=Fn.type,is=!(Fn==="button"||Fn==="input"||Fn==="select"||Fn==="textarea")),Fn=!is;break e;default:Fn=!1}if(Fn)return null;if(rs&&typeof rs!="function")throw Error(p$9(231,Mn,typeof rs));return rs}var Lb=!1;if(ia$1)try{var Mb={};Object.defineProperty(Mb,"passive",{get:function(){Lb=!0}}),window.addEventListener("test",Mb,Mb),window.removeEventListener("test",Mb,Mb)}catch{Lb=!1}function Nb(Fn,Mn,rs,is,os,as,us,ds,hs){var ps=Array.prototype.slice.call(arguments,3);try{Mn.apply(rs,ps)}catch(io){this.onError(io)}}var Ob=!1,Pb=null,Qb=!1,Rb=null,Sb={onError:function(Fn){Ob=!0,Pb=Fn}};function Tb(Fn,Mn,rs,is,os,as,us,ds,hs){Ob=!1,Pb=null,Nb.apply(Sb,arguments)}function Ub(Fn,Mn,rs,is,os,as,us,ds,hs){if(Tb.apply(this,arguments),Ob){if(Ob){var ps=Pb;Ob=!1,Pb=null}else throw Error(p$9(198));Qb||(Qb=!0,Rb=ps)}}function Vb(Fn){var Mn=Fn,rs=Fn;if(Fn.alternate)for(;Mn.return;)Mn=Mn.return;else{Fn=Mn;do Mn=Fn,Mn.flags&4098&&(rs=Mn.return),Fn=Mn.return;while(Fn)}return Mn.tag===3?rs:null}function Wb(Fn){if(Fn.tag===13){var Mn=Fn.memoizedState;if(Mn===null&&(Fn=Fn.alternate,Fn!==null&&(Mn=Fn.memoizedState)),Mn!==null)return Mn.dehydrated}return null}function Xb(Fn){if(Vb(Fn)!==Fn)throw Error(p$9(188))}function Yb(Fn){var Mn=Fn.alternate;if(!Mn){if(Mn=Vb(Fn),Mn===null)throw Error(p$9(188));return Mn!==Fn?null:Fn}for(var rs=Fn,is=Mn;;){var os=rs.return;if(os===null)break;var as=os.alternate;if(as===null){if(is=os.return,is!==null){rs=is;continue}break}if(os.child===as.child){for(as=os.child;as;){if(as===rs)return Xb(os),Fn;if(as===is)return Xb(os),Mn;as=as.sibling}throw Error(p$9(188))}if(rs.return!==is.return)rs=os,is=as;else{for(var us=!1,ds=os.child;ds;){if(ds===rs){us=!0,rs=os,is=as;break}if(ds===is){us=!0,is=os,rs=as;break}ds=ds.sibling}if(!us){for(ds=as.child;ds;){if(ds===rs){us=!0,rs=as,is=os;break}if(ds===is){us=!0,is=as,rs=os;break}ds=ds.sibling}if(!us)throw Error(p$9(189))}}if(rs.alternate!==is)throw Error(p$9(190))}if(rs.tag!==3)throw Error(p$9(188));return rs.stateNode.current===rs?Fn:Mn}function Zb(Fn){return Fn=Yb(Fn),Fn!==null?$b(Fn):null}function $b(Fn){if(Fn.tag===5||Fn.tag===6)return Fn;for(Fn=Fn.child;Fn!==null;){var Mn=$b(Fn);if(Mn!==null)return Mn;Fn=Fn.sibling}return null}var ac=ca$1.unstable_scheduleCallback,bc=ca$1.unstable_cancelCallback,cc=ca$1.unstable_shouldYield,dc=ca$1.unstable_requestPaint,B$3=ca$1.unstable_now,ec$2=ca$1.unstable_getCurrentPriorityLevel,fc=ca$1.unstable_ImmediatePriority,gc=ca$1.unstable_UserBlockingPriority,hc=ca$1.unstable_NormalPriority,ic=ca$1.unstable_LowPriority,jc=ca$1.unstable_IdlePriority,kc=null,lc=null;function mc(Fn){if(lc&&typeof lc.onCommitFiberRoot=="function")try{lc.onCommitFiberRoot(kc,Fn,void 0,(Fn.current.flags&128)===128)}catch{}}var oc=Math.clz32?Math.clz32:nc,pc=Math.log,qc=Math.LN2;function nc(Fn){return Fn>>>=0,Fn===0?32:31-(pc(Fn)/qc|0)|0}var rc=64,sc=4194304;function tc(Fn){switch(Fn&-Fn){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 Fn&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return Fn&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return Fn}}function uc(Fn,Mn){var rs=Fn.pendingLanes;if(rs===0)return 0;var is=0,os=Fn.suspendedLanes,as=Fn.pingedLanes,us=rs&268435455;if(us!==0){var ds=us&~os;ds!==0?is=tc(ds):(as&=us,as!==0&&(is=tc(as)))}else us=rs&~os,us!==0?is=tc(us):as!==0&&(is=tc(as));if(is===0)return 0;if(Mn!==0&&Mn!==is&&!(Mn&os)&&(os=is&-is,as=Mn&-Mn,os>=as||os===16&&(as&4194240)!==0))return Mn;if(is&4&&(is|=rs&16),Mn=Fn.entangledLanes,Mn!==0)for(Fn=Fn.entanglements,Mn&=is;0<Mn;)rs=31-oc(Mn),os=1<<rs,is|=Fn[rs],Mn&=~os;return is}function vc(Fn,Mn){switch(Fn){case 1:case 2:case 4:return Mn+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 Mn+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 wc(Fn,Mn){for(var rs=Fn.suspendedLanes,is=Fn.pingedLanes,os=Fn.expirationTimes,as=Fn.pendingLanes;0<as;){var us=31-oc(as),ds=1<<us,hs=os[us];hs===-1?(!(ds&rs)||ds&is)&&(os[us]=vc(ds,Mn)):hs<=Mn&&(Fn.expiredLanes|=ds),as&=~ds}}function xc(Fn){return Fn=Fn.pendingLanes&-1073741825,Fn!==0?Fn:Fn&1073741824?1073741824:0}function yc(){var Fn=rc;return rc<<=1,!(rc&4194240)&&(rc=64),Fn}function zc(Fn){for(var Mn=[],rs=0;31>rs;rs++)Mn.push(Fn);return Mn}function Ac(Fn,Mn,rs){Fn.pendingLanes|=Mn,Mn!==536870912&&(Fn.suspendedLanes=0,Fn.pingedLanes=0),Fn=Fn.eventTimes,Mn=31-oc(Mn),Fn[Mn]=rs}function Bc(Fn,Mn){var rs=Fn.pendingLanes&~Mn;Fn.pendingLanes=Mn,Fn.suspendedLanes=0,Fn.pingedLanes=0,Fn.expiredLanes&=Mn,Fn.mutableReadLanes&=Mn,Fn.entangledLanes&=Mn,Mn=Fn.entanglements;var is=Fn.eventTimes;for(Fn=Fn.expirationTimes;0<rs;){var os=31-oc(rs),as=1<<os;Mn[os]=0,is[os]=-1,Fn[os]=-1,rs&=~as}}function Cc(Fn,Mn){var rs=Fn.entangledLanes|=Mn;for(Fn=Fn.entanglements;rs;){var is=31-oc(rs),os=1<<is;os&Mn|Fn[is]&Mn&&(Fn[is]|=Mn),rs&=~os}}var C$3=0;function Dc(Fn){return Fn&=-Fn,1<Fn?4<Fn?Fn&268435455?16:536870912:4:1}var Ec,Fc,Gc,Hc,Ic,Jc=!1,Kc=[],Lc=null,Mc=null,Nc=null,Oc=new Map,Pc=new Map,Qc=[],Rc="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 Sc(Fn,Mn){switch(Fn){case"focusin":case"focusout":Lc=null;break;case"dragenter":case"dragleave":Mc=null;break;case"mouseover":case"mouseout":Nc=null;break;case"pointerover":case"pointerout":Oc.delete(Mn.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pc.delete(Mn.pointerId)}}function Tc(Fn,Mn,rs,is,os,as){return Fn===null||Fn.nativeEvent!==as?(Fn={blockedOn:Mn,domEventName:rs,eventSystemFlags:is,nativeEvent:as,targetContainers:[os]},Mn!==null&&(Mn=Cb(Mn),Mn!==null&&Fc(Mn)),Fn):(Fn.eventSystemFlags|=is,Mn=Fn.targetContainers,os!==null&&Mn.indexOf(os)===-1&&Mn.push(os),Fn)}function Uc(Fn,Mn,rs,is,os){switch(Mn){case"focusin":return Lc=Tc(Lc,Fn,Mn,rs,is,os),!0;case"dragenter":return Mc=Tc(Mc,Fn,Mn,rs,is,os),!0;case"mouseover":return Nc=Tc(Nc,Fn,Mn,rs,is,os),!0;case"pointerover":var as=os.pointerId;return Oc.set(as,Tc(Oc.get(as)||null,Fn,Mn,rs,is,os)),!0;case"gotpointercapture":return as=os.pointerId,Pc.set(as,Tc(Pc.get(as)||null,Fn,Mn,rs,is,os)),!0}return!1}function Vc(Fn){var Mn=Wc(Fn.target);if(Mn!==null){var rs=Vb(Mn);if(rs!==null){if(Mn=rs.tag,Mn===13){if(Mn=Wb(rs),Mn!==null){Fn.blockedOn=Mn,Ic(Fn.priority,function(){Gc(rs)});return}}else if(Mn===3&&rs.stateNode.current.memoizedState.isDehydrated){Fn.blockedOn=rs.tag===3?rs.stateNode.containerInfo:null;return}}}Fn.blockedOn=null}function Xc(Fn){if(Fn.blockedOn!==null)return!1;for(var Mn=Fn.targetContainers;0<Mn.length;){var rs=Yc(Fn.domEventName,Fn.eventSystemFlags,Mn[0],Fn.nativeEvent);if(rs===null){rs=Fn.nativeEvent;var is=new rs.constructor(rs.type,rs);wb=is,rs.target.dispatchEvent(is),wb=null}else return Mn=Cb(rs),Mn!==null&&Fc(Mn),Fn.blockedOn=rs,!1;Mn.shift()}return!0}function Zc(Fn,Mn,rs){Xc(Fn)&&rs.delete(Mn)}function $c(){Jc=!1,Lc!==null&&Xc(Lc)&&(Lc=null),Mc!==null&&Xc(Mc)&&(Mc=null),Nc!==null&&Xc(Nc)&&(Nc=null),Oc.forEach(Zc),Pc.forEach(Zc)}function ad(Fn,Mn){Fn.blockedOn===Mn&&(Fn.blockedOn=null,Jc||(Jc=!0,ca$1.unstable_scheduleCallback(ca$1.unstable_NormalPriority,$c)))}function bd(Fn){function Mn(os){return ad(os,Fn)}if(0<Kc.length){ad(Kc[0],Fn);for(var rs=1;rs<Kc.length;rs++){var is=Kc[rs];is.blockedOn===Fn&&(is.blockedOn=null)}}for(Lc!==null&&ad(Lc,Fn),Mc!==null&&ad(Mc,Fn),Nc!==null&&ad(Nc,Fn),Oc.forEach(Mn),Pc.forEach(Mn),rs=0;rs<Qc.length;rs++)is=Qc[rs],is.blockedOn===Fn&&(is.blockedOn=null);for(;0<Qc.length&&(rs=Qc[0],rs.blockedOn===null);)Vc(rs),rs.blockedOn===null&&Qc.shift()}var cd=ua$1.ReactCurrentBatchConfig,dd=!0;function ed(Fn,Mn,rs,is){var os=C$3,as=cd.transition;cd.transition=null;try{C$3=1,fd(Fn,Mn,rs,is)}finally{C$3=os,cd.transition=as}}function gd(Fn,Mn,rs,is){var os=C$3,as=cd.transition;cd.transition=null;try{C$3=4,fd(Fn,Mn,rs,is)}finally{C$3=os,cd.transition=as}}function fd(Fn,Mn,rs,is){if(dd){var os=Yc(Fn,Mn,rs,is);if(os===null)hd(Fn,Mn,is,id$1,rs),Sc(Fn,is);else if(Uc(os,Fn,Mn,rs,is))is.stopPropagation();else if(Sc(Fn,is),Mn&4&&-1<Rc.indexOf(Fn)){for(;os!==null;){var as=Cb(os);if(as!==null&&Ec(as),as=Yc(Fn,Mn,rs,is),as===null&&hd(Fn,Mn,is,id$1,rs),as===os)break;os=as}os!==null&&is.stopPropagation()}else hd(Fn,Mn,is,null,rs)}}var id$1=null;function Yc(Fn,Mn,rs,is){if(id$1=null,Fn=xb(is),Fn=Wc(Fn),Fn!==null)if(Mn=Vb(Fn),Mn===null)Fn=null;else if(rs=Mn.tag,rs===13){if(Fn=Wb(Mn),Fn!==null)return Fn;Fn=null}else if(rs===3){if(Mn.stateNode.current.memoizedState.isDehydrated)return Mn.tag===3?Mn.stateNode.containerInfo:null;Fn=null}else Mn!==Fn&&(Fn=null);return id$1=Fn,null}function jd(Fn){switch(Fn){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(ec$2()){case fc:return 1;case gc:return 4;case hc:case ic:return 16;case jc:return 536870912;default:return 16}default:return 16}}var kd=null,ld=null,md=null;function nd(){if(md)return md;var Fn,Mn=ld,rs=Mn.length,is,os="value"in kd?kd.value:kd.textContent,as=os.length;for(Fn=0;Fn<rs&&Mn[Fn]===os[Fn];Fn++);var us=rs-Fn;for(is=1;is<=us&&Mn[rs-is]===os[as-is];is++);return md=os.slice(Fn,1<is?1-is:void 0)}function od(Fn){var Mn=Fn.keyCode;return"charCode"in Fn?(Fn=Fn.charCode,Fn===0&&Mn===13&&(Fn=13)):Fn=Mn,Fn===10&&(Fn=13),32<=Fn||Fn===13?Fn:0}function pd(){return!0}function qd(){return!1}function rd(Fn){function Mn(rs,is,os,as,us){this._reactName=rs,this._targetInst=os,this.type=is,this.nativeEvent=as,this.target=us,this.currentTarget=null;for(var ds in Fn)Fn.hasOwnProperty(ds)&&(rs=Fn[ds],this[ds]=rs?rs(as):as[ds]);return this.isDefaultPrevented=(as.defaultPrevented!=null?as.defaultPrevented:as.returnValue===!1)?pd:qd,this.isPropagationStopped=qd,this}return A$4(Mn.prototype,{preventDefault:function(){this.defaultPrevented=!0;var rs=this.nativeEvent;rs&&(rs.preventDefault?rs.preventDefault():typeof rs.returnValue!="unknown"&&(rs.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var rs=this.nativeEvent;rs&&(rs.stopPropagation?rs.stopPropagation():typeof rs.cancelBubble!="unknown"&&(rs.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd}),Mn}var sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(Fn){return Fn.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=rd(sd),ud=A$4({},sd,{view:0,detail:0}),vd=rd(ud),wd,xd,yd,Ad=A$4({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(Fn){return Fn.relatedTarget===void 0?Fn.fromElement===Fn.srcElement?Fn.toElement:Fn.fromElement:Fn.relatedTarget},movementX:function(Fn){return"movementX"in Fn?Fn.movementX:(Fn!==yd&&(yd&&Fn.type==="mousemove"?(wd=Fn.screenX-yd.screenX,xd=Fn.screenY-yd.screenY):xd=wd=0,yd=Fn),wd)},movementY:function(Fn){return"movementY"in Fn?Fn.movementY:xd}}),Bd=rd(Ad),Cd=A$4({},Ad,{dataTransfer:0}),Dd=rd(Cd),Ed=A$4({},ud,{relatedTarget:0}),Fd=rd(Ed),Gd=A$4({},sd,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd=rd(Gd),Id=A$4({},sd,{clipboardData:function(Fn){return"clipboardData"in Fn?Fn.clipboardData:window.clipboardData}}),Jd=rd(Id),Kd=A$4({},sd,{data:0}),Ld=rd(Kd),Md={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nd={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"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pd(Fn){var Mn=this.nativeEvent;return Mn.getModifierState?Mn.getModifierState(Fn):(Fn=Od[Fn])?!!Mn[Fn]:!1}function zd(){return Pd}var Qd=A$4({},ud,{key:function(Fn){if(Fn.key){var Mn=Md[Fn.key]||Fn.key;if(Mn!=="Unidentified")return Mn}return Fn.type==="keypress"?(Fn=od(Fn),Fn===13?"Enter":String.fromCharCode(Fn)):Fn.type==="keydown"||Fn.type==="keyup"?Nd[Fn.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(Fn){return Fn.type==="keypress"?od(Fn):0},keyCode:function(Fn){return Fn.type==="keydown"||Fn.type==="keyup"?Fn.keyCode:0},which:function(Fn){return Fn.type==="keypress"?od(Fn):Fn.type==="keydown"||Fn.type==="keyup"?Fn.keyCode:0}}),Rd=rd(Qd),Sd=A$4({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd(Sd),Ud=A$4({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd(Ud),Wd=A$4({},sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd=rd(Wd),Yd=A$4({},Ad,{deltaX:function(Fn){return"deltaX"in Fn?Fn.deltaX:"wheelDeltaX"in Fn?-Fn.wheelDeltaX:0},deltaY:function(Fn){return"deltaY"in Fn?Fn.deltaY:"wheelDeltaY"in Fn?-Fn.wheelDeltaY:"wheelDelta"in Fn?-Fn.wheelDelta:0},deltaZ:0,deltaMode:0}),Zd=rd(Yd),$d=[9,13,27,32],ae$3=ia$1&&"CompositionEvent"in window,be$3=null;ia$1&&"documentMode"in document&&(be$3=document.documentMode);var ce$2=ia$1&&"TextEvent"in window&&!be$3,de$1=ia$1&&(!ae$3||be$3&&8<be$3&&11>=be$3),ee$2=" ",fe$2=!1;function ge$1(Fn,Mn){switch(Fn){case"keyup":return $d.indexOf(Mn.keyCode)!==-1;case"keydown":return Mn.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he$1(Fn){return Fn=Fn.detail,typeof Fn=="object"&&"data"in Fn?Fn.data:null}var ie$1=!1;function je(Fn,Mn){switch(Fn){case"compositionend":return he$1(Mn);case"keypress":return Mn.which!==32?null:(fe$2=!0,ee$2);case"textInput":return Fn=Mn.data,Fn===ee$2&&fe$2?null:Fn;default:return null}}function ke$1(Fn,Mn){if(ie$1)return Fn==="compositionend"||!ae$3&&ge$1(Fn,Mn)?(Fn=nd(),md=ld=kd=null,ie$1=!1,Fn):null;switch(Fn){case"paste":return null;case"keypress":if(!(Mn.ctrlKey||Mn.altKey||Mn.metaKey)||Mn.ctrlKey&&Mn.altKey){if(Mn.char&&1<Mn.char.length)return Mn.char;if(Mn.which)return String.fromCharCode(Mn.which)}return null;case"compositionend":return de$1&&Mn.locale!=="ko"?null:Mn.data;default:return null}}var le$1={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 me$2(Fn){var Mn=Fn&&Fn.nodeName&&Fn.nodeName.toLowerCase();return Mn==="input"?!!le$1[Fn.type]:Mn==="textarea"}function ne$2(Fn,Mn,rs,is){Eb(is),Mn=oe$3(Mn,"onChange"),0<Mn.length&&(rs=new td("onChange","change",null,rs,is),Fn.push({event:rs,listeners:Mn}))}var pe$1=null,qe=null;function re$1(Fn){se$1(Fn,0)}function te$2(Fn){var Mn=ue$1(Fn);if(Wa$2(Mn))return Fn}function ve$2(Fn,Mn){if(Fn==="change")return Mn}var we$3=!1;if(ia$1){var xe$2;if(ia$1){var ye$2="oninput"in document;if(!ye$2){var ze$1=document.createElement("div");ze$1.setAttribute("oninput","return;"),ye$2=typeof ze$1.oninput=="function"}xe$2=ye$2}else xe$2=!1;we$3=xe$2&&(!document.documentMode||9<document.documentMode)}function Ae$2(){pe$1&&(pe$1.detachEvent("onpropertychange",Be$1),qe=pe$1=null)}function Be$1(Fn){if(Fn.propertyName==="value"&&te$2(qe)){var Mn=[];ne$2(Mn,qe,Fn,xb(Fn)),Jb(re$1,Mn)}}function Ce$3(Fn,Mn,rs){Fn==="focusin"?(Ae$2(),pe$1=Mn,qe=rs,pe$1.attachEvent("onpropertychange",Be$1)):Fn==="focusout"&&Ae$2()}function De(Fn){if(Fn==="selectionchange"||Fn==="keyup"||Fn==="keydown")return te$2(qe)}function Ee$1(Fn,Mn){if(Fn==="click")return te$2(Mn)}function Fe(Fn,Mn){if(Fn==="input"||Fn==="change")return te$2(Mn)}function Ge(Fn,Mn){return Fn===Mn&&(Fn!==0||1/Fn===1/Mn)||Fn!==Fn&&Mn!==Mn}var He=typeof Object.is=="function"?Object.is:Ge;function Ie$1(Fn,Mn){if(He(Fn,Mn))return!0;if(typeof Fn!="object"||Fn===null||typeof Mn!="object"||Mn===null)return!1;var rs=Object.keys(Fn),is=Object.keys(Mn);if(rs.length!==is.length)return!1;for(is=0;is<rs.length;is++){var os=rs[is];if(!ja$1.call(Mn,os)||!He(Fn[os],Mn[os]))return!1}return!0}function Je(Fn){for(;Fn&&Fn.firstChild;)Fn=Fn.firstChild;return Fn}function Ke(Fn,Mn){var rs=Je(Fn);Fn=0;for(var is;rs;){if(rs.nodeType===3){if(is=Fn+rs.textContent.length,Fn<=Mn&&is>=Mn)return{node:rs,offset:Mn-Fn};Fn=is}e:{for(;rs;){if(rs.nextSibling){rs=rs.nextSibling;break e}rs=rs.parentNode}rs=void 0}rs=Je(rs)}}function Le$1(Fn,Mn){return Fn&&Mn?Fn===Mn?!0:Fn&&Fn.nodeType===3?!1:Mn&&Mn.nodeType===3?Le$1(Fn,Mn.parentNode):"contains"in Fn?Fn.contains(Mn):Fn.compareDocumentPosition?!!(Fn.compareDocumentPosition(Mn)&16):!1:!1}function Me(){for(var Fn=window,Mn=Xa$1();Mn instanceof Fn.HTMLIFrameElement;){try{var rs=typeof Mn.contentWindow.location.href=="string"}catch{rs=!1}if(rs)Fn=Mn.contentWindow;else break;Mn=Xa$1(Fn.document)}return Mn}function Ne(Fn){var Mn=Fn&&Fn.nodeName&&Fn.nodeName.toLowerCase();return Mn&&(Mn==="input"&&(Fn.type==="text"||Fn.type==="search"||Fn.type==="tel"||Fn.type==="url"||Fn.type==="password")||Mn==="textarea"||Fn.contentEditable==="true")}function Oe$2(Fn){var Mn=Me(),rs=Fn.focusedElem,is=Fn.selectionRange;if(Mn!==rs&&rs&&rs.ownerDocument&&Le$1(rs.ownerDocument.documentElement,rs)){if(is!==null&&Ne(rs)){if(Mn=is.start,Fn=is.end,Fn===void 0&&(Fn=Mn),"selectionStart"in rs)rs.selectionStart=Mn,rs.selectionEnd=Math.min(Fn,rs.value.length);else if(Fn=(Mn=rs.ownerDocument||document)&&Mn.defaultView||window,Fn.getSelection){Fn=Fn.getSelection();var os=rs.textContent.length,as=Math.min(is.start,os);is=is.end===void 0?as:Math.min(is.end,os),!Fn.extend&&as>is&&(os=is,is=as,as=os),os=Ke(rs,as);var us=Ke(rs,is);os&&us&&(Fn.rangeCount!==1||Fn.anchorNode!==os.node||Fn.anchorOffset!==os.offset||Fn.focusNode!==us.node||Fn.focusOffset!==us.offset)&&(Mn=Mn.createRange(),Mn.setStart(os.node,os.offset),Fn.removeAllRanges(),as>is?(Fn.addRange(Mn),Fn.extend(us.node,us.offset)):(Mn.setEnd(us.node,us.offset),Fn.addRange(Mn)))}}for(Mn=[],Fn=rs;Fn=Fn.parentNode;)Fn.nodeType===1&&Mn.push({element:Fn,left:Fn.scrollLeft,top:Fn.scrollTop});for(typeof rs.focus=="function"&&rs.focus(),rs=0;rs<Mn.length;rs++)Fn=Mn[rs],Fn.element.scrollLeft=Fn.left,Fn.element.scrollTop=Fn.top}}var Pe$1=ia$1&&"documentMode"in document&&11>=document.documentMode,Qe$1=null,Re$2=null,Se=null,Te$1=!1;function Ue(Fn,Mn,rs){var is=rs.window===rs?rs.document:rs.nodeType===9?rs:rs.ownerDocument;Te$1||Qe$1==null||Qe$1!==Xa$1(is)||(is=Qe$1,"selectionStart"in is&&Ne(is)?is={start:is.selectionStart,end:is.selectionEnd}:(is=(is.ownerDocument&&is.ownerDocument.defaultView||window).getSelection(),is={anchorNode:is.anchorNode,anchorOffset:is.anchorOffset,focusNode:is.focusNode,focusOffset:is.focusOffset}),Se&&Ie$1(Se,is)||(Se=is,is=oe$3(Re$2,"onSelect"),0<is.length&&(Mn=new td("onSelect","select",null,Mn,rs),Fn.push({event:Mn,listeners:is}),Mn.target=Qe$1)))}function Ve(Fn,Mn){var rs={};return rs[Fn.toLowerCase()]=Mn.toLowerCase(),rs["Webkit"+Fn]="webkit"+Mn,rs["Moz"+Fn]="moz"+Mn,rs}var We$1={animationend:Ve("Animation","AnimationEnd"),animationiteration:Ve("Animation","AnimationIteration"),animationstart:Ve("Animation","AnimationStart"),transitionend:Ve("Transition","TransitionEnd")},Xe$2={},Ye={};ia$1&&(Ye=document.createElement("div").style,"AnimationEvent"in window||(delete We$1.animationend.animation,delete We$1.animationiteration.animation,delete We$1.animationstart.animation),"TransitionEvent"in window||delete We$1.transitionend.transition);function Ze$2(Fn){if(Xe$2[Fn])return Xe$2[Fn];if(!We$1[Fn])return Fn;var Mn=We$1[Fn],rs;for(rs in Mn)if(Mn.hasOwnProperty(rs)&&rs in Ye)return Xe$2[Fn]=Mn[rs];return Fn}var $e$1=Ze$2("animationend"),af$1=Ze$2("animationiteration"),bf$1=Ze$2("animationstart"),cf$1=Ze$2("transitionend"),df$1=new Map,ef$1="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 ff$1(Fn,Mn){df$1.set(Fn,Mn),fa$1(Mn,[Fn])}for(var gf$1=0;gf$1<ef$1.length;gf$1++){var hf$1=ef$1[gf$1],jf$1=hf$1.toLowerCase(),kf$1=hf$1[0].toUpperCase()+hf$1.slice(1);ff$1(jf$1,"on"+kf$1)}ff$1($e$1,"onAnimationEnd");ff$1(af$1,"onAnimationIteration");ff$1(bf$1,"onAnimationStart");ff$1("dblclick","onDoubleClick");ff$1("focusin","onFocus");ff$1("focusout","onBlur");ff$1(cf$1,"onTransitionEnd");ha$1("onMouseEnter",["mouseout","mouseover"]);ha$1("onMouseLeave",["mouseout","mouseover"]);ha$1("onPointerEnter",["pointerout","pointerover"]);ha$1("onPointerLeave",["pointerout","pointerover"]);fa$1("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fa$1("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fa$1("onBeforeInput",["compositionend","keypress","textInput","paste"]);fa$1("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fa$1("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fa$1("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lf$1="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(" "),mf$1=new Set("cancel close invalid load scroll toggle".split(" ").concat(lf$1));function nf$1(Fn,Mn,rs){var is=Fn.type||"unknown-event";Fn.currentTarget=rs,Ub(is,Mn,void 0,Fn),Fn.currentTarget=null}function se$1(Fn,Mn){Mn=(Mn&4)!==0;for(var rs=0;rs<Fn.length;rs++){var is=Fn[rs],os=is.event;is=is.listeners;e:{var as=void 0;if(Mn)for(var us=is.length-1;0<=us;us--){var ds=is[us],hs=ds.instance,ps=ds.currentTarget;if(ds=ds.listener,hs!==as&&os.isPropagationStopped())break e;nf$1(os,ds,ps),as=hs}else for(us=0;us<is.length;us++){if(ds=is[us],hs=ds.instance,ps=ds.currentTarget,ds=ds.listener,hs!==as&&os.isPropagationStopped())break e;nf$1(os,ds,ps),as=hs}}}if(Qb)throw Fn=Rb,Qb=!1,Rb=null,Fn}function D$4(Fn,Mn){var rs=Mn[of$1];rs===void 0&&(rs=Mn[of$1]=new Set);var is=Fn+"__bubble";rs.has(is)||(pf$1(Mn,Fn,2,!1),rs.add(is))}function qf$1(Fn,Mn,rs){var is=0;Mn&&(is|=4),pf$1(rs,Fn,is,Mn)}var rf$1="_reactListening"+Math.random().toString(36).slice(2);function sf(Fn){if(!Fn[rf$1]){Fn[rf$1]=!0,da$1.forEach(function(rs){rs!=="selectionchange"&&(mf$1.has(rs)||qf$1(rs,!1,Fn),qf$1(rs,!0,Fn))});var Mn=Fn.nodeType===9?Fn:Fn.ownerDocument;Mn===null||Mn[rf$1]||(Mn[rf$1]=!0,qf$1("selectionchange",!1,Mn))}}function pf$1(Fn,Mn,rs,is){switch(jd(Mn)){case 1:var os=ed;break;case 4:os=gd;break;default:os=fd}rs=os.bind(null,Mn,rs,Fn),os=void 0,!Lb||Mn!=="touchstart"&&Mn!=="touchmove"&&Mn!=="wheel"||(os=!0),is?os!==void 0?Fn.addEventListener(Mn,rs,{capture:!0,passive:os}):Fn.addEventListener(Mn,rs,!0):os!==void 0?Fn.addEventListener(Mn,rs,{passive:os}):Fn.addEventListener(Mn,rs,!1)}function hd(Fn,Mn,rs,is,os){var as=is;if(!(Mn&1)&&!(Mn&2)&&is!==null)e:for(;;){if(is===null)return;var us=is.tag;if(us===3||us===4){var ds=is.stateNode.containerInfo;if(ds===os||ds.nodeType===8&&ds.parentNode===os)break;if(us===4)for(us=is.return;us!==null;){var hs=us.tag;if((hs===3||hs===4)&&(hs=us.stateNode.containerInfo,hs===os||hs.nodeType===8&&hs.parentNode===os))return;us=us.return}for(;ds!==null;){if(us=Wc(ds),us===null)return;if(hs=us.tag,hs===5||hs===6){is=as=us;continue e}ds=ds.parentNode}}is=is.return}Jb(function(){var ps=as,io=xb(rs),fo=[];e:{var mo=df$1.get(Fn);if(mo!==void 0){var Ao=td,$o=Fn;switch(Fn){case"keypress":if(od(rs)===0)break e;case"keydown":case"keyup":Ao=Rd;break;case"focusin":$o="focus",Ao=Fd;break;case"focusout":$o="blur",Ao=Fd;break;case"beforeblur":case"afterblur":Ao=Fd;break;case"click":if(rs.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ao=Bd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ao=Dd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ao=Vd;break;case $e$1:case af$1:case bf$1:Ao=Hd;break;case cf$1:Ao=Xd;break;case"scroll":Ao=vd;break;case"wheel":Ao=Zd;break;case"copy":case"cut":case"paste":Ao=Jd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ao=Td}var Lo=(Mn&4)!==0,Go=!Lo&&Fn==="scroll",Yo=Lo?mo!==null?mo+"Capture":null:mo;Lo=[];for(var Wo=ps,Jo;Wo!==null;){Jo=Wo;var xl=Jo.stateNode;if(Jo.tag===5&&xl!==null&&(Jo=xl,Yo!==null&&(xl=Kb(Wo,Yo),xl!=null&&Lo.push(tf$1(Wo,xl,Jo)))),Go)break;Wo=Wo.return}0<Lo.length&&(mo=new Ao(mo,$o,null,rs,io),fo.push({event:mo,listeners:Lo}))}}if(!(Mn&7)){e:{if(mo=Fn==="mouseover"||Fn==="pointerover",Ao=Fn==="mouseout"||Fn==="pointerout",mo&&rs!==wb&&($o=rs.relatedTarget||rs.fromElement)&&(Wc($o)||$o[uf]))break e;if((Ao||mo)&&(mo=io.window===io?io:(mo=io.ownerDocument)?mo.defaultView||mo.parentWindow:window,Ao?($o=rs.relatedTarget||rs.toElement,Ao=ps,$o=$o?Wc($o):null,$o!==null&&(Go=Vb($o),$o!==Go||$o.tag!==5&&$o.tag!==6)&&($o=null)):(Ao=null,$o=ps),Ao!==$o)){if(Lo=Bd,xl="onMouseLeave",Yo="onMouseEnter",Wo="mouse",(Fn==="pointerout"||Fn==="pointerover")&&(Lo=Td,xl="onPointerLeave",Yo="onPointerEnter",Wo="pointer"),Go=Ao==null?mo:ue$1(Ao),Jo=$o==null?mo:ue$1($o),mo=new Lo(xl,Wo+"leave",Ao,rs,io),mo.target=Go,mo.relatedTarget=Jo,xl=null,Wc(io)===ps&&(Lo=new Lo(Yo,Wo+"enter",$o,rs,io),Lo.target=Jo,Lo.relatedTarget=Go,xl=Lo),Go=xl,Ao&&$o)t:{for(Lo=Ao,Yo=$o,Wo=0,Jo=Lo;Jo;Jo=vf$1(Jo))Wo++;for(Jo=0,xl=Yo;xl;xl=vf$1(xl))Jo++;for(;0<Wo-Jo;)Lo=vf$1(Lo),Wo--;for(;0<Jo-Wo;)Yo=vf$1(Yo),Jo--;for(;Wo--;){if(Lo===Yo||Yo!==null&&Lo===Yo.alternate)break t;Lo=vf$1(Lo),Yo=vf$1(Yo)}Lo=null}else Lo=null;Ao!==null&&wf$1(fo,mo,Ao,Lo,!1),$o!==null&&Go!==null&&wf$1(fo,Go,$o,Lo,!0)}}e:{if(mo=ps?ue$1(ps):window,Ao=mo.nodeName&&mo.nodeName.toLowerCase(),Ao==="select"||Ao==="input"&&mo.type==="file")var _l=ve$2;else if(me$2(mo))if(we$3)_l=Fe;else{_l=De;var Tl=Ce$3}else(Ao=mo.nodeName)&&Ao.toLowerCase()==="input"&&(mo.type==="checkbox"||mo.type==="radio")&&(_l=Ee$1);if(_l&&(_l=_l(Fn,ps))){ne$2(fo,_l,rs,io);break e}Tl&&Tl(Fn,mo,ps),Fn==="focusout"&&(Tl=mo._wrapperState)&&Tl.controlled&&mo.type==="number"&&cb(mo,"number",mo.value)}switch(Tl=ps?ue$1(ps):window,Fn){case"focusin":(me$2(Tl)||Tl.contentEditable==="true")&&(Qe$1=Tl,Re$2=ps,Se=null);break;case"focusout":Se=Re$2=Qe$1=null;break;case"mousedown":Te$1=!0;break;case"contextmenu":case"mouseup":case"dragend":Te$1=!1,Ue(fo,rs,io);break;case"selectionchange":if(Pe$1)break;case"keydown":case"keyup":Ue(fo,rs,io)}var Sl;if(ae$3)e:{switch(Fn){case"compositionstart":var $l="onCompositionStart";break e;case"compositionend":$l="onCompositionEnd";break e;case"compositionupdate":$l="onCompositionUpdate";break e}$l=void 0}else ie$1?ge$1(Fn,rs)&&($l="onCompositionEnd"):Fn==="keydown"&&rs.keyCode===229&&($l="onCompositionStart");$l&&(de$1&&rs.locale!=="ko"&&(ie$1||$l!=="onCompositionStart"?$l==="onCompositionEnd"&&ie$1&&(Sl=nd()):(kd=io,ld="value"in kd?kd.value:kd.textContent,ie$1=!0)),Tl=oe$3(ps,$l),0<Tl.length&&($l=new Ld($l,Fn,null,rs,io),fo.push({event:$l,listeners:Tl}),Sl?$l.data=Sl:(Sl=he$1(rs),Sl!==null&&($l.data=Sl)))),(Sl=ce$2?je(Fn,rs):ke$1(Fn,rs))&&(ps=oe$3(ps,"onBeforeInput"),0<ps.length&&(io=new Ld("onBeforeInput","beforeinput",null,rs,io),fo.push({event:io,listeners:ps}),io.data=Sl))}se$1(fo,Mn)})}function tf$1(Fn,Mn,rs){return{instance:Fn,listener:Mn,currentTarget:rs}}function oe$3(Fn,Mn){for(var rs=Mn+"Capture",is=[];Fn!==null;){var os=Fn,as=os.stateNode;os.tag===5&&as!==null&&(os=as,as=Kb(Fn,rs),as!=null&&is.unshift(tf$1(Fn,as,os)),as=Kb(Fn,Mn),as!=null&&is.push(tf$1(Fn,as,os))),Fn=Fn.return}return is}function vf$1(Fn){if(Fn===null)return null;do Fn=Fn.return;while(Fn&&Fn.tag!==5);return Fn||null}function wf$1(Fn,Mn,rs,is,os){for(var as=Mn._reactName,us=[];rs!==null&&rs!==is;){var ds=rs,hs=ds.alternate,ps=ds.stateNode;if(hs!==null&&hs===is)break;ds.tag===5&&ps!==null&&(ds=ps,os?(hs=Kb(rs,as),hs!=null&&us.unshift(tf$1(rs,hs,ds))):os||(hs=Kb(rs,as),hs!=null&&us.push(tf$1(rs,hs,ds)))),rs=rs.return}us.length!==0&&Fn.push({event:Mn,listeners:us})}var xf$1=/\r\n?/g,yf$1=/\u0000|\uFFFD/g;function zf$1(Fn){return(typeof Fn=="string"?Fn:""+Fn).replace(xf$1,`
`).replace(yf$1,"")}function Af$1(Fn,Mn,rs){if(Mn=zf$1(Mn),zf$1(Fn)!==Mn&&rs)throw Error(p$9(425))}function Bf$1(){}var Cf$1=null,Df$1=null;function Ef$1(Fn,Mn){return Fn==="textarea"||Fn==="noscript"||typeof Mn.children=="string"||typeof Mn.children=="number"||typeof Mn.dangerouslySetInnerHTML=="object"&&Mn.dangerouslySetInnerHTML!==null&&Mn.dangerouslySetInnerHTML.__html!=null}var Ff$1=typeof setTimeout=="function"?setTimeout:void 0,Gf$1=typeof clearTimeout=="function"?clearTimeout:void 0,Hf$1=typeof Promise=="function"?Promise:void 0,Jf$1=typeof queueMicrotask=="function"?queueMicrotask:typeof Hf$1<"u"?function(Fn){return Hf$1.resolve(null).then(Fn).catch(If$1)}:Ff$1;function If$1(Fn){setTimeout(function(){throw Fn})}function Kf$1(Fn,Mn){var rs=Mn,is=0;do{var os=rs.nextSibling;if(Fn.removeChild(rs),os&&os.nodeType===8)if(rs=os.data,rs==="/$"){if(is===0){Fn.removeChild(os),bd(Mn);return}is--}else rs!=="$"&&rs!=="$?"&&rs!=="$!"||is++;rs=os}while(rs);bd(Mn)}function Lf$1(Fn){for(;Fn!=null;Fn=Fn.nextSibling){var Mn=Fn.nodeType;if(Mn===1||Mn===3)break;if(Mn===8){if(Mn=Fn.data,Mn==="$"||Mn==="$!"||Mn==="$?")break;if(Mn==="/$")return null}}return Fn}function Mf$1(Fn){Fn=Fn.previousSibling;for(var Mn=0;Fn;){if(Fn.nodeType===8){var rs=Fn.data;if(rs==="$"||rs==="$!"||rs==="$?"){if(Mn===0)return Fn;Mn--}else rs==="/$"&&Mn++}Fn=Fn.previousSibling}return null}var Nf$1=Math.random().toString(36).slice(2),Of$1="__reactFiber$"+Nf$1,Pf$1="__reactProps$"+Nf$1,uf="__reactContainer$"+Nf$1,of$1="__reactEvents$"+Nf$1,Qf$1="__reactListeners$"+Nf$1,Rf$1="__reactHandles$"+Nf$1;function Wc(Fn){var Mn=Fn[Of$1];if(Mn)return Mn;for(var rs=Fn.parentNode;rs;){if(Mn=rs[uf]||rs[Of$1]){if(rs=Mn.alternate,Mn.child!==null||rs!==null&&rs.child!==null)for(Fn=Mf$1(Fn);Fn!==null;){if(rs=Fn[Of$1])return rs;Fn=Mf$1(Fn)}return Mn}Fn=rs,rs=Fn.parentNode}return null}function Cb(Fn){return Fn=Fn[Of$1]||Fn[uf],!Fn||Fn.tag!==5&&Fn.tag!==6&&Fn.tag!==13&&Fn.tag!==3?null:Fn}function ue$1(Fn){if(Fn.tag===5||Fn.tag===6)return Fn.stateNode;throw Error(p$9(33))}function Db(Fn){return Fn[Pf$1]||null}var Sf$1=[],Tf$1=-1;function Uf$1(Fn){return{current:Fn}}function E$5(Fn){0>Tf$1||(Fn.current=Sf$1[Tf$1],Sf$1[Tf$1]=null,Tf$1--)}function G$3(Fn,Mn){Tf$1++,Sf$1[Tf$1]=Fn.current,Fn.current=Mn}var Vf$1={},H$1=Uf$1(Vf$1),Wf$1=Uf$1(!1),Xf=Vf$1;function Yf$1(Fn,Mn){var rs=Fn.type.contextTypes;if(!rs)return Vf$1;var is=Fn.stateNode;if(is&&is.__reactInternalMemoizedUnmaskedChildContext===Mn)return is.__reactInternalMemoizedMaskedChildContext;var os={},as;for(as in rs)os[as]=Mn[as];return is&&(Fn=Fn.stateNode,Fn.__reactInternalMemoizedUnmaskedChildContext=Mn,Fn.__reactInternalMemoizedMaskedChildContext=os),os}function Zf(Fn){return Fn=Fn.childContextTypes,Fn!=null}function $f(){E$5(Wf$1),E$5(H$1)}function ag(Fn,Mn,rs){if(H$1.current!==Vf$1)throw Error(p$9(168));G$3(H$1,Mn),G$3(Wf$1,rs)}function bg(Fn,Mn,rs){var is=Fn.stateNode;if(Mn=Mn.childContextTypes,typeof is.getChildContext!="function")return rs;is=is.getChildContext();for(var os in is)if(!(os in Mn))throw Error(p$9(108,Ra$2(Fn)||"Unknown",os));return A$4({},rs,is)}function cg(Fn){return Fn=(Fn=Fn.stateNode)&&Fn.__reactInternalMemoizedMergedChildContext||Vf$1,Xf=H$1.current,G$3(H$1,Fn),G$3(Wf$1,Wf$1.current),!0}function dg(Fn,Mn,rs){var is=Fn.stateNode;if(!is)throw Error(p$9(169));rs?(Fn=bg(Fn,Mn,Xf),is.__reactInternalMemoizedMergedChildContext=Fn,E$5(Wf$1),E$5(H$1),G$3(H$1,Fn)):E$5(Wf$1),G$3(Wf$1,rs)}var eg=null,fg=!1,gg=!1;function hg(Fn){eg===null?eg=[Fn]:eg.push(Fn)}function ig(Fn){fg=!0,hg(Fn)}function jg$1(){if(!gg&&eg!==null){gg=!0;var Fn=0,Mn=C$3;try{var rs=eg;for(C$3=1;Fn<rs.length;Fn++){var is=rs[Fn];do is=is(!0);while(is!==null)}eg=null,fg=!1}catch(os){throw eg!==null&&(eg=eg.slice(Fn+1)),ac(fc,jg$1),os}finally{C$3=Mn,gg=!1}}return null}var kg$1=[],lg=0,mg=null,ng=0,og=[],pg=0,qg=null,rg=1,sg="";function tg(Fn,Mn){kg$1[lg++]=ng,kg$1[lg++]=mg,mg=Fn,ng=Mn}function ug(Fn,Mn,rs){og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,qg=Fn;var is=rg;Fn=sg;var os=32-oc(is)-1;is&=~(1<<os),rs+=1;var as=32-oc(Mn)+os;if(30<as){var us=os-os%5;as=(is&(1<<us)-1).toString(32),is>>=us,os-=us,rg=1<<32-oc(Mn)+os|rs<<os|is,sg=as+Fn}else rg=1<<as|rs<<os|is,sg=Fn}function vg(Fn){Fn.return!==null&&(tg(Fn,1),ug(Fn,1,0))}function wg(Fn){for(;Fn===mg;)mg=kg$1[--lg],kg$1[lg]=null,ng=kg$1[--lg],kg$1[lg]=null;for(;Fn===qg;)qg=og[--pg],og[pg]=null,sg=og[--pg],og[pg]=null,rg=og[--pg],og[pg]=null}var xg=null,yg=null,I$4=!1,zg=null;function Ag(Fn,Mn){var rs=Bg(5,null,null,0);rs.elementType="DELETED",rs.stateNode=Mn,rs.return=Fn,Mn=Fn.deletions,Mn===null?(Fn.deletions=[rs],Fn.flags|=16):Mn.push(rs)}function Cg(Fn,Mn){switch(Fn.tag){case 5:var rs=Fn.type;return Mn=Mn.nodeType!==1||rs.toLowerCase()!==Mn.nodeName.toLowerCase()?null:Mn,Mn!==null?(Fn.stateNode=Mn,xg=Fn,yg=Lf$1(Mn.firstChild),!0):!1;case 6:return Mn=Fn.pendingProps===""||Mn.nodeType!==3?null:Mn,Mn!==null?(Fn.stateNode=Mn,xg=Fn,yg=null,!0):!1;case 13:return Mn=Mn.nodeType!==8?null:Mn,Mn!==null?(rs=qg!==null?{id:rg,overflow:sg}:null,Fn.memoizedState={dehydrated:Mn,treeContext:rs,retryLane:1073741824},rs=Bg(18,null,null,0),rs.stateNode=Mn,rs.return=Fn,Fn.child=rs,xg=Fn,yg=null,!0):!1;default:return!1}}function Dg(Fn){return(Fn.mode&1)!==0&&(Fn.flags&128)===0}function Eg(Fn){if(I$4){var Mn=yg;if(Mn){var rs=Mn;if(!Cg(Fn,Mn)){if(Dg(Fn))throw Error(p$9(418));Mn=Lf$1(rs.nextSibling);var is=xg;Mn&&Cg(Fn,Mn)?Ag(is,rs):(Fn.flags=Fn.flags&-4097|2,I$4=!1,xg=Fn)}}else{if(Dg(Fn))throw Error(p$9(418));Fn.flags=Fn.flags&-4097|2,I$4=!1,xg=Fn}}}function Fg(Fn){for(Fn=Fn.return;Fn!==null&&Fn.tag!==5&&Fn.tag!==3&&Fn.tag!==13;)Fn=Fn.return;xg=Fn}function Gg(Fn){if(Fn!==xg)return!1;if(!I$4)return Fg(Fn),I$4=!0,!1;var Mn;if((Mn=Fn.tag!==3)&&!(Mn=Fn.tag!==5)&&(Mn=Fn.type,Mn=Mn!=="head"&&Mn!=="body"&&!Ef$1(Fn.type,Fn.memoizedProps)),Mn&&(Mn=yg)){if(Dg(Fn))throw Hg(),Error(p$9(418));for(;Mn;)Ag(Fn,Mn),Mn=Lf$1(Mn.nextSibling)}if(Fg(Fn),Fn.tag===13){if(Fn=Fn.memoizedState,Fn=Fn!==null?Fn.dehydrated:null,!Fn)throw Error(p$9(317));e:{for(Fn=Fn.nextSibling,Mn=0;Fn;){if(Fn.nodeType===8){var rs=Fn.data;if(rs==="/$"){if(Mn===0){yg=Lf$1(Fn.nextSibling);break e}Mn--}else rs!=="$"&&rs!=="$!"&&rs!=="$?"||Mn++}Fn=Fn.nextSibling}yg=null}}else yg=xg?Lf$1(Fn.stateNode.nextSibling):null;return!0}function Hg(){for(var Fn=yg;Fn;)Fn=Lf$1(Fn.nextSibling)}function Ig(){yg=xg=null,I$4=!1}function Jg$1(Fn){zg===null?zg=[Fn]:zg.push(Fn)}var Kg=ua$1.ReactCurrentBatchConfig;function Lg(Fn,Mn,rs){if(Fn=rs.ref,Fn!==null&&typeof Fn!="function"&&typeof Fn!="object"){if(rs._owner){if(rs=rs._owner,rs){if(rs.tag!==1)throw Error(p$9(309));var is=rs.stateNode}if(!is)throw Error(p$9(147,Fn));var os=is,as=""+Fn;return Mn!==null&&Mn.ref!==null&&typeof Mn.ref=="function"&&Mn.ref._stringRef===as?Mn.ref:(Mn=function(us){var ds=os.refs;us===null?delete ds[as]:ds[as]=us},Mn._stringRef=as,Mn)}if(typeof Fn!="string")throw Error(p$9(284));if(!rs._owner)throw Error(p$9(290,Fn))}return Fn}function Mg$1(Fn,Mn){throw Fn=Object.prototype.toString.call(Mn),Error(p$9(31,Fn==="[object Object]"?"object with keys {"+Object.keys(Mn).join(", ")+"}":Fn))}function Ng(Fn){var Mn=Fn._init;return Mn(Fn._payload)}function Og(Fn){function Mn(Yo,Wo){if(Fn){var Jo=Yo.deletions;Jo===null?(Yo.deletions=[Wo],Yo.flags|=16):Jo.push(Wo)}}function rs(Yo,Wo){if(!Fn)return null;for(;Wo!==null;)Mn(Yo,Wo),Wo=Wo.sibling;return null}function is(Yo,Wo){for(Yo=new Map;Wo!==null;)Wo.key!==null?Yo.set(Wo.key,Wo):Yo.set(Wo.index,Wo),Wo=Wo.sibling;return Yo}function os(Yo,Wo){return Yo=Pg(Yo,Wo),Yo.index=0,Yo.sibling=null,Yo}function as(Yo,Wo,Jo){return Yo.index=Jo,Fn?(Jo=Yo.alternate,Jo!==null?(Jo=Jo.index,Jo<Wo?(Yo.flags|=2,Wo):Jo):(Yo.flags|=2,Wo)):(Yo.flags|=1048576,Wo)}function us(Yo){return Fn&&Yo.alternate===null&&(Yo.flags|=2),Yo}function ds(Yo,Wo,Jo,xl){return Wo===null||Wo.tag!==6?(Wo=Qg$1(Jo,Yo.mode,xl),Wo.return=Yo,Wo):(Wo=os(Wo,Jo),Wo.return=Yo,Wo)}function hs(Yo,Wo,Jo,xl){var _l=Jo.type;return _l===ya$2?io(Yo,Wo,Jo.props.children,xl,Jo.key):Wo!==null&&(Wo.elementType===_l||typeof _l=="object"&&_l!==null&&_l.$$typeof===Ha$2&&Ng(_l)===Wo.type)?(xl=os(Wo,Jo.props),xl.ref=Lg(Yo,Wo,Jo),xl.return=Yo,xl):(xl=Rg(Jo.type,Jo.key,Jo.props,null,Yo.mode,xl),xl.ref=Lg(Yo,Wo,Jo),xl.return=Yo,xl)}function ps(Yo,Wo,Jo,xl){return Wo===null||Wo.tag!==4||Wo.stateNode.containerInfo!==Jo.containerInfo||Wo.stateNode.implementation!==Jo.implementation?(Wo=Sg(Jo,Yo.mode,xl),Wo.return=Yo,Wo):(Wo=os(Wo,Jo.children||[]),Wo.return=Yo,Wo)}function io(Yo,Wo,Jo,xl,_l){return Wo===null||Wo.tag!==7?(Wo=Tg(Jo,Yo.mode,xl,_l),Wo.return=Yo,Wo):(Wo=os(Wo,Jo),Wo.return=Yo,Wo)}function fo(Yo,Wo,Jo){if(typeof Wo=="string"&&Wo!==""||typeof Wo=="number")return Wo=Qg$1(""+Wo,Yo.mode,Jo),Wo.return=Yo,Wo;if(typeof Wo=="object"&&Wo!==null){switch(Wo.$$typeof){case va$1:return Jo=Rg(Wo.type,Wo.key,Wo.props,null,Yo.mode,Jo),Jo.ref=Lg(Yo,null,Wo),Jo.return=Yo,Jo;case wa$1:return Wo=Sg(Wo,Yo.mode,Jo),Wo.return=Yo,Wo;case Ha$2:var xl=Wo._init;return fo(Yo,xl(Wo._payload),Jo)}if(eb(Wo)||Ka$1(Wo))return Wo=Tg(Wo,Yo.mode,Jo,null),Wo.return=Yo,Wo;Mg$1(Yo,Wo)}return null}function mo(Yo,Wo,Jo,xl){var _l=Wo!==null?Wo.key:null;if(typeof Jo=="string"&&Jo!==""||typeof Jo=="number")return _l!==null?null:ds(Yo,Wo,""+Jo,xl);if(typeof Jo=="object"&&Jo!==null){switch(Jo.$$typeof){case va$1:return Jo.key===_l?hs(Yo,Wo,Jo,xl):null;case wa$1:return Jo.key===_l?ps(Yo,Wo,Jo,xl):null;case Ha$2:return _l=Jo._init,mo(Yo,Wo,_l(Jo._payload),xl)}if(eb(Jo)||Ka$1(Jo))return _l!==null?null:io(Yo,Wo,Jo,xl,null);Mg$1(Yo,Jo)}return null}function Ao(Yo,Wo,Jo,xl,_l){if(typeof xl=="string"&&xl!==""||typeof xl=="number")return Yo=Yo.get(Jo)||null,ds(Wo,Yo,""+xl,_l);if(typeof xl=="object"&&xl!==null){switch(xl.$$typeof){case va$1:return Yo=Yo.get(xl.key===null?Jo:xl.key)||null,hs(Wo,Yo,xl,_l);case wa$1:return Yo=Yo.get(xl.key===null?Jo:xl.key)||null,ps(Wo,Yo,xl,_l);case Ha$2:var Tl=xl._init;return Ao(Yo,Wo,Jo,Tl(xl._payload),_l)}if(eb(xl)||Ka$1(xl))return Yo=Yo.get(Jo)||null,io(Wo,Yo,xl,_l,null);Mg$1(Wo,xl)}return null}function $o(Yo,Wo,Jo,xl){for(var _l=null,Tl=null,Sl=Wo,$l=Wo=0,Pl=null;Sl!==null&&$l<Jo.length;$l++){Sl.index>$l?(Pl=Sl,Sl=null):Pl=Sl.sibling;var Dl=mo(Yo,Sl,Jo[$l],xl);if(Dl===null){Sl===null&&(Sl=Pl);break}Fn&&Sl&&Dl.alternate===null&&Mn(Yo,Sl),Wo=as(Dl,Wo,$l),Tl===null?_l=Dl:Tl.sibling=Dl,Tl=Dl,Sl=Pl}if($l===Jo.length)return rs(Yo,Sl),I$4&&tg(Yo,$l),_l;if(Sl===null){for(;$l<Jo.length;$l++)Sl=fo(Yo,Jo[$l],xl),Sl!==null&&(Wo=as(Sl,Wo,$l),Tl===null?_l=Sl:Tl.sibling=Sl,Tl=Sl);return I$4&&tg(Yo,$l),_l}for(Sl=is(Yo,Sl);$l<Jo.length;$l++)Pl=Ao(Sl,Yo,$l,Jo[$l],xl),Pl!==null&&(Fn&&Pl.alternate!==null&&Sl.delete(Pl.key===null?$l:Pl.key),Wo=as(Pl,Wo,$l),Tl===null?_l=Pl:Tl.sibling=Pl,Tl=Pl);return Fn&&Sl.forEach(function(Ol){return Mn(Yo,Ol)}),I$4&&tg(Yo,$l),_l}function Lo(Yo,Wo,Jo,xl){var _l=Ka$1(Jo);if(typeof _l!="function")throw Error(p$9(150));if(Jo=_l.call(Jo),Jo==null)throw Error(p$9(151));for(var Tl=_l=null,Sl=Wo,$l=Wo=0,Pl=null,Dl=Jo.next();Sl!==null&&!Dl.done;$l++,Dl=Jo.next()){Sl.index>$l?(Pl=Sl,Sl=null):Pl=Sl.sibling;var Ol=mo(Yo,Sl,Dl.value,xl);if(Ol===null){Sl===null&&(Sl=Pl);break}Fn&&Sl&&Ol.alternate===null&&Mn(Yo,Sl),Wo=as(Ol,Wo,$l),Tl===null?_l=Ol:Tl.sibling=Ol,Tl=Ol,Sl=Pl}if(Dl.done)return rs(Yo,Sl),I$4&&tg(Yo,$l),_l;if(Sl===null){for(;!Dl.done;$l++,Dl=Jo.next())Dl=fo(Yo,Dl.value,xl),Dl!==null&&(Wo=as(Dl,Wo,$l),Tl===null?_l=Dl:Tl.sibling=Dl,Tl=Dl);return I$4&&tg(Yo,$l),_l}for(Sl=is(Yo,Sl);!Dl.done;$l++,Dl=Jo.next())Dl=Ao(Sl,Yo,$l,Dl.value,xl),Dl!==null&&(Fn&&Dl.alternate!==null&&Sl.delete(Dl.key===null?$l:Dl.key),Wo=as(Dl,Wo,$l),Tl===null?_l=Dl:Tl.sibling=Dl,Tl=Dl);return Fn&&Sl.forEach(function(Rl){return Mn(Yo,Rl)}),I$4&&tg(Yo,$l),_l}function Go(Yo,Wo,Jo,xl){if(typeof Jo=="object"&&Jo!==null&&Jo.type===ya$2&&Jo.key===null&&(Jo=Jo.props.children),typeof Jo=="object"&&Jo!==null){switch(Jo.$$typeof){case va$1:e:{for(var _l=Jo.key,Tl=Wo;Tl!==null;){if(Tl.key===_l){if(_l=Jo.type,_l===ya$2){if(Tl.tag===7){rs(Yo,Tl.sibling),Wo=os(Tl,Jo.props.children),Wo.return=Yo,Yo=Wo;break e}}else if(Tl.elementType===_l||typeof _l=="object"&&_l!==null&&_l.$$typeof===Ha$2&&Ng(_l)===Tl.type){rs(Yo,Tl.sibling),Wo=os(Tl,Jo.props),Wo.ref=Lg(Yo,Tl,Jo),Wo.return=Yo,Yo=Wo;break e}rs(Yo,Tl);break}else Mn(Yo,Tl);Tl=Tl.sibling}Jo.type===ya$2?(Wo=Tg(Jo.props.children,Yo.mode,xl,Jo.key),Wo.return=Yo,Yo=Wo):(xl=Rg(Jo.type,Jo.key,Jo.props,null,Yo.mode,xl),xl.ref=Lg(Yo,Wo,Jo),xl.return=Yo,Yo=xl)}return us(Yo);case wa$1:e:{for(Tl=Jo.key;Wo!==null;){if(Wo.key===Tl)if(Wo.tag===4&&Wo.stateNode.containerInfo===Jo.containerInfo&&Wo.stateNode.implementation===Jo.implementation){rs(Yo,Wo.sibling),Wo=os(Wo,Jo.children||[]),Wo.return=Yo,Yo=Wo;break e}else{rs(Yo,Wo);break}else Mn(Yo,Wo);Wo=Wo.sibling}Wo=Sg(Jo,Yo.mode,xl),Wo.return=Yo,Yo=Wo}return us(Yo);case Ha$2:return Tl=Jo._init,Go(Yo,Wo,Tl(Jo._payload),xl)}if(eb(Jo))return $o(Yo,Wo,Jo,xl);if(Ka$1(Jo))return Lo(Yo,Wo,Jo,xl);Mg$1(Yo,Jo)}return typeof Jo=="string"&&Jo!==""||typeof Jo=="number"?(Jo=""+Jo,Wo!==null&&Wo.tag===6?(rs(Yo,Wo.sibling),Wo=os(Wo,Jo),Wo.return=Yo,Yo=Wo):(rs(Yo,Wo),Wo=Qg$1(Jo,Yo.mode,xl),Wo.return=Yo,Yo=Wo),us(Yo)):rs(Yo,Wo)}return Go}var Ug=Og(!0),Vg$1=Og(!1),Wg=Uf$1(null),Xg$1=null,Yg$1=null,Zg$1=null;function $g(){Zg$1=Yg$1=Xg$1=null}function ah(Fn){var Mn=Wg.current;E$5(Wg),Fn._currentValue=Mn}function bh$1(Fn,Mn,rs){for(;Fn!==null;){var is=Fn.alternate;if((Fn.childLanes&Mn)!==Mn?(Fn.childLanes|=Mn,is!==null&&(is.childLanes|=Mn)):is!==null&&(is.childLanes&Mn)!==Mn&&(is.childLanes|=Mn),Fn===rs)break;Fn=Fn.return}}function ch$1(Fn,Mn){Xg$1=Fn,Zg$1=Yg$1=null,Fn=Fn.dependencies,Fn!==null&&Fn.firstContext!==null&&(Fn.lanes&Mn&&(dh$1=!0),Fn.firstContext=null)}function eh(Fn){var Mn=Fn._currentValue;if(Zg$1!==Fn)if(Fn={context:Fn,memoizedValue:Mn,next:null},Yg$1===null){if(Xg$1===null)throw Error(p$9(308));Yg$1=Fn,Xg$1.dependencies={lanes:0,firstContext:Fn}}else Yg$1=Yg$1.next=Fn;return Mn}var fh=null;function gh$1(Fn){fh===null?fh=[Fn]:fh.push(Fn)}function hh$1(Fn,Mn,rs,is){var os=Mn.interleaved;return os===null?(rs.next=rs,gh$1(Mn)):(rs.next=os.next,os.next=rs),Mn.interleaved=rs,ih(Fn,is)}function ih(Fn,Mn){Fn.lanes|=Mn;var rs=Fn.alternate;for(rs!==null&&(rs.lanes|=Mn),rs=Fn,Fn=Fn.return;Fn!==null;)Fn.childLanes|=Mn,rs=Fn.alternate,rs!==null&&(rs.childLanes|=Mn),rs=Fn,Fn=Fn.return;return rs.tag===3?rs.stateNode:null}var jh=!1;function kh(Fn){Fn.updateQueue={baseState:Fn.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh$1(Fn,Mn){Fn=Fn.updateQueue,Mn.updateQueue===Fn&&(Mn.updateQueue={baseState:Fn.baseState,firstBaseUpdate:Fn.firstBaseUpdate,lastBaseUpdate:Fn.lastBaseUpdate,shared:Fn.shared,effects:Fn.effects})}function mh$1(Fn,Mn){return{eventTime:Fn,lane:Mn,tag:0,payload:null,callback:null,next:null}}function nh(Fn,Mn,rs){var is=Fn.updateQueue;if(is===null)return null;if(is=is.shared,K$4&2){var os=is.pending;return os===null?Mn.next=Mn:(Mn.next=os.next,os.next=Mn),is.pending=Mn,ih(Fn,rs)}return os=is.interleaved,os===null?(Mn.next=Mn,gh$1(is)):(Mn.next=os.next,os.next=Mn),is.interleaved=Mn,ih(Fn,rs)}function oh(Fn,Mn,rs){if(Mn=Mn.updateQueue,Mn!==null&&(Mn=Mn.shared,(rs&4194240)!==0)){var is=Mn.lanes;is&=Fn.pendingLanes,rs|=is,Mn.lanes=rs,Cc(Fn,rs)}}function ph$1(Fn,Mn){var rs=Fn.updateQueue,is=Fn.alternate;if(is!==null&&(is=is.updateQueue,rs===is)){var os=null,as=null;if(rs=rs.firstBaseUpdate,rs!==null){do{var us={eventTime:rs.eventTime,lane:rs.lane,tag:rs.tag,payload:rs.payload,callback:rs.callback,next:null};as===null?os=as=us:as=as.next=us,rs=rs.next}while(rs!==null);as===null?os=as=Mn:as=as.next=Mn}else os=as=Mn;rs={baseState:is.baseState,firstBaseUpdate:os,lastBaseUpdate:as,shared:is.shared,effects:is.effects},Fn.updateQueue=rs;return}Fn=rs.lastBaseUpdate,Fn===null?rs.firstBaseUpdate=Mn:Fn.next=Mn,rs.lastBaseUpdate=Mn}function qh(Fn,Mn,rs,is){var os=Fn.updateQueue;jh=!1;var as=os.firstBaseUpdate,us=os.lastBaseUpdate,ds=os.shared.pending;if(ds!==null){os.shared.pending=null;var hs=ds,ps=hs.next;hs.next=null,us===null?as=ps:us.next=ps,us=hs;var io=Fn.alternate;io!==null&&(io=io.updateQueue,ds=io.lastBaseUpdate,ds!==us&&(ds===null?io.firstBaseUpdate=ps:ds.next=ps,io.lastBaseUpdate=hs))}if(as!==null){var fo=os.baseState;us=0,io=ps=hs=null,ds=as;do{var mo=ds.lane,Ao=ds.eventTime;if((is&mo)===mo){io!==null&&(io=io.next={eventTime:Ao,lane:0,tag:ds.tag,payload:ds.payload,callback:ds.callback,next:null});e:{var $o=Fn,Lo=ds;switch(mo=Mn,Ao=rs,Lo.tag){case 1:if($o=Lo.payload,typeof $o=="function"){fo=$o.call(Ao,fo,mo);break e}fo=$o;break e;case 3:$o.flags=$o.flags&-65537|128;case 0:if($o=Lo.payload,mo=typeof $o=="function"?$o.call(Ao,fo,mo):$o,mo==null)break e;fo=A$4({},fo,mo);break e;case 2:jh=!0}}ds.callback!==null&&ds.lane!==0&&(Fn.flags|=64,mo=os.effects,mo===null?os.effects=[ds]:mo.push(ds))}else Ao={eventTime:Ao,lane:mo,tag:ds.tag,payload:ds.payload,callback:ds.callback,next:null},io===null?(ps=io=Ao,hs=fo):io=io.next=Ao,us|=mo;if(ds=ds.next,ds===null){if(ds=os.shared.pending,ds===null)break;mo=ds,ds=mo.next,mo.next=null,os.lastBaseUpdate=mo,os.shared.pending=null}}while(!0);if(io===null&&(hs=fo),os.baseState=hs,os.firstBaseUpdate=ps,os.lastBaseUpdate=io,Mn=os.shared.interleaved,Mn!==null){os=Mn;do us|=os.lane,os=os.next;while(os!==Mn)}else as===null&&(os.shared.lanes=0);rh$1|=us,Fn.lanes=us,Fn.memoizedState=fo}}function sh$1(Fn,Mn,rs){if(Fn=Mn.effects,Mn.effects=null,Fn!==null)for(Mn=0;Mn<Fn.length;Mn++){var is=Fn[Mn],os=is.callback;if(os!==null){if(is.callback=null,is=rs,typeof os!="function")throw Error(p$9(191,os));os.call(is)}}}var th={},uh$1=Uf$1(th),vh$1=Uf$1(th),wh$1=Uf$1(th);function xh$1(Fn){if(Fn===th)throw Error(p$9(174));return Fn}function yh$1(Fn,Mn){switch(G$3(wh$1,Mn),G$3(vh$1,Fn),G$3(uh$1,th),Fn=Mn.nodeType,Fn){case 9:case 11:Mn=(Mn=Mn.documentElement)?Mn.namespaceURI:lb(null,"");break;default:Fn=Fn===8?Mn.parentNode:Mn,Mn=Fn.namespaceURI||null,Fn=Fn.tagName,Mn=lb(Mn,Fn)}E$5(uh$1),G$3(uh$1,Mn)}function zh(){E$5(uh$1),E$5(vh$1),E$5(wh$1)}function Ah$1(Fn){xh$1(wh$1.current);var Mn=xh$1(uh$1.current),rs=lb(Mn,Fn.type);Mn!==rs&&(G$3(vh$1,Fn),G$3(uh$1,rs))}function Bh$1(Fn){vh$1.current===Fn&&(E$5(uh$1),E$5(vh$1))}var L$3=Uf$1(0);function Ch$1(Fn){for(var Mn=Fn;Mn!==null;){if(Mn.tag===13){var rs=Mn.memoizedState;if(rs!==null&&(rs=rs.dehydrated,rs===null||rs.data==="$?"||rs.data==="$!"))return Mn}else if(Mn.tag===19&&Mn.memoizedProps.revealOrder!==void 0){if(Mn.flags&128)return Mn}else if(Mn.child!==null){Mn.child.return=Mn,Mn=Mn.child;continue}if(Mn===Fn)break;for(;Mn.sibling===null;){if(Mn.return===null||Mn.return===Fn)return null;Mn=Mn.return}Mn.sibling.return=Mn.return,Mn=Mn.sibling}return null}var Dh=[];function Eh$1(){for(var Fn=0;Fn<Dh.length;Fn++)Dh[Fn]._workInProgressVersionPrimary=null;Dh.length=0}var Fh=ua$1.ReactCurrentDispatcher,Gh=ua$1.ReactCurrentBatchConfig,Hh=0,M$4=null,N$3=null,O$6=null,Ih$1=!1,Jh=!1,Kh$1=0,Lh=0;function P$4(){throw Error(p$9(321))}function Mh$1(Fn,Mn){if(Mn===null)return!1;for(var rs=0;rs<Mn.length&&rs<Fn.length;rs++)if(!He(Fn[rs],Mn[rs]))return!1;return!0}function Nh$1(Fn,Mn,rs,is,os,as){if(Hh=as,M$4=Mn,Mn.memoizedState=null,Mn.updateQueue=null,Mn.lanes=0,Fh.current=Fn===null||Fn.memoizedState===null?Oh:Ph,Fn=rs(is,os),Jh){as=0;do{if(Jh=!1,Kh$1=0,25<=as)throw Error(p$9(301));as+=1,O$6=N$3=null,Mn.updateQueue=null,Fh.current=Qh,Fn=rs(is,os)}while(Jh)}if(Fh.current=Rh$1,Mn=N$3!==null&&N$3.next!==null,Hh=0,O$6=N$3=M$4=null,Ih$1=!1,Mn)throw Error(p$9(300));return Fn}function Sh$1(){var Fn=Kh$1!==0;return Kh$1=0,Fn}function Th(){var Fn={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return O$6===null?M$4.memoizedState=O$6=Fn:O$6=O$6.next=Fn,O$6}function Uh(){if(N$3===null){var Fn=M$4.alternate;Fn=Fn!==null?Fn.memoizedState:null}else Fn=N$3.next;var Mn=O$6===null?M$4.memoizedState:O$6.next;if(Mn!==null)O$6=Mn,N$3=Fn;else{if(Fn===null)throw Error(p$9(310));N$3=Fn,Fn={memoizedState:N$3.memoizedState,baseState:N$3.baseState,baseQueue:N$3.baseQueue,queue:N$3.queue,next:null},O$6===null?M$4.memoizedState=O$6=Fn:O$6=O$6.next=Fn}return O$6}function Vh(Fn,Mn){return typeof Mn=="function"?Mn(Fn):Mn}function Wh(Fn){var Mn=Uh(),rs=Mn.queue;if(rs===null)throw Error(p$9(311));rs.lastRenderedReducer=Fn;var is=N$3,os=is.baseQueue,as=rs.pending;if(as!==null){if(os!==null){var us=os.next;os.next=as.next,as.next=us}is.baseQueue=os=as,rs.pending=null}if(os!==null){as=os.next,is=is.baseState;var ds=us=null,hs=null,ps=as;do{var io=ps.lane;if((Hh&io)===io)hs!==null&&(hs=hs.next={lane:0,action:ps.action,hasEagerState:ps.hasEagerState,eagerState:ps.eagerState,next:null}),is=ps.hasEagerState?ps.eagerState:Fn(is,ps.action);else{var fo={lane:io,action:ps.action,hasEagerState:ps.hasEagerState,eagerState:ps.eagerState,next:null};hs===null?(ds=hs=fo,us=is):hs=hs.next=fo,M$4.lanes|=io,rh$1|=io}ps=ps.next}while(ps!==null&&ps!==as);hs===null?us=is:hs.next=ds,He(is,Mn.memoizedState)||(dh$1=!0),Mn.memoizedState=is,Mn.baseState=us,Mn.baseQueue=hs,rs.lastRenderedState=is}if(Fn=rs.interleaved,Fn!==null){os=Fn;do as=os.lane,M$4.lanes|=as,rh$1|=as,os=os.next;while(os!==Fn)}else os===null&&(rs.lanes=0);return[Mn.memoizedState,rs.dispatch]}function Xh(Fn){var Mn=Uh(),rs=Mn.queue;if(rs===null)throw Error(p$9(311));rs.lastRenderedReducer=Fn;var is=rs.dispatch,os=rs.pending,as=Mn.memoizedState;if(os!==null){rs.pending=null;var us=os=os.next;do as=Fn(as,us.action),us=us.next;while(us!==os);He(as,Mn.memoizedState)||(dh$1=!0),Mn.memoizedState=as,Mn.baseQueue===null&&(Mn.baseState=as),rs.lastRenderedState=as}return[as,is]}function Yh(){}function Zh(Fn,Mn){var rs=M$4,is=Uh(),os=Mn(),as=!He(is.memoizedState,os);if(as&&(is.memoizedState=os,dh$1=!0),is=is.queue,$h(ai$1.bind(null,rs,is,Fn),[Fn]),is.getSnapshot!==Mn||as||O$6!==null&&O$6.memoizedState.tag&1){if(rs.flags|=2048,bi$2(9,ci$1.bind(null,rs,is,os,Mn),void 0,null),Q$4===null)throw Error(p$9(349));Hh&30||di$1(rs,Mn,os)}return os}function di$1(Fn,Mn,rs){Fn.flags|=16384,Fn={getSnapshot:Mn,value:rs},Mn=M$4.updateQueue,Mn===null?(Mn={lastEffect:null,stores:null},M$4.updateQueue=Mn,Mn.stores=[Fn]):(rs=Mn.stores,rs===null?Mn.stores=[Fn]:rs.push(Fn))}function ci$1(Fn,Mn,rs,is){Mn.value=rs,Mn.getSnapshot=is,ei$1(Mn)&&fi$1(Fn)}function ai$1(Fn,Mn,rs){return rs(function(){ei$1(Mn)&&fi$1(Fn)})}function ei$1(Fn){var Mn=Fn.getSnapshot;Fn=Fn.value;try{var rs=Mn();return!He(Fn,rs)}catch{return!0}}function fi$1(Fn){var Mn=ih(Fn,1);Mn!==null&&gi$1(Mn,Fn,1,-1)}function hi$1(Fn){var Mn=Th();return typeof Fn=="function"&&(Fn=Fn()),Mn.memoizedState=Mn.baseState=Fn,Fn={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vh,lastRenderedState:Fn},Mn.queue=Fn,Fn=Fn.dispatch=ii$2.bind(null,M$4,Fn),[Mn.memoizedState,Fn]}function bi$2(Fn,Mn,rs,is){return Fn={tag:Fn,create:Mn,destroy:rs,deps:is,next:null},Mn=M$4.updateQueue,Mn===null?(Mn={lastEffect:null,stores:null},M$4.updateQueue=Mn,Mn.lastEffect=Fn.next=Fn):(rs=Mn.lastEffect,rs===null?Mn.lastEffect=Fn.next=Fn:(is=rs.next,rs.next=Fn,Fn.next=is,Mn.lastEffect=Fn)),Fn}function ji$1(){return Uh().memoizedState}function ki$1(Fn,Mn,rs,is){var os=Th();M$4.flags|=Fn,os.memoizedState=bi$2(1|Mn,rs,void 0,is===void 0?null:is)}function li$1(Fn,Mn,rs,is){var os=Uh();is=is===void 0?null:is;var as=void 0;if(N$3!==null){var us=N$3.memoizedState;if(as=us.destroy,is!==null&&Mh$1(is,us.deps)){os.memoizedState=bi$2(Mn,rs,as,is);return}}M$4.flags|=Fn,os.memoizedState=bi$2(1|Mn,rs,as,is)}function mi$1(Fn,Mn){return ki$1(8390656,8,Fn,Mn)}function $h(Fn,Mn){return li$1(2048,8,Fn,Mn)}function ni$1(Fn,Mn){return li$1(4,2,Fn,Mn)}function oi$1(Fn,Mn){return li$1(4,4,Fn,Mn)}function pi$1(Fn,Mn){if(typeof Mn=="function")return Fn=Fn(),Mn(Fn),function(){Mn(null)};if(Mn!=null)return Fn=Fn(),Mn.current=Fn,function(){Mn.current=null}}function qi$2(Fn,Mn,rs){return rs=rs!=null?rs.concat([Fn]):null,li$1(4,4,pi$1.bind(null,Mn,Fn),rs)}function ri$1(){}function si$1(Fn,Mn){var rs=Uh();Mn=Mn===void 0?null:Mn;var is=rs.memoizedState;return is!==null&&Mn!==null&&Mh$1(Mn,is[1])?is[0]:(rs.memoizedState=[Fn,Mn],Fn)}function ti$1(Fn,Mn){var rs=Uh();Mn=Mn===void 0?null:Mn;var is=rs.memoizedState;return is!==null&&Mn!==null&&Mh$1(Mn,is[1])?is[0]:(Fn=Fn(),rs.memoizedState=[Fn,Mn],Fn)}function ui$1(Fn,Mn,rs){return Hh&21?(He(rs,Mn)||(rs=yc(),M$4.lanes|=rs,rh$1|=rs,Fn.baseState=!0),Mn):(Fn.baseState&&(Fn.baseState=!1,dh$1=!0),Fn.memoizedState=rs)}function vi(Fn,Mn){var rs=C$3;C$3=rs!==0&&4>rs?rs:4,Fn(!0);var is=Gh.transition;Gh.transition={};try{Fn(!1),Mn()}finally{C$3=rs,Gh.transition=is}}function wi(){return Uh().memoizedState}function xi$1(Fn,Mn,rs){var is=yi$2(Fn);if(rs={lane:is,action:rs,hasEagerState:!1,eagerState:null,next:null},zi$1(Fn))Ai(Mn,rs);else if(rs=hh$1(Fn,Mn,rs,is),rs!==null){var os=R$4();gi$1(rs,Fn,is,os),Bi$2(rs,Mn,is)}}function ii$2(Fn,Mn,rs){var is=yi$2(Fn),os={lane:is,action:rs,hasEagerState:!1,eagerState:null,next:null};if(zi$1(Fn))Ai(Mn,os);else{var as=Fn.alternate;if(Fn.lanes===0&&(as===null||as.lanes===0)&&(as=Mn.lastRenderedReducer,as!==null))try{var us=Mn.lastRenderedState,ds=as(us,rs);if(os.hasEagerState=!0,os.eagerState=ds,He(ds,us)){var hs=Mn.interleaved;hs===null?(os.next=os,gh$1(Mn)):(os.next=hs.next,hs.next=os),Mn.interleaved=os;return}}catch{}finally{}rs=hh$1(Fn,Mn,os,is),rs!==null&&(os=R$4(),gi$1(rs,Fn,is,os),Bi$2(rs,Mn,is))}}function zi$1(Fn){var Mn=Fn.alternate;return Fn===M$4||Mn!==null&&Mn===M$4}function Ai(Fn,Mn){Jh=Ih$1=!0;var rs=Fn.pending;rs===null?Mn.next=Mn:(Mn.next=rs.next,rs.next=Mn),Fn.pending=Mn}function Bi$2(Fn,Mn,rs){if(rs&4194240){var is=Mn.lanes;is&=Fn.pendingLanes,rs|=is,Mn.lanes=rs,Cc(Fn,rs)}}var Rh$1={readContext:eh,useCallback:P$4,useContext:P$4,useEffect:P$4,useImperativeHandle:P$4,useInsertionEffect:P$4,useLayoutEffect:P$4,useMemo:P$4,useReducer:P$4,useRef:P$4,useState:P$4,useDebugValue:P$4,useDeferredValue:P$4,useTransition:P$4,useMutableSource:P$4,useSyncExternalStore:P$4,useId:P$4,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(Fn,Mn){return Th().memoizedState=[Fn,Mn===void 0?null:Mn],Fn},useContext:eh,useEffect:mi$1,useImperativeHandle:function(Fn,Mn,rs){return rs=rs!=null?rs.concat([Fn]):null,ki$1(4194308,4,pi$1.bind(null,Mn,Fn),rs)},useLayoutEffect:function(Fn,Mn){return ki$1(4194308,4,Fn,Mn)},useInsertionEffect:function(Fn,Mn){return ki$1(4,2,Fn,Mn)},useMemo:function(Fn,Mn){var rs=Th();return Mn=Mn===void 0?null:Mn,Fn=Fn(),rs.memoizedState=[Fn,Mn],Fn},useReducer:function(Fn,Mn,rs){var is=Th();return Mn=rs!==void 0?rs(Mn):Mn,is.memoizedState=is.baseState=Mn,Fn={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fn,lastRenderedState:Mn},is.queue=Fn,Fn=Fn.dispatch=xi$1.bind(null,M$4,Fn),[is.memoizedState,Fn]},useRef:function(Fn){var Mn=Th();return Fn={current:Fn},Mn.memoizedState=Fn},useState:hi$1,useDebugValue:ri$1,useDeferredValue:function(Fn){return Th().memoizedState=Fn},useTransition:function(){var Fn=hi$1(!1),Mn=Fn[0];return Fn=vi.bind(null,Fn[1]),Th().memoizedState=Fn,[Mn,Fn]},useMutableSource:function(){},useSyncExternalStore:function(Fn,Mn,rs){var is=M$4,os=Th();if(I$4){if(rs===void 0)throw Error(p$9(407));rs=rs()}else{if(rs=Mn(),Q$4===null)throw Error(p$9(349));Hh&30||di$1(is,Mn,rs)}os.memoizedState=rs;var as={value:rs,getSnapshot:Mn};return os.queue=as,mi$1(ai$1.bind(null,is,as,Fn),[Fn]),is.flags|=2048,bi$2(9,ci$1.bind(null,is,as,rs,Mn),void 0,null),rs},useId:function(){var Fn=Th(),Mn=Q$4.identifierPrefix;if(I$4){var rs=sg,is=rg;rs=(is&~(1<<32-oc(is)-1)).toString(32)+rs,Mn=":"+Mn+"R"+rs,rs=Kh$1++,0<rs&&(Mn+="H"+rs.toString(32)),Mn+=":"}else rs=Lh++,Mn=":"+Mn+"r"+rs.toString(32)+":";return Fn.memoizedState=Mn},unstable_isNewReconciler:!1},Ph={readContext:eh,useCallback:si$1,useContext:eh,useEffect:$h,useImperativeHandle:qi$2,useInsertionEffect:ni$1,useLayoutEffect:oi$1,useMemo:ti$1,useReducer:Wh,useRef:ji$1,useState:function(){return Wh(Vh)},useDebugValue:ri$1,useDeferredValue:function(Fn){var Mn=Uh();return ui$1(Mn,N$3.memoizedState,Fn)},useTransition:function(){var Fn=Wh(Vh)[0],Mn=Uh().memoizedState;return[Fn,Mn]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1},Qh={readContext:eh,useCallback:si$1,useContext:eh,useEffect:$h,useImperativeHandle:qi$2,useInsertionEffect:ni$1,useLayoutEffect:oi$1,useMemo:ti$1,useReducer:Xh,useRef:ji$1,useState:function(){return Xh(Vh)},useDebugValue:ri$1,useDeferredValue:function(Fn){var Mn=Uh();return N$3===null?Mn.memoizedState=Fn:ui$1(Mn,N$3.memoizedState,Fn)},useTransition:function(){var Fn=Xh(Vh)[0],Mn=Uh().memoizedState;return[Fn,Mn]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1};function Ci$1(Fn,Mn){if(Fn&&Fn.defaultProps){Mn=A$4({},Mn),Fn=Fn.defaultProps;for(var rs in Fn)Mn[rs]===void 0&&(Mn[rs]=Fn[rs]);return Mn}return Mn}function Di$2(Fn,Mn,rs,is){Mn=Fn.memoizedState,rs=rs(is,Mn),rs=rs==null?Mn:A$4({},Mn,rs),Fn.memoizedState=rs,Fn.lanes===0&&(Fn.updateQueue.baseState=rs)}var Ei$1={isMounted:function(Fn){return(Fn=Fn._reactInternals)?Vb(Fn)===Fn:!1},enqueueSetState:function(Fn,Mn,rs){Fn=Fn._reactInternals;var is=R$4(),os=yi$2(Fn),as=mh$1(is,os);as.payload=Mn,rs!=null&&(as.callback=rs),Mn=nh(Fn,as,os),Mn!==null&&(gi$1(Mn,Fn,os,is),oh(Mn,Fn,os))},enqueueReplaceState:function(Fn,Mn,rs){Fn=Fn._reactInternals;var is=R$4(),os=yi$2(Fn),as=mh$1(is,os);as.tag=1,as.payload=Mn,rs!=null&&(as.callback=rs),Mn=nh(Fn,as,os),Mn!==null&&(gi$1(Mn,Fn,os,is),oh(Mn,Fn,os))},enqueueForceUpdate:function(Fn,Mn){Fn=Fn._reactInternals;var rs=R$4(),is=yi$2(Fn),os=mh$1(rs,is);os.tag=2,Mn!=null&&(os.callback=Mn),Mn=nh(Fn,os,is),Mn!==null&&(gi$1(Mn,Fn,is,rs),oh(Mn,Fn,is))}};function Fi$2(Fn,Mn,rs,is,os,as,us){return Fn=Fn.stateNode,typeof Fn.shouldComponentUpdate=="function"?Fn.shouldComponentUpdate(is,as,us):Mn.prototype&&Mn.prototype.isPureReactComponent?!Ie$1(rs,is)||!Ie$1(os,as):!0}function Gi$1(Fn,Mn,rs){var is=!1,os=Vf$1,as=Mn.contextType;return typeof as=="object"&&as!==null?as=eh(as):(os=Zf(Mn)?Xf:H$1.current,is=Mn.contextTypes,as=(is=is!=null)?Yf$1(Fn,os):Vf$1),Mn=new Mn(rs,as),Fn.memoizedState=Mn.state!==null&&Mn.state!==void 0?Mn.state:null,Mn.updater=Ei$1,Fn.stateNode=Mn,Mn._reactInternals=Fn,is&&(Fn=Fn.stateNode,Fn.__reactInternalMemoizedUnmaskedChildContext=os,Fn.__reactInternalMemoizedMaskedChildContext=as),Mn}function Hi$1(Fn,Mn,rs,is){Fn=Mn.state,typeof Mn.componentWillReceiveProps=="function"&&Mn.componentWillReceiveProps(rs,is),typeof Mn.UNSAFE_componentWillReceiveProps=="function"&&Mn.UNSAFE_componentWillReceiveProps(rs,is),Mn.state!==Fn&&Ei$1.enqueueReplaceState(Mn,Mn.state,null)}function Ii$1(Fn,Mn,rs,is){var os=Fn.stateNode;os.props=rs,os.state=Fn.memoizedState,os.refs={},kh(Fn);var as=Mn.contextType;typeof as=="object"&&as!==null?os.context=eh(as):(as=Zf(Mn)?Xf:H$1.current,os.context=Yf$1(Fn,as)),os.state=Fn.memoizedState,as=Mn.getDerivedStateFromProps,typeof as=="function"&&(Di$2(Fn,Mn,as,rs),os.state=Fn.memoizedState),typeof Mn.getDerivedStateFromProps=="function"||typeof os.getSnapshotBeforeUpdate=="function"||typeof os.UNSAFE_componentWillMount!="function"&&typeof os.componentWillMount!="function"||(Mn=os.state,typeof os.componentWillMount=="function"&&os.componentWillMount(),typeof os.UNSAFE_componentWillMount=="function"&&os.UNSAFE_componentWillMount(),Mn!==os.state&&Ei$1.enqueueReplaceState(os,os.state,null),qh(Fn,rs,os,is),os.state=Fn.memoizedState),typeof os.componentDidMount=="function"&&(Fn.flags|=4194308)}function Ji$1(Fn,Mn){try{var rs="",is=Mn;do rs+=Pa$1(is),is=is.return;while(is);var os=rs}catch(as){os=`
Error generating stack: `+as.message+`
`+as.stack}return{value:Fn,source:Mn,stack:os,digest:null}}function Ki$1(Fn,Mn,rs){return{value:Fn,source:null,stack:rs??null,digest:Mn??null}}function Li$1(Fn,Mn){try{console.error(Mn.value)}catch(rs){setTimeout(function(){throw rs})}}var Mi$2=typeof WeakMap=="function"?WeakMap:Map;function Ni$1(Fn,Mn,rs){rs=mh$1(-1,rs),rs.tag=3,rs.payload={element:null};var is=Mn.value;return rs.callback=function(){Oi$1||(Oi$1=!0,Pi$1=is),Li$1(Fn,Mn)},rs}function Qi$1(Fn,Mn,rs){rs=mh$1(-1,rs),rs.tag=3;var is=Fn.type.getDerivedStateFromError;if(typeof is=="function"){var os=Mn.value;rs.payload=function(){return is(os)},rs.callback=function(){Li$1(Fn,Mn)}}var as=Fn.stateNode;return as!==null&&typeof as.componentDidCatch=="function"&&(rs.callback=function(){Li$1(Fn,Mn),typeof is!="function"&&(Ri$1===null?Ri$1=new Set([this]):Ri$1.add(this));var us=Mn.stack;this.componentDidCatch(Mn.value,{componentStack:us!==null?us:""})}),rs}function Si$1(Fn,Mn,rs){var is=Fn.pingCache;if(is===null){is=Fn.pingCache=new Mi$2;var os=new Set;is.set(Mn,os)}else os=is.get(Mn),os===void 0&&(os=new Set,is.set(Mn,os));os.has(rs)||(os.add(rs),Fn=Ti$1.bind(null,Fn,Mn,rs),Mn.then(Fn,Fn))}function Ui$1(Fn){do{var Mn;if((Mn=Fn.tag===13)&&(Mn=Fn.memoizedState,Mn=Mn!==null?Mn.dehydrated!==null:!0),Mn)return Fn;Fn=Fn.return}while(Fn!==null);return null}function Vi$1(Fn,Mn,rs,is,os){return Fn.mode&1?(Fn.flags|=65536,Fn.lanes=os,Fn):(Fn===Mn?Fn.flags|=65536:(Fn.flags|=128,rs.flags|=131072,rs.flags&=-52805,rs.tag===1&&(rs.alternate===null?rs.tag=17:(Mn=mh$1(-1,1),Mn.tag=2,nh(rs,Mn,1))),rs.lanes|=1),Fn)}var Wi$2=ua$1.ReactCurrentOwner,dh$1=!1;function Xi$1(Fn,Mn,rs,is){Mn.child=Fn===null?Vg$1(Mn,null,rs,is):Ug(Mn,Fn.child,rs,is)}function Yi$1(Fn,Mn,rs,is,os){rs=rs.render;var as=Mn.ref;return ch$1(Mn,os),is=Nh$1(Fn,Mn,rs,is,as,os),rs=Sh$1(),Fn!==null&&!dh$1?(Mn.updateQueue=Fn.updateQueue,Mn.flags&=-2053,Fn.lanes&=~os,Zi$1(Fn,Mn,os)):(I$4&&rs&&vg(Mn),Mn.flags|=1,Xi$1(Fn,Mn,is,os),Mn.child)}function $i$1(Fn,Mn,rs,is,os){if(Fn===null){var as=rs.type;return typeof as=="function"&&!aj(as)&&as.defaultProps===void 0&&rs.compare===null&&rs.defaultProps===void 0?(Mn.tag=15,Mn.type=as,bj(Fn,Mn,as,is,os)):(Fn=Rg(rs.type,null,is,Mn,Mn.mode,os),Fn.ref=Mn.ref,Fn.return=Mn,Mn.child=Fn)}if(as=Fn.child,!(Fn.lanes&os)){var us=as.memoizedProps;if(rs=rs.compare,rs=rs!==null?rs:Ie$1,rs(us,is)&&Fn.ref===Mn.ref)return Zi$1(Fn,Mn,os)}return Mn.flags|=1,Fn=Pg(as,is),Fn.ref=Mn.ref,Fn.return=Mn,Mn.child=Fn}function bj(Fn,Mn,rs,is,os){if(Fn!==null){var as=Fn.memoizedProps;if(Ie$1(as,is)&&Fn.ref===Mn.ref)if(dh$1=!1,Mn.pendingProps=is=as,(Fn.lanes&os)!==0)Fn.flags&131072&&(dh$1=!0);else return Mn.lanes=Fn.lanes,Zi$1(Fn,Mn,os)}return cj(Fn,Mn,rs,is,os)}function dj(Fn,Mn,rs){var is=Mn.pendingProps,os=is.children,as=Fn!==null?Fn.memoizedState:null;if(is.mode==="hidden")if(!(Mn.mode&1))Mn.memoizedState={baseLanes:0,cachePool:null,transitions:null},G$3(ej,fj),fj|=rs;else{if(!(rs&1073741824))return Fn=as!==null?as.baseLanes|rs:rs,Mn.lanes=Mn.childLanes=1073741824,Mn.memoizedState={baseLanes:Fn,cachePool:null,transitions:null},Mn.updateQueue=null,G$3(ej,fj),fj|=Fn,null;Mn.memoizedState={baseLanes:0,cachePool:null,transitions:null},is=as!==null?as.baseLanes:rs,G$3(ej,fj),fj|=is}else as!==null?(is=as.baseLanes|rs,Mn.memoizedState=null):is=rs,G$3(ej,fj),fj|=is;return Xi$1(Fn,Mn,os,rs),Mn.child}function gj(Fn,Mn){var rs=Mn.ref;(Fn===null&&rs!==null||Fn!==null&&Fn.ref!==rs)&&(Mn.flags|=512,Mn.flags|=2097152)}function cj(Fn,Mn,rs,is,os){var as=Zf(rs)?Xf:H$1.current;return as=Yf$1(Mn,as),ch$1(Mn,os),rs=Nh$1(Fn,Mn,rs,is,as,os),is=Sh$1(),Fn!==null&&!dh$1?(Mn.updateQueue=Fn.updateQueue,Mn.flags&=-2053,Fn.lanes&=~os,Zi$1(Fn,Mn,os)):(I$4&&is&&vg(Mn),Mn.flags|=1,Xi$1(Fn,Mn,rs,os),Mn.child)}function hj(Fn,Mn,rs,is,os){if(Zf(rs)){var as=!0;cg(Mn)}else as=!1;if(ch$1(Mn,os),Mn.stateNode===null)ij(Fn,Mn),Gi$1(Mn,rs,is),Ii$1(Mn,rs,is,os),is=!0;else if(Fn===null){var us=Mn.stateNode,ds=Mn.memoizedProps;us.props=ds;var hs=us.context,ps=rs.contextType;typeof ps=="object"&&ps!==null?ps=eh(ps):(ps=Zf(rs)?Xf:H$1.current,ps=Yf$1(Mn,ps));var io=rs.getDerivedStateFromProps,fo=typeof io=="function"||typeof us.getSnapshotBeforeUpdate=="function";fo||typeof us.UNSAFE_componentWillReceiveProps!="function"&&typeof us.componentWillReceiveProps!="function"||(ds!==is||hs!==ps)&&Hi$1(Mn,us,is,ps),jh=!1;var mo=Mn.memoizedState;us.state=mo,qh(Mn,is,us,os),hs=Mn.memoizedState,ds!==is||mo!==hs||Wf$1.current||jh?(typeof io=="function"&&(Di$2(Mn,rs,io,is),hs=Mn.memoizedState),(ds=jh||Fi$2(Mn,rs,ds,is,mo,hs,ps))?(fo||typeof us.UNSAFE_componentWillMount!="function"&&typeof us.componentWillMount!="function"||(typeof us.componentWillMount=="function"&&us.componentWillMount(),typeof us.UNSAFE_componentWillMount=="function"&&us.UNSAFE_componentWillMount()),typeof us.componentDidMount=="function"&&(Mn.flags|=4194308)):(typeof us.componentDidMount=="function"&&(Mn.flags|=4194308),Mn.memoizedProps=is,Mn.memoizedState=hs),us.props=is,us.state=hs,us.context=ps,is=ds):(typeof us.componentDidMount=="function"&&(Mn.flags|=4194308),is=!1)}else{us=Mn.stateNode,lh$1(Fn,Mn),ds=Mn.memoizedProps,ps=Mn.type===Mn.elementType?ds:Ci$1(Mn.type,ds),us.props=ps,fo=Mn.pendingProps,mo=us.context,hs=rs.contextType,typeof hs=="object"&&hs!==null?hs=eh(hs):(hs=Zf(rs)?Xf:H$1.current,hs=Yf$1(Mn,hs));var Ao=rs.getDerivedStateFromProps;(io=typeof Ao=="function"||typeof us.getSnapshotBeforeUpdate=="function")||typeof us.UNSAFE_componentWillReceiveProps!="function"&&typeof us.componentWillReceiveProps!="function"||(ds!==fo||mo!==hs)&&Hi$1(Mn,us,is,hs),jh=!1,mo=Mn.memoizedState,us.state=mo,qh(Mn,is,us,os);var $o=Mn.memoizedState;ds!==fo||mo!==$o||Wf$1.current||jh?(typeof Ao=="function"&&(Di$2(Mn,rs,Ao,is),$o=Mn.memoizedState),(ps=jh||Fi$2(Mn,rs,ps,is,mo,$o,hs)||!1)?(io||typeof us.UNSAFE_componentWillUpdate!="function"&&typeof us.componentWillUpdate!="function"||(typeof us.componentWillUpdate=="function"&&us.componentWillUpdate(is,$o,hs),typeof us.UNSAFE_componentWillUpdate=="function"&&us.UNSAFE_componentWillUpdate(is,$o,hs)),typeof us.componentDidUpdate=="function"&&(Mn.flags|=4),typeof us.getSnapshotBeforeUpdate=="function"&&(Mn.flags|=1024)):(typeof us.componentDidUpdate!="function"||ds===Fn.memoizedProps&&mo===Fn.memoizedState||(Mn.flags|=4),typeof us.getSnapshotBeforeUpdate!="function"||ds===Fn.memoizedProps&&mo===Fn.memoizedState||(Mn.flags|=1024),Mn.memoizedProps=is,Mn.memoizedState=$o),us.props=is,us.state=$o,us.context=hs,is=ps):(typeof us.componentDidUpdate!="function"||ds===Fn.memoizedProps&&mo===Fn.memoizedState||(Mn.flags|=4),typeof us.getSnapshotBeforeUpdate!="function"||ds===Fn.memoizedProps&&mo===Fn.memoizedState||(Mn.flags|=1024),is=!1)}return jj(Fn,Mn,rs,is,as,os)}function jj(Fn,Mn,rs,is,os,as){gj(Fn,Mn);var us=(Mn.flags&128)!==0;if(!is&&!us)return os&&dg(Mn,rs,!1),Zi$1(Fn,Mn,as);is=Mn.stateNode,Wi$2.current=Mn;var ds=us&&typeof rs.getDerivedStateFromError!="function"?null:is.render();return Mn.flags|=1,Fn!==null&&us?(Mn.child=Ug(Mn,Fn.child,null,as),Mn.child=Ug(Mn,null,ds,as)):Xi$1(Fn,Mn,ds,as),Mn.memoizedState=is.state,os&&dg(Mn,rs,!0),Mn.child}function kj(Fn){var Mn=Fn.stateNode;Mn.pendingContext?ag(Fn,Mn.pendingContext,Mn.pendingContext!==Mn.context):Mn.context&&ag(Fn,Mn.context,!1),yh$1(Fn,Mn.containerInfo)}function lj(Fn,Mn,rs,is,os){return Ig(),Jg$1(os),Mn.flags|=256,Xi$1(Fn,Mn,rs,is),Mn.child}var mj={dehydrated:null,treeContext:null,retryLane:0};function nj(Fn){return{baseLanes:Fn,cachePool:null,transitions:null}}function oj(Fn,Mn,rs){var is=Mn.pendingProps,os=L$3.current,as=!1,us=(Mn.flags&128)!==0,ds;if((ds=us)||(ds=Fn!==null&&Fn.memoizedState===null?!1:(os&2)!==0),ds?(as=!0,Mn.flags&=-129):(Fn===null||Fn.memoizedState!==null)&&(os|=1),G$3(L$3,os&1),Fn===null)return Eg(Mn),Fn=Mn.memoizedState,Fn!==null&&(Fn=Fn.dehydrated,Fn!==null)?(Mn.mode&1?Fn.data==="$!"?Mn.lanes=8:Mn.lanes=1073741824:Mn.lanes=1,null):(us=is.children,Fn=is.fallback,as?(is=Mn.mode,as=Mn.child,us={mode:"hidden",children:us},!(is&1)&&as!==null?(as.childLanes=0,as.pendingProps=us):as=pj(us,is,0,null),Fn=Tg(Fn,is,rs,null),as.return=Mn,Fn.return=Mn,as.sibling=Fn,Mn.child=as,Mn.child.memoizedState=nj(rs),Mn.memoizedState=mj,Fn):qj(Mn,us));if(os=Fn.memoizedState,os!==null&&(ds=os.dehydrated,ds!==null))return rj(Fn,Mn,us,is,ds,os,rs);if(as){as=is.fallback,us=Mn.mode,os=Fn.child,ds=os.sibling;var hs={mode:"hidden",children:is.children};return!(us&1)&&Mn.child!==os?(is=Mn.child,is.childLanes=0,is.pendingProps=hs,Mn.deletions=null):(is=Pg(os,hs),is.subtreeFlags=os.subtreeFlags&14680064),ds!==null?as=Pg(ds,as):(as=Tg(as,us,rs,null),as.flags|=2),as.return=Mn,is.return=Mn,is.sibling=as,Mn.child=is,is=as,as=Mn.child,us=Fn.child.memoizedState,us=us===null?nj(rs):{baseLanes:us.baseLanes|rs,cachePool:null,transitions:us.transitions},as.memoizedState=us,as.childLanes=Fn.childLanes&~rs,Mn.memoizedState=mj,is}return as=Fn.child,Fn=as.sibling,is=Pg(as,{mode:"visible",children:is.children}),!(Mn.mode&1)&&(is.lanes=rs),is.return=Mn,is.sibling=null,Fn!==null&&(rs=Mn.deletions,rs===null?(Mn.deletions=[Fn],Mn.flags|=16):rs.push(Fn)),Mn.child=is,Mn.memoizedState=null,is}function qj(Fn,Mn){return Mn=pj({mode:"visible",children:Mn},Fn.mode,0,null),Mn.return=Fn,Fn.child=Mn}function sj(Fn,Mn,rs,is){return is!==null&&Jg$1(is),Ug(Mn,Fn.child,null,rs),Fn=qj(Mn,Mn.pendingProps.children),Fn.flags|=2,Mn.memoizedState=null,Fn}function rj(Fn,Mn,rs,is,os,as,us){if(rs)return Mn.flags&256?(Mn.flags&=-257,is=Ki$1(Error(p$9(422))),sj(Fn,Mn,us,is)):Mn.memoizedState!==null?(Mn.child=Fn.child,Mn.flags|=128,null):(as=is.fallback,os=Mn.mode,is=pj({mode:"visible",children:is.children},os,0,null),as=Tg(as,os,us,null),as.flags|=2,is.return=Mn,as.return=Mn,is.sibling=as,Mn.child=is,Mn.mode&1&&Ug(Mn,Fn.child,null,us),Mn.child.memoizedState=nj(us),Mn.memoizedState=mj,as);if(!(Mn.mode&1))return sj(Fn,Mn,us,null);if(os.data==="$!"){if(is=os.nextSibling&&os.nextSibling.dataset,is)var ds=is.dgst;return is=ds,as=Error(p$9(419)),is=Ki$1(as,is,void 0),sj(Fn,Mn,us,is)}if(ds=(us&Fn.childLanes)!==0,dh$1||ds){if(is=Q$4,is!==null){switch(us&-us){case 4:os=2;break;case 16:os=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:os=32;break;case 536870912:os=268435456;break;default:os=0}os=os&(is.suspendedLanes|us)?0:os,os!==0&&os!==as.retryLane&&(as.retryLane=os,ih(Fn,os),gi$1(is,Fn,os,-1))}return tj(),is=Ki$1(Error(p$9(421))),sj(Fn,Mn,us,is)}return os.data==="$?"?(Mn.flags|=128,Mn.child=Fn.child,Mn=uj.bind(null,Fn),os._reactRetry=Mn,null):(Fn=as.treeContext,yg=Lf$1(os.nextSibling),xg=Mn,I$4=!0,zg=null,Fn!==null&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=Fn.id,sg=Fn.overflow,qg=Mn),Mn=qj(Mn,is.children),Mn.flags|=4096,Mn)}function vj(Fn,Mn,rs){Fn.lanes|=Mn;var is=Fn.alternate;is!==null&&(is.lanes|=Mn),bh$1(Fn.return,Mn,rs)}function wj(Fn,Mn,rs,is,os){var as=Fn.memoizedState;as===null?Fn.memoizedState={isBackwards:Mn,rendering:null,renderingStartTime:0,last:is,tail:rs,tailMode:os}:(as.isBackwards=Mn,as.rendering=null,as.renderingStartTime=0,as.last=is,as.tail=rs,as.tailMode=os)}function xj(Fn,Mn,rs){var is=Mn.pendingProps,os=is.revealOrder,as=is.tail;if(Xi$1(Fn,Mn,is.children,rs),is=L$3.current,is&2)is=is&1|2,Mn.flags|=128;else{if(Fn!==null&&Fn.flags&128)e:for(Fn=Mn.child;Fn!==null;){if(Fn.tag===13)Fn.memoizedState!==null&&vj(Fn,rs,Mn);else if(Fn.tag===19)vj(Fn,rs,Mn);else if(Fn.child!==null){Fn.child.return=Fn,Fn=Fn.child;continue}if(Fn===Mn)break e;for(;Fn.sibling===null;){if(Fn.return===null||Fn.return===Mn)break e;Fn=Fn.return}Fn.sibling.return=Fn.return,Fn=Fn.sibling}is&=1}if(G$3(L$3,is),!(Mn.mode&1))Mn.memoizedState=null;else switch(os){case"forwards":for(rs=Mn.child,os=null;rs!==null;)Fn=rs.alternate,Fn!==null&&Ch$1(Fn)===null&&(os=rs),rs=rs.sibling;rs=os,rs===null?(os=Mn.child,Mn.child=null):(os=rs.sibling,rs.sibling=null),wj(Mn,!1,os,rs,as);break;case"backwards":for(rs=null,os=Mn.child,Mn.child=null;os!==null;){if(Fn=os.alternate,Fn!==null&&Ch$1(Fn)===null){Mn.child=os;break}Fn=os.sibling,os.sibling=rs,rs=os,os=Fn}wj(Mn,!0,rs,null,as);break;case"together":wj(Mn,!1,null,null,void 0);break;default:Mn.memoizedState=null}return Mn.child}function ij(Fn,Mn){!(Mn.mode&1)&&Fn!==null&&(Fn.alternate=null,Mn.alternate=null,Mn.flags|=2)}function Zi$1(Fn,Mn,rs){if(Fn!==null&&(Mn.dependencies=Fn.dependencies),rh$1|=Mn.lanes,!(rs&Mn.childLanes))return null;if(Fn!==null&&Mn.child!==Fn.child)throw Error(p$9(153));if(Mn.child!==null){for(Fn=Mn.child,rs=Pg(Fn,Fn.pendingProps),Mn.child=rs,rs.return=Mn;Fn.sibling!==null;)Fn=Fn.sibling,rs=rs.sibling=Pg(Fn,Fn.pendingProps),rs.return=Mn;rs.sibling=null}return Mn.child}function yj(Fn,Mn,rs){switch(Mn.tag){case 3:kj(Mn),Ig();break;case 5:Ah$1(Mn);break;case 1:Zf(Mn.type)&&cg(Mn);break;case 4:yh$1(Mn,Mn.stateNode.containerInfo);break;case 10:var is=Mn.type._context,os=Mn.memoizedProps.value;G$3(Wg,is._currentValue),is._currentValue=os;break;case 13:if(is=Mn.memoizedState,is!==null)return is.dehydrated!==null?(G$3(L$3,L$3.current&1),Mn.flags|=128,null):rs&Mn.child.childLanes?oj(Fn,Mn,rs):(G$3(L$3,L$3.current&1),Fn=Zi$1(Fn,Mn,rs),Fn!==null?Fn.sibling:null);G$3(L$3,L$3.current&1);break;case 19:if(is=(rs&Mn.childLanes)!==0,Fn.flags&128){if(is)return xj(Fn,Mn,rs);Mn.flags|=128}if(os=Mn.memoizedState,os!==null&&(os.rendering=null,os.tail=null,os.lastEffect=null),G$3(L$3,L$3.current),is)break;return null;case 22:case 23:return Mn.lanes=0,dj(Fn,Mn,rs)}return Zi$1(Fn,Mn,rs)}var zj,Aj,Bj,Cj;zj=function(Fn,Mn){for(var rs=Mn.child;rs!==null;){if(rs.tag===5||rs.tag===6)Fn.appendChild(rs.stateNode);else if(rs.tag!==4&&rs.child!==null){rs.child.return=rs,rs=rs.child;continue}if(rs===Mn)break;for(;rs.sibling===null;){if(rs.return===null||rs.return===Mn)return;rs=rs.return}rs.sibling.return=rs.return,rs=rs.sibling}};Aj=function(){};Bj=function(Fn,Mn,rs,is){var os=Fn.memoizedProps;if(os!==is){Fn=Mn.stateNode,xh$1(uh$1.current);var as=null;switch(rs){case"input":os=Ya$1(Fn,os),is=Ya$1(Fn,is),as=[];break;case"select":os=A$4({},os,{value:void 0}),is=A$4({},is,{value:void 0}),as=[];break;case"textarea":os=gb(Fn,os),is=gb(Fn,is),as=[];break;default:typeof os.onClick!="function"&&typeof is.onClick=="function"&&(Fn.onclick=Bf$1)}ub(rs,is);var us;rs=null;for(ps in os)if(!is.hasOwnProperty(ps)&&os.hasOwnProperty(ps)&&os[ps]!=null)if(ps==="style"){var ds=os[ps];for(us in ds)ds.hasOwnProperty(us)&&(rs||(rs={}),rs[us]="")}else ps!=="dangerouslySetInnerHTML"&&ps!=="children"&&ps!=="suppressContentEditableWarning"&&ps!=="suppressHydrationWarning"&&ps!=="autoFocus"&&(ea$1.hasOwnProperty(ps)?as||(as=[]):(as=as||[]).push(ps,null));for(ps in is){var hs=is[ps];if(ds=os!=null?os[ps]:void 0,is.hasOwnProperty(ps)&&hs!==ds&&(hs!=null||ds!=null))if(ps==="style")if(ds){for(us in ds)!ds.hasOwnProperty(us)||hs&&hs.hasOwnProperty(us)||(rs||(rs={}),rs[us]="");for(us in hs)hs.hasOwnProperty(us)&&ds[us]!==hs[us]&&(rs||(rs={}),rs[us]=hs[us])}else rs||(as||(as=[]),as.push(ps,rs)),rs=hs;else ps==="dangerouslySetInnerHTML"?(hs=hs?hs.__html:void 0,ds=ds?ds.__html:void 0,hs!=null&&ds!==hs&&(as=as||[]).push(ps,hs)):ps==="children"?typeof hs!="string"&&typeof hs!="number"||(as=as||[]).push(ps,""+hs):ps!=="suppressContentEditableWarning"&&ps!=="suppressHydrationWarning"&&(ea$1.hasOwnProperty(ps)?(hs!=null&&ps==="onScroll"&&D$4("scroll",Fn),as||ds===hs||(as=[])):(as=as||[]).push(ps,hs))}rs&&(as=as||[]).push("style",rs);var ps=as;(Mn.updateQueue=ps)&&(Mn.flags|=4)}};Cj=function(Fn,Mn,rs,is){rs!==is&&(Mn.flags|=4)};function Dj(Fn,Mn){if(!I$4)switch(Fn.tailMode){case"hidden":Mn=Fn.tail;for(var rs=null;Mn!==null;)Mn.alternate!==null&&(rs=Mn),Mn=Mn.sibling;rs===null?Fn.tail=null:rs.sibling=null;break;case"collapsed":rs=Fn.tail;for(var is=null;rs!==null;)rs.alternate!==null&&(is=rs),rs=rs.sibling;is===null?Mn||Fn.tail===null?Fn.tail=null:Fn.tail.sibling=null:is.sibling=null}}function S$6(Fn){var Mn=Fn.alternate!==null&&Fn.alternate.child===Fn.child,rs=0,is=0;if(Mn)for(var os=Fn.child;os!==null;)rs|=os.lanes|os.childLanes,is|=os.subtreeFlags&14680064,is|=os.flags&14680064,os.return=Fn,os=os.sibling;else for(os=Fn.child;os!==null;)rs|=os.lanes|os.childLanes,is|=os.subtreeFlags,is|=os.flags,os.return=Fn,os=os.sibling;return Fn.subtreeFlags|=is,Fn.childLanes=rs,Mn}function Ej(Fn,Mn,rs){var is=Mn.pendingProps;switch(wg(Mn),Mn.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S$6(Mn),null;case 1:return Zf(Mn.type)&&$f(),S$6(Mn),null;case 3:return is=Mn.stateNode,zh(),E$5(Wf$1),E$5(H$1),Eh$1(),is.pendingContext&&(is.context=is.pendingContext,is.pendingContext=null),(Fn===null||Fn.child===null)&&(Gg(Mn)?Mn.flags|=4:Fn===null||Fn.memoizedState.isDehydrated&&!(Mn.flags&256)||(Mn.flags|=1024,zg!==null&&(Fj(zg),zg=null))),Aj(Fn,Mn),S$6(Mn),null;case 5:Bh$1(Mn);var os=xh$1(wh$1.current);if(rs=Mn.type,Fn!==null&&Mn.stateNode!=null)Bj(Fn,Mn,rs,is,os),Fn.ref!==Mn.ref&&(Mn.flags|=512,Mn.flags|=2097152);else{if(!is){if(Mn.stateNode===null)throw Error(p$9(166));return S$6(Mn),null}if(Fn=xh$1(uh$1.current),Gg(Mn)){is=Mn.stateNode,rs=Mn.type;var as=Mn.memoizedProps;switch(is[Of$1]=Mn,is[Pf$1]=as,Fn=(Mn.mode&1)!==0,rs){case"dialog":D$4("cancel",is),D$4("close",is);break;case"iframe":case"object":case"embed":D$4("load",is);break;case"video":case"audio":for(os=0;os<lf$1.length;os++)D$4(lf$1[os],is);break;case"source":D$4("error",is);break;case"img":case"image":case"link":D$4("error",is),D$4("load",is);break;case"details":D$4("toggle",is);break;case"input":Za$1(is,as),D$4("invalid",is);break;case"select":is._wrapperState={wasMultiple:!!as.multiple},D$4("invalid",is);break;case"textarea":hb(is,as),D$4("invalid",is)}ub(rs,as),os=null;for(var us in as)if(as.hasOwnProperty(us)){var ds=as[us];us==="children"?typeof ds=="string"?is.textContent!==ds&&(as.suppressHydrationWarning!==!0&&Af$1(is.textContent,ds,Fn),os=["children",ds]):typeof ds=="number"&&is.textContent!==""+ds&&(as.suppressHydrationWarning!==!0&&Af$1(is.textContent,ds,Fn),os=["children",""+ds]):ea$1.hasOwnProperty(us)&&ds!=null&&us==="onScroll"&&D$4("scroll",is)}switch(rs){case"input":Va$1(is),db(is,as,!0);break;case"textarea":Va$1(is),jb(is);break;case"select":case"option":break;default:typeof as.onClick=="function"&&(is.onclick=Bf$1)}is=os,Mn.updateQueue=is,is!==null&&(Mn.flags|=4)}else{us=os.nodeType===9?os:os.ownerDocument,Fn==="http://www.w3.org/1999/xhtml"&&(Fn=kb(rs)),Fn==="http://www.w3.org/1999/xhtml"?rs==="script"?(Fn=us.createElement("div"),Fn.innerHTML="<script><\/script>",Fn=Fn.removeChild(Fn.firstChild)):typeof is.is=="string"?Fn=us.createElement(rs,{is:is.is}):(Fn=us.createElement(rs),rs==="select"&&(us=Fn,is.multiple?us.multiple=!0:is.size&&(us.size=is.size))):Fn=us.createElementNS(Fn,rs),Fn[Of$1]=Mn,Fn[Pf$1]=is,zj(Fn,Mn,!1,!1),Mn.stateNode=Fn;e:{switch(us=vb(rs,is),rs){case"dialog":D$4("cancel",Fn),D$4("close",Fn),os=is;break;case"iframe":case"object":case"embed":D$4("load",Fn),os=is;break;case"video":case"audio":for(os=0;os<lf$1.length;os++)D$4(lf$1[os],Fn);os=is;break;case"source":D$4("error",Fn),os=is;break;case"img":case"image":case"link":D$4("error",Fn),D$4("load",Fn),os=is;break;case"details":D$4("toggle",Fn),os=is;break;case"input":Za$1(Fn,is),os=Ya$1(Fn,is),D$4("invalid",Fn);break;case"option":os=is;break;case"select":Fn._wrapperState={wasMultiple:!!is.multiple},os=A$4({},is,{value:void 0}),D$4("invalid",Fn);break;case"textarea":hb(Fn,is),os=gb(Fn,is),D$4("invalid",Fn);break;default:os=is}ub(rs,os),ds=os;for(as in ds)if(ds.hasOwnProperty(as)){var hs=ds[as];as==="style"?sb(Fn,hs):as==="dangerouslySetInnerHTML"?(hs=hs?hs.__html:void 0,hs!=null&&nb(Fn,hs)):as==="children"?typeof hs=="string"?(rs!=="textarea"||hs!=="")&&ob(Fn,hs):typeof hs=="number"&&ob(Fn,""+hs):as!=="suppressContentEditableWarning"&&as!=="suppressHydrationWarning"&&as!=="autoFocus"&&(ea$1.hasOwnProperty(as)?hs!=null&&as==="onScroll"&&D$4("scroll",Fn):hs!=null&&ta$1(Fn,as,hs,us))}switch(rs){case"input":Va$1(Fn),db(Fn,is,!1);break;case"textarea":Va$1(Fn),jb(Fn);break;case"option":is.value!=null&&Fn.setAttribute("value",""+Sa$2(is.value));break;case"select":Fn.multiple=!!is.multiple,as=is.value,as!=null?fb(Fn,!!is.multiple,as,!1):is.defaultValue!=null&&fb(Fn,!!is.multiple,is.defaultValue,!0);break;default:typeof os.onClick=="function"&&(Fn.onclick=Bf$1)}switch(rs){case"button":case"input":case"select":case"textarea":is=!!is.autoFocus;break e;case"img":is=!0;break e;default:is=!1}}is&&(Mn.flags|=4)}Mn.ref!==null&&(Mn.flags|=512,Mn.flags|=2097152)}return S$6(Mn),null;case 6:if(Fn&&Mn.stateNode!=null)Cj(Fn,Mn,Fn.memoizedProps,is);else{if(typeof is!="string"&&Mn.stateNode===null)throw Error(p$9(166));if(rs=xh$1(wh$1.current),xh$1(uh$1.current),Gg(Mn)){if(is=Mn.stateNode,rs=Mn.memoizedProps,is[Of$1]=Mn,(as=is.nodeValue!==rs)&&(Fn=xg,Fn!==null))switch(Fn.tag){case 3:Af$1(is.nodeValue,rs,(Fn.mode&1)!==0);break;case 5:Fn.memoizedProps.suppressHydrationWarning!==!0&&Af$1(is.nodeValue,rs,(Fn.mode&1)!==0)}as&&(Mn.flags|=4)}else is=(rs.nodeType===9?rs:rs.ownerDocument).createTextNode(is),is[Of$1]=Mn,Mn.stateNode=is}return S$6(Mn),null;case 13:if(E$5(L$3),is=Mn.memoizedState,Fn===null||Fn.memoizedState!==null&&Fn.memoizedState.dehydrated!==null){if(I$4&&yg!==null&&Mn.mode&1&&!(Mn.flags&128))Hg(),Ig(),Mn.flags|=98560,as=!1;else if(as=Gg(Mn),is!==null&&is.dehydrated!==null){if(Fn===null){if(!as)throw Error(p$9(318));if(as=Mn.memoizedState,as=as!==null?as.dehydrated:null,!as)throw Error(p$9(317));as[Of$1]=Mn}else Ig(),!(Mn.flags&128)&&(Mn.memoizedState=null),Mn.flags|=4;S$6(Mn),as=!1}else zg!==null&&(Fj(zg),zg=null),as=!0;if(!as)return Mn.flags&65536?Mn:null}return Mn.flags&128?(Mn.lanes=rs,Mn):(is=is!==null,is!==(Fn!==null&&Fn.memoizedState!==null)&&is&&(Mn.child.flags|=8192,Mn.mode&1&&(Fn===null||L$3.current&1?T$4===0&&(T$4=3):tj())),Mn.updateQueue!==null&&(Mn.flags|=4),S$6(Mn),null);case 4:return zh(),Aj(Fn,Mn),Fn===null&&sf(Mn.stateNode.containerInfo),S$6(Mn),null;case 10:return ah(Mn.type._context),S$6(Mn),null;case 17:return Zf(Mn.type)&&$f(),S$6(Mn),null;case 19:if(E$5(L$3),as=Mn.memoizedState,as===null)return S$6(Mn),null;if(is=(Mn.flags&128)!==0,us=as.rendering,us===null)if(is)Dj(as,!1);else{if(T$4!==0||Fn!==null&&Fn.flags&128)for(Fn=Mn.child;Fn!==null;){if(us=Ch$1(Fn),us!==null){for(Mn.flags|=128,Dj(as,!1),is=us.updateQueue,is!==null&&(Mn.updateQueue=is,Mn.flags|=4),Mn.subtreeFlags=0,is=rs,rs=Mn.child;rs!==null;)as=rs,Fn=is,as.flags&=14680066,us=as.alternate,us===null?(as.childLanes=0,as.lanes=Fn,as.child=null,as.subtreeFlags=0,as.memoizedProps=null,as.memoizedState=null,as.updateQueue=null,as.dependencies=null,as.stateNode=null):(as.childLanes=us.childLanes,as.lanes=us.lanes,as.child=us.child,as.subtreeFlags=0,as.deletions=null,as.memoizedProps=us.memoizedProps,as.memoizedState=us.memoizedState,as.updateQueue=us.updateQueue,as.type=us.type,Fn=us.dependencies,as.dependencies=Fn===null?null:{lanes:Fn.lanes,firstContext:Fn.firstContext}),rs=rs.sibling;return G$3(L$3,L$3.current&1|2),Mn.child}Fn=Fn.sibling}as.tail!==null&&B$3()>Gj&&(Mn.flags|=128,is=!0,Dj(as,!1),Mn.lanes=4194304)}else{if(!is)if(Fn=Ch$1(us),Fn!==null){if(Mn.flags|=128,is=!0,rs=Fn.updateQueue,rs!==null&&(Mn.updateQueue=rs,Mn.flags|=4),Dj(as,!0),as.tail===null&&as.tailMode==="hidden"&&!us.alternate&&!I$4)return S$6(Mn),null}else 2*B$3()-as.renderingStartTime>Gj&&rs!==1073741824&&(Mn.flags|=128,is=!0,Dj(as,!1),Mn.lanes=4194304);as.isBackwards?(us.sibling=Mn.child,Mn.child=us):(rs=as.last,rs!==null?rs.sibling=us:Mn.child=us,as.last=us)}return as.tail!==null?(Mn=as.tail,as.rendering=Mn,as.tail=Mn.sibling,as.renderingStartTime=B$3(),Mn.sibling=null,rs=L$3.current,G$3(L$3,is?rs&1|2:rs&1),Mn):(S$6(Mn),null);case 22:case 23:return Hj(),is=Mn.memoizedState!==null,Fn!==null&&Fn.memoizedState!==null!==is&&(Mn.flags|=8192),is&&Mn.mode&1?fj&1073741824&&(S$6(Mn),Mn.subtreeFlags&6&&(Mn.flags|=8192)):S$6(Mn),null;case 24:return null;case 25:return null}throw Error(p$9(156,Mn.tag))}function Ij(Fn,Mn){switch(wg(Mn),Mn.tag){case 1:return Zf(Mn.type)&&$f(),Fn=Mn.flags,Fn&65536?(Mn.flags=Fn&-65537|128,Mn):null;case 3:return zh(),E$5(Wf$1),E$5(H$1),Eh$1(),Fn=Mn.flags,Fn&65536&&!(Fn&128)?(Mn.flags=Fn&-65537|128,Mn):null;case 5:return Bh$1(Mn),null;case 13:if(E$5(L$3),Fn=Mn.memoizedState,Fn!==null&&Fn.dehydrated!==null){if(Mn.alternate===null)throw Error(p$9(340));Ig()}return Fn=Mn.flags,Fn&65536?(Mn.flags=Fn&-65537|128,Mn):null;case 19:return E$5(L$3),null;case 4:return zh(),null;case 10:return ah(Mn.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U$3=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V$2=null;function Lj(Fn,Mn){var rs=Fn.ref;if(rs!==null)if(typeof rs=="function")try{rs(null)}catch(is){W$1(Fn,Mn,is)}else rs.current=null}function Mj(Fn,Mn,rs){try{rs()}catch(is){W$1(Fn,Mn,is)}}var Nj=!1;function Oj(Fn,Mn){if(Cf$1=dd,Fn=Me(),Ne(Fn)){if("selectionStart"in Fn)var rs={start:Fn.selectionStart,end:Fn.selectionEnd};else e:{rs=(rs=Fn.ownerDocument)&&rs.defaultView||window;var is=rs.getSelection&&rs.getSelection();if(is&&is.rangeCount!==0){rs=is.anchorNode;var os=is.anchorOffset,as=is.focusNode;is=is.focusOffset;try{rs.nodeType,as.nodeType}catch{rs=null;break e}var us=0,ds=-1,hs=-1,ps=0,io=0,fo=Fn,mo=null;t:for(;;){for(var Ao;fo!==rs||os!==0&&fo.nodeType!==3||(ds=us+os),fo!==as||is!==0&&fo.nodeType!==3||(hs=us+is),fo.nodeType===3&&(us+=fo.nodeValue.length),(Ao=fo.firstChild)!==null;)mo=fo,fo=Ao;for(;;){if(fo===Fn)break t;if(mo===rs&&++ps===os&&(ds=us),mo===as&&++io===is&&(hs=us),(Ao=fo.nextSibling)!==null)break;fo=mo,mo=fo.parentNode}fo=Ao}rs=ds===-1||hs===-1?null:{start:ds,end:hs}}else rs=null}rs=rs||{start:0,end:0}}else rs=null;for(Df$1={focusedElem:Fn,selectionRange:rs},dd=!1,V$2=Mn;V$2!==null;)if(Mn=V$2,Fn=Mn.child,(Mn.subtreeFlags&1028)!==0&&Fn!==null)Fn.return=Mn,V$2=Fn;else for(;V$2!==null;){Mn=V$2;try{var $o=Mn.alternate;if(Mn.flags&1024)switch(Mn.tag){case 0:case 11:case 15:break;case 1:if($o!==null){var Lo=$o.memoizedProps,Go=$o.memoizedState,Yo=Mn.stateNode,Wo=Yo.getSnapshotBeforeUpdate(Mn.elementType===Mn.type?Lo:Ci$1(Mn.type,Lo),Go);Yo.__reactInternalSnapshotBeforeUpdate=Wo}break;case 3:var Jo=Mn.stateNode.containerInfo;Jo.nodeType===1?Jo.textContent="":Jo.nodeType===9&&Jo.documentElement&&Jo.removeChild(Jo.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$9(163))}}catch(xl){W$1(Mn,Mn.return,xl)}if(Fn=Mn.sibling,Fn!==null){Fn.return=Mn.return,V$2=Fn;break}V$2=Mn.return}return $o=Nj,Nj=!1,$o}function Pj(Fn,Mn,rs){var is=Mn.updateQueue;if(is=is!==null?is.lastEffect:null,is!==null){var os=is=is.next;do{if((os.tag&Fn)===Fn){var as=os.destroy;os.destroy=void 0,as!==void 0&&Mj(Mn,rs,as)}os=os.next}while(os!==is)}}function Qj(Fn,Mn){if(Mn=Mn.updateQueue,Mn=Mn!==null?Mn.lastEffect:null,Mn!==null){var rs=Mn=Mn.next;do{if((rs.tag&Fn)===Fn){var is=rs.create;rs.destroy=is()}rs=rs.next}while(rs!==Mn)}}function Rj(Fn){var Mn=Fn.ref;if(Mn!==null){var rs=Fn.stateNode;switch(Fn.tag){case 5:Fn=rs;break;default:Fn=rs}typeof Mn=="function"?Mn(Fn):Mn.current=Fn}}function Sj(Fn){var Mn=Fn.alternate;Mn!==null&&(Fn.alternate=null,Sj(Mn)),Fn.child=null,Fn.deletions=null,Fn.sibling=null,Fn.tag===5&&(Mn=Fn.stateNode,Mn!==null&&(delete Mn[Of$1],delete Mn[Pf$1],delete Mn[of$1],delete Mn[Qf$1],delete Mn[Rf$1])),Fn.stateNode=null,Fn.return=null,Fn.dependencies=null,Fn.memoizedProps=null,Fn.memoizedState=null,Fn.pendingProps=null,Fn.stateNode=null,Fn.updateQueue=null}function Tj(Fn){return Fn.tag===5||Fn.tag===3||Fn.tag===4}function Uj(Fn){e:for(;;){for(;Fn.sibling===null;){if(Fn.return===null||Tj(Fn.return))return null;Fn=Fn.return}for(Fn.sibling.return=Fn.return,Fn=Fn.sibling;Fn.tag!==5&&Fn.tag!==6&&Fn.tag!==18;){if(Fn.flags&2||Fn.child===null||Fn.tag===4)continue e;Fn.child.return=Fn,Fn=Fn.child}if(!(Fn.flags&2))return Fn.stateNode}}function Vj(Fn,Mn,rs){var is=Fn.tag;if(is===5||is===6)Fn=Fn.stateNode,Mn?rs.nodeType===8?rs.parentNode.insertBefore(Fn,Mn):rs.insertBefore(Fn,Mn):(rs.nodeType===8?(Mn=rs.parentNode,Mn.insertBefore(Fn,rs)):(Mn=rs,Mn.appendChild(Fn)),rs=rs._reactRootContainer,rs!=null||Mn.onclick!==null||(Mn.onclick=Bf$1));else if(is!==4&&(Fn=Fn.child,Fn!==null))for(Vj(Fn,Mn,rs),Fn=Fn.sibling;Fn!==null;)Vj(Fn,Mn,rs),Fn=Fn.sibling}function Wj(Fn,Mn,rs){var is=Fn.tag;if(is===5||is===6)Fn=Fn.stateNode,Mn?rs.insertBefore(Fn,Mn):rs.appendChild(Fn);else if(is!==4&&(Fn=Fn.child,Fn!==null))for(Wj(Fn,Mn,rs),Fn=Fn.sibling;Fn!==null;)Wj(Fn,Mn,rs),Fn=Fn.sibling}var X$1=null,Xj=!1;function Yj(Fn,Mn,rs){for(rs=rs.child;rs!==null;)Zj(Fn,Mn,rs),rs=rs.sibling}function Zj(Fn,Mn,rs){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,rs)}catch{}switch(rs.tag){case 5:U$3||Lj(rs,Mn);case 6:var is=X$1,os=Xj;X$1=null,Yj(Fn,Mn,rs),X$1=is,Xj=os,X$1!==null&&(Xj?(Fn=X$1,rs=rs.stateNode,Fn.nodeType===8?Fn.parentNode.removeChild(rs):Fn.removeChild(rs)):X$1.removeChild(rs.stateNode));break;case 18:X$1!==null&&(Xj?(Fn=X$1,rs=rs.stateNode,Fn.nodeType===8?Kf$1(Fn.parentNode,rs):Fn.nodeType===1&&Kf$1(Fn,rs),bd(Fn)):Kf$1(X$1,rs.stateNode));break;case 4:is=X$1,os=Xj,X$1=rs.stateNode.containerInfo,Xj=!0,Yj(Fn,Mn,rs),X$1=is,Xj=os;break;case 0:case 11:case 14:case 15:if(!U$3&&(is=rs.updateQueue,is!==null&&(is=is.lastEffect,is!==null))){os=is=is.next;do{var as=os,us=as.destroy;as=as.tag,us!==void 0&&(as&2||as&4)&&Mj(rs,Mn,us),os=os.next}while(os!==is)}Yj(Fn,Mn,rs);break;case 1:if(!U$3&&(Lj(rs,Mn),is=rs.stateNode,typeof is.componentWillUnmount=="function"))try{is.props=rs.memoizedProps,is.state=rs.memoizedState,is.componentWillUnmount()}catch(ds){W$1(rs,Mn,ds)}Yj(Fn,Mn,rs);break;case 21:Yj(Fn,Mn,rs);break;case 22:rs.mode&1?(U$3=(is=U$3)||rs.memoizedState!==null,Yj(Fn,Mn,rs),U$3=is):Yj(Fn,Mn,rs);break;default:Yj(Fn,Mn,rs)}}function ak(Fn){var Mn=Fn.updateQueue;if(Mn!==null){Fn.updateQueue=null;var rs=Fn.stateNode;rs===null&&(rs=Fn.stateNode=new Kj),Mn.forEach(function(is){var os=bk.bind(null,Fn,is);rs.has(is)||(rs.add(is),is.then(os,os))})}}function ck(Fn,Mn){var rs=Mn.deletions;if(rs!==null)for(var is=0;is<rs.length;is++){var os=rs[is];try{var as=Fn,us=Mn,ds=us;e:for(;ds!==null;){switch(ds.tag){case 5:X$1=ds.stateNode,Xj=!1;break e;case 3:X$1=ds.stateNode.containerInfo,Xj=!0;break e;case 4:X$1=ds.stateNode.containerInfo,Xj=!0;break e}ds=ds.return}if(X$1===null)throw Error(p$9(160));Zj(as,us,os),X$1=null,Xj=!1;var hs=os.alternate;hs!==null&&(hs.return=null),os.return=null}catch(ps){W$1(os,Mn,ps)}}if(Mn.subtreeFlags&12854)for(Mn=Mn.child;Mn!==null;)dk(Mn,Fn),Mn=Mn.sibling}function dk(Fn,Mn){var rs=Fn.alternate,is=Fn.flags;switch(Fn.tag){case 0:case 11:case 14:case 15:if(ck(Mn,Fn),ek(Fn),is&4){try{Pj(3,Fn,Fn.return),Qj(3,Fn)}catch(Lo){W$1(Fn,Fn.return,Lo)}try{Pj(5,Fn,Fn.return)}catch(Lo){W$1(Fn,Fn.return,Lo)}}break;case 1:ck(Mn,Fn),ek(Fn),is&512&&rs!==null&&Lj(rs,rs.return);break;case 5:if(ck(Mn,Fn),ek(Fn),is&512&&rs!==null&&Lj(rs,rs.return),Fn.flags&32){var os=Fn.stateNode;try{ob(os,"")}catch(Lo){W$1(Fn,Fn.return,Lo)}}if(is&4&&(os=Fn.stateNode,os!=null)){var as=Fn.memoizedProps,us=rs!==null?rs.memoizedProps:as,ds=Fn.type,hs=Fn.updateQueue;if(Fn.updateQueue=null,hs!==null)try{ds==="input"&&as.type==="radio"&&as.name!=null&&ab(os,as),vb(ds,us);var ps=vb(ds,as);for(us=0;us<hs.length;us+=2){var io=hs[us],fo=hs[us+1];io==="style"?sb(os,fo):io==="dangerouslySetInnerHTML"?nb(os,fo):io==="children"?ob(os,fo):ta$1(os,io,fo,ps)}switch(ds){case"input":bb(os,as);break;case"textarea":ib(os,as);break;case"select":var mo=os._wrapperState.wasMultiple;os._wrapperState.wasMultiple=!!as.multiple;var Ao=as.value;Ao!=null?fb(os,!!as.multiple,Ao,!1):mo!==!!as.multiple&&(as.defaultValue!=null?fb(os,!!as.multiple,as.defaultValue,!0):fb(os,!!as.multiple,as.multiple?[]:"",!1))}os[Pf$1]=as}catch(Lo){W$1(Fn,Fn.return,Lo)}}break;case 6:if(ck(Mn,Fn),ek(Fn),is&4){if(Fn.stateNode===null)throw Error(p$9(162));os=Fn.stateNode,as=Fn.memoizedProps;try{os.nodeValue=as}catch(Lo){W$1(Fn,Fn.return,Lo)}}break;case 3:if(ck(Mn,Fn),ek(Fn),is&4&&rs!==null&&rs.memoizedState.isDehydrated)try{bd(Mn.containerInfo)}catch(Lo){W$1(Fn,Fn.return,Lo)}break;case 4:ck(Mn,Fn),ek(Fn);break;case 13:ck(Mn,Fn),ek(Fn),os=Fn.child,os.flags&8192&&(as=os.memoizedState!==null,os.stateNode.isHidden=as,!as||os.alternate!==null&&os.alternate.memoizedState!==null||(fk=B$3())),is&4&&ak(Fn);break;case 22:if(io=rs!==null&&rs.memoizedState!==null,Fn.mode&1?(U$3=(ps=U$3)||io,ck(Mn,Fn),U$3=ps):ck(Mn,Fn),ek(Fn),is&8192){if(ps=Fn.memoizedState!==null,(Fn.stateNode.isHidden=ps)&&!io&&Fn.mode&1)for(V$2=Fn,io=Fn.child;io!==null;){for(fo=V$2=io;V$2!==null;){switch(mo=V$2,Ao=mo.child,mo.tag){case 0:case 11:case 14:case 15:Pj(4,mo,mo.return);break;case 1:Lj(mo,mo.return);var $o=mo.stateNode;if(typeof $o.componentWillUnmount=="function"){is=mo,rs=mo.return;try{Mn=is,$o.props=Mn.memoizedProps,$o.state=Mn.memoizedState,$o.componentWillUnmount()}catch(Lo){W$1(is,rs,Lo)}}break;case 5:Lj(mo,mo.return);break;case 22:if(mo.memoizedState!==null){gk(fo);continue}}Ao!==null?(Ao.return=mo,V$2=Ao):gk(fo)}io=io.sibling}e:for(io=null,fo=Fn;;){if(fo.tag===5){if(io===null){io=fo;try{os=fo.stateNode,ps?(as=os.style,typeof as.setProperty=="function"?as.setProperty("display","none","important"):as.display="none"):(ds=fo.stateNode,hs=fo.memoizedProps.style,us=hs!=null&&hs.hasOwnProperty("display")?hs.display:null,ds.style.display=rb("display",us))}catch(Lo){W$1(Fn,Fn.return,Lo)}}}else if(fo.tag===6){if(io===null)try{fo.stateNode.nodeValue=ps?"":fo.memoizedProps}catch(Lo){W$1(Fn,Fn.return,Lo)}}else if((fo.tag!==22&&fo.tag!==23||fo.memoizedState===null||fo===Fn)&&fo.child!==null){fo.child.return=fo,fo=fo.child;continue}if(fo===Fn)break e;for(;fo.sibling===null;){if(fo.return===null||fo.return===Fn)break e;io===fo&&(io=null),fo=fo.return}io===fo&&(io=null),fo.sibling.return=fo.return,fo=fo.sibling}}break;case 19:ck(Mn,Fn),ek(Fn),is&4&&ak(Fn);break;case 21:break;default:ck(Mn,Fn),ek(Fn)}}function ek(Fn){var Mn=Fn.flags;if(Mn&2){try{e:{for(var rs=Fn.return;rs!==null;){if(Tj(rs)){var is=rs;break e}rs=rs.return}throw Error(p$9(160))}switch(is.tag){case 5:var os=is.stateNode;is.flags&32&&(ob(os,""),is.flags&=-33);var as=Uj(Fn);Wj(Fn,as,os);break;case 3:case 4:var us=is.stateNode.containerInfo,ds=Uj(Fn);Vj(Fn,ds,us);break;default:throw Error(p$9(161))}}catch(hs){W$1(Fn,Fn.return,hs)}Fn.flags&=-3}Mn&4096&&(Fn.flags&=-4097)}function hk(Fn,Mn,rs){V$2=Fn,ik(Fn)}function ik(Fn,Mn,rs){for(var is=(Fn.mode&1)!==0;V$2!==null;){var os=V$2,as=os.child;if(os.tag===22&&is){var us=os.memoizedState!==null||Jj;if(!us){var ds=os.alternate,hs=ds!==null&&ds.memoizedState!==null||U$3;ds=Jj;var ps=U$3;if(Jj=us,(U$3=hs)&&!ps)for(V$2=os;V$2!==null;)us=V$2,hs=us.child,us.tag===22&&us.memoizedState!==null?jk(os):hs!==null?(hs.return=us,V$2=hs):jk(os);for(;as!==null;)V$2=as,ik(as),as=as.sibling;V$2=os,Jj=ds,U$3=ps}kk(Fn)}else os.subtreeFlags&8772&&as!==null?(as.return=os,V$2=as):kk(Fn)}}function kk(Fn){for(;V$2!==null;){var Mn=V$2;if(Mn.flags&8772){var rs=Mn.alternate;try{if(Mn.flags&8772)switch(Mn.tag){case 0:case 11:case 15:U$3||Qj(5,Mn);break;case 1:var is=Mn.stateNode;if(Mn.flags&4&&!U$3)if(rs===null)is.componentDidMount();else{var os=Mn.elementType===Mn.type?rs.memoizedProps:Ci$1(Mn.type,rs.memoizedProps);is.componentDidUpdate(os,rs.memoizedState,is.__reactInternalSnapshotBeforeUpdate)}var as=Mn.updateQueue;as!==null&&sh$1(Mn,as,is);break;case 3:var us=Mn.updateQueue;if(us!==null){if(rs=null,Mn.child!==null)switch(Mn.child.tag){case 5:rs=Mn.child.stateNode;break;case 1:rs=Mn.child.stateNode}sh$1(Mn,us,rs)}break;case 5:var ds=Mn.stateNode;if(rs===null&&Mn.flags&4){rs=ds;var hs=Mn.memoizedProps;switch(Mn.type){case"button":case"input":case"select":case"textarea":hs.autoFocus&&rs.focus();break;case"img":hs.src&&(rs.src=hs.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(Mn.memoizedState===null){var ps=Mn.alternate;if(ps!==null){var io=ps.memoizedState;if(io!==null){var fo=io.dehydrated;fo!==null&&bd(fo)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(p$9(163))}U$3||Mn.flags&512&&Rj(Mn)}catch(mo){W$1(Mn,Mn.return,mo)}}if(Mn===Fn){V$2=null;break}if(rs=Mn.sibling,rs!==null){rs.return=Mn.return,V$2=rs;break}V$2=Mn.return}}function gk(Fn){for(;V$2!==null;){var Mn=V$2;if(Mn===Fn){V$2=null;break}var rs=Mn.sibling;if(rs!==null){rs.return=Mn.return,V$2=rs;break}V$2=Mn.return}}function jk(Fn){for(;V$2!==null;){var Mn=V$2;try{switch(Mn.tag){case 0:case 11:case 15:var rs=Mn.return;try{Qj(4,Mn)}catch(hs){W$1(Mn,rs,hs)}break;case 1:var is=Mn.stateNode;if(typeof is.componentDidMount=="function"){var os=Mn.return;try{is.componentDidMount()}catch(hs){W$1(Mn,os,hs)}}var as=Mn.return;try{Rj(Mn)}catch(hs){W$1(Mn,as,hs)}break;case 5:var us=Mn.return;try{Rj(Mn)}catch(hs){W$1(Mn,us,hs)}}}catch(hs){W$1(Mn,Mn.return,hs)}if(Mn===Fn){V$2=null;break}var ds=Mn.sibling;if(ds!==null){ds.return=Mn.return,V$2=ds;break}V$2=Mn.return}}var lk=Math.ceil,mk=ua$1.ReactCurrentDispatcher,nk=ua$1.ReactCurrentOwner,ok=ua$1.ReactCurrentBatchConfig,K$4=0,Q$4=null,Y$1=null,Z$3=0,fj=0,ej=Uf$1(0),T$4=0,pk=null,rh$1=0,qk=0,rk=0,sk=null,tk=null,fk=0,Gj=1/0,uk=null,Oi$1=!1,Pi$1=null,Ri$1=null,vk=!1,wk=null,xk=0,yk=0,zk=null,Ak=-1,Bk=0;function R$4(){return K$4&6?B$3():Ak!==-1?Ak:Ak=B$3()}function yi$2(Fn){return Fn.mode&1?K$4&2&&Z$3!==0?Z$3&-Z$3:Kg.transition!==null?(Bk===0&&(Bk=yc()),Bk):(Fn=C$3,Fn!==0||(Fn=window.event,Fn=Fn===void 0?16:jd(Fn.type)),Fn):1}function gi$1(Fn,Mn,rs,is){if(50<yk)throw yk=0,zk=null,Error(p$9(185));Ac(Fn,rs,is),(!(K$4&2)||Fn!==Q$4)&&(Fn===Q$4&&(!(K$4&2)&&(qk|=rs),T$4===4&&Ck(Fn,Z$3)),Dk(Fn,is),rs===1&&K$4===0&&!(Mn.mode&1)&&(Gj=B$3()+500,fg&&jg$1()))}function Dk(Fn,Mn){var rs=Fn.callbackNode;wc(Fn,Mn);var is=uc(Fn,Fn===Q$4?Z$3:0);if(is===0)rs!==null&&bc(rs),Fn.callbackNode=null,Fn.callbackPriority=0;else if(Mn=is&-is,Fn.callbackPriority!==Mn){if(rs!=null&&bc(rs),Mn===1)Fn.tag===0?ig(Ek.bind(null,Fn)):hg(Ek.bind(null,Fn)),Jf$1(function(){!(K$4&6)&&jg$1()}),rs=null;else{switch(Dc(is)){case 1:rs=fc;break;case 4:rs=gc;break;case 16:rs=hc;break;case 536870912:rs=jc;break;default:rs=hc}rs=Fk(rs,Gk.bind(null,Fn))}Fn.callbackPriority=Mn,Fn.callbackNode=rs}}function Gk(Fn,Mn){if(Ak=-1,Bk=0,K$4&6)throw Error(p$9(327));var rs=Fn.callbackNode;if(Hk()&&Fn.callbackNode!==rs)return null;var is=uc(Fn,Fn===Q$4?Z$3:0);if(is===0)return null;if(is&30||is&Fn.expiredLanes||Mn)Mn=Ik(Fn,is);else{Mn=is;var os=K$4;K$4|=2;var as=Jk();(Q$4!==Fn||Z$3!==Mn)&&(uk=null,Gj=B$3()+500,Kk(Fn,Mn));do try{Lk();break}catch(ds){Mk(Fn,ds)}while(!0);$g(),mk.current=as,K$4=os,Y$1!==null?Mn=0:(Q$4=null,Z$3=0,Mn=T$4)}if(Mn!==0){if(Mn===2&&(os=xc(Fn),os!==0&&(is=os,Mn=Nk(Fn,os))),Mn===1)throw rs=pk,Kk(Fn,0),Ck(Fn,is),Dk(Fn,B$3()),rs;if(Mn===6)Ck(Fn,is);else{if(os=Fn.current.alternate,!(is&30)&&!Ok(os)&&(Mn=Ik(Fn,is),Mn===2&&(as=xc(Fn),as!==0&&(is=as,Mn=Nk(Fn,as))),Mn===1))throw rs=pk,Kk(Fn,0),Ck(Fn,is),Dk(Fn,B$3()),rs;switch(Fn.finishedWork=os,Fn.finishedLanes=is,Mn){case 0:case 1:throw Error(p$9(345));case 2:Pk(Fn,tk,uk);break;case 3:if(Ck(Fn,is),(is&130023424)===is&&(Mn=fk+500-B$3(),10<Mn)){if(uc(Fn,0)!==0)break;if(os=Fn.suspendedLanes,(os&is)!==is){R$4(),Fn.pingedLanes|=Fn.suspendedLanes&os;break}Fn.timeoutHandle=Ff$1(Pk.bind(null,Fn,tk,uk),Mn);break}Pk(Fn,tk,uk);break;case 4:if(Ck(Fn,is),(is&4194240)===is)break;for(Mn=Fn.eventTimes,os=-1;0<is;){var us=31-oc(is);as=1<<us,us=Mn[us],us>os&&(os=us),is&=~as}if(is=os,is=B$3()-is,is=(120>is?120:480>is?480:1080>is?1080:1920>is?1920:3e3>is?3e3:4320>is?4320:1960*lk(is/1960))-is,10<is){Fn.timeoutHandle=Ff$1(Pk.bind(null,Fn,tk,uk),is);break}Pk(Fn,tk,uk);break;case 5:Pk(Fn,tk,uk);break;default:throw Error(p$9(329))}}}return Dk(Fn,B$3()),Fn.callbackNode===rs?Gk.bind(null,Fn):null}function Nk(Fn,Mn){var rs=sk;return Fn.current.memoizedState.isDehydrated&&(Kk(Fn,Mn).flags|=256),Fn=Ik(Fn,Mn),Fn!==2&&(Mn=tk,tk=rs,Mn!==null&&Fj(Mn)),Fn}function Fj(Fn){tk===null?tk=Fn:tk.push.apply(tk,Fn)}function Ok(Fn){for(var Mn=Fn;;){if(Mn.flags&16384){var rs=Mn.updateQueue;if(rs!==null&&(rs=rs.stores,rs!==null))for(var is=0;is<rs.length;is++){var os=rs[is],as=os.getSnapshot;os=os.value;try{if(!He(as(),os))return!1}catch{return!1}}}if(rs=Mn.child,Mn.subtreeFlags&16384&&rs!==null)rs.return=Mn,Mn=rs;else{if(Mn===Fn)break;for(;Mn.sibling===null;){if(Mn.return===null||Mn.return===Fn)return!0;Mn=Mn.return}Mn.sibling.return=Mn.return,Mn=Mn.sibling}}return!0}function Ck(Fn,Mn){for(Mn&=~rk,Mn&=~qk,Fn.suspendedLanes|=Mn,Fn.pingedLanes&=~Mn,Fn=Fn.expirationTimes;0<Mn;){var rs=31-oc(Mn),is=1<<rs;Fn[rs]=-1,Mn&=~is}}function Ek(Fn){if(K$4&6)throw Error(p$9(327));Hk();var Mn=uc(Fn,0);if(!(Mn&1))return Dk(Fn,B$3()),null;var rs=Ik(Fn,Mn);if(Fn.tag!==0&&rs===2){var is=xc(Fn);is!==0&&(Mn=is,rs=Nk(Fn,is))}if(rs===1)throw rs=pk,Kk(Fn,0),Ck(Fn,Mn),Dk(Fn,B$3()),rs;if(rs===6)throw Error(p$9(345));return Fn.finishedWork=Fn.current.alternate,Fn.finishedLanes=Mn,Pk(Fn,tk,uk),Dk(Fn,B$3()),null}function Qk(Fn,Mn){var rs=K$4;K$4|=1;try{return Fn(Mn)}finally{K$4=rs,K$4===0&&(Gj=B$3()+500,fg&&jg$1())}}function Rk(Fn){wk!==null&&wk.tag===0&&!(K$4&6)&&Hk();var Mn=K$4;K$4|=1;var rs=ok.transition,is=C$3;try{if(ok.transition=null,C$3=1,Fn)return Fn()}finally{C$3=is,ok.transition=rs,K$4=Mn,!(K$4&6)&&jg$1()}}function Hj(){fj=ej.current,E$5(ej)}function Kk(Fn,Mn){Fn.finishedWork=null,Fn.finishedLanes=0;var rs=Fn.timeoutHandle;if(rs!==-1&&(Fn.timeoutHandle=-1,Gf$1(rs)),Y$1!==null)for(rs=Y$1.return;rs!==null;){var is=rs;switch(wg(is),is.tag){case 1:is=is.type.childContextTypes,is!=null&&$f();break;case 3:zh(),E$5(Wf$1),E$5(H$1),Eh$1();break;case 5:Bh$1(is);break;case 4:zh();break;case 13:E$5(L$3);break;case 19:E$5(L$3);break;case 10:ah(is.type._context);break;case 22:case 23:Hj()}rs=rs.return}if(Q$4=Fn,Y$1=Fn=Pg(Fn.current,null),Z$3=fj=Mn,T$4=0,pk=null,rk=qk=rh$1=0,tk=sk=null,fh!==null){for(Mn=0;Mn<fh.length;Mn++)if(rs=fh[Mn],is=rs.interleaved,is!==null){rs.interleaved=null;var os=is.next,as=rs.pending;if(as!==null){var us=as.next;as.next=os,is.next=us}rs.pending=is}fh=null}return Fn}function Mk(Fn,Mn){do{var rs=Y$1;try{if($g(),Fh.current=Rh$1,Ih$1){for(var is=M$4.memoizedState;is!==null;){var os=is.queue;os!==null&&(os.pending=null),is=is.next}Ih$1=!1}if(Hh=0,O$6=N$3=M$4=null,Jh=!1,Kh$1=0,nk.current=null,rs===null||rs.return===null){T$4=1,pk=Mn,Y$1=null;break}e:{var as=Fn,us=rs.return,ds=rs,hs=Mn;if(Mn=Z$3,ds.flags|=32768,hs!==null&&typeof hs=="object"&&typeof hs.then=="function"){var ps=hs,io=ds,fo=io.tag;if(!(io.mode&1)&&(fo===0||fo===11||fo===15)){var mo=io.alternate;mo?(io.updateQueue=mo.updateQueue,io.memoizedState=mo.memoizedState,io.lanes=mo.lanes):(io.updateQueue=null,io.memoizedState=null)}var Ao=Ui$1(us);if(Ao!==null){Ao.flags&=-257,Vi$1(Ao,us,ds,as,Mn),Ao.mode&1&&Si$1(as,ps,Mn),Mn=Ao,hs=ps;var $o=Mn.updateQueue;if($o===null){var Lo=new Set;Lo.add(hs),Mn.updateQueue=Lo}else $o.add(hs);break e}else{if(!(Mn&1)){Si$1(as,ps,Mn),tj();break e}hs=Error(p$9(426))}}else if(I$4&&ds.mode&1){var Go=Ui$1(us);if(Go!==null){!(Go.flags&65536)&&(Go.flags|=256),Vi$1(Go,us,ds,as,Mn),Jg$1(Ji$1(hs,ds));break e}}as=hs=Ji$1(hs,ds),T$4!==4&&(T$4=2),sk===null?sk=[as]:sk.push(as),as=us;do{switch(as.tag){case 3:as.flags|=65536,Mn&=-Mn,as.lanes|=Mn;var Yo=Ni$1(as,hs,Mn);ph$1(as,Yo);break e;case 1:ds=hs;var Wo=as.type,Jo=as.stateNode;if(!(as.flags&128)&&(typeof Wo.getDerivedStateFromError=="function"||Jo!==null&&typeof Jo.componentDidCatch=="function"&&(Ri$1===null||!Ri$1.has(Jo)))){as.flags|=65536,Mn&=-Mn,as.lanes|=Mn;var xl=Qi$1(as,ds,Mn);ph$1(as,xl);break e}}as=as.return}while(as!==null)}Sk(rs)}catch(_l){Mn=_l,Y$1===rs&&rs!==null&&(Y$1=rs=rs.return);continue}break}while(!0)}function Jk(){var Fn=mk.current;return mk.current=Rh$1,Fn===null?Rh$1:Fn}function tj(){(T$4===0||T$4===3||T$4===2)&&(T$4=4),Q$4===null||!(rh$1&268435455)&&!(qk&268435455)||Ck(Q$4,Z$3)}function Ik(Fn,Mn){var rs=K$4;K$4|=2;var is=Jk();(Q$4!==Fn||Z$3!==Mn)&&(uk=null,Kk(Fn,Mn));do try{Tk();break}catch(os){Mk(Fn,os)}while(!0);if($g(),K$4=rs,mk.current=is,Y$1!==null)throw Error(p$9(261));return Q$4=null,Z$3=0,T$4}function Tk(){for(;Y$1!==null;)Uk(Y$1)}function Lk(){for(;Y$1!==null&&!cc();)Uk(Y$1)}function Uk(Fn){var Mn=Vk(Fn.alternate,Fn,fj);Fn.memoizedProps=Fn.pendingProps,Mn===null?Sk(Fn):Y$1=Mn,nk.current=null}function Sk(Fn){var Mn=Fn;do{var rs=Mn.alternate;if(Fn=Mn.return,Mn.flags&32768){if(rs=Ij(rs,Mn),rs!==null){rs.flags&=32767,Y$1=rs;return}if(Fn!==null)Fn.flags|=32768,Fn.subtreeFlags=0,Fn.deletions=null;else{T$4=6,Y$1=null;return}}else if(rs=Ej(rs,Mn,fj),rs!==null){Y$1=rs;return}if(Mn=Mn.sibling,Mn!==null){Y$1=Mn;return}Y$1=Mn=Fn}while(Mn!==null);T$4===0&&(T$4=5)}function Pk(Fn,Mn,rs){var is=C$3,os=ok.transition;try{ok.transition=null,C$3=1,Wk(Fn,Mn,rs,is)}finally{ok.transition=os,C$3=is}return null}function Wk(Fn,Mn,rs,is){do Hk();while(wk!==null);if(K$4&6)throw Error(p$9(327));rs=Fn.finishedWork;var os=Fn.finishedLanes;if(rs===null)return null;if(Fn.finishedWork=null,Fn.finishedLanes=0,rs===Fn.current)throw Error(p$9(177));Fn.callbackNode=null,Fn.callbackPriority=0;var as=rs.lanes|rs.childLanes;if(Bc(Fn,as),Fn===Q$4&&(Y$1=Q$4=null,Z$3=0),!(rs.subtreeFlags&2064)&&!(rs.flags&2064)||vk||(vk=!0,Fk(hc,function(){return Hk(),null})),as=(rs.flags&15990)!==0,rs.subtreeFlags&15990||as){as=ok.transition,ok.transition=null;var us=C$3;C$3=1;var ds=K$4;K$4|=4,nk.current=null,Oj(Fn,rs),dk(rs,Fn),Oe$2(Df$1),dd=!!Cf$1,Df$1=Cf$1=null,Fn.current=rs,hk(rs),dc(),K$4=ds,C$3=us,ok.transition=as}else Fn.current=rs;if(vk&&(vk=!1,wk=Fn,xk=os),as=Fn.pendingLanes,as===0&&(Ri$1=null),mc(rs.stateNode),Dk(Fn,B$3()),Mn!==null)for(is=Fn.onRecoverableError,rs=0;rs<Mn.length;rs++)os=Mn[rs],is(os.value,{componentStack:os.stack,digest:os.digest});if(Oi$1)throw Oi$1=!1,Fn=Pi$1,Pi$1=null,Fn;return xk&1&&Fn.tag!==0&&Hk(),as=Fn.pendingLanes,as&1?Fn===zk?yk++:(yk=0,zk=Fn):yk=0,jg$1(),null}function Hk(){if(wk!==null){var Fn=Dc(xk),Mn=ok.transition,rs=C$3;try{if(ok.transition=null,C$3=16>Fn?16:Fn,wk===null)var is=!1;else{if(Fn=wk,wk=null,xk=0,K$4&6)throw Error(p$9(331));var os=K$4;for(K$4|=4,V$2=Fn.current;V$2!==null;){var as=V$2,us=as.child;if(V$2.flags&16){var ds=as.deletions;if(ds!==null){for(var hs=0;hs<ds.length;hs++){var ps=ds[hs];for(V$2=ps;V$2!==null;){var io=V$2;switch(io.tag){case 0:case 11:case 15:Pj(8,io,as)}var fo=io.child;if(fo!==null)fo.return=io,V$2=fo;else for(;V$2!==null;){io=V$2;var mo=io.sibling,Ao=io.return;if(Sj(io),io===ps){V$2=null;break}if(mo!==null){mo.return=Ao,V$2=mo;break}V$2=Ao}}}var $o=as.alternate;if($o!==null){var Lo=$o.child;if(Lo!==null){$o.child=null;do{var Go=Lo.sibling;Lo.sibling=null,Lo=Go}while(Lo!==null)}}V$2=as}}if(as.subtreeFlags&2064&&us!==null)us.return=as,V$2=us;else e:for(;V$2!==null;){if(as=V$2,as.flags&2048)switch(as.tag){case 0:case 11:case 15:Pj(9,as,as.return)}var Yo=as.sibling;if(Yo!==null){Yo.return=as.return,V$2=Yo;break e}V$2=as.return}}var Wo=Fn.current;for(V$2=Wo;V$2!==null;){us=V$2;var Jo=us.child;if(us.subtreeFlags&2064&&Jo!==null)Jo.return=us,V$2=Jo;else e:for(us=Wo;V$2!==null;){if(ds=V$2,ds.flags&2048)try{switch(ds.tag){case 0:case 11:case 15:Qj(9,ds)}}catch(_l){W$1(ds,ds.return,_l)}if(ds===us){V$2=null;break e}var xl=ds.sibling;if(xl!==null){xl.return=ds.return,V$2=xl;break e}V$2=ds.return}}if(K$4=os,jg$1(),lc&&typeof lc.onPostCommitFiberRoot=="function")try{lc.onPostCommitFiberRoot(kc,Fn)}catch{}is=!0}return is}finally{C$3=rs,ok.transition=Mn}}return!1}function Xk(Fn,Mn,rs){Mn=Ji$1(rs,Mn),Mn=Ni$1(Fn,Mn,1),Fn=nh(Fn,Mn,1),Mn=R$4(),Fn!==null&&(Ac(Fn,1,Mn),Dk(Fn,Mn))}function W$1(Fn,Mn,rs){if(Fn.tag===3)Xk(Fn,Fn,rs);else for(;Mn!==null;){if(Mn.tag===3){Xk(Mn,Fn,rs);break}else if(Mn.tag===1){var is=Mn.stateNode;if(typeof Mn.type.getDerivedStateFromError=="function"||typeof is.componentDidCatch=="function"&&(Ri$1===null||!Ri$1.has(is))){Fn=Ji$1(rs,Fn),Fn=Qi$1(Mn,Fn,1),Mn=nh(Mn,Fn,1),Fn=R$4(),Mn!==null&&(Ac(Mn,1,Fn),Dk(Mn,Fn));break}}Mn=Mn.return}}function Ti$1(Fn,Mn,rs){var is=Fn.pingCache;is!==null&&is.delete(Mn),Mn=R$4(),Fn.pingedLanes|=Fn.suspendedLanes&rs,Q$4===Fn&&(Z$3&rs)===rs&&(T$4===4||T$4===3&&(Z$3&130023424)===Z$3&&500>B$3()-fk?Kk(Fn,0):rk|=rs),Dk(Fn,Mn)}function Yk(Fn,Mn){Mn===0&&(Fn.mode&1?(Mn=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):Mn=1);var rs=R$4();Fn=ih(Fn,Mn),Fn!==null&&(Ac(Fn,Mn,rs),Dk(Fn,rs))}function uj(Fn){var Mn=Fn.memoizedState,rs=0;Mn!==null&&(rs=Mn.retryLane),Yk(Fn,rs)}function bk(Fn,Mn){var rs=0;switch(Fn.tag){case 13:var is=Fn.stateNode,os=Fn.memoizedState;os!==null&&(rs=os.retryLane);break;case 19:is=Fn.stateNode;break;default:throw Error(p$9(314))}is!==null&&is.delete(Mn),Yk(Fn,rs)}var Vk;Vk=function(Fn,Mn,rs){if(Fn!==null)if(Fn.memoizedProps!==Mn.pendingProps||Wf$1.current)dh$1=!0;else{if(!(Fn.lanes&rs)&&!(Mn.flags&128))return dh$1=!1,yj(Fn,Mn,rs);dh$1=!!(Fn.flags&131072)}else dh$1=!1,I$4&&Mn.flags&1048576&&ug(Mn,ng,Mn.index);switch(Mn.lanes=0,Mn.tag){case 2:var is=Mn.type;ij(Fn,Mn),Fn=Mn.pendingProps;var os=Yf$1(Mn,H$1.current);ch$1(Mn,rs),os=Nh$1(null,Mn,is,Fn,os,rs);var as=Sh$1();return Mn.flags|=1,typeof os=="object"&&os!==null&&typeof os.render=="function"&&os.$$typeof===void 0?(Mn.tag=1,Mn.memoizedState=null,Mn.updateQueue=null,Zf(is)?(as=!0,cg(Mn)):as=!1,Mn.memoizedState=os.state!==null&&os.state!==void 0?os.state:null,kh(Mn),os.updater=Ei$1,Mn.stateNode=os,os._reactInternals=Mn,Ii$1(Mn,is,Fn,rs),Mn=jj(null,Mn,is,!0,as,rs)):(Mn.tag=0,I$4&&as&&vg(Mn),Xi$1(null,Mn,os,rs),Mn=Mn.child),Mn;case 16:is=Mn.elementType;e:{switch(ij(Fn,Mn),Fn=Mn.pendingProps,os=is._init,is=os(is._payload),Mn.type=is,os=Mn.tag=Zk(is),Fn=Ci$1(is,Fn),os){case 0:Mn=cj(null,Mn,is,Fn,rs);break e;case 1:Mn=hj(null,Mn,is,Fn,rs);break e;case 11:Mn=Yi$1(null,Mn,is,Fn,rs);break e;case 14:Mn=$i$1(null,Mn,is,Ci$1(is.type,Fn),rs);break e}throw Error(p$9(306,is,""))}return Mn;case 0:return is=Mn.type,os=Mn.pendingProps,os=Mn.elementType===is?os:Ci$1(is,os),cj(Fn,Mn,is,os,rs);case 1:return is=Mn.type,os=Mn.pendingProps,os=Mn.elementType===is?os:Ci$1(is,os),hj(Fn,Mn,is,os,rs);case 3:e:{if(kj(Mn),Fn===null)throw Error(p$9(387));is=Mn.pendingProps,as=Mn.memoizedState,os=as.element,lh$1(Fn,Mn),qh(Mn,is,null,rs);var us=Mn.memoizedState;if(is=us.element,as.isDehydrated)if(as={element:is,isDehydrated:!1,cache:us.cache,pendingSuspenseBoundaries:us.pendingSuspenseBoundaries,transitions:us.transitions},Mn.updateQueue.baseState=as,Mn.memoizedState=as,Mn.flags&256){os=Ji$1(Error(p$9(423)),Mn),Mn=lj(Fn,Mn,is,rs,os);break e}else if(is!==os){os=Ji$1(Error(p$9(424)),Mn),Mn=lj(Fn,Mn,is,rs,os);break e}else for(yg=Lf$1(Mn.stateNode.containerInfo.firstChild),xg=Mn,I$4=!0,zg=null,rs=Vg$1(Mn,null,is,rs),Mn.child=rs;rs;)rs.flags=rs.flags&-3|4096,rs=rs.sibling;else{if(Ig(),is===os){Mn=Zi$1(Fn,Mn,rs);break e}Xi$1(Fn,Mn,is,rs)}Mn=Mn.child}return Mn;case 5:return Ah$1(Mn),Fn===null&&Eg(Mn),is=Mn.type,os=Mn.pendingProps,as=Fn!==null?Fn.memoizedProps:null,us=os.children,Ef$1(is,os)?us=null:as!==null&&Ef$1(is,as)&&(Mn.flags|=32),gj(Fn,Mn),Xi$1(Fn,Mn,us,rs),Mn.child;case 6:return Fn===null&&Eg(Mn),null;case 13:return oj(Fn,Mn,rs);case 4:return yh$1(Mn,Mn.stateNode.containerInfo),is=Mn.pendingProps,Fn===null?Mn.child=Ug(Mn,null,is,rs):Xi$1(Fn,Mn,is,rs),Mn.child;case 11:return is=Mn.type,os=Mn.pendingProps,os=Mn.elementType===is?os:Ci$1(is,os),Yi$1(Fn,Mn,is,os,rs);case 7:return Xi$1(Fn,Mn,Mn.pendingProps,rs),Mn.child;case 8:return Xi$1(Fn,Mn,Mn.pendingProps.children,rs),Mn.child;case 12:return Xi$1(Fn,Mn,Mn.pendingProps.children,rs),Mn.child;case 10:e:{if(is=Mn.type._context,os=Mn.pendingProps,as=Mn.memoizedProps,us=os.value,G$3(Wg,is._currentValue),is._currentValue=us,as!==null)if(He(as.value,us)){if(as.children===os.children&&!Wf$1.current){Mn=Zi$1(Fn,Mn,rs);break e}}else for(as=Mn.child,as!==null&&(as.return=Mn);as!==null;){var ds=as.dependencies;if(ds!==null){us=as.child;for(var hs=ds.firstContext;hs!==null;){if(hs.context===is){if(as.tag===1){hs=mh$1(-1,rs&-rs),hs.tag=2;var ps=as.updateQueue;if(ps!==null){ps=ps.shared;var io=ps.pending;io===null?hs.next=hs:(hs.next=io.next,io.next=hs),ps.pending=hs}}as.lanes|=rs,hs=as.alternate,hs!==null&&(hs.lanes|=rs),bh$1(as.return,rs,Mn),ds.lanes|=rs;break}hs=hs.next}}else if(as.tag===10)us=as.type===Mn.type?null:as.child;else if(as.tag===18){if(us=as.return,us===null)throw Error(p$9(341));us.lanes|=rs,ds=us.alternate,ds!==null&&(ds.lanes|=rs),bh$1(us,rs,Mn),us=as.sibling}else us=as.child;if(us!==null)us.return=as;else for(us=as;us!==null;){if(us===Mn){us=null;break}if(as=us.sibling,as!==null){as.return=us.return,us=as;break}us=us.return}as=us}Xi$1(Fn,Mn,os.children,rs),Mn=Mn.child}return Mn;case 9:return os=Mn.type,is=Mn.pendingProps.children,ch$1(Mn,rs),os=eh(os),is=is(os),Mn.flags|=1,Xi$1(Fn,Mn,is,rs),Mn.child;case 14:return is=Mn.type,os=Ci$1(is,Mn.pendingProps),os=Ci$1(is.type,os),$i$1(Fn,Mn,is,os,rs);case 15:return bj(Fn,Mn,Mn.type,Mn.pendingProps,rs);case 17:return is=Mn.type,os=Mn.pendingProps,os=Mn.elementType===is?os:Ci$1(is,os),ij(Fn,Mn),Mn.tag=1,Zf(is)?(Fn=!0,cg(Mn)):Fn=!1,ch$1(Mn,rs),Gi$1(Mn,is,os),Ii$1(Mn,is,os,rs),jj(null,Mn,is,!0,Fn,rs);case 19:return xj(Fn,Mn,rs);case 22:return dj(Fn,Mn,rs)}throw Error(p$9(156,Mn.tag))};function Fk(Fn,Mn){return ac(Fn,Mn)}function $k(Fn,Mn,rs,is){this.tag=Fn,this.key=rs,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=Mn,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=is,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(Fn,Mn,rs,is){return new $k(Fn,Mn,rs,is)}function aj(Fn){return Fn=Fn.prototype,!(!Fn||!Fn.isReactComponent)}function Zk(Fn){if(typeof Fn=="function")return aj(Fn)?1:0;if(Fn!=null){if(Fn=Fn.$$typeof,Fn===Da$2)return 11;if(Fn===Ga$1)return 14}return 2}function Pg(Fn,Mn){var rs=Fn.alternate;return rs===null?(rs=Bg(Fn.tag,Mn,Fn.key,Fn.mode),rs.elementType=Fn.elementType,rs.type=Fn.type,rs.stateNode=Fn.stateNode,rs.alternate=Fn,Fn.alternate=rs):(rs.pendingProps=Mn,rs.type=Fn.type,rs.flags=0,rs.subtreeFlags=0,rs.deletions=null),rs.flags=Fn.flags&14680064,rs.childLanes=Fn.childLanes,rs.lanes=Fn.lanes,rs.child=Fn.child,rs.memoizedProps=Fn.memoizedProps,rs.memoizedState=Fn.memoizedState,rs.updateQueue=Fn.updateQueue,Mn=Fn.dependencies,rs.dependencies=Mn===null?null:{lanes:Mn.lanes,firstContext:Mn.firstContext},rs.sibling=Fn.sibling,rs.index=Fn.index,rs.ref=Fn.ref,rs}function Rg(Fn,Mn,rs,is,os,as){var us=2;if(is=Fn,typeof Fn=="function")aj(Fn)&&(us=1);else if(typeof Fn=="string")us=5;else e:switch(Fn){case ya$2:return Tg(rs.children,os,as,Mn);case za$1:us=8,os|=8;break;case Aa$1:return Fn=Bg(12,rs,Mn,os|2),Fn.elementType=Aa$1,Fn.lanes=as,Fn;case Ea$1:return Fn=Bg(13,rs,Mn,os),Fn.elementType=Ea$1,Fn.lanes=as,Fn;case Fa$2:return Fn=Bg(19,rs,Mn,os),Fn.elementType=Fa$2,Fn.lanes=as,Fn;case Ia$1:return pj(rs,os,as,Mn);default:if(typeof Fn=="object"&&Fn!==null)switch(Fn.$$typeof){case Ba$1:us=10;break e;case Ca$1:us=9;break e;case Da$2:us=11;break e;case Ga$1:us=14;break e;case Ha$2:us=16,is=null;break e}throw Error(p$9(130,Fn==null?Fn:typeof Fn,""))}return Mn=Bg(us,rs,Mn,os),Mn.elementType=Fn,Mn.type=is,Mn.lanes=as,Mn}function Tg(Fn,Mn,rs,is){return Fn=Bg(7,Fn,is,Mn),Fn.lanes=rs,Fn}function pj(Fn,Mn,rs,is){return Fn=Bg(22,Fn,is,Mn),Fn.elementType=Ia$1,Fn.lanes=rs,Fn.stateNode={isHidden:!1},Fn}function Qg$1(Fn,Mn,rs){return Fn=Bg(6,Fn,null,Mn),Fn.lanes=rs,Fn}function Sg(Fn,Mn,rs){return Mn=Bg(4,Fn.children!==null?Fn.children:[],Fn.key,Mn),Mn.lanes=rs,Mn.stateNode={containerInfo:Fn.containerInfo,pendingChildren:null,implementation:Fn.implementation},Mn}function al(Fn,Mn,rs,is,os){this.tag=Mn,this.containerInfo=Fn,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=is,this.onRecoverableError=os,this.mutableSourceEagerHydrationData=null}function bl(Fn,Mn,rs,is,os,as,us,ds,hs){return Fn=new al(Fn,Mn,rs,ds,hs),Mn===1?(Mn=1,as===!0&&(Mn|=8)):Mn=0,as=Bg(3,null,null,Mn),Fn.current=as,as.stateNode=Fn,as.memoizedState={element:is,isDehydrated:rs,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(as),Fn}function cl(Fn,Mn,rs){var is=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wa$1,key:is==null?null:""+is,children:Fn,containerInfo:Mn,implementation:rs}}function dl(Fn){if(!Fn)return Vf$1;Fn=Fn._reactInternals;e:{if(Vb(Fn)!==Fn||Fn.tag!==1)throw Error(p$9(170));var Mn=Fn;do{switch(Mn.tag){case 3:Mn=Mn.stateNode.context;break e;case 1:if(Zf(Mn.type)){Mn=Mn.stateNode.__reactInternalMemoizedMergedChildContext;break e}}Mn=Mn.return}while(Mn!==null);throw Error(p$9(171))}if(Fn.tag===1){var rs=Fn.type;if(Zf(rs))return bg(Fn,rs,Mn)}return Mn}function el(Fn,Mn,rs,is,os,as,us,ds,hs){return Fn=bl(rs,is,!0,Fn,os,as,us,ds,hs),Fn.context=dl(null),rs=Fn.current,is=R$4(),os=yi$2(rs),as=mh$1(is,os),as.callback=Mn??null,nh(rs,as,os),Fn.current.lanes=os,Ac(Fn,os,is),Dk(Fn,is),Fn}function fl(Fn,Mn,rs,is){var os=Mn.current,as=R$4(),us=yi$2(os);return rs=dl(rs),Mn.context===null?Mn.context=rs:Mn.pendingContext=rs,Mn=mh$1(as,us),Mn.payload={element:Fn},is=is===void 0?null:is,is!==null&&(Mn.callback=is),Fn=nh(os,Mn,us),Fn!==null&&(gi$1(Fn,os,us,as),oh(Fn,os,us)),us}function gl(Fn){if(Fn=Fn.current,!Fn.child)return null;switch(Fn.child.tag){case 5:return Fn.child.stateNode;default:return Fn.child.stateNode}}function hl(Fn,Mn){if(Fn=Fn.memoizedState,Fn!==null&&Fn.dehydrated!==null){var rs=Fn.retryLane;Fn.retryLane=rs!==0&&rs<Mn?rs:Mn}}function il(Fn,Mn){hl(Fn,Mn),(Fn=Fn.alternate)&&hl(Fn,Mn)}function jl(){return null}var kl=typeof reportError=="function"?reportError:function(Fn){console.error(Fn)};function ll(Fn){this._internalRoot=Fn}ml.prototype.render=ll.prototype.render=function(Fn){var Mn=this._internalRoot;if(Mn===null)throw Error(p$9(409));fl(Fn,Mn,null,null)};ml.prototype.unmount=ll.prototype.unmount=function(){var Fn=this._internalRoot;if(Fn!==null){this._internalRoot=null;var Mn=Fn.containerInfo;Rk(function(){fl(null,Fn,null,null)}),Mn[uf]=null}};function ml(Fn){this._internalRoot=Fn}ml.prototype.unstable_scheduleHydration=function(Fn){if(Fn){var Mn=Hc();Fn={blockedOn:null,target:Fn,priority:Mn};for(var rs=0;rs<Qc.length&&Mn!==0&&Mn<Qc[rs].priority;rs++);Qc.splice(rs,0,Fn),rs===0&&Vc(Fn)}};function nl(Fn){return!(!Fn||Fn.nodeType!==1&&Fn.nodeType!==9&&Fn.nodeType!==11)}function ol(Fn){return!(!Fn||Fn.nodeType!==1&&Fn.nodeType!==9&&Fn.nodeType!==11&&(Fn.nodeType!==8||Fn.nodeValue!==" react-mount-point-unstable "))}function pl(){}function ql(Fn,Mn,rs,is,os){if(os){if(typeof is=="function"){var as=is;is=function(){var ps=gl(us);as.call(ps)}}var us=el(Mn,is,Fn,0,null,!1,!1,"",pl);return Fn._reactRootContainer=us,Fn[uf]=us.current,sf(Fn.nodeType===8?Fn.parentNode:Fn),Rk(),us}for(;os=Fn.lastChild;)Fn.removeChild(os);if(typeof is=="function"){var ds=is;is=function(){var ps=gl(hs);ds.call(ps)}}var hs=bl(Fn,0,!1,null,null,!1,!1,"",pl);return Fn._reactRootContainer=hs,Fn[uf]=hs.current,sf(Fn.nodeType===8?Fn.parentNode:Fn),Rk(function(){fl(Mn,hs,rs,is)}),hs}function rl(Fn,Mn,rs,is,os){var as=rs._reactRootContainer;if(as){var us=as;if(typeof os=="function"){var ds=os;os=function(){var hs=gl(us);ds.call(hs)}}fl(Mn,us,Fn,os)}else us=ql(rs,Mn,Fn,os,is);return gl(us)}Ec=function(Fn){switch(Fn.tag){case 3:var Mn=Fn.stateNode;if(Mn.current.memoizedState.isDehydrated){var rs=tc(Mn.pendingLanes);rs!==0&&(Cc(Mn,rs|1),Dk(Mn,B$3()),!(K$4&6)&&(Gj=B$3()+500,jg$1()))}break;case 13:Rk(function(){var is=ih(Fn,1);if(is!==null){var os=R$4();gi$1(is,Fn,1,os)}}),il(Fn,1)}};Fc=function(Fn){if(Fn.tag===13){var Mn=ih(Fn,134217728);if(Mn!==null){var rs=R$4();gi$1(Mn,Fn,134217728,rs)}il(Fn,134217728)}};Gc=function(Fn){if(Fn.tag===13){var Mn=yi$2(Fn),rs=ih(Fn,Mn);if(rs!==null){var is=R$4();gi$1(rs,Fn,Mn,is)}il(Fn,Mn)}};Hc=function(){return C$3};Ic=function(Fn,Mn){var rs=C$3;try{return C$3=Fn,Mn()}finally{C$3=rs}};yb=function(Fn,Mn,rs){switch(Mn){case"input":if(bb(Fn,rs),Mn=rs.name,rs.type==="radio"&&Mn!=null){for(rs=Fn;rs.parentNode;)rs=rs.parentNode;for(rs=rs.querySelectorAll("input[name="+JSON.stringify(""+Mn)+'][type="radio"]'),Mn=0;Mn<rs.length;Mn++){var is=rs[Mn];if(is!==Fn&&is.form===Fn.form){var os=Db(is);if(!os)throw Error(p$9(90));Wa$2(is),bb(is,os)}}}break;case"textarea":ib(Fn,rs);break;case"select":Mn=rs.value,Mn!=null&&fb(Fn,!!rs.multiple,Mn,!1)}};Gb=Qk;Hb=Rk;var sl={usingClientEntryPoint:!1,Events:[Cb,ue$1,Db,Eb,Fb,Qk]},tl={findFiberByHostInstance:Wc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ul={bundleType:tl.bundleType,version:tl.version,rendererPackageName:tl.rendererPackageName,rendererConfig:tl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ua$1.ReactCurrentDispatcher,findHostInstanceByFiber:function(Fn){return Fn=Zb(Fn),Fn===null?null:Fn.stateNode},findFiberByHostInstance:tl.findFiberByHostInstance||jl,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 vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vl.isDisabled&&vl.supportsFiber)try{kc=vl.inject(ul),lc=vl}catch{}}reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sl;reactDom_production_min.createPortal=function(Fn,Mn){var rs=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nl(Mn))throw Error(p$9(200));return cl(Fn,Mn,null,rs)};reactDom_production_min.createRoot=function(Fn,Mn){if(!nl(Fn))throw Error(p$9(299));var rs=!1,is="",os=kl;return Mn!=null&&(Mn.unstable_strictMode===!0&&(rs=!0),Mn.identifierPrefix!==void 0&&(is=Mn.identifierPrefix),Mn.onRecoverableError!==void 0&&(os=Mn.onRecoverableError)),Mn=bl(Fn,1,!1,null,null,rs,!1,is,os),Fn[uf]=Mn.current,sf(Fn.nodeType===8?Fn.parentNode:Fn),new ll(Mn)};reactDom_production_min.findDOMNode=function(Fn){if(Fn==null)return null;if(Fn.nodeType===1)return Fn;var Mn=Fn._reactInternals;if(Mn===void 0)throw typeof Fn.render=="function"?Error(p$9(188)):(Fn=Object.keys(Fn).join(","),Error(p$9(268,Fn)));return Fn=Zb(Mn),Fn=Fn===null?null:Fn.stateNode,Fn};reactDom_production_min.flushSync=function(Fn){return Rk(Fn)};reactDom_production_min.hydrate=function(Fn,Mn,rs){if(!ol(Mn))throw Error(p$9(200));return rl(null,Fn,Mn,!0,rs)};reactDom_production_min.hydrateRoot=function(Fn,Mn,rs){if(!nl(Fn))throw Error(p$9(405));var is=rs!=null&&rs.hydratedSources||null,os=!1,as="",us=kl;if(rs!=null&&(rs.unstable_strictMode===!0&&(os=!0),rs.identifierPrefix!==void 0&&(as=rs.identifierPrefix),rs.onRecoverableError!==void 0&&(us=rs.onRecoverableError)),Mn=el(Mn,null,Fn,1,rs??null,os,!1,as,us),Fn[uf]=Mn.current,sf(Fn),is)for(Fn=0;Fn<is.length;Fn++)rs=is[Fn],os=rs._getVersion,os=os(rs._source),Mn.mutableSourceEagerHydrationData==null?Mn.mutableSourceEagerHydrationData=[rs,os]:Mn.mutableSourceEagerHydrationData.push(rs,os);return new ml(Mn)};reactDom_production_min.render=function(Fn,Mn,rs){if(!ol(Mn))throw Error(p$9(200));return rl(null,Fn,Mn,!1,rs)};reactDom_production_min.unmountComponentAtNode=function(Fn){if(!ol(Fn))throw Error(p$9(40));return Fn._reactRootContainer?(Rk(function(){rl(null,null,Fn,!1,function(){Fn._reactRootContainer=null,Fn[uf]=null})}),!0):!1};reactDom_production_min.unstable_batchedUpdates=Qk;reactDom_production_min.unstable_renderSubtreeIntoContainer=function(Fn,Mn,rs,is){if(!ol(rs))throw Error(p$9(200));if(Fn==null||Fn._reactInternals===void 0)throw Error(p$9(38));return rl(Fn,Mn,rs,!1,is)};reactDom_production_min.version="18.3.1-next-f1338f8080-20240426";function checkDCE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(Fn){console.error(Fn)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs(reactDomExports),ReactDOM$1=_mergeNamespaces({__proto__:null,default:ReactDOM},[reactDomExports]);var m$5=reactDomExports;client.createRoot=m$5.createRoot,client.hydrateRoot=m$5.hydrateRoot;/**
 * @remix-run/router v1.19.0
 *
 * 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 _extends$7(){return _extends$7=Object.assign?Object.assign.bind():function(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn];for(var is in rs)Object.prototype.hasOwnProperty.call(rs,is)&&(Fn[is]=rs[is])}return Fn},_extends$7.apply(this,arguments)}var Action;(function(Fn){Fn.Pop="POP",Fn.Push="PUSH",Fn.Replace="REPLACE"})(Action||(Action={}));const PopStateEventType="popstate";function createBrowserHistory(Fn){Fn===void 0&&(Fn={});function Mn(is,os){let{pathname:as,search:us,hash:ds}=is.location;return createLocation("",{pathname:as,search:us,hash:ds},os.state&&os.state.usr||null,os.state&&os.state.key||"default")}function rs(is,os){return typeof os=="string"?os:createPath(os)}return getUrlBasedHistory(Mn,rs,null,Fn)}function invariant(Fn,Mn){if(Fn===!1||Fn===null||typeof Fn>"u")throw new Error(Mn)}function warning$3(Fn,Mn){if(!Fn){typeof console<"u"&&console.warn(Mn);try{throw new Error(Mn)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(Fn,Mn){return{usr:Fn.state,key:Fn.key,idx:Mn}}function createLocation(Fn,Mn,rs,is){return rs===void 0&&(rs=null),_extends$7({pathname:typeof Fn=="string"?Fn:Fn.pathname,search:"",hash:""},typeof Mn=="string"?parsePath(Mn):Mn,{state:rs,key:Mn&&Mn.key||is||createKey()})}function createPath(Fn){let{pathname:Mn="/",search:rs="",hash:is=""}=Fn;return rs&&rs!=="?"&&(Mn+=rs.charAt(0)==="?"?rs:"?"+rs),is&&is!=="#"&&(Mn+=is.charAt(0)==="#"?is:"#"+is),Mn}function parsePath(Fn){let Mn={};if(Fn){let rs=Fn.indexOf("#");rs>=0&&(Mn.hash=Fn.substr(rs),Fn=Fn.substr(0,rs));let is=Fn.indexOf("?");is>=0&&(Mn.search=Fn.substr(is),Fn=Fn.substr(0,is)),Fn&&(Mn.pathname=Fn)}return Mn}function getUrlBasedHistory(Fn,Mn,rs,is){is===void 0&&(is={});let{window:os=document.defaultView,v5Compat:as=!1}=is,us=os.history,ds=Action.Pop,hs=null,ps=io();ps==null&&(ps=0,us.replaceState(_extends$7({},us.state,{idx:ps}),""));function io(){return(us.state||{idx:null}).idx}function fo(){ds=Action.Pop;let Go=io(),Yo=Go==null?null:Go-ps;ps=Go,hs&&hs({action:ds,location:Lo.location,delta:Yo})}function mo(Go,Yo){ds=Action.Push;let Wo=createLocation(Lo.location,Go,Yo);ps=io()+1;let Jo=getHistoryState(Wo,ps),xl=Lo.createHref(Wo);try{us.pushState(Jo,"",xl)}catch(_l){if(_l instanceof DOMException&&_l.name==="DataCloneError")throw _l;os.location.assign(xl)}as&&hs&&hs({action:ds,location:Lo.location,delta:1})}function Ao(Go,Yo){ds=Action.Replace;let Wo=createLocation(Lo.location,Go,Yo);ps=io();let Jo=getHistoryState(Wo,ps),xl=Lo.createHref(Wo);us.replaceState(Jo,"",xl),as&&hs&&hs({action:ds,location:Lo.location,delta:0})}function $o(Go){let Yo=os.location.origin!=="null"?os.location.origin:os.location.href,Wo=typeof Go=="string"?Go:createPath(Go);return Wo=Wo.replace(/ $/,"%20"),invariant(Yo,"No window.location.(origin|href) available to create URL for href: "+Wo),new URL(Wo,Yo)}let Lo={get action(){return ds},get location(){return Fn(os,us)},listen(Go){if(hs)throw new Error("A history only accepts one active listener");return os.addEventListener(PopStateEventType,fo),hs=Go,()=>{os.removeEventListener(PopStateEventType,fo),hs=null}},createHref(Go){return Mn(os,Go)},createURL:$o,encodeLocation(Go){let Yo=$o(Go);return{pathname:Yo.pathname,search:Yo.search,hash:Yo.hash}},push:mo,replace:Ao,go(Go){return us.go(Go)}};return Lo}var ResultType;(function(Fn){Fn.data="data",Fn.deferred="deferred",Fn.redirect="redirect",Fn.error="error"})(ResultType||(ResultType={}));function matchRoutes(Fn,Mn,rs){return rs===void 0&&(rs="/"),matchRoutesImpl(Fn,Mn,rs,!1)}function matchRoutesImpl(Fn,Mn,rs,is){let os=typeof Mn=="string"?parsePath(Mn):Mn,as=stripBasename(os.pathname||"/",rs);if(as==null)return null;let us=flattenRoutes(Fn);rankRouteBranches(us);let ds=null;for(let hs=0;ds==null&&hs<us.length;++hs){let ps=decodePath(as);ds=matchRouteBranch(us[hs],ps,is)}return ds}function flattenRoutes(Fn,Mn,rs,is){Mn===void 0&&(Mn=[]),rs===void 0&&(rs=[]),is===void 0&&(is="");let os=(as,us,ds)=>{let hs={relativePath:ds===void 0?as.path||"":ds,caseSensitive:as.caseSensitive===!0,childrenIndex:us,route:as};hs.relativePath.startsWith("/")&&(invariant(hs.relativePath.startsWith(is),'Absolute route path "'+hs.relativePath+'" nested under path '+('"'+is+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),hs.relativePath=hs.relativePath.slice(is.length));let ps=joinPaths([is,hs.relativePath]),io=rs.concat(hs);as.children&&as.children.length>0&&(invariant(as.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+ps+'".')),flattenRoutes(as.children,Mn,io,ps)),!(as.path==null&&!as.index)&&Mn.push({path:ps,score:computeScore(ps,as.index),routesMeta:io})};return Fn.forEach((as,us)=>{var ds;if(as.path===""||!((ds=as.path)!=null&&ds.includes("?")))os(as,us);else for(let hs of explodeOptionalSegments(as.path))os(as,us,hs)}),Mn}function explodeOptionalSegments(Fn){let Mn=Fn.split("/");if(Mn.length===0)return[];let[rs,...is]=Mn,os=rs.endsWith("?"),as=rs.replace(/\?$/,"");if(is.length===0)return os?[as,""]:[as];let us=explodeOptionalSegments(is.join("/")),ds=[];return ds.push(...us.map(hs=>hs===""?as:[as,hs].join("/"))),os&&ds.push(...us),ds.map(hs=>Fn.startsWith("/")&&hs===""?"/":hs)}function rankRouteBranches(Fn){Fn.sort((Mn,rs)=>Mn.score!==rs.score?rs.score-Mn.score:compareIndexes(Mn.routesMeta.map(is=>is.childrenIndex),rs.routesMeta.map(is=>is.childrenIndex)))}const paramRe=/^:[\w-]+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=Fn=>Fn==="*";function computeScore(Fn,Mn){let rs=Fn.split("/"),is=rs.length;return rs.some(isSplat)&&(is+=splatPenalty),Mn&&(is+=indexRouteValue),rs.filter(os=>!isSplat(os)).reduce((os,as)=>os+(paramRe.test(as)?dynamicSegmentValue:as===""?emptySegmentValue:staticSegmentValue),is)}function compareIndexes(Fn,Mn){return Fn.length===Mn.length&&Fn.slice(0,-1).every((is,os)=>is===Mn[os])?Fn[Fn.length-1]-Mn[Mn.length-1]:0}function matchRouteBranch(Fn,Mn,rs){let{routesMeta:is}=Fn,os={},as="/",us=[];for(let ds=0;ds<is.length;++ds){let hs=is[ds],ps=ds===is.length-1,io=as==="/"?Mn:Mn.slice(as.length)||"/",fo=matchPath({path:hs.relativePath,caseSensitive:hs.caseSensitive,end:ps},io),mo=hs.route;if(!fo&&ps&&rs&&!is[is.length-1].route.index&&(fo=matchPath({path:hs.relativePath,caseSensitive:hs.caseSensitive,end:!1},io)),!fo)return null;Object.assign(os,fo.params),us.push({params:os,pathname:joinPaths([as,fo.pathname]),pathnameBase:normalizePathname(joinPaths([as,fo.pathnameBase])),route:mo}),fo.pathnameBase!=="/"&&(as=joinPaths([as,fo.pathnameBase]))}return us}function matchPath(Fn,Mn){typeof Fn=="string"&&(Fn={path:Fn,caseSensitive:!1,end:!0});let[rs,is]=compilePath(Fn.path,Fn.caseSensitive,Fn.end),os=Mn.match(rs);if(!os)return null;let as=os[0],us=as.replace(/(.)\/+$/,"$1"),ds=os.slice(1);return{params:is.reduce((ps,io,fo)=>{let{paramName:mo,isOptional:Ao}=io;if(mo==="*"){let Lo=ds[fo]||"";us=as.slice(0,as.length-Lo.length).replace(/(.)\/+$/,"$1")}const $o=ds[fo];return Ao&&!$o?ps[mo]=void 0:ps[mo]=($o||"").replace(/%2F/g,"/"),ps},{}),pathname:as,pathnameBase:us,pattern:Fn}}function compilePath(Fn,Mn,rs){Mn===void 0&&(Mn=!1),rs===void 0&&(rs=!0),warning$3(Fn==="*"||!Fn.endsWith("*")||Fn.endsWith("/*"),'Route path "'+Fn+'" will be treated as if it were '+('"'+Fn.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+Fn.replace(/\*$/,"/*")+'".'));let is=[],os="^"+Fn.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(us,ds,hs)=>(is.push({paramName:ds,isOptional:hs!=null}),hs?"/?([^\\/]+)?":"/([^\\/]+)"));return Fn.endsWith("*")?(is.push({paramName:"*"}),os+=Fn==="*"||Fn==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):rs?os+="\\/*$":Fn!==""&&Fn!=="/"&&(os+="(?:(?=\\/|$))"),[new RegExp(os,Mn?void 0:"i"),is]}function decodePath(Fn){try{return Fn.split("/").map(Mn=>decodeURIComponent(Mn).replace(/\//g,"%2F")).join("/")}catch(Mn){return warning$3(!1,'The URL path "'+Fn+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+Mn+").")),Fn}}function stripBasename(Fn,Mn){if(Mn==="/")return Fn;if(!Fn.toLowerCase().startsWith(Mn.toLowerCase()))return null;let rs=Mn.endsWith("/")?Mn.length-1:Mn.length,is=Fn.charAt(rs);return is&&is!=="/"?null:Fn.slice(rs)||"/"}function resolvePath(Fn,Mn){Mn===void 0&&(Mn="/");let{pathname:rs,search:is="",hash:os=""}=typeof Fn=="string"?parsePath(Fn):Fn;return{pathname:rs?rs.startsWith("/")?rs:resolvePathname(rs,Mn):Mn,search:normalizeSearch(is),hash:normalizeHash(os)}}function resolvePathname(Fn,Mn){let rs=Mn.replace(/\/+$/,"").split("/");return Fn.split("/").forEach(os=>{os===".."?rs.length>1&&rs.pop():os!=="."&&rs.push(os)}),rs.length>1?rs.join("/"):"/"}function getInvalidPathError(Fn,Mn,rs,is){return"Cannot include a '"+Fn+"' character in a manually specified "+("`to."+Mn+"` field ["+JSON.stringify(is)+"].  Please separate it out to the ")+("`to."+rs+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function getPathContributingMatches(Fn){return Fn.filter((Mn,rs)=>rs===0||Mn.route.path&&Mn.route.path.length>0)}function getResolveToMatches(Fn,Mn){let rs=getPathContributingMatches(Fn);return Mn?rs.map((is,os)=>os===rs.length-1?is.pathname:is.pathnameBase):rs.map(is=>is.pathnameBase)}function resolveTo(Fn,Mn,rs,is){is===void 0&&(is=!1);let os;typeof Fn=="string"?os=parsePath(Fn):(os=_extends$7({},Fn),invariant(!os.pathname||!os.pathname.includes("?"),getInvalidPathError("?","pathname","search",os)),invariant(!os.pathname||!os.pathname.includes("#"),getInvalidPathError("#","pathname","hash",os)),invariant(!os.search||!os.search.includes("#"),getInvalidPathError("#","search","hash",os)));let as=Fn===""||os.pathname==="",us=as?"/":os.pathname,ds;if(us==null)ds=rs;else{let fo=Mn.length-1;if(!is&&us.startsWith("..")){let mo=us.split("/");for(;mo[0]==="..";)mo.shift(),fo-=1;os.pathname=mo.join("/")}ds=fo>=0?Mn[fo]:"/"}let hs=resolvePath(os,ds),ps=us&&us!=="/"&&us.endsWith("/"),io=(as||us===".")&&rs.endsWith("/");return!hs.pathname.endsWith("/")&&(ps||io)&&(hs.pathname+="/"),hs}const joinPaths=Fn=>Fn.join("/").replace(/\/\/+/g,"/"),normalizePathname=Fn=>Fn.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=Fn=>!Fn||Fn==="?"?"":Fn.startsWith("?")?Fn:"?"+Fn,normalizeHash=Fn=>!Fn||Fn==="#"?"":Fn.startsWith("#")?Fn:"#"+Fn;function isRouteErrorResponse(Fn){return Fn!=null&&typeof Fn.status=="number"&&typeof Fn.statusText=="string"&&typeof Fn.internal=="boolean"&&"data"in Fn}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/**
 * React Router v6.26.0
 *
 * 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 _extends$6(){return _extends$6=Object.assign?Object.assign.bind():function(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn];for(var is in rs)Object.prototype.hasOwnProperty.call(rs,is)&&(Fn[is]=rs[is])}return Fn},_extends$6.apply(this,arguments)}const DataRouterContext=reactExports.createContext(null),DataRouterStateContext=reactExports.createContext(null),NavigationContext=reactExports.createContext(null),LocationContext=reactExports.createContext(null),RouteContext=reactExports.createContext({outlet:null,matches:[],isDataRoute:!1}),RouteErrorContext=reactExports.createContext(null);function useHref(Fn,Mn){let{relative:rs}=Mn===void 0?{}:Mn;useInRouterContext()||invariant(!1);let{basename:is,navigator:os}=reactExports.useContext(NavigationContext),{hash:as,pathname:us,search:ds}=useResolvedPath(Fn,{relative:rs}),hs=us;return is!=="/"&&(hs=us==="/"?is:joinPaths([is,us])),os.createHref({pathname:hs,search:ds,hash:as})}function useInRouterContext(){return reactExports.useContext(LocationContext)!=null}function useLocation(){return useInRouterContext()||invariant(!1),reactExports.useContext(LocationContext).location}function useIsomorphicLayoutEffect$1(Fn){reactExports.useContext(NavigationContext).static||reactExports.useLayoutEffect(Fn)}function useNavigate(){let{isDataRoute:Fn}=reactExports.useContext(RouteContext);return Fn?useNavigateStable():useNavigateUnstable()}function useNavigateUnstable(){useInRouterContext()||invariant(!1);let Fn=reactExports.useContext(DataRouterContext),{basename:Mn,future:rs,navigator:is}=reactExports.useContext(NavigationContext),{matches:os}=reactExports.useContext(RouteContext),{pathname:as}=useLocation(),us=JSON.stringify(getResolveToMatches(os,rs.v7_relativeSplatPath)),ds=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>{ds.current=!0}),reactExports.useCallback(function(ps,io){if(io===void 0&&(io={}),!ds.current)return;if(typeof ps=="number"){is.go(ps);return}let fo=resolveTo(ps,JSON.parse(us),as,io.relative==="path");Fn==null&&Mn!=="/"&&(fo.pathname=fo.pathname==="/"?Mn:joinPaths([Mn,fo.pathname])),(io.replace?is.replace:is.push)(fo,io.state,io)},[Mn,is,us,as,Fn])}function useResolvedPath(Fn,Mn){let{relative:rs}=Mn===void 0?{}:Mn,{future:is}=reactExports.useContext(NavigationContext),{matches:os}=reactExports.useContext(RouteContext),{pathname:as}=useLocation(),us=JSON.stringify(getResolveToMatches(os,is.v7_relativeSplatPath));return reactExports.useMemo(()=>resolveTo(Fn,JSON.parse(us),as,rs==="path"),[Fn,us,as,rs])}function useRoutes(Fn,Mn){return useRoutesImpl(Fn,Mn)}function useRoutesImpl(Fn,Mn,rs,is){useInRouterContext()||invariant(!1);let{navigator:os}=reactExports.useContext(NavigationContext),{matches:as}=reactExports.useContext(RouteContext),us=as[as.length-1],ds=us?us.params:{};us&&us.pathname;let hs=us?us.pathnameBase:"/";us&&us.route;let ps=useLocation(),io;if(Mn){var fo;let Go=typeof Mn=="string"?parsePath(Mn):Mn;hs==="/"||(fo=Go.pathname)!=null&&fo.startsWith(hs)||invariant(!1),io=Go}else io=ps;let mo=io.pathname||"/",Ao=mo;if(hs!=="/"){let Go=hs.replace(/^\//,"").split("/");Ao="/"+mo.replace(/^\//,"").split("/").slice(Go.length).join("/")}let $o=matchRoutes(Fn,{pathname:Ao}),Lo=_renderMatches($o&&$o.map(Go=>Object.assign({},Go,{params:Object.assign({},ds,Go.params),pathname:joinPaths([hs,os.encodeLocation?os.encodeLocation(Go.pathname).pathname:Go.pathname]),pathnameBase:Go.pathnameBase==="/"?hs:joinPaths([hs,os.encodeLocation?os.encodeLocation(Go.pathnameBase).pathname:Go.pathnameBase])})),as,rs,is);return Mn&&Lo?reactExports.createElement(LocationContext.Provider,{value:{location:_extends$6({pathname:"/",search:"",hash:"",state:null,key:"default"},io),navigationType:Action.Pop}},Lo):Lo}function DefaultErrorComponent(){let Fn=useRouteError(),Mn=isRouteErrorResponse(Fn)?Fn.status+" "+Fn.statusText:Fn instanceof Error?Fn.message:JSON.stringify(Fn),rs=Fn instanceof Error?Fn.stack:null,os={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},Mn),rs?reactExports.createElement("pre",{style:os},rs):null,null)}const defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends reactExports.Component{constructor(Mn){super(Mn),this.state={location:Mn.location,revalidation:Mn.revalidation,error:Mn.error}}static getDerivedStateFromError(Mn){return{error:Mn}}static getDerivedStateFromProps(Mn,rs){return rs.location!==Mn.location||rs.revalidation!=="idle"&&Mn.revalidation==="idle"?{error:Mn.error,location:Mn.location,revalidation:Mn.revalidation}:{error:Mn.error!==void 0?Mn.error:rs.error,location:rs.location,revalidation:Mn.revalidation||rs.revalidation}}componentDidCatch(Mn,rs){console.error("React Router caught the following error during render",Mn,rs)}render(){return this.state.error!==void 0?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(Fn){let{routeContext:Mn,match:rs,children:is}=Fn,os=reactExports.useContext(DataRouterContext);return os&&os.static&&os.staticContext&&(rs.route.errorElement||rs.route.ErrorBoundary)&&(os.staticContext._deepestRenderedBoundaryId=rs.route.id),reactExports.createElement(RouteContext.Provider,{value:Mn},is)}function _renderMatches(Fn,Mn,rs,is){var os;if(Mn===void 0&&(Mn=[]),rs===void 0&&(rs=null),is===void 0&&(is=null),Fn==null){var as;if(!rs)return null;if(rs.errors)Fn=rs.matches;else if((as=is)!=null&&as.v7_partialHydration&&Mn.length===0&&!rs.initialized&&rs.matches.length>0)Fn=rs.matches;else return null}let us=Fn,ds=(os=rs)==null?void 0:os.errors;if(ds!=null){let io=us.findIndex(fo=>fo.route.id&&(ds==null?void 0:ds[fo.route.id])!==void 0);io>=0||invariant(!1),us=us.slice(0,Math.min(us.length,io+1))}let hs=!1,ps=-1;if(rs&&is&&is.v7_partialHydration)for(let io=0;io<us.length;io++){let fo=us[io];if((fo.route.HydrateFallback||fo.route.hydrateFallbackElement)&&(ps=io),fo.route.id){let{loaderData:mo,errors:Ao}=rs,$o=fo.route.loader&&mo[fo.route.id]===void 0&&(!Ao||Ao[fo.route.id]===void 0);if(fo.route.lazy||$o){hs=!0,ps>=0?us=us.slice(0,ps+1):us=[us[0]];break}}}return us.reduceRight((io,fo,mo)=>{let Ao,$o=!1,Lo=null,Go=null;rs&&(Ao=ds&&fo.route.id?ds[fo.route.id]:void 0,Lo=fo.route.errorElement||defaultErrorElement,hs&&(ps<0&&mo===0?($o=!0,Go=null):ps===mo&&($o=!0,Go=fo.route.hydrateFallbackElement||null)));let Yo=Mn.concat(us.slice(0,mo+1)),Wo=()=>{let Jo;return Ao?Jo=Lo:$o?Jo=Go:fo.route.Component?Jo=reactExports.createElement(fo.route.Component,null):fo.route.element?Jo=fo.route.element:Jo=io,reactExports.createElement(RenderedRoute,{match:fo,routeContext:{outlet:io,matches:Yo,isDataRoute:rs!=null},children:Jo})};return rs&&(fo.route.ErrorBoundary||fo.route.errorElement||mo===0)?reactExports.createElement(RenderErrorBoundary,{location:rs.location,revalidation:rs.revalidation,component:Lo,error:Ao,children:Wo(),routeContext:{outlet:null,matches:Yo,isDataRoute:!0}}):Wo()},null)}var DataRouterHook$1=function(Fn){return Fn.UseBlocker="useBlocker",Fn.UseRevalidator="useRevalidator",Fn.UseNavigateStable="useNavigate",Fn}(DataRouterHook$1||{}),DataRouterStateHook$1=function(Fn){return Fn.UseBlocker="useBlocker",Fn.UseLoaderData="useLoaderData",Fn.UseActionData="useActionData",Fn.UseRouteError="useRouteError",Fn.UseNavigation="useNavigation",Fn.UseRouteLoaderData="useRouteLoaderData",Fn.UseMatches="useMatches",Fn.UseRevalidator="useRevalidator",Fn.UseNavigateStable="useNavigate",Fn.UseRouteId="useRouteId",Fn}(DataRouterStateHook$1||{});function useDataRouterContext(Fn){let Mn=reactExports.useContext(DataRouterContext);return Mn||invariant(!1),Mn}function useDataRouterState(Fn){let Mn=reactExports.useContext(DataRouterStateContext);return Mn||invariant(!1),Mn}function useRouteContext(Fn){let Mn=reactExports.useContext(RouteContext);return Mn||invariant(!1),Mn}function useCurrentRouteId(Fn){let Mn=useRouteContext(),rs=Mn.matches[Mn.matches.length-1];return rs.route.id||invariant(!1),rs.route.id}function useRouteError(){var Fn;let Mn=reactExports.useContext(RouteErrorContext),rs=useDataRouterState(DataRouterStateHook$1.UseRouteError),is=useCurrentRouteId(DataRouterStateHook$1.UseRouteError);return Mn!==void 0?Mn:(Fn=rs.errors)==null?void 0:Fn[is]}function useNavigateStable(){let{router:Fn}=useDataRouterContext(DataRouterHook$1.UseNavigateStable),Mn=useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable),rs=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>{rs.current=!0}),reactExports.useCallback(function(os,as){as===void 0&&(as={}),rs.current&&(typeof os=="number"?Fn.navigate(os):Fn.navigate(os,_extends$6({fromRouteId:Mn},as)))},[Fn,Mn])}function Route(Fn){invariant(!1)}function Router(Fn){let{basename:Mn="/",children:rs=null,location:is,navigationType:os=Action.Pop,navigator:as,static:us=!1,future:ds}=Fn;useInRouterContext()&&invariant(!1);let hs=Mn.replace(/^\/*/,"/"),ps=reactExports.useMemo(()=>({basename:hs,navigator:as,static:us,future:_extends$6({v7_relativeSplatPath:!1},ds)}),[hs,ds,as,us]);typeof is=="string"&&(is=parsePath(is));let{pathname:io="/",search:fo="",hash:mo="",state:Ao=null,key:$o="default"}=is,Lo=reactExports.useMemo(()=>{let Go=stripBasename(io,hs);return Go==null?null:{location:{pathname:Go,search:fo,hash:mo,state:Ao,key:$o},navigationType:os}},[hs,io,fo,mo,Ao,$o,os]);return Lo==null?null:reactExports.createElement(NavigationContext.Provider,{value:ps},reactExports.createElement(LocationContext.Provider,{children:rs,value:Lo}))}function Routes(Fn){let{children:Mn,location:rs}=Fn;return useRoutes(createRoutesFromChildren(Mn),rs)}new Promise(()=>{});function createRoutesFromChildren(Fn,Mn){Mn===void 0&&(Mn=[]);let rs=[];return reactExports.Children.forEach(Fn,(is,os)=>{if(!reactExports.isValidElement(is))return;let as=[...Mn,os];if(is.type===reactExports.Fragment){rs.push.apply(rs,createRoutesFromChildren(is.props.children,as));return}is.type!==Route&&invariant(!1),!is.props.index||!is.props.children||invariant(!1);let us={id:is.props.id||as.join("-"),caseSensitive:is.props.caseSensitive,element:is.props.element,Component:is.props.Component,index:is.props.index,path:is.props.path,loader:is.props.loader,action:is.props.action,errorElement:is.props.errorElement,ErrorBoundary:is.props.ErrorBoundary,hasErrorBoundary:is.props.ErrorBoundary!=null||is.props.errorElement!=null,shouldRevalidate:is.props.shouldRevalidate,handle:is.props.handle,lazy:is.props.lazy};is.props.children&&(us.children=createRoutesFromChildren(is.props.children,as)),rs.push(us)}),rs}/**
 * React Router DOM v6.26.0
 *
 * 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 _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn];for(var is in rs)Object.prototype.hasOwnProperty.call(rs,is)&&(Fn[is]=rs[is])}return Fn},_extends$5.apply(this,arguments)}function _objectWithoutPropertiesLoose$3(Fn,Mn){if(Fn==null)return{};var rs={},is=Object.keys(Fn),os,as;for(as=0;as<is.length;as++)os=is[as],!(Mn.indexOf(os)>=0)&&(rs[os]=Fn[os]);return rs}function isModifiedEvent(Fn){return!!(Fn.metaKey||Fn.altKey||Fn.ctrlKey||Fn.shiftKey)}function shouldProcessLinkClick(Fn,Mn){return Fn.button===0&&(!Mn||Mn==="_self")&&!isModifiedEvent(Fn)}const _excluded$d=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],REACT_ROUTER_VERSION="6";try{window.__reactRouterVersion=REACT_ROUTER_VERSION}catch{}const START_TRANSITION="startTransition",startTransitionImpl=React$1[START_TRANSITION];function BrowserRouter(Fn){let{basename:Mn,children:rs,future:is,window:os}=Fn,as=reactExports.useRef();as.current==null&&(as.current=createBrowserHistory({window:os,v5Compat:!0}));let us=as.current,[ds,hs]=reactExports.useState({action:us.action,location:us.location}),{v7_startTransition:ps}=is||{},io=reactExports.useCallback(fo=>{ps&&startTransitionImpl?startTransitionImpl(()=>hs(fo)):hs(fo)},[hs,ps]);return reactExports.useLayoutEffect(()=>us.listen(io),[us,io]),reactExports.createElement(Router,{basename:Mn,children:rs,location:ds.location,navigationType:ds.action,navigator:us,future:is})}const isBrowser$2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ABSOLUTE_URL_REGEX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Link=reactExports.forwardRef(function(Mn,rs){let{onClick:is,relative:os,reloadDocument:as,replace:us,state:ds,target:hs,to:ps,preventScrollReset:io,unstable_viewTransition:fo}=Mn,mo=_objectWithoutPropertiesLoose$3(Mn,_excluded$d),{basename:Ao}=reactExports.useContext(NavigationContext),$o,Lo=!1;if(typeof ps=="string"&&ABSOLUTE_URL_REGEX.test(ps)&&($o=ps,isBrowser$2))try{let Jo=new URL(window.location.href),xl=ps.startsWith("//")?new URL(Jo.protocol+ps):new URL(ps),_l=stripBasename(xl.pathname,Ao);xl.origin===Jo.origin&&_l!=null?ps=_l+xl.search+xl.hash:Lo=!0}catch{}let Go=useHref(ps,{relative:os}),Yo=useLinkClickHandler(ps,{replace:us,state:ds,target:hs,preventScrollReset:io,relative:os,unstable_viewTransition:fo});function Wo(Jo){is&&is(Jo),Jo.defaultPrevented||Yo(Jo)}return reactExports.createElement("a",_extends$5({},mo,{href:$o||Go,onClick:Lo||as?is:Wo,ref:rs,target:hs}))});var DataRouterHook;(function(Fn){Fn.UseScrollRestoration="useScrollRestoration",Fn.UseSubmit="useSubmit",Fn.UseSubmitFetcher="useSubmitFetcher",Fn.UseFetcher="useFetcher",Fn.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(Fn){Fn.UseFetcher="useFetcher",Fn.UseFetchers="useFetchers",Fn.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function useLinkClickHandler(Fn,Mn){let{target:rs,replace:is,state:os,preventScrollReset:as,relative:us,unstable_viewTransition:ds}=Mn===void 0?{}:Mn,hs=useNavigate(),ps=useLocation(),io=useResolvedPath(Fn,{relative:us});return reactExports.useCallback(fo=>{if(shouldProcessLinkClick(fo,rs)){fo.preventDefault();let mo=is!==void 0?is:createPath(ps)===createPath(io);hs(Fn,{replace:mo,state:os,preventScrollReset:as,relative:us,unstable_viewTransition:ds})}},[ps,hs,io,is,os,rs,Fn,as,us,ds])}const EthosX="/assets/EthosX-BMFaAdwY.svg",Vectordown="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='M6%209L12%2015L18%209'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",defaultFallback="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='30'%20cy='30'%20r='30'%20fill='%23FFEEFF'/%3e%3cg%20clip-path='url(%23clip0)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M30.1074%2013.8438L20.1709%2030.2085L29.8027%2035.8745L30.1074%2036.0532L40.043%2030.2085L30.1074%2013.8438ZM29.5068%2034.3081L22.3135%2030.0762L29.5068%2026.9028V34.3081ZM22.5029%2028.6812L29.5068%2025.5908V17.1445L22.5029%2028.6812ZM30.707%2025.5908V17.1445L37.7119%2028.6812L30.707%2025.5908ZM30.707%2026.9028L37.9014%2030.0762L30.707%2034.3081V26.9028Z'%20fill='url(%23paint0_linear)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21.3047%2031.6255L20.5107%2032.4897L30.1074%2046.0381L39.7041%2032.4897L38.9102%2031.6255L30.1074%2036.8037L21.3047%2031.6255ZM23.1055%2034.0776L29.5068%2037.8433V43.1147L23.1055%2034.0776ZM30.707%2037.8433V43.1147L37.1084%2034.0776L30.707%2037.8433Z'%20fill='url(%23paint1_linear)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear'%20x1='20'%20y1='14'%20x2='40'%20y2='46'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFDC81'/%3e%3cstop%20offset='1'%20stop-color='%23FF67E7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear'%20x1='20'%20y1='14'%20x2='40'%20y2='46'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFDC81'/%3e%3cstop%20offset='1'%20stop-color='%23FF67E7'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0'%3e%3crect%20width='32'%20height='32'%20fill='white'%20transform='translate(14%2014)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",PerpsLight="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3e%3cpath%20d='M7.33333%201.99992H5.2C4.0799%201.99992%203.51984%201.99992%203.09202%202.21791C2.71569%202.40965%202.40973%202.71561%202.21799%203.09194C2%203.51976%202%204.07981%202%205.19992V10.7999C2%2011.92%202%2012.4801%202.21799%2012.9079C2.40973%2013.2842%202.71569%2013.5902%203.09202%2013.7819C3.51984%2013.9999%204.07989%2013.9999%205.2%2013.9999H10.8C11.9201%2013.9999%2012.4802%2013.9999%2012.908%2013.7819C13.2843%2013.5902%2013.5903%2013.2842%2013.782%2012.9079C14%2012.4801%2014%2011.92%2014%2010.7999V8.66659M8%205.33325H10.6667V7.99992M10.3333%202.33325V1.33325M12.9596%203.04036L13.6667%202.33325M13.6735%205.66659H14.6735M2%208.89799C2.43463%208.9651%202.87991%208.99992%203.33333%208.99992C6.25757%208.99992%208.84355%207.55165%2010.4131%205.33325'%20stroke='%23FFFFFF'%20stroke-width='1.33'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",PerpsDark="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3e%3cpath%20d='M7.33333%201.99992H5.2C4.0799%201.99992%203.51984%201.99992%203.09202%202.21791C2.71569%202.40965%202.40973%202.71561%202.21799%203.09194C2%203.51976%202%204.07981%202%205.19992V10.7999C2%2011.92%202%2012.4801%202.21799%2012.9079C2.40973%2013.2842%202.71569%2013.5902%203.09202%2013.7819C3.51984%2013.9999%204.07989%2013.9999%205.2%2013.9999H10.8C11.9201%2013.9999%2012.4802%2013.9999%2012.908%2013.7819C13.2843%2013.5902%2013.5903%2013.2842%2013.782%2012.9079C14%2012.4801%2014%2011.92%2014%2010.7999V8.66659M8%205.33325H10.6667V7.99992M10.3333%202.33325V1.33325M12.9596%203.04036L13.6667%202.33325M13.6735%205.66659H14.6735M2%208.89799C2.43463%208.9651%202.87991%208.99992%203.33333%208.99992C6.25757%208.99992%208.84355%207.55165%2010.4131%205.33325'%20stroke='%230C0C0D'%20stroke-width='1.33'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",MetaMask="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='212'%20height='189'%20viewBox='0%200%20212%20189'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpolygon%20fill='%23CDBDB2'%20points='60.75%20173.25%2088.313%20180.563%2088.313%20171%2090.563%20168.75%20106.313%20168.75%20106.313%20180%20106.313%20187.875%2089.438%20187.875%2068.625%20178.875'/%3e%3cpolygon%20fill='%23CDBDB2'%20points='105.75%20173.25%20132.75%20180.563%20132.75%20171%20135%20168.75%20150.75%20168.75%20150.75%20180%20150.75%20187.875%20133.875%20187.875%20113.063%20178.875'%20transform='matrix(-1%200%200%201%20256.5%200)'/%3e%3cpolygon%20fill='%23393939'%20points='90.563%20152.438%2088.313%20171%2091.125%20168.75%20120.375%20168.75%20123.75%20171%20121.5%20152.438%20117%20149.625%2094.5%20150.188'/%3e%3cpolygon%20fill='%23F89C35'%20points='75.375%2027%2088.875%2058.5%2095.063%20150.188%20117%20150.188%20123.75%2058.5%20136.125%2027'/%3e%3cpolygon%20fill='%23F89D35'%20points='16.313%2096.188%20.563%20141.75%2039.938%20139.5%2065.25%20139.5%2065.25%20119.813%2064.125%2079.313%2058.5%2083.813'/%3e%3cpolygon%20fill='%23D87C30'%20points='46.125%20101.25%2092.25%20102.375%2087.188%20126%2065.25%20120.375'/%3e%3cpolygon%20fill='%23EA8D3A'%20points='46.125%20101.813%2065.25%20119.813%2065.25%20137.813'/%3e%3cpolygon%20fill='%23F89D35'%20points='65.25%20120.375%2087.75%20126%2095.063%20150.188%2090%20153%2065.25%20138.375'/%3e%3cpolygon%20fill='%23EB8F35'%20points='65.25%20138.375%2060.75%20173.25%2090.563%20152.438'/%3e%3cpolygon%20fill='%23EA8E3A'%20points='92.25%20102.375%2095.063%20150.188%2086.625%20125.719'/%3e%3cpolygon%20fill='%23D87C30'%20points='39.375%20138.938%2065.25%20138.375%2060.75%20173.25'/%3e%3cpolygon%20fill='%23EB8F35'%20points='12.938%20188.438%2060.75%20173.25%2039.375%20138.938%20.563%20141.75'/%3e%3cpolygon%20fill='%23E8821E'%20points='88.875%2058.5%2064.688%2078.75%2046.125%20101.25%2092.25%20102.938'/%3e%3cpolygon%20fill='%23DFCEC3'%20points='60.75%20173.25%2090.563%20152.438%2088.313%20170.438%2088.313%20180.563%2068.063%20176.625'/%3e%3cpolygon%20fill='%23DFCEC3'%20points='121.5%20173.25%20150.75%20152.438%20148.5%20170.438%20148.5%20180.563%20128.25%20176.625'%20transform='matrix(-1%200%200%201%20272.25%200)'/%3e%3cpolygon%20fill='%23393939'%20points='70.313%20112.5%2064.125%20125.438%2086.063%20119.813'%20transform='matrix(-1%200%200%201%20150.188%200)'/%3e%3cpolygon%20fill='%23E88F35'%20points='12.375%20.563%2088.875%2058.5%2075.938%2027'/%3e%3cpath%20fill='%238E5A30'%20d='M12.3750002,0.562500008%20L2.25000003,31.5000005%20L7.87500012,65.250001%20L3.93750006,67.500001%20L9.56250014,72.5625%20L5.06250008,76.5000011%20L11.25,82.1250012%20L7.31250011,85.5000013%20L16.3125002,96.7500014%20L58.5000009,83.8125012%20C79.1250012,67.3125004%2089.2500013,58.8750003%2088.8750013,58.5000009%20C88.5000013,58.1250009%2063.0000009,38.8125006%2012.3750002,0.562500008%20Z'/%3e%3cg%20transform='matrix(-1%200%200%201%20211.5%200)'%3e%3cpolygon%20fill='%23F89D35'%20points='16.313%2096.188%20.563%20141.75%2039.938%20139.5%2065.25%20139.5%2065.25%20119.813%2064.125%2079.313%2058.5%2083.813'/%3e%3cpolygon%20fill='%23D87C30'%20points='46.125%20101.25%2092.25%20102.375%2087.188%20126%2065.25%20120.375'/%3e%3cpolygon%20fill='%23EA8D3A'%20points='46.125%20101.813%2065.25%20119.813%2065.25%20137.813'/%3e%3cpolygon%20fill='%23F89D35'%20points='65.25%20120.375%2087.75%20126%2095.063%20150.188%2090%20153%2065.25%20138.375'/%3e%3cpolygon%20fill='%23EB8F35'%20points='65.25%20138.375%2060.75%20173.25%2090%20153'/%3e%3cpolygon%20fill='%23EA8E3A'%20points='92.25%20102.375%2095.063%20150.188%2086.625%20125.719'/%3e%3cpolygon%20fill='%23D87C30'%20points='39.375%20138.938%2065.25%20138.375%2060.75%20173.25'/%3e%3cpolygon%20fill='%23EB8F35'%20points='12.938%20188.438%2060.75%20173.25%2039.375%20138.938%20.563%20141.75'/%3e%3cpolygon%20fill='%23E8821E'%20points='88.875%2058.5%2064.688%2078.75%2046.125%20101.25%2092.25%20102.938'/%3e%3cpolygon%20fill='%23393939'%20points='70.313%20112.5%2064.125%20125.438%2086.063%20119.813'%20transform='matrix(-1%200%200%201%20150.188%200)'/%3e%3cpolygon%20fill='%23E88F35'%20points='12.375%20.563%2088.875%2058.5%2075.938%2027'/%3e%3cpath%20fill='%238E5A30'%20d='M12.3750002,0.562500008%20L2.25000003,31.5000005%20L7.87500012,65.250001%20L3.93750006,67.500001%20L9.56250014,72.5625%20L5.06250008,76.5000011%20L11.25,82.1250012%20L7.31250011,85.5000013%20L16.3125002,96.7500014%20L58.5000009,83.8125012%20C79.1250012,67.3125004%2089.2500013,58.8750003%2088.8750013,58.5000009%20C88.5000013,58.1250009%2063.0000009,38.8125006%2012.3750002,0.562500008%20Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",walletConnect$1="/assets/walletconnect-DAR04Jhh.png",Copy="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='M19.1995%2019.1999V21.4398C19.1995%2022.3359%2019.1995%2022.7839%2019.0251%2023.1261C18.8717%2023.4272%2018.627%2023.6719%2018.3259%2023.8253C17.9836%2023.9997%2017.5355%2023.9997%2016.6394%2023.9997H10.5591C9.66302%2023.9997%209.21495%2023.9997%208.87268%2023.8253C8.57161%2023.6719%208.32683%2023.4272%208.17342%2023.1261C7.99902%2022.7839%207.99902%2022.3359%207.99902%2021.4398V15.3601C7.99902%2014.4641%207.99902%2014.0161%208.17342%2013.6738C8.32683%2013.3728%208.57161%2013.128%208.87268%2012.9746C9.21495%2012.8003%209.66302%2012.8003%2010.5591%2012.8003H12.7992M15.3594%2019.1999H21.4396C22.3358%2019.1999%2022.7838%2019.1999%2023.1261%2019.0256C23.4272%2018.8722%2023.672%2018.6274%2023.8254%2018.3264C23.9998%2017.9841%2023.9998%2017.5361%2023.9998%2016.6401V10.5604C23.9998%209.66432%2023.9998%209.2163%2023.8254%208.87406C23.672%208.57302%2023.4272%208.32826%2023.1261%208.17487C22.7838%208.00049%2022.3358%208.00049%2021.4396%208.00049H15.3594C14.4632%208.00049%2014.0152%208.00049%2013.6729%208.17487C13.3718%208.32826%2013.127%208.57302%2012.9736%208.87406C12.7992%209.2163%2012.7992%209.66432%2012.7992%2010.5604V16.6401C12.7992%2017.5361%2012.7992%2017.9841%2012.9736%2018.3264C13.127%2018.6274%2013.3718%2018.8722%2013.6729%2019.0256C14.0152%2019.1999%2014.4632%2019.1999%2015.3594%2019.1999Z'%20stroke='%232ED3B7'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Power="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='M7.99943%201.33325V7.99992M12.2394%204.42659C13.0783%205.26578%2013.6496%206.33488%2013.881%207.49871C14.1123%208.66254%2013.9934%209.86884%2013.5392%2010.9651C13.085%2012.0613%2012.316%2012.9983%2011.3293%2013.6575C10.3427%2014.3167%209.1827%2014.6685%207.9961%2014.6685C6.80949%2014.6685%205.64953%2014.3167%204.66288%2013.6575C3.67623%2012.9983%202.90719%2012.0613%202.45301%2010.9651C1.99882%209.86884%201.87989%208.66254%202.11124%207.49871C2.34259%206.33488%202.91384%205.26578%203.75276%204.42659'%20stroke='%23F04438'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";var classnames={exports:{}};/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/(function(Fn){(function(){var Mn={}.hasOwnProperty;function rs(){for(var as="",us=0;us<arguments.length;us++){var ds=arguments[us];ds&&(as=os(as,is(ds)))}return as}function is(as){if(typeof as=="string"||typeof as=="number")return as;if(typeof as!="object")return"";if(Array.isArray(as))return rs.apply(null,as);if(as.toString!==Object.prototype.toString&&!as.toString.toString().includes("[native code]"))return as.toString();var us="";for(var ds in as)Mn.call(as,ds)&&as[ds]&&(us=os(us,ds));return us}function os(as,us){return us?as?as+" "+us:as+us:as}Fn.exports?(rs.default=rs,Fn.exports=rs):window.classNames=rs})()})(classnames);var classnamesExports=classnames.exports;const classNames=getDefaultExportFromCjs(classnamesExports);function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn];for(var is in rs)({}).hasOwnProperty.call(rs,is)&&(Fn[is]=rs[is])}return Fn},_extends$4.apply(null,arguments)}var reactIs={exports:{}},reactIs_production_min$1={};/**
 * @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 b$5=Symbol.for("react.element"),c$a=Symbol.for("react.portal"),d$6=Symbol.for("react.fragment"),e$7=Symbol.for("react.strict_mode"),f$9=Symbol.for("react.profiler"),g$6=Symbol.for("react.provider"),h$c=Symbol.for("react.context"),k$6=Symbol.for("react.server_context"),l$8=Symbol.for("react.forward_ref"),m$4=Symbol.for("react.suspense"),n$d=Symbol.for("react.suspense_list"),p$8=Symbol.for("react.memo"),q$6=Symbol.for("react.lazy"),t$8=Symbol.for("react.offscreen"),u$6;u$6=Symbol.for("react.module.reference");function v$9(Fn){if(typeof Fn=="object"&&Fn!==null){var Mn=Fn.$$typeof;switch(Mn){case b$5:switch(Fn=Fn.type,Fn){case d$6:case f$9:case e$7:case m$4:case n$d:return Fn;default:switch(Fn=Fn&&Fn.$$typeof,Fn){case k$6:case h$c:case l$8:case q$6:case p$8:case g$6:return Fn;default:return Mn}}case c$a:return Mn}}}reactIs_production_min$1.ContextConsumer=h$c;reactIs_production_min$1.ContextProvider=g$6;reactIs_production_min$1.Element=b$5;reactIs_production_min$1.ForwardRef=l$8;reactIs_production_min$1.Fragment=d$6;reactIs_production_min$1.Lazy=q$6;reactIs_production_min$1.Memo=p$8;reactIs_production_min$1.Portal=c$a;reactIs_production_min$1.Profiler=f$9;reactIs_production_min$1.StrictMode=e$7;reactIs_production_min$1.Suspense=m$4;reactIs_production_min$1.SuspenseList=n$d;reactIs_production_min$1.isAsyncMode=function(){return!1};reactIs_production_min$1.isConcurrentMode=function(){return!1};reactIs_production_min$1.isContextConsumer=function(Fn){return v$9(Fn)===h$c};reactIs_production_min$1.isContextProvider=function(Fn){return v$9(Fn)===g$6};reactIs_production_min$1.isElement=function(Fn){return typeof Fn=="object"&&Fn!==null&&Fn.$$typeof===b$5};reactIs_production_min$1.isForwardRef=function(Fn){return v$9(Fn)===l$8};reactIs_production_min$1.isFragment=function(Fn){return v$9(Fn)===d$6};reactIs_production_min$1.isLazy=function(Fn){return v$9(Fn)===q$6};reactIs_production_min$1.isMemo=function(Fn){return v$9(Fn)===p$8};reactIs_production_min$1.isPortal=function(Fn){return v$9(Fn)===c$a};reactIs_production_min$1.isProfiler=function(Fn){return v$9(Fn)===f$9};reactIs_production_min$1.isStrictMode=function(Fn){return v$9(Fn)===e$7};reactIs_production_min$1.isSuspense=function(Fn){return v$9(Fn)===m$4};reactIs_production_min$1.isSuspenseList=function(Fn){return v$9(Fn)===n$d};reactIs_production_min$1.isValidElementType=function(Fn){return typeof Fn=="string"||typeof Fn=="function"||Fn===d$6||Fn===f$9||Fn===e$7||Fn===m$4||Fn===n$d||Fn===t$8||typeof Fn=="object"&&Fn!==null&&(Fn.$$typeof===q$6||Fn.$$typeof===p$8||Fn.$$typeof===g$6||Fn.$$typeof===h$c||Fn.$$typeof===l$8||Fn.$$typeof===u$6||Fn.getModuleId!==void 0)};reactIs_production_min$1.typeOf=v$9;reactIs.exports=reactIs_production_min$1;var reactIsExports=reactIs.exports;function toArray$5(Fn){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rs=[];return React.Children.forEach(Fn,function(is){is==null&&!Mn.keepEmpty||(Array.isArray(is)?rs=rs.concat(toArray$5(is)):reactIsExports.isFragment(is)&&is.props?rs=rs.concat(toArray$5(is.props.children,Mn)):rs.push(is))}),rs}var warned={},preMessage=function(Mn){};function warning$2(Fn,Mn){}function note(Fn,Mn){}function resetWarned(){warned={}}function call$1(Fn,Mn,rs){!Mn&&!warned[rs]&&(Fn(!1,rs),warned[rs]=!0)}function warningOnce(Fn,Mn){call$1(warning$2,Fn,Mn)}function noteOnce(Fn,Mn){call$1(note,Fn,Mn)}warningOnce.preMessage=preMessage;warningOnce.resetWarned=resetWarned;warningOnce.noteOnce=noteOnce;function _typeof$4(Fn){"@babel/helpers - typeof";return _typeof$4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Mn){return typeof Mn}:function(Mn){return Mn&&typeof Symbol=="function"&&Mn.constructor===Symbol&&Mn!==Symbol.prototype?"symbol":typeof Mn},_typeof$4(Fn)}function toPrimitive(Fn,Mn){if(_typeof$4(Fn)!="object"||!Fn)return Fn;var rs=Fn[Symbol.toPrimitive];if(rs!==void 0){var is=rs.call(Fn,Mn||"default");if(_typeof$4(is)!="object")return is;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Mn==="string"?String:Number)(Fn)}function toPropertyKey(Fn){var Mn=toPrimitive(Fn,"string");return _typeof$4(Mn)=="symbol"?Mn:Mn+""}function _defineProperty$5(Fn,Mn,rs){return(Mn=toPropertyKey(Mn))in Fn?Object.defineProperty(Fn,Mn,{value:rs,enumerable:!0,configurable:!0,writable:!0}):Fn[Mn]=rs,Fn}function ownKeys$5(Fn,Mn){var rs=Object.keys(Fn);if(Object.getOwnPropertySymbols){var is=Object.getOwnPropertySymbols(Fn);Mn&&(is=is.filter(function(os){return Object.getOwnPropertyDescriptor(Fn,os).enumerable})),rs.push.apply(rs,is)}return rs}function _objectSpread2(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn]!=null?arguments[Mn]:{};Mn%2?ownKeys$5(Object(rs),!0).forEach(function(is){_defineProperty$5(Fn,is,rs[is])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Fn,Object.getOwnPropertyDescriptors(rs)):ownKeys$5(Object(rs)).forEach(function(is){Object.defineProperty(Fn,is,Object.getOwnPropertyDescriptor(rs,is))})}return Fn}function isDOM(Fn){return Fn instanceof HTMLElement||Fn instanceof SVGElement}function getDOM(Fn){return Fn&&_typeof$4(Fn)==="object"&&isDOM(Fn.nativeElement)?Fn.nativeElement:isDOM(Fn)?Fn:null}function findDOMNode(Fn){var Mn=getDOM(Fn);if(Mn)return Mn;if(Fn instanceof React.Component){var rs;return(rs=ReactDOM.findDOMNode)===null||rs===void 0?void 0:rs.call(ReactDOM,Fn)}return null}function useMemo(Fn,Mn,rs){var is=reactExports.useRef({});return(!("value"in is.current)||rs(is.current.condition,Mn))&&(is.current.value=Fn(),is.current.condition=Mn),is.current.value}var fillRef=function(Mn,rs){typeof Mn=="function"?Mn(rs):_typeof$4(Mn)==="object"&&Mn&&"current"in Mn&&(Mn.current=rs)},composeRef=function(){for(var Mn=arguments.length,rs=new Array(Mn),is=0;is<Mn;is++)rs[is]=arguments[is];var os=rs.filter(Boolean);return os.length<=1?os[0]:function(as){rs.forEach(function(us){fillRef(us,as)})}},useComposeRef=function(){for(var Mn=arguments.length,rs=new Array(Mn),is=0;is<Mn;is++)rs[is]=arguments[is];return useMemo(function(){return composeRef.apply(void 0,rs)},rs,function(os,as){return os.length!==as.length||os.every(function(us,ds){return us!==as[ds]})})},supportRef=function(Mn){var rs,is,os=reactIsExports.isMemo(Mn)?Mn.type.type:Mn.type;return!(typeof os=="function"&&!((rs=os.prototype)!==null&&rs!==void 0&&rs.render)&&os.$$typeof!==reactIsExports.ForwardRef||typeof Mn=="function"&&!((is=Mn.prototype)!==null&&is!==void 0&&is.render)&&Mn.$$typeof!==reactIsExports.ForwardRef)};function isReactElement$1(Fn){return reactExports.isValidElement(Fn)&&!reactIsExports.isFragment(Fn)}Number(reactExports.version.split(".")[0])>=19;var CollectionContext=reactExports.createContext(null);function Collection(Fn){var Mn=Fn.children,rs=Fn.onBatchResize,is=reactExports.useRef(0),os=reactExports.useRef([]),as=reactExports.useContext(CollectionContext),us=reactExports.useCallback(function(ds,hs,ps){is.current+=1;var io=is.current;os.current.push({size:ds,element:hs,data:ps}),Promise.resolve().then(function(){io===is.current&&(rs==null||rs(os.current),os.current=[])}),as==null||as(ds,hs,ps)},[rs,as]);return reactExports.createElement(CollectionContext.Provider,{value:us},Mn)}const global$2=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{};var MapShim=function(){if(typeof Map<"u")return Map;function Fn(Mn,rs){var is=-1;return Mn.some(function(os,as){return os[0]===rs?(is=as,!0):!1}),is}return function(){function Mn(){this.__entries__=[]}return Object.defineProperty(Mn.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),Mn.prototype.get=function(rs){var is=Fn(this.__entries__,rs),os=this.__entries__[is];return os&&os[1]},Mn.prototype.set=function(rs,is){var os=Fn(this.__entries__,rs);~os?this.__entries__[os][1]=is:this.__entries__.push([rs,is])},Mn.prototype.delete=function(rs){var is=this.__entries__,os=Fn(is,rs);~os&&is.splice(os,1)},Mn.prototype.has=function(rs){return!!~Fn(this.__entries__,rs)},Mn.prototype.clear=function(){this.__entries__.splice(0)},Mn.prototype.forEach=function(rs,is){is===void 0&&(is=null);for(var os=0,as=this.__entries__;os<as.length;os++){var us=as[os];rs.call(is,us[1],us[0])}},Mn}()}(),isBrowser$1=typeof window<"u"&&typeof document<"u"&&window.document===document,global$1=function(){return typeof global$2<"u"&&global$2.Math===Math?global$2:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),requestAnimationFrame$1=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(global$1):function(Fn){return setTimeout(function(){return Fn(Date.now())},1e3/60)}}(),trailingTimeout=2;function throttle$1(Fn,Mn){var rs=!1,is=!1,os=0;function as(){rs&&(rs=!1,Fn()),is&&ds()}function us(){requestAnimationFrame$1(as)}function ds(){var hs=Date.now();if(rs){if(hs-os<trailingTimeout)return;is=!0}else rs=!0,is=!1,setTimeout(us,Mn);os=hs}return ds}var REFRESH_DELAY=20,transitionKeys=["top","right","bottom","left","width","height","size","weight"],mutationObserverSupported=typeof MutationObserver<"u",ResizeObserverController=function(){function Fn(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=throttle$1(this.refresh.bind(this),REFRESH_DELAY)}return Fn.prototype.addObserver=function(Mn){~this.observers_.indexOf(Mn)||this.observers_.push(Mn),this.connected_||this.connect_()},Fn.prototype.removeObserver=function(Mn){var rs=this.observers_,is=rs.indexOf(Mn);~is&&rs.splice(is,1),!rs.length&&this.connected_&&this.disconnect_()},Fn.prototype.refresh=function(){var Mn=this.updateObservers_();Mn&&this.refresh()},Fn.prototype.updateObservers_=function(){var Mn=this.observers_.filter(function(rs){return rs.gatherActive(),rs.hasActive()});return Mn.forEach(function(rs){return rs.broadcastActive()}),Mn.length>0},Fn.prototype.connect_=function(){!isBrowser$1||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},Fn.prototype.disconnect_=function(){!isBrowser$1||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},Fn.prototype.onTransitionEnd_=function(Mn){var rs=Mn.propertyName,is=rs===void 0?"":rs,os=transitionKeys.some(function(as){return!!~is.indexOf(as)});os&&this.refresh()},Fn.getInstance=function(){return this.instance_||(this.instance_=new Fn),this.instance_},Fn.instance_=null,Fn}(),defineConfigurable=function(Fn,Mn){for(var rs=0,is=Object.keys(Mn);rs<is.length;rs++){var os=is[rs];Object.defineProperty(Fn,os,{value:Mn[os],enumerable:!1,writable:!1,configurable:!0})}return Fn},getWindowOf=function(Fn){var Mn=Fn&&Fn.ownerDocument&&Fn.ownerDocument.defaultView;return Mn||global$1},emptyRect=createRectInit(0,0,0,0);function toFloat(Fn){return parseFloat(Fn)||0}function getBordersSize(Fn){for(var Mn=[],rs=1;rs<arguments.length;rs++)Mn[rs-1]=arguments[rs];return Mn.reduce(function(is,os){var as=Fn["border-"+os+"-width"];return is+toFloat(as)},0)}function getPaddings(Fn){for(var Mn=["top","right","bottom","left"],rs={},is=0,os=Mn;is<os.length;is++){var as=os[is],us=Fn["padding-"+as];rs[as]=toFloat(us)}return rs}function getSVGContentRect(Fn){var Mn=Fn.getBBox();return createRectInit(0,0,Mn.width,Mn.height)}function getHTMLElementContentRect(Fn){var Mn=Fn.clientWidth,rs=Fn.clientHeight;if(!Mn&&!rs)return emptyRect;var is=getWindowOf(Fn).getComputedStyle(Fn),os=getPaddings(is),as=os.left+os.right,us=os.top+os.bottom,ds=toFloat(is.width),hs=toFloat(is.height);if(is.boxSizing==="border-box"&&(Math.round(ds+as)!==Mn&&(ds-=getBordersSize(is,"left","right")+as),Math.round(hs+us)!==rs&&(hs-=getBordersSize(is,"top","bottom")+us)),!isDocumentElement(Fn)){var ps=Math.round(ds+as)-Mn,io=Math.round(hs+us)-rs;Math.abs(ps)!==1&&(ds-=ps),Math.abs(io)!==1&&(hs-=io)}return createRectInit(os.left,os.top,ds,hs)}var isSVGGraphicsElement=function(){return typeof SVGGraphicsElement<"u"?function(Fn){return Fn instanceof getWindowOf(Fn).SVGGraphicsElement}:function(Fn){return Fn instanceof getWindowOf(Fn).SVGElement&&typeof Fn.getBBox=="function"}}();function isDocumentElement(Fn){return Fn===getWindowOf(Fn).document.documentElement}function getContentRect(Fn){return isBrowser$1?isSVGGraphicsElement(Fn)?getSVGContentRect(Fn):getHTMLElementContentRect(Fn):emptyRect}function createReadOnlyRect(Fn){var Mn=Fn.x,rs=Fn.y,is=Fn.width,os=Fn.height,as=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,us=Object.create(as.prototype);return defineConfigurable(us,{x:Mn,y:rs,width:is,height:os,top:rs,right:Mn+is,bottom:os+rs,left:Mn}),us}function createRectInit(Fn,Mn,rs,is){return{x:Fn,y:Mn,width:rs,height:is}}var ResizeObservation=function(){function Fn(Mn){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=createRectInit(0,0,0,0),this.target=Mn}return Fn.prototype.isActive=function(){var Mn=getContentRect(this.target);return this.contentRect_=Mn,Mn.width!==this.broadcastWidth||Mn.height!==this.broadcastHeight},Fn.prototype.broadcastRect=function(){var Mn=this.contentRect_;return this.broadcastWidth=Mn.width,this.broadcastHeight=Mn.height,Mn},Fn}(),ResizeObserverEntry=function(){function Fn(Mn,rs){var is=createReadOnlyRect(rs);defineConfigurable(this,{target:Mn,contentRect:is})}return Fn}(),ResizeObserverSPI=function(){function Fn(Mn,rs,is){if(this.activeObservations_=[],this.observations_=new MapShim,typeof Mn!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=Mn,this.controller_=rs,this.callbackCtx_=is}return Fn.prototype.observe=function(Mn){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(Mn instanceof getWindowOf(Mn).Element))throw new TypeError('parameter 1 is not of type "Element".');var rs=this.observations_;rs.has(Mn)||(rs.set(Mn,new ResizeObservation(Mn)),this.controller_.addObserver(this),this.controller_.refresh())}},Fn.prototype.unobserve=function(Mn){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(Mn instanceof getWindowOf(Mn).Element))throw new TypeError('parameter 1 is not of type "Element".');var rs=this.observations_;rs.has(Mn)&&(rs.delete(Mn),rs.size||this.controller_.removeObserver(this))}},Fn.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},Fn.prototype.gatherActive=function(){var Mn=this;this.clearActive(),this.observations_.forEach(function(rs){rs.isActive()&&Mn.activeObservations_.push(rs)})},Fn.prototype.broadcastActive=function(){if(this.hasActive()){var Mn=this.callbackCtx_,rs=this.activeObservations_.map(function(is){return new ResizeObserverEntry(is.target,is.broadcastRect())});this.callback_.call(Mn,rs,Mn),this.clearActive()}},Fn.prototype.clearActive=function(){this.activeObservations_.splice(0)},Fn.prototype.hasActive=function(){return this.activeObservations_.length>0},Fn}(),observers=typeof WeakMap<"u"?new WeakMap:new MapShim,ResizeObserver$2=function(){function Fn(Mn){if(!(this instanceof Fn))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var rs=ResizeObserverController.getInstance(),is=new ResizeObserverSPI(Mn,rs,this);observers.set(this,is)}return Fn}();["observe","unobserve","disconnect"].forEach(function(Fn){ResizeObserver$2.prototype[Fn]=function(){var Mn;return(Mn=observers.get(this))[Fn].apply(Mn,arguments)}});var index$2=function(){return typeof global$1.ResizeObserver<"u"?global$1.ResizeObserver:ResizeObserver$2}();const ResizeObserver_es=Object.freeze(Object.defineProperty({__proto__:null,default:index$2},Symbol.toStringTag,{value:"Module"}));var elementListeners=new Map;function onResize(Fn){Fn.forEach(function(Mn){var rs,is=Mn.target;(rs=elementListeners.get(is))===null||rs===void 0||rs.forEach(function(os){return os(is)})})}var resizeObserver=new index$2(onResize);function observe$1(Fn,Mn){elementListeners.has(Fn)||(elementListeners.set(Fn,new Set),resizeObserver.observe(Fn)),elementListeners.get(Fn).add(Mn)}function unobserve(Fn,Mn){elementListeners.has(Fn)&&(elementListeners.get(Fn).delete(Mn),elementListeners.get(Fn).size||(resizeObserver.unobserve(Fn),elementListeners.delete(Fn)))}function _classCallCheck$4(Fn,Mn){if(!(Fn instanceof Mn))throw new TypeError("Cannot call a class as a function")}function _defineProperties$4(Fn,Mn){for(var rs=0;rs<Mn.length;rs++){var is=Mn[rs];is.enumerable=is.enumerable||!1,is.configurable=!0,"value"in is&&(is.writable=!0),Object.defineProperty(Fn,toPropertyKey(is.key),is)}}function _createClass$4(Fn,Mn,rs){return Mn&&_defineProperties$4(Fn.prototype,Mn),rs&&_defineProperties$4(Fn,rs),Object.defineProperty(Fn,"prototype",{writable:!1}),Fn}function _setPrototypeOf$4(Fn,Mn){return _setPrototypeOf$4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rs,is){return rs.__proto__=is,rs},_setPrototypeOf$4(Fn,Mn)}function _inherits$4(Fn,Mn){if(typeof Mn!="function"&&Mn!==null)throw new TypeError("Super expression must either be null or a function");Fn.prototype=Object.create(Mn&&Mn.prototype,{constructor:{value:Fn,writable:!0,configurable:!0}}),Object.defineProperty(Fn,"prototype",{writable:!1}),Mn&&_setPrototypeOf$4(Fn,Mn)}function _getPrototypeOf$4(Fn){return _getPrototypeOf$4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Mn){return Mn.__proto__||Object.getPrototypeOf(Mn)},_getPrototypeOf$4(Fn)}function _isNativeReflectConstruct$4(){try{var Fn=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$4=function(){return!!Fn})()}function _assertThisInitialized$4(Fn){if(Fn===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Fn}function _possibleConstructorReturn$4(Fn,Mn){if(Mn&&(_typeof$4(Mn)=="object"||typeof Mn=="function"))return Mn;if(Mn!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$4(Fn)}function _createSuper$4(Fn){var Mn=_isNativeReflectConstruct$4();return function(){var rs,is=_getPrototypeOf$4(Fn);if(Mn){var os=_getPrototypeOf$4(this).constructor;rs=Reflect.construct(is,arguments,os)}else rs=is.apply(this,arguments);return _possibleConstructorReturn$4(this,rs)}}var DomWrapper$1=function(Fn){_inherits$4(rs,Fn);var Mn=_createSuper$4(rs);function rs(){return _classCallCheck$4(this,rs),Mn.apply(this,arguments)}return _createClass$4(rs,[{key:"render",value:function(){return this.props.children}}]),rs}(reactExports.Component);function SingleObserver(Fn,Mn){var rs=Fn.children,is=Fn.disabled,os=reactExports.useRef(null),as=reactExports.useRef(null),us=reactExports.useContext(CollectionContext),ds=typeof rs=="function",hs=ds?rs(os):rs,ps=reactExports.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),io=!ds&&reactExports.isValidElement(hs)&&supportRef(hs),fo=io?hs.ref:null,mo=useComposeRef(fo,os),Ao=function(){var Yo;return findDOMNode(os.current)||(os.current&&_typeof$4(os.current)==="object"?findDOMNode((Yo=os.current)===null||Yo===void 0?void 0:Yo.nativeElement):null)||findDOMNode(as.current)};reactExports.useImperativeHandle(Mn,function(){return Ao()});var $o=reactExports.useRef(Fn);$o.current=Fn;var Lo=reactExports.useCallback(function(Go){var Yo=$o.current,Wo=Yo.onResize,Jo=Yo.data,xl=Go.getBoundingClientRect(),_l=xl.width,Tl=xl.height,Sl=Go.offsetWidth,$l=Go.offsetHeight,Pl=Math.floor(_l),Dl=Math.floor(Tl);if(ps.current.width!==Pl||ps.current.height!==Dl||ps.current.offsetWidth!==Sl||ps.current.offsetHeight!==$l){var Ol={width:Pl,height:Dl,offsetWidth:Sl,offsetHeight:$l};ps.current=Ol;var Rl=Sl===Math.round(_l)?_l:Sl,Vo=$l===Math.round(Tl)?Tl:$l,jo=_objectSpread2(_objectSpread2({},Ol),{},{offsetWidth:Rl,offsetHeight:Vo});us==null||us(jo,Go,Jo),Wo&&Promise.resolve().then(function(){Wo(jo,Go)})}},[]);return reactExports.useEffect(function(){var Go=Ao();return Go&&!is&&observe$1(Go,Lo),function(){return unobserve(Go,Lo)}},[os.current,is]),reactExports.createElement(DomWrapper$1,{ref:as},io?reactExports.cloneElement(hs,{ref:mo}):hs)}var RefSingleObserver=reactExports.forwardRef(SingleObserver),INTERNAL_PREFIX_KEY="rc-observer-key";function ResizeObserver$1(Fn,Mn){var rs=Fn.children,is=typeof rs=="function"?[rs]:toArray$5(rs);return is.map(function(os,as){var us=(os==null?void 0:os.key)||"".concat(INTERNAL_PREFIX_KEY,"-").concat(as);return reactExports.createElement(RefSingleObserver,_extends$4({},Fn,{key:us,ref:as===0?Mn:void 0}),os)})}var RefResizeObserver=reactExports.forwardRef(ResizeObserver$1);RefResizeObserver.Collection=Collection;function omit$1(Fn,Mn){var rs=Object.assign({},Fn);return Array.isArray(Mn)&&Mn.forEach(function(is){delete rs[is]}),rs}function _arrayLikeToArray(Fn,Mn){(Mn==null||Mn>Fn.length)&&(Mn=Fn.length);for(var rs=0,is=Array(Mn);rs<Mn;rs++)is[rs]=Fn[rs];return is}function _arrayWithoutHoles(Fn){if(Array.isArray(Fn))return _arrayLikeToArray(Fn)}function _iterableToArray(Fn){if(typeof Symbol<"u"&&Fn[Symbol.iterator]!=null||Fn["@@iterator"]!=null)return Array.from(Fn)}function _unsupportedIterableToArray(Fn,Mn){if(Fn){if(typeof Fn=="string")return _arrayLikeToArray(Fn,Mn);var rs={}.toString.call(Fn).slice(8,-1);return rs==="Object"&&Fn.constructor&&(rs=Fn.constructor.name),rs==="Map"||rs==="Set"?Array.from(Fn):rs==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(rs)?_arrayLikeToArray(Fn,Mn):void 0}}function _nonIterableSpread(){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 _toConsumableArray(Fn){return _arrayWithoutHoles(Fn)||_iterableToArray(Fn)||_unsupportedIterableToArray(Fn)||_nonIterableSpread()}var raf=function(Mn){return+setTimeout(Mn,16)},caf=function(Mn){return clearTimeout(Mn)};typeof window<"u"&&"requestAnimationFrame"in window&&(raf=function(Mn){return window.requestAnimationFrame(Mn)},caf=function(Mn){return window.cancelAnimationFrame(Mn)});var rafUUID=0,rafIds=new Map;function cleanup(Fn){rafIds.delete(Fn)}var wrapperRaf=function(Mn){var rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;rafUUID+=1;var is=rafUUID;function os(as){if(as===0)cleanup(is),Mn();else{var us=raf(function(){os(as-1)});rafIds.set(is,us)}}return os(rs),is};wrapperRaf.cancel=function(Fn){var Mn=rafIds.get(Fn);return cleanup(Fn),caf(Mn)};function _arrayWithHoles(Fn){if(Array.isArray(Fn))return Fn}function _iterableToArrayLimit(Fn,Mn){var rs=Fn==null?null:typeof Symbol<"u"&&Fn[Symbol.iterator]||Fn["@@iterator"];if(rs!=null){var is,os,as,us,ds=[],hs=!0,ps=!1;try{if(as=(rs=rs.call(Fn)).next,Mn===0){if(Object(rs)!==rs)return;hs=!1}else for(;!(hs=(is=as.call(rs)).done)&&(ds.push(is.value),ds.length!==Mn);hs=!0);}catch(io){ps=!0,os=io}finally{try{if(!hs&&rs.return!=null&&(us=rs.return(),Object(us)!==us))return}finally{if(ps)throw os}}return ds}}function _nonIterableRest(){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 _slicedToArray(Fn,Mn){return _arrayWithHoles(Fn)||_iterableToArrayLimit(Fn,Mn)||_unsupportedIterableToArray(Fn,Mn)||_nonIterableRest()}function murmur2(Fn){for(var Mn=0,rs,is=0,os=Fn.length;os>=4;++is,os-=4)rs=Fn.charCodeAt(is)&255|(Fn.charCodeAt(++is)&255)<<8|(Fn.charCodeAt(++is)&255)<<16|(Fn.charCodeAt(++is)&255)<<24,rs=(rs&65535)*1540483477+((rs>>>16)*59797<<16),rs^=rs>>>24,Mn=(rs&65535)*1540483477+((rs>>>16)*59797<<16)^(Mn&65535)*1540483477+((Mn>>>16)*59797<<16);switch(os){case 3:Mn^=(Fn.charCodeAt(is+2)&255)<<16;case 2:Mn^=(Fn.charCodeAt(is+1)&255)<<8;case 1:Mn^=Fn.charCodeAt(is)&255,Mn=(Mn&65535)*1540483477+((Mn>>>16)*59797<<16)}return Mn^=Mn>>>13,Mn=(Mn&65535)*1540483477+((Mn>>>16)*59797<<16),((Mn^Mn>>>15)>>>0).toString(36)}function canUseDom(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function contains(Fn,Mn){if(!Fn)return!1;if(Fn.contains)return Fn.contains(Mn);for(var rs=Mn;rs;){if(rs===Fn)return!0;rs=rs.parentNode}return!1}var APPEND_ORDER="data-rc-order",APPEND_PRIORITY="data-rc-priority",MARK_KEY="rc-util-key",containerCache=new Map;function getMark(){var Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mn=Fn.mark;return Mn?Mn.startsWith("data-")?Mn:"data-".concat(Mn):MARK_KEY}function getContainer(Fn){if(Fn.attachTo)return Fn.attachTo;var Mn=document.querySelector("head");return Mn||document.body}function getOrder(Fn){return Fn==="queue"?"prependQueue":Fn?"prepend":"append"}function findStyles(Fn){return Array.from((containerCache.get(Fn)||Fn).children).filter(function(Mn){return Mn.tagName==="STYLE"})}function injectCSS(Fn){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!canUseDom())return null;var rs=Mn.csp,is=Mn.prepend,os=Mn.priority,as=os===void 0?0:os,us=getOrder(is),ds=us==="prependQueue",hs=document.createElement("style");hs.setAttribute(APPEND_ORDER,us),ds&&as&&hs.setAttribute(APPEND_PRIORITY,"".concat(as)),rs!=null&&rs.nonce&&(hs.nonce=rs==null?void 0:rs.nonce),hs.innerHTML=Fn;var ps=getContainer(Mn),io=ps.firstChild;if(is){if(ds){var fo=(Mn.styles||findStyles(ps)).filter(function(mo){if(!["prepend","prependQueue"].includes(mo.getAttribute(APPEND_ORDER)))return!1;var Ao=Number(mo.getAttribute(APPEND_PRIORITY)||0);return as>=Ao});if(fo.length)return ps.insertBefore(hs,fo[fo.length-1].nextSibling),hs}ps.insertBefore(hs,io)}else ps.appendChild(hs);return hs}function findExistNode(Fn){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rs=getContainer(Mn);return(Mn.styles||findStyles(rs)).find(function(is){return is.getAttribute(getMark(Mn))===Fn})}function removeCSS(Fn){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rs=findExistNode(Fn,Mn);if(rs){var is=getContainer(Mn);is.removeChild(rs)}}function syncRealContainer(Fn,Mn){var rs=containerCache.get(Fn);if(!rs||!contains(document,rs)){var is=injectCSS("",Mn),os=is.parentNode;containerCache.set(Fn,os),Fn.removeChild(is)}}function updateCSS(Fn,Mn){var rs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},is=getContainer(rs),os=findStyles(is),as=_objectSpread2(_objectSpread2({},rs),{},{styles:os});syncRealContainer(is,as);var us=findExistNode(Mn,as);if(us){var ds,hs;if((ds=as.csp)!==null&&ds!==void 0&&ds.nonce&&us.nonce!==((hs=as.csp)===null||hs===void 0?void 0:hs.nonce)){var ps;us.nonce=(ps=as.csp)===null||ps===void 0?void 0:ps.nonce}return us.innerHTML!==Fn&&(us.innerHTML=Fn),us}var io=injectCSS(Fn,as);return io.setAttribute(getMark(as),Mn),io}function _objectWithoutPropertiesLoose$2(Fn,Mn){if(Fn==null)return{};var rs={};for(var is in Fn)if({}.hasOwnProperty.call(Fn,is)){if(Mn.includes(is))continue;rs[is]=Fn[is]}return rs}function _objectWithoutProperties$1(Fn,Mn){if(Fn==null)return{};var rs,is,os=_objectWithoutPropertiesLoose$2(Fn,Mn);if(Object.getOwnPropertySymbols){var as=Object.getOwnPropertySymbols(Fn);for(is=0;is<as.length;is++)rs=as[is],Mn.includes(rs)||{}.propertyIsEnumerable.call(Fn,rs)&&(os[rs]=Fn[rs])}return os}function isEqual$1(Fn,Mn){var rs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,is=new Set;function os(as,us){var ds=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,hs=is.has(as);if(warningOnce(!hs,"Warning: There may be circular references"),hs)return!1;if(as===us)return!0;if(rs&&ds>1)return!1;is.add(as);var ps=ds+1;if(Array.isArray(as)){if(!Array.isArray(us)||as.length!==us.length)return!1;for(var io=0;io<as.length;io++)if(!os(as[io],us[io],ps))return!1;return!0}if(as&&us&&_typeof$4(as)==="object"&&_typeof$4(us)==="object"){var fo=Object.keys(as);return fo.length!==Object.keys(us).length?!1:fo.every(function(mo){return os(as[mo],us[mo],ps)})}return!1}return os(Fn,Mn)}var SPLIT$1="%";function pathKey(Fn){return Fn.join(SPLIT$1)}var Entity=function(){function Fn(Mn){_classCallCheck$4(this,Fn),_defineProperty$5(this,"instanceId",void 0),_defineProperty$5(this,"cache",new Map),this.instanceId=Mn}return _createClass$4(Fn,[{key:"get",value:function(rs){return this.opGet(pathKey(rs))}},{key:"opGet",value:function(rs){return this.cache.get(rs)||null}},{key:"update",value:function(rs,is){return this.opUpdate(pathKey(rs),is)}},{key:"opUpdate",value:function(rs,is){var os=this.cache.get(rs),as=is(os);as===null?this.cache.delete(rs):this.cache.set(rs,as)}}]),Fn}(),ATTR_TOKEN="data-token-hash",ATTR_MARK="data-css-hash",CSS_IN_JS_INSTANCE="__cssinjs_instance__";function createCache(){var Fn=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var Mn=document.body.querySelectorAll("style[".concat(ATTR_MARK,"]"))||[],rs=document.head.firstChild;Array.from(Mn).forEach(function(os){os[CSS_IN_JS_INSTANCE]=os[CSS_IN_JS_INSTANCE]||Fn,os[CSS_IN_JS_INSTANCE]===Fn&&document.head.insertBefore(os,rs)});var is={};Array.from(document.querySelectorAll("style[".concat(ATTR_MARK,"]"))).forEach(function(os){var as=os.getAttribute(ATTR_MARK);if(is[as]){if(os[CSS_IN_JS_INSTANCE]===Fn){var us;(us=os.parentNode)===null||us===void 0||us.removeChild(os)}}else is[as]=!0})}return new Entity(Fn)}var StyleContext=reactExports.createContext({hashPriority:"low",cache:createCache(),defaultCache:!0});function sameDerivativeOption(Fn,Mn){if(Fn.length!==Mn.length)return!1;for(var rs=0;rs<Fn.length;rs++)if(Fn[rs]!==Mn[rs])return!1;return!0}var ThemeCache=function(){function Fn(){_classCallCheck$4(this,Fn),_defineProperty$5(this,"cache",void 0),_defineProperty$5(this,"keys",void 0),_defineProperty$5(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return _createClass$4(Fn,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(rs){var is,os,as=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,us={map:this.cache};return rs.forEach(function(ds){if(!us)us=void 0;else{var hs;us=(hs=us)===null||hs===void 0||(hs=hs.map)===null||hs===void 0?void 0:hs.get(ds)}}),(is=us)!==null&&is!==void 0&&is.value&&as&&(us.value[1]=this.cacheCallTimes++),(os=us)===null||os===void 0?void 0:os.value}},{key:"get",value:function(rs){var is;return(is=this.internalGet(rs,!0))===null||is===void 0?void 0:is[0]}},{key:"has",value:function(rs){return!!this.internalGet(rs)}},{key:"set",value:function(rs,is){var os=this;if(!this.has(rs)){if(this.size()+1>Fn.MAX_CACHE_SIZE+Fn.MAX_CACHE_OFFSET){var as=this.keys.reduce(function(ps,io){var fo=_slicedToArray(ps,2),mo=fo[1];return os.internalGet(io)[1]<mo?[io,os.internalGet(io)[1]]:ps},[this.keys[0],this.cacheCallTimes]),us=_slicedToArray(as,1),ds=us[0];this.delete(ds)}this.keys.push(rs)}var hs=this.cache;rs.forEach(function(ps,io){if(io===rs.length-1)hs.set(ps,{value:[is,os.cacheCallTimes++]});else{var fo=hs.get(ps);fo?fo.map||(fo.map=new Map):hs.set(ps,{map:new Map}),hs=hs.get(ps).map}})}},{key:"deleteByPath",value:function(rs,is){var os=rs.get(is[0]);if(is.length===1){var as;return os.map?rs.set(is[0],{map:os.map}):rs.delete(is[0]),(as=os.value)===null||as===void 0?void 0:as[0]}var us=this.deleteByPath(os.map,is.slice(1));return(!os.map||os.map.size===0)&&!os.value&&rs.delete(is[0]),us}},{key:"delete",value:function(rs){if(this.has(rs))return this.keys=this.keys.filter(function(is){return!sameDerivativeOption(is,rs)}),this.deleteByPath(this.cache,rs)}}]),Fn}();_defineProperty$5(ThemeCache,"MAX_CACHE_SIZE",20);_defineProperty$5(ThemeCache,"MAX_CACHE_OFFSET",5);var uuid$3=0,Theme=function(){function Fn(Mn){_classCallCheck$4(this,Fn),_defineProperty$5(this,"derivatives",void 0),_defineProperty$5(this,"id",void 0),this.derivatives=Array.isArray(Mn)?Mn:[Mn],this.id=uuid$3,Mn.length===0&&(Mn.length>0,void 0),uuid$3+=1}return _createClass$4(Fn,[{key:"getDerivativeToken",value:function(rs){return this.derivatives.reduce(function(is,os){return os(rs,is)},void 0)}}]),Fn}(),cacheThemes=new ThemeCache;function createTheme(Fn){var Mn=Array.isArray(Fn)?Fn:[Fn];return cacheThemes.has(Mn)||cacheThemes.set(Mn,new Theme(Mn)),cacheThemes.get(Mn)}var resultCache=new WeakMap,RESULT_VALUE={};function memoResult(Fn,Mn){for(var rs=resultCache,is=0;is<Mn.length;is+=1){var os=Mn[is];rs.has(os)||rs.set(os,new WeakMap),rs=rs.get(os)}return rs.has(RESULT_VALUE)||rs.set(RESULT_VALUE,Fn()),rs.get(RESULT_VALUE)}var flattenTokenCache=new WeakMap;function flattenToken(Fn){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,rs=flattenTokenCache.get(Fn)||"";return rs||(Object.keys(Fn).forEach(function(is){var os=Fn[is];rs+=is,os instanceof Theme?rs+=os.id:os&&_typeof$4(os)==="object"?rs+=flattenToken(os,Mn):rs+=os}),Mn&&(rs=murmur2(rs)),flattenTokenCache.set(Fn,rs)),rs}function token2key(Fn,Mn){return murmur2("".concat(Mn,"_").concat(flattenToken(Fn,!0)))}var isClientSide=canUseDom();function unit$1(Fn){return typeof Fn=="number"?"".concat(Fn,"px"):Fn}function toStyleStr(Fn,Mn,rs){var is=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},os=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(os)return Fn;var as=_objectSpread2(_objectSpread2({},is),{},_defineProperty$5(_defineProperty$5({},ATTR_TOKEN,Mn),ATTR_MARK,rs)),us=Object.keys(as).map(function(ds){var hs=as[ds];return hs?"".concat(ds,'="').concat(hs,'"'):null}).filter(function(ds){return ds}).join(" ");return"<style ".concat(us,">").concat(Fn,"</style>")}var token2CSSVar=function(Mn){var rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(rs?"".concat(rs,"-"):"").concat(Mn).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},serializeCSSVar=function(Mn,rs,is){return Object.keys(Mn).length?".".concat(rs).concat(is!=null&&is.scope?".".concat(is.scope):"","{").concat(Object.entries(Mn).map(function(os){var as=_slicedToArray(os,2),us=as[0],ds=as[1];return"".concat(us,":").concat(ds,";")}).join(""),"}"):""},transformToken=function(Mn,rs,is){var os={},as={};return Object.entries(Mn).forEach(function(us){var ds,hs,ps=_slicedToArray(us,2),io=ps[0],fo=ps[1];if(is!=null&&(ds=is.preserve)!==null&&ds!==void 0&&ds[io])as[io]=fo;else if((typeof fo=="string"||typeof fo=="number")&&!(is!=null&&(hs=is.ignore)!==null&&hs!==void 0&&hs[io])){var mo,Ao=token2CSSVar(io,is==null?void 0:is.prefix);os[Ao]=typeof fo=="number"&&!(is!=null&&(mo=is.unitless)!==null&&mo!==void 0&&mo[io])?"".concat(fo,"px"):String(fo),as[io]="var(".concat(Ao,")")}}),[as,serializeCSSVar(os,rs,{scope:is==null?void 0:is.scope})]},useInternalLayoutEffect=canUseDom()?reactExports.useLayoutEffect:reactExports.useEffect,useLayoutEffect=function(Mn,rs){var is=reactExports.useRef(!0);useInternalLayoutEffect(function(){return Mn(is.current)},rs),useInternalLayoutEffect(function(){return is.current=!1,function(){is.current=!0}},[])},useLayoutUpdateEffect=function(Mn,rs){useLayoutEffect(function(is){if(!is)return Mn()},rs)},fullClone$3=_objectSpread2({},React$1),useInsertionEffect$1=fullClone$3.useInsertionEffect,useInsertionEffectPolyfill=function(Mn,rs,is){reactExports.useMemo(Mn,is),useLayoutEffect(function(){return rs(!0)},is)},useCompatibleInsertionEffect=useInsertionEffect$1?function(Fn,Mn,rs){return useInsertionEffect$1(function(){return Fn(),Mn()},rs)}:useInsertionEffectPolyfill,fullClone$2=_objectSpread2({},React$1),useInsertionEffect=fullClone$2.useInsertionEffect,useCleanupRegister=function(Mn){var rs=[],is=!1;function os(as){is||rs.push(as)}return reactExports.useEffect(function(){return is=!1,function(){is=!0,rs.length&&rs.forEach(function(as){return as()})}},Mn),os},useRun=function(){return function(Mn){Mn()}},useEffectCleanupRegister=typeof useInsertionEffect<"u"?useCleanupRegister:useRun;function useGlobalCache(Fn,Mn,rs,is,os){var as=reactExports.useContext(StyleContext),us=as.cache,ds=[Fn].concat(_toConsumableArray(Mn)),hs=pathKey(ds),ps=useEffectCleanupRegister([hs]),io=function($o){us.opUpdate(hs,function(Lo){var Go=Lo||[void 0,void 0],Yo=_slicedToArray(Go,2),Wo=Yo[0],Jo=Wo===void 0?0:Wo,xl=Yo[1],_l=xl,Tl=_l||rs(),Sl=[Jo,Tl];return $o?$o(Sl):Sl})};reactExports.useMemo(function(){io()},[hs]);var fo=us.opGet(hs),mo=fo[1];return useCompatibleInsertionEffect(function(){os==null||os(mo)},function(Ao){return io(function($o){var Lo=_slicedToArray($o,2),Go=Lo[0],Yo=Lo[1];return Ao&&Go===0&&(os==null||os(mo)),[Go+1,Yo]}),function(){us.opUpdate(hs,function($o){var Lo=$o||[],Go=_slicedToArray(Lo,2),Yo=Go[0],Wo=Yo===void 0?0:Yo,Jo=Go[1],xl=Wo-1;return xl===0?(ps(function(){(Ao||!us.opGet(hs))&&(is==null||is(Jo,!1))}),null):[Wo-1,Jo]})}},[hs]),mo}var EMPTY_OVERRIDE={},hashPrefix="css",tokenKeys=new Map;function recordCleanToken(Fn){tokenKeys.set(Fn,(tokenKeys.get(Fn)||0)+1)}function removeStyleTags(Fn,Mn){if(typeof document<"u"){var rs=document.querySelectorAll("style[".concat(ATTR_TOKEN,'="').concat(Fn,'"]'));rs.forEach(function(is){if(is[CSS_IN_JS_INSTANCE]===Mn){var os;(os=is.parentNode)===null||os===void 0||os.removeChild(is)}})}}var TOKEN_THRESHOLD=0;function cleanTokenStyle(Fn,Mn){tokenKeys.set(Fn,(tokenKeys.get(Fn)||0)-1);var rs=Array.from(tokenKeys.keys()),is=rs.filter(function(os){var as=tokenKeys.get(os)||0;return as<=0});rs.length-is.length>TOKEN_THRESHOLD&&is.forEach(function(os){removeStyleTags(os,Mn),tokenKeys.delete(os)})}var getComputedToken$1=function(Mn,rs,is,os){var as=is.getDerivativeToken(Mn),us=_objectSpread2(_objectSpread2({},as),rs);return os&&(us=os(us)),us},TOKEN_PREFIX="token";function useCacheToken(Fn,Mn){var rs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},is=reactExports.useContext(StyleContext),os=is.cache.instanceId,as=is.container,us=rs.salt,ds=us===void 0?"":us,hs=rs.override,ps=hs===void 0?EMPTY_OVERRIDE:hs,io=rs.formatToken,fo=rs.getComputedToken,mo=rs.cssVar,Ao=memoResult(function(){return Object.assign.apply(Object,[{}].concat(_toConsumableArray(Mn)))},Mn),$o=flattenToken(Ao),Lo=flattenToken(ps),Go=mo?flattenToken(mo):"",Yo=useGlobalCache(TOKEN_PREFIX,[ds,Fn.id,$o,Lo,Go],function(){var Wo,Jo=fo?fo(Ao,ps,Fn):getComputedToken$1(Ao,ps,Fn,io),xl=_objectSpread2({},Jo),_l="";if(mo){var Tl=transformToken(Jo,mo.key,{prefix:mo.prefix,ignore:mo.ignore,unitless:mo.unitless,preserve:mo.preserve}),Sl=_slicedToArray(Tl,2);Jo=Sl[0],_l=Sl[1]}var $l=token2key(Jo,ds);Jo._tokenKey=$l,xl._tokenKey=token2key(xl,ds);var Pl=(Wo=mo==null?void 0:mo.key)!==null&&Wo!==void 0?Wo:$l;Jo._themeKey=Pl,recordCleanToken(Pl);var Dl="".concat(hashPrefix,"-").concat(murmur2($l));return Jo._hashId=Dl,[Jo,Dl,xl,_l,(mo==null?void 0:mo.key)||""]},function(Wo){cleanTokenStyle(Wo[0]._themeKey,os)},function(Wo){var Jo=_slicedToArray(Wo,4),xl=Jo[0],_l=Jo[3];if(mo&&_l){var Tl=updateCSS(_l,murmur2("css-variables-".concat(xl._themeKey)),{mark:ATTR_MARK,prepend:"queue",attachTo:as,priority:-999});Tl[CSS_IN_JS_INSTANCE]=os,Tl.setAttribute(ATTR_TOKEN,xl._themeKey)}});return Yo}var extract$3=function(Mn,rs,is){var os=_slicedToArray(Mn,5),as=os[2],us=os[3],ds=os[4],hs=is||{},ps=hs.plain;if(!us)return null;var io=as._tokenKey,fo=-999,mo={"data-rc-order":"prependQueue","data-rc-priority":"".concat(fo)},Ao=toStyleStr(us,ds,io,mo,ps);return[fo,io,Ao]},unitlessKeys={animationIterationCount: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,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},COMMENT="comm",RULESET="rule",DECLARATION="decl",IMPORT="@import",KEYFRAMES="@keyframes",LAYER="@layer",abs=Math.abs,from$3=String.fromCharCode;function trim$2(Fn){return Fn.trim()}function replace(Fn,Mn,rs){return Fn.replace(Mn,rs)}function indexof(Fn,Mn,rs){return Fn.indexOf(Mn,rs)}function charat(Fn,Mn){return Fn.charCodeAt(Mn)|0}function substr(Fn,Mn,rs){return Fn.slice(Mn,rs)}function strlen(Fn){return Fn.length}function sizeof(Fn){return Fn.length}function append(Fn,Mn){return Mn.push(Fn),Fn}var line=1,column=1,length=0,position$1=0,character=0,characters="";function node$2(Fn,Mn,rs,is,os,as,us,ds){return{value:Fn,root:Mn,parent:rs,type:is,props:os,children:as,line,column,length:us,return:"",siblings:ds}}function char(){return character}function prev(){return character=position$1>0?charat(characters,--position$1):0,column--,character===10&&(column=1,line--),character}function next(){return character=position$1<length?charat(characters,position$1++):0,column++,character===10&&(column=1,line++),character}function peek(){return charat(characters,position$1)}function caret(){return position$1}function slice$1(Fn,Mn){return substr(characters,Fn,Mn)}function token$1(Fn){switch(Fn){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 alloc$1(Fn){return line=column=1,length=strlen(characters=Fn),position$1=0,[]}function dealloc(Fn){return characters="",Fn}function delimit(Fn){return trim$2(slice$1(position$1-1,delimiter(Fn===91?Fn+2:Fn===40?Fn+1:Fn)))}function whitespace$1(Fn){for(;(character=peek())&&character<33;)next();return token$1(Fn)>2||token$1(character)>3?"":" "}function escaping(Fn,Mn){for(;--Mn&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice$1(Fn,caret()+(Mn<6&&peek()==32&&next()==32))}function delimiter(Fn){for(;next();)switch(character){case Fn:return position$1;case 34:case 39:Fn!==34&&Fn!==39&&delimiter(character);break;case 40:Fn===41&&delimiter(Fn);break;case 92:next();break}return position$1}function commenter(Fn,Mn){for(;next()&&Fn+character!==57;)if(Fn+character===84&&peek()===47)break;return"/*"+slice$1(Mn,position$1-1)+"*"+from$3(Fn===47?Fn:next())}function identifier(Fn){for(;!token$1(peek());)next();return slice$1(Fn,position$1)}function compile(Fn){return dealloc(parse$2("",null,null,null,[""],Fn=alloc$1(Fn),0,[0],Fn))}function parse$2(Fn,Mn,rs,is,os,as,us,ds,hs){for(var ps=0,io=0,fo=us,mo=0,Ao=0,$o=0,Lo=1,Go=1,Yo=1,Wo=0,Jo="",xl=os,_l=as,Tl=is,Sl=Jo;Go;)switch($o=Wo,Wo=next()){case 40:if($o!=108&&charat(Sl,fo-1)==58){indexof(Sl+=replace(delimit(Wo),"&","&\f"),"&\f",abs(ps?ds[ps-1]:0))!=-1&&(Yo=-1);break}case 34:case 39:case 91:Sl+=delimit(Wo);break;case 9:case 10:case 13:case 32:Sl+=whitespace$1($o);break;case 92:Sl+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append(comment(commenter(next(),caret()),Mn,rs,hs),hs);break;default:Sl+="/"}break;case 123*Lo:ds[ps++]=strlen(Sl)*Yo;case 125*Lo:case 59:case 0:switch(Wo){case 0:case 125:Go=0;case 59+io:Yo==-1&&(Sl=replace(Sl,/\f/g,"")),Ao>0&&strlen(Sl)-fo&&append(Ao>32?declaration(Sl+";",is,rs,fo-1,hs):declaration(replace(Sl," ","")+";",is,rs,fo-2,hs),hs);break;case 59:Sl+=";";default:if(append(Tl=ruleset(Sl,Mn,rs,ps,io,os,ds,Jo,xl=[],_l=[],fo,as),as),Wo===123)if(io===0)parse$2(Sl,Mn,Tl,Tl,xl,as,fo,ds,_l);else switch(mo===99&&charat(Sl,3)===110?100:mo){case 100:case 108:case 109:case 115:parse$2(Fn,Tl,Tl,is&&append(ruleset(Fn,Tl,Tl,0,0,os,ds,Jo,os,xl=[],fo,_l),_l),os,_l,fo,ds,is?xl:_l);break;default:parse$2(Sl,Tl,Tl,Tl,[""],_l,0,ds,_l)}}ps=io=Ao=0,Lo=Yo=1,Jo=Sl="",fo=us;break;case 58:fo=1+strlen(Sl),Ao=$o;default:if(Lo<1){if(Wo==123)--Lo;else if(Wo==125&&Lo++==0&&prev()==125)continue}switch(Sl+=from$3(Wo),Wo*Lo){case 38:Yo=io>0?1:(Sl+="\f",-1);break;case 44:ds[ps++]=(strlen(Sl)-1)*Yo,Yo=1;break;case 64:peek()===45&&(Sl+=delimit(next())),mo=peek(),io=fo=strlen(Jo=Sl+=identifier(caret())),Wo++;break;case 45:$o===45&&strlen(Sl)==2&&(Lo=0)}}return as}function ruleset(Fn,Mn,rs,is,os,as,us,ds,hs,ps,io,fo){for(var mo=os-1,Ao=os===0?as:[""],$o=sizeof(Ao),Lo=0,Go=0,Yo=0;Lo<is;++Lo)for(var Wo=0,Jo=substr(Fn,mo+1,mo=abs(Go=us[Lo])),xl=Fn;Wo<$o;++Wo)(xl=trim$2(Go>0?Ao[Wo]+" "+Jo:replace(Jo,/&\f/g,Ao[Wo])))&&(hs[Yo++]=xl);return node$2(Fn,Mn,rs,os===0?RULESET:ds,hs,ps,io,fo)}function comment(Fn,Mn,rs,is){return node$2(Fn,Mn,rs,COMMENT,from$3(char()),substr(Fn,2,-2),0,is)}function declaration(Fn,Mn,rs,is,os){return node$2(Fn,Mn,rs,DECLARATION,substr(Fn,0,is),substr(Fn,is+1,-1),is,os)}function serialize$1(Fn,Mn){for(var rs="",is=0;is<Fn.length;is++)rs+=Mn(Fn[is],is,Fn,Mn)||"";return rs}function stringify$3(Fn,Mn,rs,is){switch(Fn.type){case LAYER:if(Fn.children.length)break;case IMPORT:case DECLARATION:return Fn.return=Fn.return||Fn.value;case COMMENT:return"";case KEYFRAMES:return Fn.return=Fn.value+"{"+serialize$1(Fn.children,is)+"}";case RULESET:if(!strlen(Fn.value=Fn.props.join(",")))return""}return strlen(rs=serialize$1(Fn.children,is))?Fn.return=Fn.value+"{"+rs+"}":""}var ATTR_CACHE_MAP="data-ant-cssinjs-cache-path",CSS_FILE_STYLE="_FILE_STYLE__",cachePathMap,fromCSSFile=!0;function prepare(){if(!cachePathMap&&(cachePathMap={},canUseDom())){var Fn=document.createElement("div");Fn.className=ATTR_CACHE_MAP,Fn.style.position="fixed",Fn.style.visibility="hidden",Fn.style.top="-9999px",document.body.appendChild(Fn);var Mn=getComputedStyle(Fn).content||"";Mn=Mn.replace(/^"/,"").replace(/"$/,""),Mn.split(";").forEach(function(os){var as=os.split(":"),us=_slicedToArray(as,2),ds=us[0],hs=us[1];cachePathMap[ds]=hs});var rs=document.querySelector("style[".concat(ATTR_CACHE_MAP,"]"));if(rs){var is;fromCSSFile=!1,(is=rs.parentNode)===null||is===void 0||is.removeChild(rs)}document.body.removeChild(Fn)}}function existPath(Fn){return prepare(),!!cachePathMap[Fn]}function getStyleAndHash(Fn){var Mn=cachePathMap[Fn],rs=null;if(Mn&&canUseDom())if(fromCSSFile)rs=CSS_FILE_STYLE;else{var is=document.querySelector("style[".concat(ATTR_MARK,'="').concat(cachePathMap[Fn],'"]'));is?rs=is.innerHTML:delete cachePathMap[Fn]}return[rs,Mn]}var SKIP_CHECK="_skip_check_",MULTI_VALUE="_multi_value_";function normalizeStyle(Fn){var Mn=serialize$1(compile(Fn),stringify$3);return Mn.replace(/\{%%%\:[^;];}/g,";")}function isCompoundCSSProperty(Fn){return _typeof$4(Fn)==="object"&&Fn&&(SKIP_CHECK in Fn||MULTI_VALUE in Fn)}function injectSelectorHash(Fn,Mn,rs){if(!Mn)return Fn;var is=".".concat(Mn),os=rs==="low"?":where(".concat(is,")"):is,as=Fn.split(",").map(function(us){var ds,hs=us.trim().split(/\s+/),ps=hs[0]||"",io=((ds=ps.match(/^\w+/))===null||ds===void 0?void 0:ds[0])||"";return ps="".concat(io).concat(os).concat(ps.slice(io.length)),[ps].concat(_toConsumableArray(hs.slice(1))).join(" ")});return as.join(",")}var parseStyle=function Fn(Mn){var rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},is=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},os=is.root,as=is.injectHash,us=is.parentSelectors,ds=rs.hashId,hs=rs.layer;rs.path;var ps=rs.hashPriority,io=rs.transformers,fo=io===void 0?[]:io;rs.linters;var mo="",Ao={};function $o(Yo){var Wo=Yo.getName(ds);if(!Ao[Wo]){var Jo=Fn(Yo.style,rs,{root:!1,parentSelectors:us}),xl=_slicedToArray(Jo,1),_l=xl[0];Ao[Wo]="@keyframes ".concat(Yo.getName(ds)).concat(_l)}}function Lo(Yo){var Wo=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Yo.forEach(function(Jo){Array.isArray(Jo)?Lo(Jo,Wo):Jo&&Wo.push(Jo)}),Wo}var Go=Lo(Array.isArray(Mn)?Mn:[Mn]);return Go.forEach(function(Yo){var Wo=typeof Yo=="string"&&!os?{}:Yo;if(typeof Wo=="string")mo+="".concat(Wo,`
`);else if(Wo._keyframe)$o(Wo);else{var Jo=fo.reduce(function(xl,_l){var Tl;return(_l==null||(Tl=_l.visit)===null||Tl===void 0?void 0:Tl.call(_l,xl))||xl},Wo);Object.keys(Jo).forEach(function(xl){var _l=Jo[xl];if(_typeof$4(_l)==="object"&&_l&&(xl!=="animationName"||!_l._keyframe)&&!isCompoundCSSProperty(_l)){var Tl=!1,Sl=xl.trim(),$l=!1;(os||as)&&ds?Sl.startsWith("@")?Tl=!0:Sl=injectSelectorHash(xl,ds,ps):os&&!ds&&(Sl==="&"||Sl==="")&&(Sl="",$l=!0);var Pl=Fn(_l,rs,{root:$l,injectHash:Tl,parentSelectors:[].concat(_toConsumableArray(us),[Sl])}),Dl=_slicedToArray(Pl,2),Ol=Dl[0],Rl=Dl[1];Ao=_objectSpread2(_objectSpread2({},Ao),Rl),mo+="".concat(Sl).concat(Ol)}else{let Ho=function(Qo,El){var Xo=Qo.replace(/[A-Z]/g,function(wl){return"-".concat(wl.toLowerCase())}),Al=El;!unitlessKeys[Qo]&&typeof Al=="number"&&Al!==0&&(Al="".concat(Al,"px")),Qo==="animationName"&&El!==null&&El!==void 0&&El._keyframe&&($o(El),Al=El.getName(ds)),mo+="".concat(Xo,":").concat(Al,";")};var Vo,jo=(Vo=_l==null?void 0:_l.value)!==null&&Vo!==void 0?Vo:_l;_typeof$4(_l)==="object"&&_l!==null&&_l!==void 0&&_l[MULTI_VALUE]&&Array.isArray(jo)?jo.forEach(function(Qo){Ho(xl,Qo)}):Ho(xl,jo)}})}}),os?hs&&(mo="@layer ".concat(hs.name," {").concat(mo,"}"),hs.dependencies&&(Ao["@layer ".concat(hs.name)]=hs.dependencies.map(function(Yo){return"@layer ".concat(Yo,", ").concat(hs.name,";")}).join(`
`))):mo="{".concat(mo,"}"),[mo,Ao]};function uniqueHash(Fn,Mn){return murmur2("".concat(Fn.join("%")).concat(Mn))}function Empty(){return null}var STYLE_PREFIX="style";function useStyleRegister(Fn,Mn){var rs=Fn.token,is=Fn.path,os=Fn.hashId,as=Fn.layer,us=Fn.nonce,ds=Fn.clientOnly,hs=Fn.order,ps=hs===void 0?0:hs,io=reactExports.useContext(StyleContext),fo=io.autoClear;io.mock;var mo=io.defaultCache,Ao=io.hashPriority,$o=io.container,Lo=io.ssrInline,Go=io.transformers,Yo=io.linters,Wo=io.cache,Jo=io.layer,xl=rs._tokenKey,_l=[xl];Jo&&_l.push("layer"),_l.push.apply(_l,_toConsumableArray(is));var Tl=isClientSide,Sl=useGlobalCache(STYLE_PREFIX,_l,function(){var Rl=_l.join("|");if(existPath(Rl)){var Vo=getStyleAndHash(Rl),jo=_slicedToArray(Vo,2),Ho=jo[0],Qo=jo[1];if(Ho)return[Ho,xl,Qo,{},ds,ps]}var El=Mn(),Xo=parseStyle(El,{hashId:os,hashPriority:Ao,layer:Jo?as:void 0,path:is.join("-"),transformers:Go,linters:Yo}),Al=_slicedToArray(Xo,2),wl=Al[0],yl=Al[1],Il=normalizeStyle(wl),Bl=uniqueHash(_l,Il);return[Il,xl,Bl,yl,ds,ps]},function(Rl,Vo){var jo=_slicedToArray(Rl,3),Ho=jo[2];(Vo||fo)&&isClientSide&&removeCSS(Ho,{mark:ATTR_MARK})},function(Rl){var Vo=_slicedToArray(Rl,4),jo=Vo[0];Vo[1];var Ho=Vo[2],Qo=Vo[3];if(Tl&&jo!==CSS_FILE_STYLE){var El={mark:ATTR_MARK,prepend:Jo?!1:"queue",attachTo:$o,priority:ps},Xo=typeof us=="function"?us():us;Xo&&(El.csp={nonce:Xo});var Al=[],wl=[];Object.keys(Qo).forEach(function(Il){Il.startsWith("@layer")?Al.push(Il):wl.push(Il)}),Al.forEach(function(Il){updateCSS(normalizeStyle(Qo[Il]),"_layer-".concat(Il),_objectSpread2(_objectSpread2({},El),{},{prepend:!0}))});var yl=updateCSS(jo,Ho,El);yl[CSS_IN_JS_INSTANCE]=Wo.instanceId,yl.setAttribute(ATTR_TOKEN,xl),wl.forEach(function(Il){updateCSS(normalizeStyle(Qo[Il]),"_effect-".concat(Il),El)})}}),$l=_slicedToArray(Sl,3),Pl=$l[0],Dl=$l[1],Ol=$l[2];return function(Rl){var Vo;return!Lo||Tl||!mo?Vo=reactExports.createElement(Empty,null):Vo=reactExports.createElement("style",_extends$4({},_defineProperty$5(_defineProperty$5({},ATTR_TOKEN,Dl),ATTR_MARK,Ol),{dangerouslySetInnerHTML:{__html:Pl}})),reactExports.createElement(reactExports.Fragment,null,Vo,Rl)}}var extract$2=function(Mn,rs,is){var os=_slicedToArray(Mn,6),as=os[0],us=os[1],ds=os[2],hs=os[3],ps=os[4],io=os[5],fo=is||{},mo=fo.plain;if(ps)return null;var Ao=as,$o={"data-rc-order":"prependQueue","data-rc-priority":"".concat(io)};return Ao=toStyleStr(as,us,ds,$o,mo),hs&&Object.keys(hs).forEach(function(Lo){if(!rs[Lo]){rs[Lo]=!0;var Go=normalizeStyle(hs[Lo]),Yo=toStyleStr(Go,us,"_effect-".concat(Lo),$o,mo);Lo.startsWith("@layer")?Ao=Yo+Ao:Ao+=Yo}}),[io,ds,Ao]},CSS_VAR_PREFIX="cssVar",useCSSVarRegister=function(Mn,rs){var is=Mn.key,os=Mn.prefix,as=Mn.unitless,us=Mn.ignore,ds=Mn.token,hs=Mn.scope,ps=hs===void 0?"":hs,io=reactExports.useContext(StyleContext),fo=io.cache.instanceId,mo=io.container,Ao=ds._tokenKey,$o=[].concat(_toConsumableArray(Mn.path),[is,ps,Ao]),Lo=useGlobalCache(CSS_VAR_PREFIX,$o,function(){var Go=rs(),Yo=transformToken(Go,is,{prefix:os,unitless:as,ignore:us,scope:ps}),Wo=_slicedToArray(Yo,2),Jo=Wo[0],xl=Wo[1],_l=uniqueHash($o,xl);return[Jo,xl,_l,is]},function(Go){var Yo=_slicedToArray(Go,3),Wo=Yo[2];isClientSide&&removeCSS(Wo,{mark:ATTR_MARK})},function(Go){var Yo=_slicedToArray(Go,3),Wo=Yo[1],Jo=Yo[2];if(Wo){var xl=updateCSS(Wo,Jo,{mark:ATTR_MARK,prepend:"queue",attachTo:mo,priority:-999});xl[CSS_IN_JS_INSTANCE]=fo,xl.setAttribute(ATTR_TOKEN,is)}});return Lo},extract$1=function(Mn,rs,is){var os=_slicedToArray(Mn,4),as=os[1],us=os[2],ds=os[3],hs=is||{},ps=hs.plain;if(!as)return null;var io=-999,fo={"data-rc-order":"prependQueue","data-rc-priority":"".concat(io)},mo=toStyleStr(as,ds,us,fo,ps);return[io,us,mo]};_defineProperty$5(_defineProperty$5(_defineProperty$5({},STYLE_PREFIX,extract$2),TOKEN_PREFIX,extract$3),CSS_VAR_PREFIX,extract$1);var Keyframe=function(){function Fn(Mn,rs){_classCallCheck$4(this,Fn),_defineProperty$5(this,"name",void 0),_defineProperty$5(this,"style",void 0),_defineProperty$5(this,"_keyframe",!0),this.name=Mn,this.style=rs}return _createClass$4(Fn,[{key:"getName",value:function(){var rs=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return rs?"".concat(rs,"-").concat(this.name):this.name}}]),Fn}();function noSplit(Fn){return Fn.notSplit=!0,Fn}noSplit(["borderTop","borderBottom"]),noSplit(["borderTop"]),noSplit(["borderBottom"]),noSplit(["borderLeft","borderRight"]),noSplit(["borderLeft"]),noSplit(["borderRight"]);var IconContext=reactExports.createContext({});function _toArray(Fn){return _arrayWithHoles(Fn)||_iterableToArray(Fn)||_unsupportedIterableToArray(Fn)||_nonIterableRest()}function get$2(Fn,Mn){for(var rs=Fn,is=0;is<Mn.length;is+=1){if(rs==null)return;rs=rs[Mn[is]]}return rs}function internalSet(Fn,Mn,rs,is){if(!Mn.length)return rs;var os=_toArray(Mn),as=os[0],us=os.slice(1),ds;return!Fn&&typeof as=="number"?ds=[]:Array.isArray(Fn)?ds=_toConsumableArray(Fn):ds=_objectSpread2({},Fn),is&&rs===void 0&&us.length===1?delete ds[as][us[0]]:ds[as]=internalSet(ds[as],us,rs,is),ds}function set$3(Fn,Mn,rs){var is=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Mn.length&&is&&rs===void 0&&!get$2(Fn,Mn.slice(0,-1))?Fn:internalSet(Fn,Mn,rs,is)}function isObject$4(Fn){return _typeof$4(Fn)==="object"&&Fn!==null&&Object.getPrototypeOf(Fn)===Object.prototype}function createEmpty(Fn){return Array.isArray(Fn)?[]:{}}var keys$1=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function merge$3(){for(var Fn=arguments.length,Mn=new Array(Fn),rs=0;rs<Fn;rs++)Mn[rs]=arguments[rs];var is=createEmpty(Mn[0]);return Mn.forEach(function(os){function as(us,ds){var hs=new Set(ds),ps=get$2(os,us),io=Array.isArray(ps);if(io||isObject$4(ps)){if(!hs.has(ps)){hs.add(ps);var fo=get$2(is,us);io?is=set$3(is,us,[]):(!fo||_typeof$4(fo)!=="object")&&(is=set$3(is,us,createEmpty(ps))),keys$1(ps).forEach(function(mo){as([].concat(_toConsumableArray(us),[mo]),hs)})}}else is=set$3(is,us,ps)}as([])}),is}function noop$9(){}const WarningContext=reactExports.createContext({}),devUseWarning=()=>{const Fn=()=>{};return Fn.deprecated=noop$9,Fn},ValidateMessagesContext=reactExports.createContext(void 0);var locale$3={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},commonLocale={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},locale$2=_objectSpread2(_objectSpread2({},commonLocale),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"});const locale$1={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},locale={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},locale$2),timePickerLocale:Object.assign({},locale$1)},typeTemplate$1="${label} is not a valid ${type}",localeValues={locale:"en",Pagination:locale$3,DatePicker:locale,TimePicker:locale$1,Calendar:locale,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:typeTemplate$1,method:typeTemplate$1,array:typeTemplate$1,object:typeTemplate$1,number:typeTemplate$1,date:typeTemplate$1,boolean:typeTemplate$1,integer:typeTemplate$1,float:typeTemplate$1,regexp:typeTemplate$1,email:typeTemplate$1,url:typeTemplate$1,hex:typeTemplate$1},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}};Object.assign({},localeValues.Modal);let localeList=[];const generateLocale=()=>localeList.reduce((Fn,Mn)=>Object.assign(Object.assign({},Fn),Mn),localeValues.Modal);function changeConfirmLocale(Fn){if(Fn){const Mn=Object.assign({},Fn);return localeList.push(Mn),generateLocale(),()=>{localeList=localeList.filter(rs=>rs!==Mn),generateLocale()}}Object.assign({},localeValues.Modal)}const LocaleContext=reactExports.createContext(void 0),useLocale=(Fn,Mn)=>{const rs=reactExports.useContext(LocaleContext),is=reactExports.useMemo(()=>{var as;const us=Mn||localeValues[Fn],ds=(as=rs==null?void 0:rs[Fn])!==null&&as!==void 0?as:{};return Object.assign(Object.assign({},typeof us=="function"?us():us),ds||{})},[Fn,Mn,rs]),os=reactExports.useMemo(()=>{const as=rs==null?void 0:rs.locale;return rs!=null&&rs.exist&&!as?localeValues.locale:as},[rs]);return[is,os]},ANT_MARK="internalMark",LocaleProvider=Fn=>{const{locale:Mn={},children:rs,_ANT_MARK__:is}=Fn;reactExports.useEffect(()=>changeConfirmLocale(Mn==null?void 0:Mn.Modal),[Mn]);const os=reactExports.useMemo(()=>Object.assign(Object.assign({},Mn),{exist:!0}),[Mn]);return reactExports.createElement(LocaleContext.Provider,{value:os},rs)};function bound01(Fn,Mn){isOnePointZero(Fn)&&(Fn="100%");var rs=isPercentage(Fn);return Fn=Mn===360?Fn:Math.min(Mn,Math.max(0,parseFloat(Fn))),rs&&(Fn=parseInt(String(Fn*Mn),10)/100),Math.abs(Fn-Mn)<1e-6?1:(Mn===360?Fn=(Fn<0?Fn%Mn+Mn:Fn%Mn)/parseFloat(String(Mn)):Fn=Fn%Mn/parseFloat(String(Mn)),Fn)}function clamp01(Fn){return Math.min(1,Math.max(0,Fn))}function isOnePointZero(Fn){return typeof Fn=="string"&&Fn.indexOf(".")!==-1&&parseFloat(Fn)===1}function isPercentage(Fn){return typeof Fn=="string"&&Fn.indexOf("%")!==-1}function boundAlpha(Fn){return Fn=parseFloat(Fn),(isNaN(Fn)||Fn<0||Fn>1)&&(Fn=1),Fn}function convertToPercentage(Fn){return Fn<=1?"".concat(Number(Fn)*100,"%"):Fn}function pad2(Fn){return Fn.length===1?"0"+Fn:String(Fn)}function rgbToRgb(Fn,Mn,rs){return{r:bound01(Fn,255)*255,g:bound01(Mn,255)*255,b:bound01(rs,255)*255}}function rgbToHsl(Fn,Mn,rs){Fn=bound01(Fn,255),Mn=bound01(Mn,255),rs=bound01(rs,255);var is=Math.max(Fn,Mn,rs),os=Math.min(Fn,Mn,rs),as=0,us=0,ds=(is+os)/2;if(is===os)us=0,as=0;else{var hs=is-os;switch(us=ds>.5?hs/(2-is-os):hs/(is+os),is){case Fn:as=(Mn-rs)/hs+(Mn<rs?6:0);break;case Mn:as=(rs-Fn)/hs+2;break;case rs:as=(Fn-Mn)/hs+4;break}as/=6}return{h:as,s:us,l:ds}}function hue2rgb(Fn,Mn,rs){return rs<0&&(rs+=1),rs>1&&(rs-=1),rs<1/6?Fn+(Mn-Fn)*(6*rs):rs<1/2?Mn:rs<2/3?Fn+(Mn-Fn)*(2/3-rs)*6:Fn}function hslToRgb(Fn,Mn,rs){var is,os,as;if(Fn=bound01(Fn,360),Mn=bound01(Mn,100),rs=bound01(rs,100),Mn===0)os=rs,as=rs,is=rs;else{var us=rs<.5?rs*(1+Mn):rs+Mn-rs*Mn,ds=2*rs-us;is=hue2rgb(ds,us,Fn+1/3),os=hue2rgb(ds,us,Fn),as=hue2rgb(ds,us,Fn-1/3)}return{r:is*255,g:os*255,b:as*255}}function rgbToHsv(Fn,Mn,rs){Fn=bound01(Fn,255),Mn=bound01(Mn,255),rs=bound01(rs,255);var is=Math.max(Fn,Mn,rs),os=Math.min(Fn,Mn,rs),as=0,us=is,ds=is-os,hs=is===0?0:ds/is;if(is===os)as=0;else{switch(is){case Fn:as=(Mn-rs)/ds+(Mn<rs?6:0);break;case Mn:as=(rs-Fn)/ds+2;break;case rs:as=(Fn-Mn)/ds+4;break}as/=6}return{h:as,s:hs,v:us}}function hsvToRgb(Fn,Mn,rs){Fn=bound01(Fn,360)*6,Mn=bound01(Mn,100),rs=bound01(rs,100);var is=Math.floor(Fn),os=Fn-is,as=rs*(1-Mn),us=rs*(1-os*Mn),ds=rs*(1-(1-os)*Mn),hs=is%6,ps=[rs,us,as,as,ds,rs][hs],io=[ds,rs,rs,us,as,as][hs],fo=[as,as,ds,rs,rs,us][hs];return{r:ps*255,g:io*255,b:fo*255}}function rgbToHex(Fn,Mn,rs,is){var os=[pad2(Math.round(Fn).toString(16)),pad2(Math.round(Mn).toString(16)),pad2(Math.round(rs).toString(16))];return is&&os[0].startsWith(os[0].charAt(1))&&os[1].startsWith(os[1].charAt(1))&&os[2].startsWith(os[2].charAt(1))?os[0].charAt(0)+os[1].charAt(0)+os[2].charAt(0):os.join("")}function rgbaToHex(Fn,Mn,rs,is,os){var as=[pad2(Math.round(Fn).toString(16)),pad2(Math.round(Mn).toString(16)),pad2(Math.round(rs).toString(16)),pad2(convertDecimalToHex(is))];return os&&as[0].startsWith(as[0].charAt(1))&&as[1].startsWith(as[1].charAt(1))&&as[2].startsWith(as[2].charAt(1))&&as[3].startsWith(as[3].charAt(1))?as[0].charAt(0)+as[1].charAt(0)+as[2].charAt(0)+as[3].charAt(0):as.join("")}function convertDecimalToHex(Fn){return Math.round(parseFloat(Fn)*255).toString(16)}function convertHexToDecimal(Fn){return parseIntFromHex(Fn)/255}function parseIntFromHex(Fn){return parseInt(Fn,16)}function numberInputToObject(Fn){return{r:Fn>>16,g:(Fn&65280)>>8,b:Fn&255}}var names$3={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",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",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",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",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"};function inputToRGB(Fn){var Mn={r:0,g:0,b:0},rs=1,is=null,os=null,as=null,us=!1,ds=!1;return typeof Fn=="string"&&(Fn=stringInputToObject(Fn)),typeof Fn=="object"&&(isValidCSSUnit(Fn.r)&&isValidCSSUnit(Fn.g)&&isValidCSSUnit(Fn.b)?(Mn=rgbToRgb(Fn.r,Fn.g,Fn.b),us=!0,ds=String(Fn.r).substr(-1)==="%"?"prgb":"rgb"):isValidCSSUnit(Fn.h)&&isValidCSSUnit(Fn.s)&&isValidCSSUnit(Fn.v)?(is=convertToPercentage(Fn.s),os=convertToPercentage(Fn.v),Mn=hsvToRgb(Fn.h,is,os),us=!0,ds="hsv"):isValidCSSUnit(Fn.h)&&isValidCSSUnit(Fn.s)&&isValidCSSUnit(Fn.l)&&(is=convertToPercentage(Fn.s),as=convertToPercentage(Fn.l),Mn=hslToRgb(Fn.h,is,as),us=!0,ds="hsl"),Object.prototype.hasOwnProperty.call(Fn,"a")&&(rs=Fn.a)),rs=boundAlpha(rs),{ok:us,format:Fn.format||ds,r:Math.min(255,Math.max(Mn.r,0)),g:Math.min(255,Math.max(Mn.g,0)),b:Math.min(255,Math.max(Mn.b,0)),a:rs}}var CSS_INTEGER="[-\\+]?\\d+%?",CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?",CSS_UNIT="(?:".concat(CSS_NUMBER,")|(?:").concat(CSS_INTEGER,")"),PERMISSIVE_MATCH3="[\\s|\\(]+(".concat(CSS_UNIT,")[,|\\s]+(").concat(CSS_UNIT,")[,|\\s]+(").concat(CSS_UNIT,")\\s*\\)?"),PERMISSIVE_MATCH4="[\\s|\\(]+(".concat(CSS_UNIT,")[,|\\s]+(").concat(CSS_UNIT,")[,|\\s]+(").concat(CSS_UNIT,")[,|\\s]+(").concat(CSS_UNIT,")\\s*\\)?"),matchers$1={CSS_UNIT:new RegExp(CSS_UNIT),rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function stringInputToObject(Fn){if(Fn=Fn.trim().toLowerCase(),Fn.length===0)return!1;var Mn=!1;if(names$3[Fn])Fn=names$3[Fn],Mn=!0;else if(Fn==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var rs=matchers$1.rgb.exec(Fn);return rs?{r:rs[1],g:rs[2],b:rs[3]}:(rs=matchers$1.rgba.exec(Fn),rs?{r:rs[1],g:rs[2],b:rs[3],a:rs[4]}:(rs=matchers$1.hsl.exec(Fn),rs?{h:rs[1],s:rs[2],l:rs[3]}:(rs=matchers$1.hsla.exec(Fn),rs?{h:rs[1],s:rs[2],l:rs[3],a:rs[4]}:(rs=matchers$1.hsv.exec(Fn),rs?{h:rs[1],s:rs[2],v:rs[3]}:(rs=matchers$1.hsva.exec(Fn),rs?{h:rs[1],s:rs[2],v:rs[3],a:rs[4]}:(rs=matchers$1.hex8.exec(Fn),rs?{r:parseIntFromHex(rs[1]),g:parseIntFromHex(rs[2]),b:parseIntFromHex(rs[3]),a:convertHexToDecimal(rs[4]),format:Mn?"name":"hex8"}:(rs=matchers$1.hex6.exec(Fn),rs?{r:parseIntFromHex(rs[1]),g:parseIntFromHex(rs[2]),b:parseIntFromHex(rs[3]),format:Mn?"name":"hex"}:(rs=matchers$1.hex4.exec(Fn),rs?{r:parseIntFromHex(rs[1]+rs[1]),g:parseIntFromHex(rs[2]+rs[2]),b:parseIntFromHex(rs[3]+rs[3]),a:convertHexToDecimal(rs[4]+rs[4]),format:Mn?"name":"hex8"}:(rs=matchers$1.hex3.exec(Fn),rs?{r:parseIntFromHex(rs[1]+rs[1]),g:parseIntFromHex(rs[2]+rs[2]),b:parseIntFromHex(rs[3]+rs[3]),format:Mn?"name":"hex"}:!1)))))))))}function isValidCSSUnit(Fn){return!!matchers$1.CSS_UNIT.exec(String(Fn))}var TinyColor=function(){function Fn(Mn,rs){Mn===void 0&&(Mn=""),rs===void 0&&(rs={});var is;if(Mn instanceof Fn)return Mn;typeof Mn=="number"&&(Mn=numberInputToObject(Mn)),this.originalInput=Mn;var os=inputToRGB(Mn);this.originalInput=Mn,this.r=os.r,this.g=os.g,this.b=os.b,this.a=os.a,this.roundA=Math.round(100*this.a)/100,this.format=(is=rs.format)!==null&&is!==void 0?is:os.format,this.gradientType=rs.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=os.ok}return Fn.prototype.isDark=function(){return this.getBrightness()<128},Fn.prototype.isLight=function(){return!this.isDark()},Fn.prototype.getBrightness=function(){var Mn=this.toRgb();return(Mn.r*299+Mn.g*587+Mn.b*114)/1e3},Fn.prototype.getLuminance=function(){var Mn=this.toRgb(),rs,is,os,as=Mn.r/255,us=Mn.g/255,ds=Mn.b/255;return as<=.03928?rs=as/12.92:rs=Math.pow((as+.055)/1.055,2.4),us<=.03928?is=us/12.92:is=Math.pow((us+.055)/1.055,2.4),ds<=.03928?os=ds/12.92:os=Math.pow((ds+.055)/1.055,2.4),.2126*rs+.7152*is+.0722*os},Fn.prototype.getAlpha=function(){return this.a},Fn.prototype.setAlpha=function(Mn){return this.a=boundAlpha(Mn),this.roundA=Math.round(100*this.a)/100,this},Fn.prototype.isMonochrome=function(){var Mn=this.toHsl().s;return Mn===0},Fn.prototype.toHsv=function(){var Mn=rgbToHsv(this.r,this.g,this.b);return{h:Mn.h*360,s:Mn.s,v:Mn.v,a:this.a}},Fn.prototype.toHsvString=function(){var Mn=rgbToHsv(this.r,this.g,this.b),rs=Math.round(Mn.h*360),is=Math.round(Mn.s*100),os=Math.round(Mn.v*100);return this.a===1?"hsv(".concat(rs,", ").concat(is,"%, ").concat(os,"%)"):"hsva(".concat(rs,", ").concat(is,"%, ").concat(os,"%, ").concat(this.roundA,")")},Fn.prototype.toHsl=function(){var Mn=rgbToHsl(this.r,this.g,this.b);return{h:Mn.h*360,s:Mn.s,l:Mn.l,a:this.a}},Fn.prototype.toHslString=function(){var Mn=rgbToHsl(this.r,this.g,this.b),rs=Math.round(Mn.h*360),is=Math.round(Mn.s*100),os=Math.round(Mn.l*100);return this.a===1?"hsl(".concat(rs,", ").concat(is,"%, ").concat(os,"%)"):"hsla(".concat(rs,", ").concat(is,"%, ").concat(os,"%, ").concat(this.roundA,")")},Fn.prototype.toHex=function(Mn){return Mn===void 0&&(Mn=!1),rgbToHex(this.r,this.g,this.b,Mn)},Fn.prototype.toHexString=function(Mn){return Mn===void 0&&(Mn=!1),"#"+this.toHex(Mn)},Fn.prototype.toHex8=function(Mn){return Mn===void 0&&(Mn=!1),rgbaToHex(this.r,this.g,this.b,this.a,Mn)},Fn.prototype.toHex8String=function(Mn){return Mn===void 0&&(Mn=!1),"#"+this.toHex8(Mn)},Fn.prototype.toHexShortString=function(Mn){return Mn===void 0&&(Mn=!1),this.a===1?this.toHexString(Mn):this.toHex8String(Mn)},Fn.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},Fn.prototype.toRgbString=function(){var Mn=Math.round(this.r),rs=Math.round(this.g),is=Math.round(this.b);return this.a===1?"rgb(".concat(Mn,", ").concat(rs,", ").concat(is,")"):"rgba(".concat(Mn,", ").concat(rs,", ").concat(is,", ").concat(this.roundA,")")},Fn.prototype.toPercentageRgb=function(){var Mn=function(rs){return"".concat(Math.round(bound01(rs,255)*100),"%")};return{r:Mn(this.r),g:Mn(this.g),b:Mn(this.b),a:this.a}},Fn.prototype.toPercentageRgbString=function(){var Mn=function(rs){return Math.round(bound01(rs,255)*100)};return this.a===1?"rgb(".concat(Mn(this.r),"%, ").concat(Mn(this.g),"%, ").concat(Mn(this.b),"%)"):"rgba(".concat(Mn(this.r),"%, ").concat(Mn(this.g),"%, ").concat(Mn(this.b),"%, ").concat(this.roundA,")")},Fn.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var Mn="#"+rgbToHex(this.r,this.g,this.b,!1),rs=0,is=Object.entries(names$3);rs<is.length;rs++){var os=is[rs],as=os[0],us=os[1];if(Mn===us)return as}return!1},Fn.prototype.toString=function(Mn){var rs=!!Mn;Mn=Mn??this.format;var is=!1,os=this.a<1&&this.a>=0,as=!rs&&os&&(Mn.startsWith("hex")||Mn==="name");return as?Mn==="name"&&this.a===0?this.toName():this.toRgbString():(Mn==="rgb"&&(is=this.toRgbString()),Mn==="prgb"&&(is=this.toPercentageRgbString()),(Mn==="hex"||Mn==="hex6")&&(is=this.toHexString()),Mn==="hex3"&&(is=this.toHexString(!0)),Mn==="hex4"&&(is=this.toHex8String(!0)),Mn==="hex8"&&(is=this.toHex8String()),Mn==="name"&&(is=this.toName()),Mn==="hsl"&&(is=this.toHslString()),Mn==="hsv"&&(is=this.toHsvString()),is||this.toHexString())},Fn.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},Fn.prototype.clone=function(){return new Fn(this.toString())},Fn.prototype.lighten=function(Mn){Mn===void 0&&(Mn=10);var rs=this.toHsl();return rs.l+=Mn/100,rs.l=clamp01(rs.l),new Fn(rs)},Fn.prototype.brighten=function(Mn){Mn===void 0&&(Mn=10);var rs=this.toRgb();return rs.r=Math.max(0,Math.min(255,rs.r-Math.round(255*-(Mn/100)))),rs.g=Math.max(0,Math.min(255,rs.g-Math.round(255*-(Mn/100)))),rs.b=Math.max(0,Math.min(255,rs.b-Math.round(255*-(Mn/100)))),new Fn(rs)},Fn.prototype.darken=function(Mn){Mn===void 0&&(Mn=10);var rs=this.toHsl();return rs.l-=Mn/100,rs.l=clamp01(rs.l),new Fn(rs)},Fn.prototype.tint=function(Mn){return Mn===void 0&&(Mn=10),this.mix("white",Mn)},Fn.prototype.shade=function(Mn){return Mn===void 0&&(Mn=10),this.mix("black",Mn)},Fn.prototype.desaturate=function(Mn){Mn===void 0&&(Mn=10);var rs=this.toHsl();return rs.s-=Mn/100,rs.s=clamp01(rs.s),new Fn(rs)},Fn.prototype.saturate=function(Mn){Mn===void 0&&(Mn=10);var rs=this.toHsl();return rs.s+=Mn/100,rs.s=clamp01(rs.s),new Fn(rs)},Fn.prototype.greyscale=function(){return this.desaturate(100)},Fn.prototype.spin=function(Mn){var rs=this.toHsl(),is=(rs.h+Mn)%360;return rs.h=is<0?360+is:is,new Fn(rs)},Fn.prototype.mix=function(Mn,rs){rs===void 0&&(rs=50);var is=this.toRgb(),os=new Fn(Mn).toRgb(),as=rs/100,us={r:(os.r-is.r)*as+is.r,g:(os.g-is.g)*as+is.g,b:(os.b-is.b)*as+is.b,a:(os.a-is.a)*as+is.a};return new Fn(us)},Fn.prototype.analogous=function(Mn,rs){Mn===void 0&&(Mn=6),rs===void 0&&(rs=30);var is=this.toHsl(),os=360/rs,as=[this];for(is.h=(is.h-(os*Mn>>1)+720)%360;--Mn;)is.h=(is.h+os)%360,as.push(new Fn(is));return as},Fn.prototype.complement=function(){var Mn=this.toHsl();return Mn.h=(Mn.h+180)%360,new Fn(Mn)},Fn.prototype.monochromatic=function(Mn){Mn===void 0&&(Mn=6);for(var rs=this.toHsv(),is=rs.h,os=rs.s,as=rs.v,us=[],ds=1/Mn;Mn--;)us.push(new Fn({h:is,s:os,v:as})),as=(as+ds)%1;return us},Fn.prototype.splitcomplement=function(){var Mn=this.toHsl(),rs=Mn.h;return[this,new Fn({h:(rs+72)%360,s:Mn.s,l:Mn.l}),new Fn({h:(rs+216)%360,s:Mn.s,l:Mn.l})]},Fn.prototype.onBackground=function(Mn){var rs=this.toRgb(),is=new Fn(Mn).toRgb(),os=rs.a+is.a*(1-rs.a);return new Fn({r:(rs.r*rs.a+is.r*is.a*(1-rs.a))/os,g:(rs.g*rs.a+is.g*is.a*(1-rs.a))/os,b:(rs.b*rs.a+is.b*is.a*(1-rs.a))/os,a:os})},Fn.prototype.triad=function(){return this.polyad(3)},Fn.prototype.tetrad=function(){return this.polyad(4)},Fn.prototype.polyad=function(Mn){for(var rs=this.toHsl(),is=rs.h,os=[this],as=360/Mn,us=1;us<Mn;us++)os.push(new Fn({h:(is+us*as)%360,s:rs.s,l:rs.l}));return os},Fn.prototype.equals=function(Mn){return this.toRgbString()===new Fn(Mn).toRgbString()},Fn}(),hueStep=2,saturationStep=.16,saturationStep2=.05,brightnessStep1=.05,brightnessStep2=.15,lightColorCount=5,darkColorCount=4,darkColorMap=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function toHsv(Fn){var Mn=Fn.r,rs=Fn.g,is=Fn.b,os=rgbToHsv(Mn,rs,is);return{h:os.h*360,s:os.s,v:os.v}}function toHex$4(Fn){var Mn=Fn.r,rs=Fn.g,is=Fn.b;return"#".concat(rgbToHex(Mn,rs,is,!1))}function mix(Fn,Mn,rs){var is=rs/100,os={r:(Mn.r-Fn.r)*is+Fn.r,g:(Mn.g-Fn.g)*is+Fn.g,b:(Mn.b-Fn.b)*is+Fn.b};return os}function getHue(Fn,Mn,rs){var is;return Math.round(Fn.h)>=60&&Math.round(Fn.h)<=240?is=rs?Math.round(Fn.h)-hueStep*Mn:Math.round(Fn.h)+hueStep*Mn:is=rs?Math.round(Fn.h)+hueStep*Mn:Math.round(Fn.h)-hueStep*Mn,is<0?is+=360:is>=360&&(is-=360),is}function getSaturation(Fn,Mn,rs){if(Fn.h===0&&Fn.s===0)return Fn.s;var is;return rs?is=Fn.s-saturationStep*Mn:Mn===darkColorCount?is=Fn.s+saturationStep:is=Fn.s+saturationStep2*Mn,is>1&&(is=1),rs&&Mn===lightColorCount&&is>.1&&(is=.1),is<.06&&(is=.06),Number(is.toFixed(2))}function getValue$1(Fn,Mn,rs){var is;return rs?is=Fn.v+brightnessStep1*Mn:is=Fn.v-brightnessStep2*Mn,is>1&&(is=1),Number(is.toFixed(2))}function generate$1(Fn){for(var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rs=[],is=inputToRGB(Fn),os=lightColorCount;os>0;os-=1){var as=toHsv(is),us=toHex$4(inputToRGB({h:getHue(as,os,!0),s:getSaturation(as,os,!0),v:getValue$1(as,os,!0)}));rs.push(us)}rs.push(toHex$4(is));for(var ds=1;ds<=darkColorCount;ds+=1){var hs=toHsv(is),ps=toHex$4(inputToRGB({h:getHue(hs,ds),s:getSaturation(hs,ds),v:getValue$1(hs,ds)}));rs.push(ps)}return Mn.theme==="dark"?darkColorMap.map(function(io){var fo=io.index,mo=io.opacity,Ao=toHex$4(mix(inputToRGB(Mn.backgroundColor||"#141414"),inputToRGB(rs[fo]),mo*100));return Ao}):rs}var presetPrimaryColors={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},red=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];red.primary=red[5];var volcano=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];volcano.primary=volcano[5];var orange=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];orange.primary=orange[5];var gold=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];gold.primary=gold[5];var yellow=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];yellow.primary=yellow[5];var lime=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];lime.primary=lime[5];var green=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];green.primary=green[5];var cyan=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];cyan.primary=cyan[5];var blue=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];blue.primary=blue[5];var geekblue=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];geekblue.primary=geekblue[5];var purple=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];purple.primary=purple[5];var magenta=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];magenta.primary=magenta[5];var grey=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];grey.primary=grey[5];var presetPalettes={red,volcano,orange,gold,yellow,lime,green,cyan,blue,geekblue,purple,magenta,grey};const defaultPresetColors={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},seedToken=Object.assign(Object.assign({},defaultPresetColors),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});function genColorMapToken(Fn,Mn){let{generateColorPalettes:rs,generateNeutralColorPalettes:is}=Mn;const{colorSuccess:os,colorWarning:as,colorError:us,colorInfo:ds,colorPrimary:hs,colorBgBase:ps,colorTextBase:io}=Fn,fo=rs(hs),mo=rs(os),Ao=rs(as),$o=rs(us),Lo=rs(ds),Go=is(ps,io),Yo=Fn.colorLink||Fn.colorInfo,Wo=rs(Yo);return Object.assign(Object.assign({},Go),{colorPrimaryBg:fo[1],colorPrimaryBgHover:fo[2],colorPrimaryBorder:fo[3],colorPrimaryBorderHover:fo[4],colorPrimaryHover:fo[5],colorPrimary:fo[6],colorPrimaryActive:fo[7],colorPrimaryTextHover:fo[8],colorPrimaryText:fo[9],colorPrimaryTextActive:fo[10],colorSuccessBg:mo[1],colorSuccessBgHover:mo[2],colorSuccessBorder:mo[3],colorSuccessBorderHover:mo[4],colorSuccessHover:mo[4],colorSuccess:mo[6],colorSuccessActive:mo[7],colorSuccessTextHover:mo[8],colorSuccessText:mo[9],colorSuccessTextActive:mo[10],colorErrorBg:$o[1],colorErrorBgHover:$o[2],colorErrorBgActive:$o[3],colorErrorBorder:$o[3],colorErrorBorderHover:$o[4],colorErrorHover:$o[5],colorError:$o[6],colorErrorActive:$o[7],colorErrorTextHover:$o[8],colorErrorText:$o[9],colorErrorTextActive:$o[10],colorWarningBg:Ao[1],colorWarningBgHover:Ao[2],colorWarningBorder:Ao[3],colorWarningBorderHover:Ao[4],colorWarningHover:Ao[4],colorWarning:Ao[6],colorWarningActive:Ao[7],colorWarningTextHover:Ao[8],colorWarningText:Ao[9],colorWarningTextActive:Ao[10],colorInfoBg:Lo[1],colorInfoBgHover:Lo[2],colorInfoBorder:Lo[3],colorInfoBorderHover:Lo[4],colorInfoHover:Lo[4],colorInfo:Lo[6],colorInfoActive:Lo[7],colorInfoTextHover:Lo[8],colorInfoText:Lo[9],colorInfoTextActive:Lo[10],colorLinkHover:Wo[4],colorLink:Wo[6],colorLinkActive:Wo[7],colorBgMask:new TinyColor("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const genRadius=Fn=>{let Mn=Fn,rs=Fn,is=Fn,os=Fn;return Fn<6&&Fn>=5?Mn=Fn+1:Fn<16&&Fn>=6?Mn=Fn+2:Fn>=16&&(Mn=16),Fn<7&&Fn>=5?rs=4:Fn<8&&Fn>=7?rs=5:Fn<14&&Fn>=8?rs=6:Fn<16&&Fn>=14?rs=7:Fn>=16&&(rs=8),Fn<6&&Fn>=2?is=1:Fn>=6&&(is=2),Fn>4&&Fn<8?os=4:Fn>=8&&(os=6),{borderRadius:Fn,borderRadiusXS:is,borderRadiusSM:rs,borderRadiusLG:Mn,borderRadiusOuter:os}};function genCommonMapToken(Fn){const{motionUnit:Mn,motionBase:rs,borderRadius:is,lineWidth:os}=Fn;return Object.assign({motionDurationFast:`${(rs+Mn).toFixed(1)}s`,motionDurationMid:`${(rs+Mn*2).toFixed(1)}s`,motionDurationSlow:`${(rs+Mn*3).toFixed(1)}s`,lineWidthBold:os+1},genRadius(is))}const genControlHeight=Fn=>{const{controlHeight:Mn}=Fn;return{controlHeightSM:Mn*.75,controlHeightXS:Mn*.5,controlHeightLG:Mn*1.25}};function getLineHeight(Fn){return(Fn+8)/Fn}function getFontSizes(Fn){const Mn=new Array(10).fill(null).map((rs,is)=>{const os=is-1,as=Fn*Math.pow(Math.E,os/5),us=is>1?Math.floor(as):Math.ceil(as);return Math.floor(us/2)*2});return Mn[1]=Fn,Mn.map(rs=>({size:rs,lineHeight:getLineHeight(rs)}))}const genFontMapToken=Fn=>{const Mn=getFontSizes(Fn),rs=Mn.map(io=>io.size),is=Mn.map(io=>io.lineHeight),os=rs[1],as=rs[0],us=rs[2],ds=is[1],hs=is[0],ps=is[2];return{fontSizeSM:as,fontSize:os,fontSizeLG:us,fontSizeXL:rs[3],fontSizeHeading1:rs[6],fontSizeHeading2:rs[5],fontSizeHeading3:rs[4],fontSizeHeading4:rs[3],fontSizeHeading5:rs[2],lineHeight:ds,lineHeightLG:ps,lineHeightSM:hs,fontHeight:Math.round(ds*os),fontHeightLG:Math.round(ps*us),fontHeightSM:Math.round(hs*as),lineHeightHeading1:is[6],lineHeightHeading2:is[5],lineHeightHeading3:is[4],lineHeightHeading4:is[3],lineHeightHeading5:is[2]}};function genSizeMapToken(Fn){const{sizeUnit:Mn,sizeStep:rs}=Fn;return{sizeXXL:Mn*(rs+8),sizeXL:Mn*(rs+4),sizeLG:Mn*(rs+2),sizeMD:Mn*(rs+1),sizeMS:Mn*rs,size:Mn*rs,sizeSM:Mn*(rs-1),sizeXS:Mn*(rs-2),sizeXXS:Mn*(rs-3)}}const getAlphaColor$1=(Fn,Mn)=>new TinyColor(Fn).setAlpha(Mn).toRgbString(),getSolidColor=(Fn,Mn)=>new TinyColor(Fn).darken(Mn).toHexString(),generateColorPalettes=Fn=>{const Mn=generate$1(Fn);return{1:Mn[0],2:Mn[1],3:Mn[2],4:Mn[3],5:Mn[4],6:Mn[5],7:Mn[6],8:Mn[4],9:Mn[5],10:Mn[6]}},generateNeutralColorPalettes=(Fn,Mn)=>{const rs=Fn||"#fff",is=Mn||"#000";return{colorBgBase:rs,colorTextBase:is,colorText:getAlphaColor$1(is,.88),colorTextSecondary:getAlphaColor$1(is,.65),colorTextTertiary:getAlphaColor$1(is,.45),colorTextQuaternary:getAlphaColor$1(is,.25),colorFill:getAlphaColor$1(is,.15),colorFillSecondary:getAlphaColor$1(is,.06),colorFillTertiary:getAlphaColor$1(is,.04),colorFillQuaternary:getAlphaColor$1(is,.02),colorBgLayout:getSolidColor(rs,4),colorBgContainer:getSolidColor(rs,0),colorBgElevated:getSolidColor(rs,0),colorBgSpotlight:getAlphaColor$1(is,.85),colorBgBlur:"transparent",colorBorder:getSolidColor(rs,15),colorBorderSecondary:getSolidColor(rs,6)}};function derivative(Fn){presetPrimaryColors.pink=presetPrimaryColors.magenta,presetPalettes.pink=presetPalettes.magenta;const Mn=Object.keys(defaultPresetColors).map(rs=>{const is=Fn[rs]===presetPrimaryColors[rs]?presetPalettes[rs]:generate$1(Fn[rs]);return new Array(10).fill(1).reduce((os,as,us)=>(os[`${rs}-${us+1}`]=is[us],os[`${rs}${us+1}`]=is[us],os),{})}).reduce((rs,is)=>(rs=Object.assign(Object.assign({},rs),is),rs),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Fn),Mn),genColorMapToken(Fn,{generateColorPalettes,generateNeutralColorPalettes})),genFontMapToken(Fn.fontSize)),genSizeMapToken(Fn)),genControlHeight(Fn)),genCommonMapToken(Fn))}const defaultTheme=createTheme(derivative),defaultConfig={token:seedToken,override:{override:seedToken},hashed:!0},DesignTokenContext=React.createContext(defaultConfig),defaultPrefixCls="ant",defaultIconPrefixCls="anticon",defaultGetPrefixCls=(Fn,Mn)=>Mn||(Fn?`${defaultPrefixCls}-${Fn}`:defaultPrefixCls),ConfigContext=reactExports.createContext({getPrefixCls:defaultGetPrefixCls,iconPrefixCls:defaultIconPrefixCls}),dynamicStyleMark=`-ant-${Date.now()}-${Math.random()}`;function getStyle$1(Fn,Mn){const rs={},is=(us,ds)=>{let hs=us.clone();return hs=(ds==null?void 0:ds(hs))||hs,hs.toRgbString()},os=(us,ds)=>{const hs=new TinyColor(us),ps=generate$1(hs.toRgbString());rs[`${ds}-color`]=is(hs),rs[`${ds}-color-disabled`]=ps[1],rs[`${ds}-color-hover`]=ps[4],rs[`${ds}-color-active`]=ps[6],rs[`${ds}-color-outline`]=hs.clone().setAlpha(.2).toRgbString(),rs[`${ds}-color-deprecated-bg`]=ps[0],rs[`${ds}-color-deprecated-border`]=ps[2]};if(Mn.primaryColor){os(Mn.primaryColor,"primary");const us=new TinyColor(Mn.primaryColor),ds=generate$1(us.toRgbString());ds.forEach((ps,io)=>{rs[`primary-${io+1}`]=ps}),rs["primary-color-deprecated-l-35"]=is(us,ps=>ps.lighten(35)),rs["primary-color-deprecated-l-20"]=is(us,ps=>ps.lighten(20)),rs["primary-color-deprecated-t-20"]=is(us,ps=>ps.tint(20)),rs["primary-color-deprecated-t-50"]=is(us,ps=>ps.tint(50)),rs["primary-color-deprecated-f-12"]=is(us,ps=>ps.setAlpha(ps.getAlpha()*.12));const hs=new TinyColor(ds[0]);rs["primary-color-active-deprecated-f-30"]=is(hs,ps=>ps.setAlpha(ps.getAlpha()*.3)),rs["primary-color-active-deprecated-d-02"]=is(hs,ps=>ps.darken(2))}return Mn.successColor&&os(Mn.successColor,"success"),Mn.warningColor&&os(Mn.warningColor,"warning"),Mn.errorColor&&os(Mn.errorColor,"error"),Mn.infoColor&&os(Mn.infoColor,"info"),`
  :root {
    ${Object.keys(rs).map(us=>`--${Fn}-${us}: ${rs[us]};`).join(`
`)}
  }
  `.trim()}function registerTheme(Fn,Mn){const rs=getStyle$1(Fn,Mn);canUseDom()&&updateCSS(rs,`${dynamicStyleMark}-dynamic-theme`)}const DisabledContext=reactExports.createContext(!1),DisabledContextProvider=Fn=>{let{children:Mn,disabled:rs}=Fn;const is=reactExports.useContext(DisabledContext);return reactExports.createElement(DisabledContext.Provider,{value:rs??is},Mn)},SizeContext=reactExports.createContext(void 0),SizeContextProvider=Fn=>{let{children:Mn,size:rs}=Fn;const is=reactExports.useContext(SizeContext);return reactExports.createElement(SizeContext.Provider,{value:rs||is},Mn)};function useConfig$1(){const Fn=reactExports.useContext(DisabledContext),Mn=reactExports.useContext(SizeContext);return{componentDisabled:Fn,componentSize:Mn}}var AbstractCalculator=_createClass$4(function Fn(){_classCallCheck$4(this,Fn)}),CALC_UNIT="CALC_UNIT",regexp$1=new RegExp(CALC_UNIT,"g");function unit(Fn){return typeof Fn=="number"?"".concat(Fn).concat(CALC_UNIT):Fn}var CSSCalculator=function(Fn){_inherits$4(rs,Fn);var Mn=_createSuper$4(rs);function rs(is,os){var as;_classCallCheck$4(this,rs),as=Mn.call(this),_defineProperty$5(_assertThisInitialized$4(as),"result",""),_defineProperty$5(_assertThisInitialized$4(as),"unitlessCssVar",void 0),_defineProperty$5(_assertThisInitialized$4(as),"lowPriority",void 0);var us=_typeof$4(is);return as.unitlessCssVar=os,is instanceof rs?as.result="(".concat(is.result,")"):us==="number"?as.result=unit(is):us==="string"&&(as.result=is),as}return _createClass$4(rs,[{key:"add",value:function(os){return os instanceof rs?this.result="".concat(this.result," + ").concat(os.getResult()):(typeof os=="number"||typeof os=="string")&&(this.result="".concat(this.result," + ").concat(unit(os))),this.lowPriority=!0,this}},{key:"sub",value:function(os){return os instanceof rs?this.result="".concat(this.result," - ").concat(os.getResult()):(typeof os=="number"||typeof os=="string")&&(this.result="".concat(this.result," - ").concat(unit(os))),this.lowPriority=!0,this}},{key:"mul",value:function(os){return this.lowPriority&&(this.result="(".concat(this.result,")")),os instanceof rs?this.result="".concat(this.result," * ").concat(os.getResult(!0)):(typeof os=="number"||typeof os=="string")&&(this.result="".concat(this.result," * ").concat(os)),this.lowPriority=!1,this}},{key:"div",value:function(os){return this.lowPriority&&(this.result="(".concat(this.result,")")),os instanceof rs?this.result="".concat(this.result," / ").concat(os.getResult(!0)):(typeof os=="number"||typeof os=="string")&&(this.result="".concat(this.result," / ").concat(os)),this.lowPriority=!1,this}},{key:"getResult",value:function(os){return this.lowPriority||os?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(os){var as=this,us=os||{},ds=us.unit,hs=!0;return typeof ds=="boolean"?hs=ds:Array.from(this.unitlessCssVar).some(function(ps){return as.result.includes(ps)})&&(hs=!1),this.result=this.result.replace(regexp$1,hs?"px":""),typeof this.lowPriority<"u"?"calc(".concat(this.result,")"):this.result}}]),rs}(AbstractCalculator),NumCalculator=function(Fn){_inherits$4(rs,Fn);var Mn=_createSuper$4(rs);function rs(is){var os;return _classCallCheck$4(this,rs),os=Mn.call(this),_defineProperty$5(_assertThisInitialized$4(os),"result",0),is instanceof rs?os.result=is.result:typeof is=="number"&&(os.result=is),os}return _createClass$4(rs,[{key:"add",value:function(os){return os instanceof rs?this.result+=os.result:typeof os=="number"&&(this.result+=os),this}},{key:"sub",value:function(os){return os instanceof rs?this.result-=os.result:typeof os=="number"&&(this.result-=os),this}},{key:"mul",value:function(os){return os instanceof rs?this.result*=os.result:typeof os=="number"&&(this.result*=os),this}},{key:"div",value:function(os){return os instanceof rs?this.result/=os.result:typeof os=="number"&&(this.result/=os),this}},{key:"equal",value:function(){return this.result}}]),rs}(AbstractCalculator),genCalc=function(Mn,rs){var is=Mn==="css"?CSSCalculator:NumCalculator;return function(os){return new is(os,rs)}},getCompVarPrefix=function(Mn,rs){return"".concat([rs,Mn.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};function useEvent(Fn){var Mn=reactExports.useRef();Mn.current=Fn;var rs=reactExports.useCallback(function(){for(var is,os=arguments.length,as=new Array(os),us=0;us<os;us++)as[us]=arguments[us];return(is=Mn.current)===null||is===void 0?void 0:is.call.apply(is,[Mn].concat(as))},[]);return rs}function useSafeState(Fn){var Mn=reactExports.useRef(!1),rs=reactExports.useState(Fn),is=_slicedToArray(rs,2),os=is[0],as=is[1];reactExports.useEffect(function(){return Mn.current=!1,function(){Mn.current=!0}},[]);function us(ds,hs){hs&&Mn.current||as(ds)}return[os,us]}function hasValue(Fn){return Fn!==void 0}function useMergedState(Fn,Mn){var rs=Mn||{},is=rs.defaultValue,os=rs.value,as=rs.onChange,us=rs.postState,ds=useSafeState(function(){return hasValue(os)?os:hasValue(is)?typeof is=="function"?is():is:typeof Fn=="function"?Fn():Fn}),hs=_slicedToArray(ds,2),ps=hs[0],io=hs[1],fo=os!==void 0?os:ps,mo=us?us(fo):fo,Ao=useEvent(as),$o=useSafeState([fo]),Lo=_slicedToArray($o,2),Go=Lo[0],Yo=Lo[1];useLayoutUpdateEffect(function(){var Jo=Go[0];ps!==Jo&&Ao(ps,Jo)},[Go]),useLayoutUpdateEffect(function(){hasValue(os)||io(os)},[os]);var Wo=useEvent(function(Jo,xl){io(Jo,xl),Yo([fo],xl)});return[mo,Wo]}function getComponentToken(Fn,Mn,rs,is){var os=_objectSpread2({},Mn[Fn]);if(is!=null&&is.deprecatedTokens){var as=is.deprecatedTokens;as.forEach(function(ds){var hs=_slicedToArray(ds,2),ps=hs[0],io=hs[1];if(os!=null&&os[ps]||os!=null&&os[io]){var fo;(fo=os[io])!==null&&fo!==void 0||(os[io]=os==null?void 0:os[ps])}})}var us=_objectSpread2(_objectSpread2({},rs),os);return Object.keys(us).forEach(function(ds){us[ds]===Mn[ds]&&delete us[ds]}),us}var enableStatistic=typeof CSSINJS_STATISTIC<"u",recording=!0;function merge$2(){for(var Fn=arguments.length,Mn=new Array(Fn),rs=0;rs<Fn;rs++)Mn[rs]=arguments[rs];if(!enableStatistic)return Object.assign.apply(Object,[{}].concat(Mn));recording=!1;var is={};return Mn.forEach(function(os){if(_typeof$4(os)==="object"){var as=Object.keys(os);as.forEach(function(us){Object.defineProperty(is,us,{configurable:!0,enumerable:!0,get:function(){return os[us]}})})}}),recording=!0,is}var statistic={};function noop$8(){}var statisticToken=function(Mn){var rs,is=Mn,os=noop$8;return enableStatistic&&typeof Proxy<"u"&&(rs=new Set,is=new Proxy(Mn,{get:function(us,ds){return recording&&rs.add(ds),us[ds]}}),os=function(us,ds){var hs;statistic[us]={global:Array.from(rs),component:_objectSpread2(_objectSpread2({},(hs=statistic[us])===null||hs===void 0?void 0:hs.component),ds)}}),{token:is,keys:rs,flush:os}};function getDefaultComponentToken(Fn,Mn,rs){if(typeof rs=="function"){var is;return rs(merge$2(Mn,(is=Mn[Fn])!==null&&is!==void 0?is:{}))}return rs??{}}function genMaxMin(Fn){return Fn==="js"?{max:Math.max,min:Math.min}:{max:function(){for(var rs=arguments.length,is=new Array(rs),os=0;os<rs;os++)is[os]=arguments[os];return"max(".concat(is.map(function(as){return unit$1(as)}).join(","),")")},min:function(){for(var rs=arguments.length,is=new Array(rs),os=0;os<rs;os++)is[os]=arguments[os];return"min(".concat(is.map(function(as){return unit$1(as)}).join(","),")")}}}var BEAT_LIMIT=1e3*60*10,ArrayKeyMap=function(){function Fn(){_classCallCheck$4(this,Fn),_defineProperty$5(this,"map",new Map),_defineProperty$5(this,"objectIDMap",new WeakMap),_defineProperty$5(this,"nextID",0),_defineProperty$5(this,"lastAccessBeat",new Map),_defineProperty$5(this,"accessBeat",0)}return _createClass$4(Fn,[{key:"set",value:function(rs,is){this.clear();var os=this.getCompositeKey(rs);this.map.set(os,is),this.lastAccessBeat.set(os,Date.now())}},{key:"get",value:function(rs){var is=this.getCompositeKey(rs),os=this.map.get(is);return this.lastAccessBeat.set(is,Date.now()),this.accessBeat+=1,os}},{key:"getCompositeKey",value:function(rs){var is=this,os=rs.map(function(as){return as&&_typeof$4(as)==="object"?"obj_".concat(is.getObjectID(as)):"".concat(_typeof$4(as),"_").concat(as)});return os.join("|")}},{key:"getObjectID",value:function(rs){if(this.objectIDMap.has(rs))return this.objectIDMap.get(rs);var is=this.nextID;return this.objectIDMap.set(rs,is),this.nextID+=1,is}},{key:"clear",value:function(){var rs=this;if(this.accessBeat>1e4){var is=Date.now();this.lastAccessBeat.forEach(function(os,as){is-os>BEAT_LIMIT&&(rs.map.delete(as),rs.lastAccessBeat.delete(as))}),this.accessBeat=0}}}]),Fn}(),uniqueMap=new ArrayKeyMap;function useUniqueMemo(Fn,Mn){return React.useMemo(function(){var rs=uniqueMap.get(Mn);if(rs)return rs;var is=Fn();return uniqueMap.set(Mn,is),is},Mn)}var useDefaultCSP=function(){return{}};function genStyleUtils(Fn){var Mn=Fn.useCSP,rs=Mn===void 0?useDefaultCSP:Mn,is=Fn.useToken,os=Fn.usePrefix,as=Fn.getResetStyles,us=Fn.getCommonStyle,ds=Fn.getCompUnitless;function hs(mo,Ao,$o,Lo){var Go=Array.isArray(mo)?mo[0]:mo;function Yo($l){return"".concat(String(Go)).concat($l.slice(0,1).toUpperCase()).concat($l.slice(1))}var Wo=(Lo==null?void 0:Lo.unitless)||{},Jo=typeof ds=="function"?ds(mo):{},xl=_objectSpread2(_objectSpread2({},Jo),{},_defineProperty$5({},Yo("zIndexPopup"),!0));Object.keys(Wo).forEach(function($l){xl[Yo($l)]=Wo[$l]});var _l=_objectSpread2(_objectSpread2({},Lo),{},{unitless:xl,prefixToken:Yo}),Tl=io(mo,Ao,$o,_l),Sl=ps(Go,$o,_l);return function($l){var Pl=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$l,Dl=Tl($l,Pl),Ol=_slicedToArray(Dl,2),Rl=Ol[1],Vo=Sl(Pl),jo=_slicedToArray(Vo,2),Ho=jo[0],Qo=jo[1];return[Ho,Rl,Qo]}}function ps(mo,Ao,$o){var Lo=$o.unitless,Go=$o.injectStyle,Yo=Go===void 0?!0:Go,Wo=$o.prefixToken,Jo=$o.ignore,xl=function(Sl){var $l=Sl.rootCls,Pl=Sl.cssVar,Dl=Pl===void 0?{}:Pl,Ol=is(),Rl=Ol.realToken;return useCSSVarRegister({path:[mo],prefix:Dl.prefix,key:Dl.key,unitless:Lo,ignore:Jo,token:Rl,scope:$l},function(){var Vo=getDefaultComponentToken(mo,Rl,Ao),jo=getComponentToken(mo,Rl,Vo,{deprecatedTokens:$o==null?void 0:$o.deprecatedTokens});return Object.keys(Vo).forEach(function(Ho){jo[Wo(Ho)]=jo[Ho],delete jo[Ho]}),jo}),null},_l=function(Sl){var $l=is(),Pl=$l.cssVar;return[function(Dl){return Yo&&Pl?React.createElement(React.Fragment,null,React.createElement(xl,{rootCls:Sl,cssVar:Pl,component:mo}),Dl):Dl},Pl==null?void 0:Pl.key]};return _l}function io(mo,Ao,$o){var Lo=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Go=Array.isArray(mo)?mo:[mo,mo],Yo=_slicedToArray(Go,1),Wo=Yo[0],Jo=Go.join("-");return function(xl){var _l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xl,Tl=is(),Sl=Tl.theme,$l=Tl.realToken,Pl=Tl.hashId,Dl=Tl.token,Ol=Tl.cssVar,Rl=os(),Vo=Rl.rootPrefixCls,jo=Rl.iconPrefixCls,Ho=rs(),Qo=Ol?"css":"js",El=useUniqueMemo(function(){var Bl=new Set;return Ol&&Object.keys(Lo.unitless||{}).forEach(function(Gl){Bl.add(token2CSSVar(Gl,Ol.prefix)),Bl.add(token2CSSVar(Gl,getCompVarPrefix(Wo,Ol.prefix)))}),genCalc(Qo,Bl)},[Qo,Wo,Ol==null?void 0:Ol.prefix]),Xo=genMaxMin(Qo),Al=Xo.max,wl=Xo.min,yl={theme:Sl,token:Dl,hashId:Pl,nonce:function(){return Ho.nonce},clientOnly:Lo.clientOnly,layer:{name:"antd"},order:Lo.order||-999};useStyleRegister(_objectSpread2(_objectSpread2({},yl),{},{clientOnly:!1,path:["Shared",Vo]}),function(){return typeof as=="function"?as(Dl):[]});var Il=useStyleRegister(_objectSpread2(_objectSpread2({},yl),{},{path:[Jo,xl,jo]}),function(){if(Lo.injectStyle===!1)return[];var Bl=statisticToken(Dl),Gl=Bl.token,Nl=Bl.flush,zl=getDefaultComponentToken(Wo,$l,$o),Vl=".".concat(xl),Hl=getComponentToken(Wo,$l,zl,{deprecatedTokens:Lo.deprecatedTokens});Ol&&_typeof$4(zl)==="object"&&Object.keys(zl).forEach(function(Xl){zl[Xl]="var(".concat(token2CSSVar(Xl,getCompVarPrefix(Wo,Ol.prefix)),")")});var Yl=merge$2(Gl,{componentCls:Vl,prefixCls:xl,iconCls:".".concat(jo),antCls:".".concat(Vo),calc:El,max:Al,min:wl},Ol?zl:Hl),Ll=Ao(Yl,{hashId:Pl,prefixCls:xl,rootPrefixCls:Vo,iconPrefixCls:jo});Nl(Wo,Hl);var Zl=typeof us=="function"?us(Yl,xl,_l,Lo.resetFont):null;return[Lo.resetStyle===!1?null:Zl,Ll]});return[Il,Pl]}}function fo(mo,Ao,$o){var Lo=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Go=io(mo,Ao,$o,_objectSpread2({resetStyle:!1,order:-998},Lo)),Yo=function(Jo){var xl=Jo.prefixCls,_l=Jo.rootCls,Tl=_l===void 0?xl:_l;return Go(xl,Tl),null};return Yo}return{genStyleHooks:hs,genSubStyleComponent:fo,genComponentStyleHook:io}}const PresetColors=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"],version$t="5.20.1";function isStableColor(Fn){return Fn>=0&&Fn<=255}function getAlphaColor(Fn,Mn){const{r:rs,g:is,b:os,a:as}=new TinyColor(Fn).toRgb();if(as<1)return Fn;const{r:us,g:ds,b:hs}=new TinyColor(Mn).toRgb();for(let ps=.01;ps<=1;ps+=.01){const io=Math.round((rs-us*(1-ps))/ps),fo=Math.round((is-ds*(1-ps))/ps),mo=Math.round((os-hs*(1-ps))/ps);if(isStableColor(io)&&isStableColor(fo)&&isStableColor(mo))return new TinyColor({r:io,g:fo,b:mo,a:Math.round(ps*100)/100}).toRgbString()}return new TinyColor({r:rs,g:is,b:os,a:1}).toRgbString()}var __rest$c=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};function formatToken(Fn){const{override:Mn}=Fn,rs=__rest$c(Fn,["override"]),is=Object.assign({},Mn);Object.keys(seedToken).forEach(mo=>{delete is[mo]});const os=Object.assign(Object.assign({},rs),is),as=480,us=576,ds=768,hs=992,ps=1200,io=1600;if(os.motion===!1){const mo="0s";os.motionDurationFast=mo,os.motionDurationMid=mo,os.motionDurationSlow=mo}return Object.assign(Object.assign(Object.assign({},os),{colorFillContent:os.colorFillSecondary,colorFillContentHover:os.colorFill,colorFillAlter:os.colorFillQuaternary,colorBgContainerDisabled:os.colorFillTertiary,colorBorderBg:os.colorBgContainer,colorSplit:getAlphaColor(os.colorBorderSecondary,os.colorBgContainer),colorTextPlaceholder:os.colorTextQuaternary,colorTextDisabled:os.colorTextQuaternary,colorTextHeading:os.colorText,colorTextLabel:os.colorTextSecondary,colorTextDescription:os.colorTextTertiary,colorTextLightSolid:os.colorWhite,colorHighlight:os.colorError,colorBgTextHover:os.colorFillSecondary,colorBgTextActive:os.colorFill,colorIcon:os.colorTextTertiary,colorIconHover:os.colorText,colorErrorOutline:getAlphaColor(os.colorErrorBg,os.colorBgContainer),colorWarningOutline:getAlphaColor(os.colorWarningBg,os.colorBgContainer),fontSizeIcon:os.fontSizeSM,lineWidthFocus:os.lineWidth*4,lineWidth:os.lineWidth,controlOutlineWidth:os.lineWidth*2,controlInteractiveSize:os.controlHeight/2,controlItemBgHover:os.colorFillTertiary,controlItemBgActive:os.colorPrimaryBg,controlItemBgActiveHover:os.colorPrimaryBgHover,controlItemBgActiveDisabled:os.colorFill,controlTmpOutline:os.colorFillQuaternary,controlOutline:getAlphaColor(os.colorPrimaryBg,os.colorBgContainer),lineType:os.lineType,borderRadius:os.borderRadius,borderRadiusXS:os.borderRadiusXS,borderRadiusSM:os.borderRadiusSM,borderRadiusLG:os.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:os.sizeXXS,paddingXS:os.sizeXS,paddingSM:os.sizeSM,padding:os.size,paddingMD:os.sizeMD,paddingLG:os.sizeLG,paddingXL:os.sizeXL,paddingContentHorizontalLG:os.sizeLG,paddingContentVerticalLG:os.sizeMS,paddingContentHorizontal:os.sizeMS,paddingContentVertical:os.sizeSM,paddingContentHorizontalSM:os.size,paddingContentVerticalSM:os.sizeXS,marginXXS:os.sizeXXS,marginXS:os.sizeXS,marginSM:os.sizeSM,margin:os.size,marginMD:os.sizeMD,marginLG:os.sizeLG,marginXL:os.sizeXL,marginXXL:os.sizeXXL,boxShadow:`
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,boxShadowSecondary:`
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,boxShadowTertiary:`
      0 1px 2px 0 rgba(0, 0, 0, 0.03),
      0 1px 6px -1px rgba(0, 0, 0, 0.02),
      0 2px 4px 0 rgba(0, 0, 0, 0.02)
    `,screenXS:as,screenXSMin:as,screenXSMax:us-1,screenSM:us,screenSMMin:us,screenSMMax:ds-1,screenMD:ds,screenMDMin:ds,screenMDMax:hs-1,screenLG:hs,screenLGMin:hs,screenLGMax:ps-1,screenXL:ps,screenXLMin:ps,screenXLMax:io-1,screenXXL:io,screenXXLMin:io,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`
      0 1px 2px -2px ${new TinyColor("rgba(0, 0, 0, 0.16)").toRgbString()},
      0 3px 6px 0 ${new TinyColor("rgba(0, 0, 0, 0.12)").toRgbString()},
      0 5px 12px 4px ${new TinyColor("rgba(0, 0, 0, 0.09)").toRgbString()}
    `,boxShadowDrawerRight:`
      -6px 0 16px 0 rgba(0, 0, 0, 0.08),
      -3px 0 6px -4px rgba(0, 0, 0, 0.12),
      -9px 0 28px 8px rgba(0, 0, 0, 0.05)
    `,boxShadowDrawerLeft:`
      6px 0 16px 0 rgba(0, 0, 0, 0.08),
      3px 0 6px -4px rgba(0, 0, 0, 0.12),
      9px 0 28px 8px rgba(0, 0, 0, 0.05)
    `,boxShadowDrawerUp:`
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,boxShadowDrawerDown:`
      0 -6px 16px 0 rgba(0, 0, 0, 0.08),
      0 -3px 6px -4px rgba(0, 0, 0, 0.12),
      0 -9px 28px 8px rgba(0, 0, 0, 0.05)
    `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),is)}var __rest$b=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};const unitless={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},ignore={size:!0,sizeSM:!0,sizeLG:!0,sizeMD:!0,sizeXS:!0,sizeXXS:!0,sizeMS:!0,sizeXL:!0,sizeXXL:!0,sizeUnit:!0,sizeStep:!0,motionBase:!0,motionUnit:!0},preserve={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},getComputedToken=(Fn,Mn,rs)=>{const is=rs.getDerivativeToken(Fn),{override:os}=Mn,as=__rest$b(Mn,["override"]);let us=Object.assign(Object.assign({},is),{override:os});return us=formatToken(us),as&&Object.entries(as).forEach(ds=>{let[hs,ps]=ds;const{theme:io}=ps,fo=__rest$b(ps,["theme"]);let mo=fo;io&&(mo=getComputedToken(Object.assign(Object.assign({},us),fo),{override:fo},io)),us[hs]=mo}),us};function useToken(){const{token:Fn,hashed:Mn,theme:rs,override:is,cssVar:os}=React.useContext(DesignTokenContext),as=`${version$t}-${Mn||""}`,us=rs||defaultTheme,[ds,hs,ps]=useCacheToken(us,[seedToken,Fn],{salt:as,override:is,getComputedToken,formatToken,cssVar:os&&{prefix:os.prefix,key:os.key,unitless,ignore,preserve}});return[us,ps,Mn?hs:"",ds,os]}const resetComponent=function(Fn){let Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:Fn.colorText,fontSize:Fn.fontSize,lineHeight:Fn.lineHeight,listStyle:"none",fontFamily:Mn?"inherit":Fn.fontFamily}},resetIcon=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),genLinkStyle=Fn=>({a:{color:Fn.colorLink,textDecoration:Fn.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${Fn.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:Fn.colorLinkHover},"&:active":{color:Fn.colorLinkActive},"&:active, &:hover":{textDecoration:Fn.linkHoverDecoration,outline:0},"&:focus":{textDecoration:Fn.linkFocusDecoration,outline:0},"&[disabled]":{color:Fn.colorTextDisabled,cursor:"not-allowed"}}}),genCommonStyle=(Fn,Mn,rs,is)=>{const os=`[class^="${Mn}"], [class*=" ${Mn}"]`,as=rs?`.${rs}`:os,us={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let ds={};return is!==!1&&(ds={fontFamily:Fn.fontFamily,fontSize:Fn.fontSize}),{[as]:Object.assign(Object.assign(Object.assign({},ds),us),{[os]:us})}},genFocusOutline=Fn=>({outline:`${unit$1(Fn.lineWidthFocus)} solid ${Fn.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),genFocusStyle=Fn=>({"&:focus-visible":Object.assign({},genFocusOutline(Fn))}),useResetIconStyle=(Fn,Mn)=>{const[rs,is]=useToken();return useStyleRegister({theme:rs,token:is,hashId:"",path:["ant-design-icons",Fn],nonce:()=>Mn==null?void 0:Mn.nonce,layer:{name:"antd"}},()=>[{[`.${Fn}`]:Object.assign(Object.assign({},resetIcon()),{[`.${Fn} .${Fn}-icon`]:{display:"block"}})}])},{genStyleHooks,genComponentStyleHook,genSubStyleComponent}=genStyleUtils({usePrefix:()=>{const{getPrefixCls:Fn,iconPrefixCls:Mn}=reactExports.useContext(ConfigContext);return{rootPrefixCls:Fn(),iconPrefixCls:Mn}},useToken:()=>{const[Fn,Mn,rs,is,os]=useToken();return{theme:Fn,realToken:Mn,hashId:rs,token:is,cssVar:os}},useCSP:()=>{const{csp:Fn,iconPrefixCls:Mn}=reactExports.useContext(ConfigContext);return useResetIconStyle(Mn,Fn),Fn??{}},getResetStyles:Fn=>[{"&":genLinkStyle(Fn)}],getCommonStyle:genCommonStyle,getCompUnitless:()=>unitless});function genPresetColor(Fn,Mn){return PresetColors.reduce((rs,is)=>{const os=Fn[`${is}1`],as=Fn[`${is}3`],us=Fn[`${is}6`],ds=Fn[`${is}7`];return Object.assign(Object.assign({},rs),Mn(is,{lightColor:os,lightBorderColor:as,darkColor:us,textColor:ds}))},{})}const fullClone$1=Object.assign({},React$1),{useId:useId$2}=fullClone$1,useEmptyId=()=>"",useThemeKey=typeof useId$2>"u"?useEmptyId:useId$2;function useTheme(Fn,Mn,rs){var is;devUseWarning();const os=Fn||{},as=os.inherit===!1||!Mn?Object.assign(Object.assign({},defaultConfig),{hashed:(is=Mn==null?void 0:Mn.hashed)!==null&&is!==void 0?is:defaultConfig.hashed,cssVar:Mn==null?void 0:Mn.cssVar}):Mn,us=useThemeKey();return useMemo(()=>{var ds,hs;if(!Fn)return Mn;const ps=Object.assign({},as.components);Object.keys(Fn.components||{}).forEach(mo=>{ps[mo]=Object.assign(Object.assign({},ps[mo]),Fn.components[mo])});const io=`css-var-${us.replace(/:/g,"")}`,fo=((ds=os.cssVar)!==null&&ds!==void 0?ds:as.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:rs==null?void 0:rs.prefixCls},typeof as.cssVar=="object"?as.cssVar:{}),typeof os.cssVar=="object"?os.cssVar:{}),{key:typeof os.cssVar=="object"&&((hs=os.cssVar)===null||hs===void 0?void 0:hs.key)||io});return Object.assign(Object.assign(Object.assign({},as),os),{token:Object.assign(Object.assign({},as.token),os.token),components:ps,cssVar:fo})},[os,as],(ds,hs)=>ds.some((ps,io)=>{const fo=hs[io];return!isEqual$1(ps,fo,!0)}))}var _excluded$c=["children"],Context$1=reactExports.createContext({});function MotionProvider(Fn){var Mn=Fn.children,rs=_objectWithoutProperties$1(Fn,_excluded$c);return reactExports.createElement(Context$1.Provider,{value:rs},Mn)}var DomWrapper=function(Fn){_inherits$4(rs,Fn);var Mn=_createSuper$4(rs);function rs(){return _classCallCheck$4(this,rs),Mn.apply(this,arguments)}return _createClass$4(rs,[{key:"render",value:function(){return this.props.children}}]),rs}(reactExports.Component);function useSyncState(Fn){var Mn=reactExports.useReducer(function(ds){return ds+1},0),rs=_slicedToArray(Mn,2),is=rs[1],os=reactExports.useRef(Fn),as=useEvent(function(){return os.current}),us=useEvent(function(ds){os.current=typeof ds=="function"?ds(os.current):ds,is()});return[as,us]}var STATUS_NONE="none",STATUS_APPEAR="appear",STATUS_ENTER="enter",STATUS_LEAVE="leave",STEP_NONE="none",STEP_PREPARE="prepare",STEP_START="start",STEP_ACTIVE="active",STEP_ACTIVATED="end",STEP_PREPARED="prepared";function makePrefixMap(Fn,Mn){var rs={};return rs[Fn.toLowerCase()]=Mn.toLowerCase(),rs["Webkit".concat(Fn)]="webkit".concat(Mn),rs["Moz".concat(Fn)]="moz".concat(Mn),rs["ms".concat(Fn)]="MS".concat(Mn),rs["O".concat(Fn)]="o".concat(Mn.toLowerCase()),rs}function getVendorPrefixes(Fn,Mn){var rs={animationend:makePrefixMap("Animation","AnimationEnd"),transitionend:makePrefixMap("Transition","TransitionEnd")};return Fn&&("AnimationEvent"in Mn||delete rs.animationend.animation,"TransitionEvent"in Mn||delete rs.transitionend.transition),rs}var vendorPrefixes=getVendorPrefixes(canUseDom(),typeof window<"u"?window:{}),style={};if(canUseDom()){var _document$createEleme=document.createElement("div");style=_document$createEleme.style}var prefixedEventNames={};function getVendorPrefixedEventName(Fn){if(prefixedEventNames[Fn])return prefixedEventNames[Fn];var Mn=vendorPrefixes[Fn];if(Mn)for(var rs=Object.keys(Mn),is=rs.length,os=0;os<is;os+=1){var as=rs[os];if(Object.prototype.hasOwnProperty.call(Mn,as)&&as in style)return prefixedEventNames[Fn]=Mn[as],prefixedEventNames[Fn]}return""}var internalAnimationEndName=getVendorPrefixedEventName("animationend"),internalTransitionEndName=getVendorPrefixedEventName("transitionend"),supportTransition=!!(internalAnimationEndName&&internalTransitionEndName),animationEndName=internalAnimationEndName||"animationend",transitionEndName=internalTransitionEndName||"transitionend";function getTransitionName$1(Fn,Mn){if(!Fn)return null;if(_typeof$4(Fn)==="object"){var rs=Mn.replace(/-\w/g,function(is){return is[1].toUpperCase()});return Fn[rs]}return"".concat(Fn,"-").concat(Mn)}const useDomMotionEvents=function(Fn){var Mn=reactExports.useRef();function rs(os){os&&(os.removeEventListener(transitionEndName,Fn),os.removeEventListener(animationEndName,Fn))}function is(os){Mn.current&&Mn.current!==os&&rs(Mn.current),os&&os!==Mn.current&&(os.addEventListener(transitionEndName,Fn),os.addEventListener(animationEndName,Fn),Mn.current=os)}return reactExports.useEffect(function(){return function(){rs(Mn.current)}},[]),[is,rs]};var useIsomorphicLayoutEffect=canUseDom()?reactExports.useLayoutEffect:reactExports.useEffect;const useNextFrame=function(){var Fn=reactExports.useRef(null);function Mn(){wrapperRaf.cancel(Fn.current)}function rs(is){var os=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Mn();var as=wrapperRaf(function(){os<=1?is({isCanceled:function(){return as!==Fn.current}}):rs(is,os-1)});Fn.current=as}return reactExports.useEffect(function(){return function(){Mn()}},[]),[rs,Mn]};var FULL_STEP_QUEUE=[STEP_PREPARE,STEP_START,STEP_ACTIVE,STEP_ACTIVATED],SIMPLE_STEP_QUEUE=[STEP_PREPARE,STEP_PREPARED],SkipStep=!1,DoStep=!0;function isActive(Fn){return Fn===STEP_ACTIVE||Fn===STEP_ACTIVATED}const useStepQueue=function(Fn,Mn,rs){var is=useSafeState(STEP_NONE),os=_slicedToArray(is,2),as=os[0],us=os[1],ds=useNextFrame(),hs=_slicedToArray(ds,2),ps=hs[0],io=hs[1];function fo(){us(STEP_PREPARE,!0)}var mo=Mn?SIMPLE_STEP_QUEUE:FULL_STEP_QUEUE;return useIsomorphicLayoutEffect(function(){if(as!==STEP_NONE&&as!==STEP_ACTIVATED){var Ao=mo.indexOf(as),$o=mo[Ao+1],Lo=rs(as);Lo===SkipStep?us($o,!0):$o&&ps(function(Go){function Yo(){Go.isCanceled()||us($o,!0)}Lo===!0?Yo():Promise.resolve(Lo).then(Yo)})}},[Fn,as]),reactExports.useEffect(function(){return function(){io()}},[]),[fo,as]};function useStatus(Fn,Mn,rs,is){var os=is.motionEnter,as=os===void 0?!0:os,us=is.motionAppear,ds=us===void 0?!0:us,hs=is.motionLeave,ps=hs===void 0?!0:hs,io=is.motionDeadline,fo=is.motionLeaveImmediately,mo=is.onAppearPrepare,Ao=is.onEnterPrepare,$o=is.onLeavePrepare,Lo=is.onAppearStart,Go=is.onEnterStart,Yo=is.onLeaveStart,Wo=is.onAppearActive,Jo=is.onEnterActive,xl=is.onLeaveActive,_l=is.onAppearEnd,Tl=is.onEnterEnd,Sl=is.onLeaveEnd,$l=is.onVisibleChanged,Pl=useSafeState(),Dl=_slicedToArray(Pl,2),Ol=Dl[0],Rl=Dl[1],Vo=useSyncState(STATUS_NONE),jo=_slicedToArray(Vo,2),Ho=jo[0],Qo=jo[1],El=useSafeState(null),Xo=_slicedToArray(El,2),Al=Xo[0],wl=Xo[1],yl=Ho(),Il=reactExports.useRef(!1),Bl=reactExports.useRef(null);function Gl(){return rs()}var Nl=reactExports.useRef(!1);function zl(){Qo(STATUS_NONE),wl(null,!0)}var Vl=useEvent(function(pp){var cp=Ho();if(cp!==STATUS_NONE){var gp=Gl();if(!(pp&&!pp.deadline&&pp.target!==gp)){var mp=Nl.current,fp;cp===STATUS_APPEAR&&mp?fp=_l==null?void 0:_l(gp,pp):cp===STATUS_ENTER&&mp?fp=Tl==null?void 0:Tl(gp,pp):cp===STATUS_LEAVE&&mp&&(fp=Sl==null?void 0:Sl(gp,pp)),mp&&fp!==!1&&zl()}}}),Hl=useDomMotionEvents(Vl),Yl=_slicedToArray(Hl,1),Ll=Yl[0],Zl=function(cp){switch(cp){case STATUS_APPEAR:return _defineProperty$5(_defineProperty$5(_defineProperty$5({},STEP_PREPARE,mo),STEP_START,Lo),STEP_ACTIVE,Wo);case STATUS_ENTER:return _defineProperty$5(_defineProperty$5(_defineProperty$5({},STEP_PREPARE,Ao),STEP_START,Go),STEP_ACTIVE,Jo);case STATUS_LEAVE:return _defineProperty$5(_defineProperty$5(_defineProperty$5({},STEP_PREPARE,$o),STEP_START,Yo),STEP_ACTIVE,xl);default:return{}}},Xl=reactExports.useMemo(function(){return Zl(yl)},[yl]),wu=useStepQueue(yl,!Fn,function(pp){if(pp===STEP_PREPARE){var cp=Xl[STEP_PREPARE];return cp?cp(Gl()):SkipStep}if(dp in Xl){var gp;wl(((gp=Xl[dp])===null||gp===void 0?void 0:gp.call(Xl,Gl(),null))||null)}return dp===STEP_ACTIVE&&yl!==STATUS_NONE&&(Ll(Gl()),io>0&&(clearTimeout(Bl.current),Bl.current=setTimeout(function(){Vl({deadline:!0})},io))),dp===STEP_PREPARED&&zl(),DoStep}),yu=_slicedToArray(wu,2),rp=yu[0],dp=yu[1],up=isActive(dp);Nl.current=up,useIsomorphicLayoutEffect(function(){Rl(Mn);var pp=Il.current;Il.current=!0;var cp;!pp&&Mn&&ds&&(cp=STATUS_APPEAR),pp&&Mn&&as&&(cp=STATUS_ENTER),(pp&&!Mn&&ps||!pp&&fo&&!Mn&&ps)&&(cp=STATUS_LEAVE);var gp=Zl(cp);cp&&(Fn||gp[STEP_PREPARE])?(Qo(cp),rp()):Qo(STATUS_NONE)},[Mn]),reactExports.useEffect(function(){(yl===STATUS_APPEAR&&!ds||yl===STATUS_ENTER&&!as||yl===STATUS_LEAVE&&!ps)&&Qo(STATUS_NONE)},[ds,as,ps]),reactExports.useEffect(function(){return function(){Il.current=!1,clearTimeout(Bl.current)}},[]);var wp=reactExports.useRef(!1);reactExports.useEffect(function(){Ol&&(wp.current=!0),Ol!==void 0&&yl===STATUS_NONE&&((wp.current||Ol)&&($l==null||$l(Ol)),wp.current=!0)},[Ol,yl]);var vp=Al;return Xl[STEP_PREPARE]&&dp===STEP_START&&(vp=_objectSpread2({transition:"none"},vp)),[yl,dp,vp,Ol??Mn]}function genCSSMotion(Fn){var Mn=Fn;_typeof$4(Fn)==="object"&&(Mn=Fn.transitionSupport);function rs(os,as){return!!(os.motionName&&Mn&&as!==!1)}var is=reactExports.forwardRef(function(os,as){var us=os.visible,ds=us===void 0?!0:us,hs=os.removeOnLeave,ps=hs===void 0?!0:hs,io=os.forceRender,fo=os.children,mo=os.motionName,Ao=os.leavedClassName,$o=os.eventProps,Lo=reactExports.useContext(Context$1),Go=Lo.motion,Yo=rs(os,Go),Wo=reactExports.useRef(),Jo=reactExports.useRef();function xl(){try{return Wo.current instanceof HTMLElement?Wo.current:findDOMNode(Jo.current)}catch{return null}}var _l=useStatus(Yo,ds,xl,os),Tl=_slicedToArray(_l,4),Sl=Tl[0],$l=Tl[1],Pl=Tl[2],Dl=Tl[3],Ol=reactExports.useRef(Dl);Dl&&(Ol.current=!0);var Rl=reactExports.useCallback(function(Al){Wo.current=Al,fillRef(as,Al)},[as]),Vo,jo=_objectSpread2(_objectSpread2({},$o),{},{visible:ds});if(!fo)Vo=null;else if(Sl===STATUS_NONE)Dl?Vo=fo(_objectSpread2({},jo),Rl):!ps&&Ol.current&&Ao?Vo=fo(_objectSpread2(_objectSpread2({},jo),{},{className:Ao}),Rl):io||!ps&&!Ao?Vo=fo(_objectSpread2(_objectSpread2({},jo),{},{style:{display:"none"}}),Rl):Vo=null;else{var Ho;$l===STEP_PREPARE?Ho="prepare":isActive($l)?Ho="active":$l===STEP_START&&(Ho="start");var Qo=getTransitionName$1(mo,"".concat(Sl,"-").concat(Ho));Vo=fo(_objectSpread2(_objectSpread2({},jo),{},{className:classNames(getTransitionName$1(mo,Sl),_defineProperty$5(_defineProperty$5({},Qo,Qo&&Ho),mo,typeof mo=="string")),style:Pl}),Rl)}if(reactExports.isValidElement(Vo)&&supportRef(Vo)){var El=Vo,Xo=El.ref;Xo||(Vo=reactExports.cloneElement(Vo,{ref:Rl}))}return reactExports.createElement(DomWrapper,{ref:Jo},Vo)});return is.displayName="CSSMotion",is}const CSSMotion=genCSSMotion(supportTransition);var STATUS_ADD="add",STATUS_KEEP="keep",STATUS_REMOVE="remove",STATUS_REMOVED="removed";function wrapKeyToObject(Fn){var Mn;return Fn&&_typeof$4(Fn)==="object"&&"key"in Fn?Mn=Fn:Mn={key:Fn},_objectSpread2(_objectSpread2({},Mn),{},{key:String(Mn.key)})}function parseKeys(){var Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Fn.map(wrapKeyToObject)}function diffKeys(){var Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],rs=[],is=0,os=Mn.length,as=parseKeys(Fn),us=parseKeys(Mn);as.forEach(function(ps){for(var io=!1,fo=is;fo<os;fo+=1){var mo=us[fo];if(mo.key===ps.key){is<fo&&(rs=rs.concat(us.slice(is,fo).map(function(Ao){return _objectSpread2(_objectSpread2({},Ao),{},{status:STATUS_ADD})})),is=fo),rs.push(_objectSpread2(_objectSpread2({},mo),{},{status:STATUS_KEEP})),is+=1,io=!0;break}}io||rs.push(_objectSpread2(_objectSpread2({},ps),{},{status:STATUS_REMOVE}))}),is<os&&(rs=rs.concat(us.slice(is).map(function(ps){return _objectSpread2(_objectSpread2({},ps),{},{status:STATUS_ADD})})));var ds={};rs.forEach(function(ps){var io=ps.key;ds[io]=(ds[io]||0)+1});var hs=Object.keys(ds).filter(function(ps){return ds[ps]>1});return hs.forEach(function(ps){rs=rs.filter(function(io){var fo=io.key,mo=io.status;return fo!==ps||mo!==STATUS_REMOVE}),rs.forEach(function(io){io.key===ps&&(io.status=STATUS_KEEP)})}),rs}var _excluded$b=["component","children","onVisibleChanged","onAllRemoved"],_excluded2=["status"],MOTION_PROP_NAMES=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function genCSSMotionList(Fn){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:CSSMotion,rs=function(is){_inherits$4(as,is);var os=_createSuper$4(as);function as(){var us;_classCallCheck$4(this,as);for(var ds=arguments.length,hs=new Array(ds),ps=0;ps<ds;ps++)hs[ps]=arguments[ps];return us=os.call.apply(os,[this].concat(hs)),_defineProperty$5(_assertThisInitialized$4(us),"state",{keyEntities:[]}),_defineProperty$5(_assertThisInitialized$4(us),"removeKey",function(io){var fo=us.state.keyEntities,mo=fo.map(function(Ao){return Ao.key!==io?Ao:_objectSpread2(_objectSpread2({},Ao),{},{status:STATUS_REMOVED})});return us.setState({keyEntities:mo}),mo.filter(function(Ao){var $o=Ao.status;return $o!==STATUS_REMOVED}).length}),us}return _createClass$4(as,[{key:"render",value:function(){var ds=this,hs=this.state.keyEntities,ps=this.props,io=ps.component,fo=ps.children,mo=ps.onVisibleChanged,Ao=ps.onAllRemoved,$o=_objectWithoutProperties$1(ps,_excluded$b),Lo=io||reactExports.Fragment,Go={};return MOTION_PROP_NAMES.forEach(function(Yo){Go[Yo]=$o[Yo],delete $o[Yo]}),delete $o.keys,reactExports.createElement(Lo,$o,hs.map(function(Yo,Wo){var Jo=Yo.status,xl=_objectWithoutProperties$1(Yo,_excluded2),_l=Jo===STATUS_ADD||Jo===STATUS_KEEP;return reactExports.createElement(Mn,_extends$4({},Go,{key:xl.key,visible:_l,eventProps:xl,onVisibleChanged:function(Sl){if(mo==null||mo(Sl,{key:xl.key}),!Sl){var $l=ds.removeKey(xl.key);$l===0&&Ao&&Ao()}}}),function(Tl,Sl){return fo(_objectSpread2(_objectSpread2({},Tl),{},{index:Wo}),Sl)})}))}}],[{key:"getDerivedStateFromProps",value:function(ds,hs){var ps=ds.keys,io=hs.keyEntities,fo=parseKeys(ps),mo=diffKeys(io,fo);return{keyEntities:mo.filter(function(Ao){var $o=io.find(function(Lo){var Go=Lo.key;return Ao.key===Go});return!($o&&$o.status===STATUS_REMOVED&&Ao.status===STATUS_REMOVE)})}}}]),as}(reactExports.Component);return _defineProperty$5(rs,"defaultProps",{component:"div"}),rs}const CSSMotionList=genCSSMotionList(supportTransition);function MotionWrapper(Fn){const{children:Mn}=Fn,[,rs]=useToken(),{motion:is}=rs,os=reactExports.useRef(!1);return os.current=os.current||is===!1,os.current?reactExports.createElement(MotionProvider,{motion:is},Mn):Mn}const PropWarning=()=>null;var __rest$a=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};const PASSED_PROPS=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let globalPrefixCls,globalIconPrefixCls,globalTheme,globalHolderRender;function getGlobalPrefixCls(){return globalPrefixCls||defaultPrefixCls}function getGlobalIconPrefixCls(){return globalIconPrefixCls||defaultIconPrefixCls}function isLegacyTheme(Fn){return Object.keys(Fn).some(Mn=>Mn.endsWith("Color"))}const setGlobalConfig=Fn=>{const{prefixCls:Mn,iconPrefixCls:rs,theme:is,holderRender:os}=Fn;Mn!==void 0&&(globalPrefixCls=Mn),rs!==void 0&&(globalIconPrefixCls=rs),"holderRender"in Fn&&(globalHolderRender=os),is&&(isLegacyTheme(is)?registerTheme(getGlobalPrefixCls(),is):globalTheme=is)},globalConfig=()=>({getPrefixCls:(Fn,Mn)=>Mn||(Fn?`${getGlobalPrefixCls()}-${Fn}`:getGlobalPrefixCls()),getIconPrefixCls:getGlobalIconPrefixCls,getRootPrefixCls:()=>globalPrefixCls||getGlobalPrefixCls(),getTheme:()=>globalTheme,holderRender:globalHolderRender}),ProviderChildren=Fn=>{const{children:Mn,csp:rs,autoInsertSpaceInButton:is,alert:os,anchor:as,form:us,locale:ds,componentSize:hs,direction:ps,space:io,virtual:fo,dropdownMatchSelectWidth:mo,popupMatchSelectWidth:Ao,popupOverflow:$o,legacyLocale:Lo,parentContext:Go,iconPrefixCls:Yo,theme:Wo,componentDisabled:Jo,segmented:xl,statistic:_l,spin:Tl,calendar:Sl,carousel:$l,cascader:Pl,collapse:Dl,typography:Ol,checkbox:Rl,descriptions:Vo,divider:jo,drawer:Ho,skeleton:Qo,steps:El,image:Xo,layout:Al,list:wl,mentions:yl,modal:Il,progress:Bl,result:Gl,slider:Nl,breadcrumb:zl,menu:Vl,pagination:Hl,input:Yl,textArea:Ll,empty:Zl,badge:Xl,radio:wu,rate:yu,switch:rp,transfer:dp,avatar:up,message:wp,tag:vp,table:pp,card:cp,tabs:gp,timeline:mp,timePicker:fp,upload:hp,notification:xp,tree:Kl,colorPicker:Fl,datePicker:Ul,rangePicker:Jl,flex:fu,wave:_d,dropdown:tp,warning:yp,tour:_p,floatButtonGroup:Sp,variant:Ap,inputNumber:Op,treeSelect:Zp}=Fn,Qp=reactExports.useCallback((Mp,Ip)=>{const{prefixCls:Dp}=Fn;if(Ip)return Ip;const Lp=Dp||Go.getPrefixCls("");return Mp?`${Lp}-${Mp}`:Lp},[Go.getPrefixCls,Fn.prefixCls]),Xp=Yo||Go.iconPrefixCls||defaultIconPrefixCls,h0=rs||Go.csp;useResetIconStyle(Xp,h0);const Wp=useTheme(Wo,Go.theme,{prefixCls:Qp("")}),Np={csp:h0,autoInsertSpaceInButton:is,alert:os,anchor:as,locale:ds||Lo,direction:ps,space:io,virtual:fo,popupMatchSelectWidth:Ao??mo,popupOverflow:$o,getPrefixCls:Qp,iconPrefixCls:Xp,theme:Wp,segmented:xl,statistic:_l,spin:Tl,calendar:Sl,carousel:$l,cascader:Pl,collapse:Dl,typography:Ol,checkbox:Rl,descriptions:Vo,divider:jo,drawer:Ho,skeleton:Qo,steps:El,image:Xo,input:Yl,textArea:Ll,layout:Al,list:wl,mentions:yl,modal:Il,progress:Bl,result:Gl,slider:Nl,breadcrumb:zl,menu:Vl,pagination:Hl,empty:Zl,badge:Xl,radio:wu,rate:yu,switch:rp,transfer:dp,avatar:up,message:wp,tag:vp,table:pp,card:cp,tabs:gp,timeline:mp,timePicker:fp,upload:hp,notification:xp,tree:Kl,colorPicker:Fl,datePicker:Ul,rangePicker:Jl,flex:fu,wave:_d,dropdown:tp,warning:yp,tour:_p,floatButtonGroup:Sp,variant:Ap,inputNumber:Op,treeSelect:Zp},Rp=Object.assign({},Go);Object.keys(Np).forEach(Mp=>{Np[Mp]!==void 0&&(Rp[Mp]=Np[Mp])}),PASSED_PROPS.forEach(Mp=>{const Ip=Fn[Mp];Ip&&(Rp[Mp]=Ip)}),typeof is<"u"&&(Rp.button=Object.assign({autoInsertSpace:is},Rp.button));const Pp=useMemo(()=>Rp,Rp,(Mp,Ip)=>{const Dp=Object.keys(Mp),Lp=Object.keys(Ip);return Dp.length!==Lp.length||Dp.some(zp=>Mp[zp]!==Ip[zp])}),Hp=reactExports.useMemo(()=>({prefixCls:Xp,csp:h0}),[Xp,h0]);let kp=reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(PropWarning,{dropdownMatchSelectWidth:mo}),Mn);const Gp=reactExports.useMemo(()=>{var Mp,Ip,Dp,Lp;return merge$3(((Mp=localeValues.Form)===null||Mp===void 0?void 0:Mp.defaultValidateMessages)||{},((Dp=(Ip=Pp.locale)===null||Ip===void 0?void 0:Ip.Form)===null||Dp===void 0?void 0:Dp.defaultValidateMessages)||{},((Lp=Pp.form)===null||Lp===void 0?void 0:Lp.validateMessages)||{},(us==null?void 0:us.validateMessages)||{})},[Pp,us==null?void 0:us.validateMessages]);Object.keys(Gp).length>0&&(kp=reactExports.createElement(ValidateMessagesContext.Provider,{value:Gp},kp)),ds&&(kp=reactExports.createElement(LocaleProvider,{locale:ds,_ANT_MARK__:ANT_MARK},kp)),(Xp||h0)&&(kp=reactExports.createElement(IconContext.Provider,{value:Hp},kp)),hs&&(kp=reactExports.createElement(SizeContextProvider,{size:hs},kp)),kp=reactExports.createElement(MotionWrapper,null,kp);const Yp=reactExports.useMemo(()=>{const Mp=Wp||{},{algorithm:Ip,token:Dp,components:Lp,cssVar:zp}=Mp,Bp=__rest$a(Mp,["algorithm","token","components","cssVar"]),qp=Ip&&(!Array.isArray(Ip)||Ip.length>0)?createTheme(Ip):defaultTheme,Vp={};Object.entries(Lp||{}).forEach(g0=>{let[rm,Jp]=g0;const lm=Object.assign({},Jp);"algorithm"in lm&&(lm.algorithm===!0?lm.theme=qp:(Array.isArray(lm.algorithm)||typeof lm.algorithm=="function")&&(lm.theme=createTheme(lm.algorithm)),delete lm.algorithm),Vp[rm]=lm});const tm=Object.assign(Object.assign({},seedToken),Dp);return Object.assign(Object.assign({},Bp),{theme:qp,token:tm,components:Vp,override:Object.assign({override:tm},Vp),cssVar:zp})},[Wp]);return Wo&&(kp=reactExports.createElement(DesignTokenContext.Provider,{value:Yp},kp)),Pp.warning&&(kp=reactExports.createElement(WarningContext.Provider,{value:Pp.warning},kp)),Jo!==void 0&&(kp=reactExports.createElement(DisabledContextProvider,{disabled:Jo},kp)),reactExports.createElement(ConfigContext.Provider,{value:Pp},kp)},ConfigProvider=Fn=>{const Mn=reactExports.useContext(ConfigContext),rs=reactExports.useContext(LocaleContext);return reactExports.createElement(ProviderChildren,Object.assign({parentContext:Mn,legacyLocale:rs},Fn))};ConfigProvider.ConfigContext=ConfigContext;ConfigProvider.SizeContext=SizeContext;ConfigProvider.config=setGlobalConfig;ConfigProvider.useConfig=useConfig$1;Object.defineProperty(ConfigProvider,"SizeContext",{get:()=>SizeContext});var CheckCircleFilled$1={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};function getRoot(Fn){var Mn;return Fn==null||(Mn=Fn.getRootNode)===null||Mn===void 0?void 0:Mn.call(Fn)}function inShadow(Fn){return getRoot(Fn)instanceof ShadowRoot}function getShadowRoot(Fn){return inShadow(Fn)?getRoot(Fn):null}function camelCase(Fn){return Fn.replace(/-(.)/g,function(Mn,rs){return rs.toUpperCase()})}function warning$1(Fn,Mn){warningOnce(Fn,"[@ant-design/icons] ".concat(Mn))}function isIconDefinition(Fn){return _typeof$4(Fn)==="object"&&typeof Fn.name=="string"&&typeof Fn.theme=="string"&&(_typeof$4(Fn.icon)==="object"||typeof Fn.icon=="function")}function normalizeAttrs(){var Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(Fn).reduce(function(Mn,rs){var is=Fn[rs];switch(rs){case"class":Mn.className=is,delete Mn.class;break;default:delete Mn[rs],Mn[camelCase(rs)]=is}return Mn},{})}function generate(Fn,Mn,rs){return rs?React.createElement(Fn.tag,_objectSpread2(_objectSpread2({key:Mn},normalizeAttrs(Fn.attrs)),rs),(Fn.children||[]).map(function(is,os){return generate(is,"".concat(Mn,"-").concat(Fn.tag,"-").concat(os))})):React.createElement(Fn.tag,_objectSpread2({key:Mn},normalizeAttrs(Fn.attrs)),(Fn.children||[]).map(function(is,os){return generate(is,"".concat(Mn,"-").concat(Fn.tag,"-").concat(os))}))}function getSecondaryColor(Fn){return generate$1(Fn)[0]}function normalizeTwoToneColors(Fn){return Fn?Array.isArray(Fn)?Fn:[Fn]:[]}var iconStyles=`
.anticon {
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-style: normal;
  line-height: 0;
  text-align: center;
  text-transform: none;
  vertical-align: -0.125em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.anticon > * {
  line-height: 1;
}

.anticon svg {
  display: inline-block;
}

.anticon::before {
  display: none;
}

.anticon .anticon-icon {
  display: block;
}

.anticon[tabindex] {
  cursor: pointer;
}

.anticon-spin::before,
.anticon-spin {
  display: inline-block;
  -webkit-animation: loadingCircle 1s infinite linear;
  animation: loadingCircle 1s infinite linear;
}

@-webkit-keyframes loadingCircle {
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@keyframes loadingCircle {
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
`,useInsertStyles=function(Mn){var rs=reactExports.useContext(IconContext),is=rs.csp,os=rs.prefixCls,as=iconStyles;os&&(as=as.replace(/anticon/g,os)),reactExports.useEffect(function(){var us=Mn.current,ds=getShadowRoot(us);updateCSS(as,"@ant-design-icons",{prepend:!0,csp:is,attachTo:ds})},[])},_excluded$a=["icon","className","onClick","style","primaryColor","secondaryColor"],twoToneColorPalette={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function setTwoToneColors(Fn){var Mn=Fn.primaryColor,rs=Fn.secondaryColor;twoToneColorPalette.primaryColor=Mn,twoToneColorPalette.secondaryColor=rs||getSecondaryColor(Mn),twoToneColorPalette.calculated=!!rs}function getTwoToneColors(){return _objectSpread2({},twoToneColorPalette)}var IconBase=function(Mn){var rs=Mn.icon,is=Mn.className,os=Mn.onClick,as=Mn.style,us=Mn.primaryColor,ds=Mn.secondaryColor,hs=_objectWithoutProperties$1(Mn,_excluded$a),ps=reactExports.useRef(),io=twoToneColorPalette;if(us&&(io={primaryColor:us,secondaryColor:ds||getSecondaryColor(us)}),useInsertStyles(ps),warning$1(isIconDefinition(rs),"icon should be icon definiton, but got ".concat(rs)),!isIconDefinition(rs))return null;var fo=rs;return fo&&typeof fo.icon=="function"&&(fo=_objectSpread2(_objectSpread2({},fo),{},{icon:fo.icon(io.primaryColor,io.secondaryColor)})),generate(fo.icon,"svg-".concat(fo.name),_objectSpread2(_objectSpread2({className:is,onClick:os,style:as,"data-icon":fo.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},hs),{},{ref:ps}))};IconBase.displayName="IconReact";IconBase.getTwoToneColors=getTwoToneColors;IconBase.setTwoToneColors=setTwoToneColors;function setTwoToneColor(Fn){var Mn=normalizeTwoToneColors(Fn),rs=_slicedToArray(Mn,2),is=rs[0],os=rs[1];return IconBase.setTwoToneColors({primaryColor:is,secondaryColor:os})}function getTwoToneColor(){var Fn=IconBase.getTwoToneColors();return Fn.calculated?[Fn.primaryColor,Fn.secondaryColor]:Fn.primaryColor}var _excluded$9=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];setTwoToneColor(blue.primary);var Icon=reactExports.forwardRef(function(Fn,Mn){var rs=Fn.className,is=Fn.icon,os=Fn.spin,as=Fn.rotate,us=Fn.tabIndex,ds=Fn.onClick,hs=Fn.twoToneColor,ps=_objectWithoutProperties$1(Fn,_excluded$9),io=reactExports.useContext(IconContext),fo=io.prefixCls,mo=fo===void 0?"anticon":fo,Ao=io.rootClassName,$o=classNames(Ao,mo,_defineProperty$5(_defineProperty$5({},"".concat(mo,"-").concat(is.name),!!is.name),"".concat(mo,"-spin"),!!os||is.name==="loading"),rs),Lo=us;Lo===void 0&&ds&&(Lo=-1);var Go=as?{msTransform:"rotate(".concat(as,"deg)"),transform:"rotate(".concat(as,"deg)")}:void 0,Yo=normalizeTwoToneColors(hs),Wo=_slicedToArray(Yo,2),Jo=Wo[0],xl=Wo[1];return reactExports.createElement("span",_extends$4({role:"img","aria-label":is.name},ps,{ref:Mn,tabIndex:Lo,onClick:ds,className:$o}),reactExports.createElement(IconBase,{icon:is,primaryColor:Jo,secondaryColor:xl,style:Go}))});Icon.displayName="AntdIcon";Icon.getTwoToneColor=getTwoToneColor;Icon.setTwoToneColor=setTwoToneColor;var CheckCircleFilled=function(Mn,rs){return reactExports.createElement(Icon,_extends$4({},Mn,{ref:rs,icon:CheckCircleFilled$1}))},RefIcon$6=reactExports.forwardRef(CheckCircleFilled),CloseCircleFilled$1={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},CloseCircleFilled=function(Mn,rs){return reactExports.createElement(Icon,_extends$4({},Mn,{ref:rs,icon:CloseCircleFilled$1}))},RefIcon$5=reactExports.forwardRef(CloseCircleFilled),CloseOutlined$1={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},CloseOutlined=function(Mn,rs){return reactExports.createElement(Icon,_extends$4({},Mn,{ref:rs,icon:CloseOutlined$1}))},RefIcon$4=reactExports.forwardRef(CloseOutlined),ExclamationCircleFilled$1={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},ExclamationCircleFilled=function(Mn,rs){return reactExports.createElement(Icon,_extends$4({},Mn,{ref:rs,icon:ExclamationCircleFilled$1}))},RefIcon$3=reactExports.forwardRef(ExclamationCircleFilled),InfoCircleFilled$1={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},InfoCircleFilled=function(Mn,rs){return reactExports.createElement(Icon,_extends$4({},Mn,{ref:rs,icon:InfoCircleFilled$1}))},RefIcon$2=reactExports.forwardRef(InfoCircleFilled),attributes=`accept acceptCharset accessKey action allowFullScreen allowTransparency
    alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
    charSet checked classID className colSpan cols content contentEditable contextMenu
    controls coords crossOrigin data dateTime default defer dir disabled download draggable
    encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
    headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
    is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
    mediaGroup method min minLength multiple muted name noValidate nonce open
    optimum pattern placeholder poster preload radioGroup readOnly rel required
    reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
    shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
    summary tabIndex target title type useMap value width wmode wrap`,eventsName=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
    onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
    onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
    onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
    onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
    onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
    onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,propList="".concat(attributes," ").concat(eventsName).split(/[\s\n]+/),ariaPrefix="aria-",dataPrefix="data-";function match(Fn,Mn){return Fn.indexOf(Mn)===0}function pickAttrs(Fn){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,rs;Mn===!1?rs={aria:!0,data:!0,attr:!0}:Mn===!0?rs={aria:!0}:rs=_objectSpread2({},Mn);var is={};return Object.keys(Fn).forEach(function(os){(rs.aria&&(os==="role"||match(os,ariaPrefix))||rs.data&&match(os,dataPrefix)||rs.attr&&propList.includes(os))&&(is[os]=Fn[os])}),is}function isFragment$1(Fn){return Fn&&React.isValidElement(Fn)&&Fn.type===React.Fragment}const replaceElement=(Fn,Mn,rs)=>React.isValidElement(Fn)?React.cloneElement(Fn,typeof rs=="function"?rs(Fn.props||{}):rs):Mn;function cloneElement(Fn,Mn){return replaceElement(Fn,Fn,Mn)}const useCSSVarCls=Fn=>{const[,,,,Mn]=useToken();return Mn?`${Fn}-css-var`:""};var KeyCode={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Mn){var rs=Mn.keyCode;if(Mn.altKey&&!Mn.ctrlKey||Mn.metaKey||rs>=KeyCode.F1&&rs<=KeyCode.F12)return!1;switch(rs){case KeyCode.ALT:case KeyCode.CAPS_LOCK:case KeyCode.CONTEXT_MENU:case KeyCode.CTRL:case KeyCode.DOWN:case KeyCode.END:case KeyCode.ESC:case KeyCode.HOME:case KeyCode.INSERT:case KeyCode.LEFT:case KeyCode.MAC_FF_META:case KeyCode.META:case KeyCode.NUMLOCK:case KeyCode.NUM_CENTER:case KeyCode.PAGE_DOWN:case KeyCode.PAGE_UP:case KeyCode.PAUSE:case KeyCode.PRINT_SCREEN:case KeyCode.RIGHT:case KeyCode.SHIFT:case KeyCode.UP:case KeyCode.WIN_KEY:case KeyCode.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Mn){if(Mn>=KeyCode.ZERO&&Mn<=KeyCode.NINE||Mn>=KeyCode.NUM_ZERO&&Mn<=KeyCode.NUM_MULTIPLY||Mn>=KeyCode.A&&Mn<=KeyCode.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Mn===0)return!0;switch(Mn){case KeyCode.SPACE:case KeyCode.QUESTION_MARK:case KeyCode.NUM_PLUS:case KeyCode.NUM_MINUS:case KeyCode.NUM_PERIOD:case KeyCode.NUM_DIVISION:case KeyCode.SEMICOLON:case KeyCode.DASH:case KeyCode.EQUALS:case KeyCode.COMMA:case KeyCode.PERIOD:case KeyCode.SLASH:case KeyCode.APOSTROPHE:case KeyCode.SINGLE_QUOTE:case KeyCode.OPEN_SQUARE_BRACKET:case KeyCode.BACKSLASH:case KeyCode.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Notify=reactExports.forwardRef(function(Fn,Mn){var rs=Fn.prefixCls,is=Fn.style,os=Fn.className,as=Fn.duration,us=as===void 0?4.5:as,ds=Fn.showProgress,hs=Fn.pauseOnHover,ps=hs===void 0?!0:hs,io=Fn.eventKey,fo=Fn.content,mo=Fn.closable,Ao=Fn.closeIcon,$o=Ao===void 0?"x":Ao,Lo=Fn.props,Go=Fn.onClick,Yo=Fn.onNoticeClose,Wo=Fn.times,Jo=Fn.hovering,xl=reactExports.useState(!1),_l=_slicedToArray(xl,2),Tl=_l[0],Sl=_l[1],$l=reactExports.useState(0),Pl=_slicedToArray($l,2),Dl=Pl[0],Ol=Pl[1],Rl=reactExports.useState(0),Vo=_slicedToArray(Rl,2),jo=Vo[0],Ho=Vo[1],Qo=Jo||Tl,El=us>0&&ds,Xo=function(){Yo(io)},Al=function(Nl){(Nl.key==="Enter"||Nl.code==="Enter"||Nl.keyCode===KeyCode.ENTER)&&Xo()};reactExports.useEffect(function(){if(!Qo&&us>0){var Gl=Date.now()-jo,Nl=setTimeout(function(){Xo()},us*1e3-jo);return function(){ps&&clearTimeout(Nl),Ho(Date.now()-Gl)}}},[us,Qo,Wo]),reactExports.useEffect(function(){if(!Qo&&El&&(ps||jo===0)){var Gl=performance.now(),Nl,zl=function Vl(){cancelAnimationFrame(Nl),Nl=requestAnimationFrame(function(Hl){var Yl=Hl+jo-Gl,Ll=Math.min(Yl/(us*1e3),1);Ol(Ll*100),Ll<1&&Vl()})};return zl(),function(){ps&&cancelAnimationFrame(Nl)}}},[us,jo,Qo,El,Wo]);var wl=reactExports.useMemo(function(){return _typeof$4(mo)==="object"&&mo!==null?mo:mo?{closeIcon:$o}:{}},[mo,$o]),yl=pickAttrs(wl,!0),Il=100-(!Dl||Dl<0?0:Dl>100?100:Dl),Bl="".concat(rs,"-notice");return reactExports.createElement("div",_extends$4({},Lo,{ref:Mn,className:classNames(Bl,os,_defineProperty$5({},"".concat(Bl,"-closable"),mo)),style:is,onMouseEnter:function(Nl){var zl;Sl(!0),Lo==null||(zl=Lo.onMouseEnter)===null||zl===void 0||zl.call(Lo,Nl)},onMouseLeave:function(Nl){var zl;Sl(!1),Lo==null||(zl=Lo.onMouseLeave)===null||zl===void 0||zl.call(Lo,Nl)},onClick:Go}),reactExports.createElement("div",{className:"".concat(Bl,"-content")},fo),mo&&reactExports.createElement("a",_extends$4({tabIndex:0,className:"".concat(Bl,"-close"),onKeyDown:Al,"aria-label":"Close"},yl,{onClick:function(Nl){Nl.preventDefault(),Nl.stopPropagation(),Xo()}}),wl.closeIcon),El&&reactExports.createElement("progress",{className:"".concat(Bl,"-progress"),max:"100",value:Il},Il+"%"))}),NotificationContext=React.createContext({}),NotificationProvider=function(Mn){var rs=Mn.children,is=Mn.classNames;return React.createElement(NotificationContext.Provider,{value:{classNames:is}},rs)},DEFAULT_OFFSET$1=8,DEFAULT_THRESHOLD=3,DEFAULT_GAP=16,useStack=function(Mn){var rs={offset:DEFAULT_OFFSET$1,threshold:DEFAULT_THRESHOLD,gap:DEFAULT_GAP};if(Mn&&_typeof$4(Mn)==="object"){var is,os,as;rs.offset=(is=Mn.offset)!==null&&is!==void 0?is:DEFAULT_OFFSET$1,rs.threshold=(os=Mn.threshold)!==null&&os!==void 0?os:DEFAULT_THRESHOLD,rs.gap=(as=Mn.gap)!==null&&as!==void 0?as:DEFAULT_GAP}return[!!Mn,rs]},_excluded$8=["className","style","classNames","styles"],NoticeList=function(Mn){var rs=Mn.configList,is=Mn.placement,os=Mn.prefixCls,as=Mn.className,us=Mn.style,ds=Mn.motion,hs=Mn.onAllNoticeRemoved,ps=Mn.onNoticeClose,io=Mn.stack,fo=reactExports.useContext(NotificationContext),mo=fo.classNames,Ao=reactExports.useRef({}),$o=reactExports.useState(null),Lo=_slicedToArray($o,2),Go=Lo[0],Yo=Lo[1],Wo=reactExports.useState([]),Jo=_slicedToArray(Wo,2),xl=Jo[0],_l=Jo[1],Tl=rs.map(function(Qo){return{config:Qo,key:String(Qo.key)}}),Sl=useStack(io),$l=_slicedToArray(Sl,2),Pl=$l[0],Dl=$l[1],Ol=Dl.offset,Rl=Dl.threshold,Vo=Dl.gap,jo=Pl&&(xl.length>0||Tl.length<=Rl),Ho=typeof ds=="function"?ds(is):ds;return reactExports.useEffect(function(){Pl&&xl.length>1&&_l(function(Qo){return Qo.filter(function(El){return Tl.some(function(Xo){var Al=Xo.key;return El===Al})})})},[xl,Tl,Pl]),reactExports.useEffect(function(){var Qo;if(Pl&&Ao.current[(Qo=Tl[Tl.length-1])===null||Qo===void 0?void 0:Qo.key]){var El;Yo(Ao.current[(El=Tl[Tl.length-1])===null||El===void 0?void 0:El.key])}},[Tl,Pl]),React.createElement(CSSMotionList,_extends$4({key:is,className:classNames(os,"".concat(os,"-").concat(is),mo==null?void 0:mo.list,as,_defineProperty$5(_defineProperty$5({},"".concat(os,"-stack"),!!Pl),"".concat(os,"-stack-expanded"),jo)),style:us,keys:Tl,motionAppear:!0},Ho,{onAllRemoved:function(){hs(is)}}),function(Qo,El){var Xo=Qo.config,Al=Qo.className,wl=Qo.style,yl=Qo.index,Il=Xo,Bl=Il.key,Gl=Il.times,Nl=String(Bl),zl=Xo,Vl=zl.className,Hl=zl.style,Yl=zl.classNames,Ll=zl.styles,Zl=_objectWithoutProperties$1(zl,_excluded$8),Xl=Tl.findIndex(function(fp){return fp.key===Nl}),wu={};if(Pl){var yu=Tl.length-1-(Xl>-1?Xl:yl-1),rp=is==="top"||is==="bottom"?"-50%":"0";if(yu>0){var dp,up,wp;wu.height=jo?(dp=Ao.current[Nl])===null||dp===void 0?void 0:dp.offsetHeight:Go==null?void 0:Go.offsetHeight;for(var vp=0,pp=0;pp<yu;pp++){var cp;vp+=((cp=Ao.current[Tl[Tl.length-1-pp].key])===null||cp===void 0?void 0:cp.offsetHeight)+Vo}var gp=(jo?vp:yu*Ol)*(is.startsWith("top")?1:-1),mp=!jo&&Go!==null&&Go!==void 0&&Go.offsetWidth&&(up=Ao.current[Nl])!==null&&up!==void 0&&up.offsetWidth?((Go==null?void 0:Go.offsetWidth)-Ol*2*(yu<3?yu:3))/((wp=Ao.current[Nl])===null||wp===void 0?void 0:wp.offsetWidth):1;wu.transform="translate3d(".concat(rp,", ").concat(gp,"px, 0) scaleX(").concat(mp,")")}else wu.transform="translate3d(".concat(rp,", 0, 0)")}return React.createElement("div",{ref:El,className:classNames("".concat(os,"-notice-wrapper"),Al,Yl==null?void 0:Yl.wrapper),style:_objectSpread2(_objectSpread2(_objectSpread2({},wl),wu),Ll==null?void 0:Ll.wrapper),onMouseEnter:function(){return _l(function(hp){return hp.includes(Nl)?hp:[].concat(_toConsumableArray(hp),[Nl])})},onMouseLeave:function(){return _l(function(hp){return hp.filter(function(xp){return xp!==Nl})})}},React.createElement(Notify,_extends$4({},Zl,{ref:function(hp){Xl>-1?Ao.current[Nl]=hp:delete Ao.current[Nl]},prefixCls:os,classNames:Yl,styles:Ll,className:classNames(Vl,mo==null?void 0:mo.notice),style:Hl,times:Gl,key:Bl,eventKey:Bl,onNoticeClose:ps,hovering:Pl&&xl.length>0})))})},Notifications=reactExports.forwardRef(function(Fn,Mn){var rs=Fn.prefixCls,is=rs===void 0?"rc-notification":rs,os=Fn.container,as=Fn.motion,us=Fn.maxCount,ds=Fn.className,hs=Fn.style,ps=Fn.onAllRemoved,io=Fn.stack,fo=Fn.renderNotifications,mo=reactExports.useState([]),Ao=_slicedToArray(mo,2),$o=Ao[0],Lo=Ao[1],Go=function(Pl){var Dl,Ol=$o.find(function(Rl){return Rl.key===Pl});Ol==null||(Dl=Ol.onClose)===null||Dl===void 0||Dl.call(Ol),Lo(function(Rl){return Rl.filter(function(Vo){return Vo.key!==Pl})})};reactExports.useImperativeHandle(Mn,function(){return{open:function(Pl){Lo(function(Dl){var Ol=_toConsumableArray(Dl),Rl=Ol.findIndex(function(Ho){return Ho.key===Pl.key}),Vo=_objectSpread2({},Pl);if(Rl>=0){var jo;Vo.times=(((jo=Dl[Rl])===null||jo===void 0?void 0:jo.times)||0)+1,Ol[Rl]=Vo}else Vo.times=0,Ol.push(Vo);return us>0&&Ol.length>us&&(Ol=Ol.slice(-us)),Ol})},close:function(Pl){Go(Pl)},destroy:function(){Lo([])}}});var Yo=reactExports.useState({}),Wo=_slicedToArray(Yo,2),Jo=Wo[0],xl=Wo[1];reactExports.useEffect(function(){var $l={};$o.forEach(function(Pl){var Dl=Pl.placement,Ol=Dl===void 0?"topRight":Dl;Ol&&($l[Ol]=$l[Ol]||[],$l[Ol].push(Pl))}),Object.keys(Jo).forEach(function(Pl){$l[Pl]=$l[Pl]||[]}),xl($l)},[$o]);var _l=function(Pl){xl(function(Dl){var Ol=_objectSpread2({},Dl),Rl=Ol[Pl]||[];return Rl.length||delete Ol[Pl],Ol})},Tl=reactExports.useRef(!1);if(reactExports.useEffect(function(){Object.keys(Jo).length>0?Tl.current=!0:Tl.current&&(ps==null||ps(),Tl.current=!1)},[Jo]),!os)return null;var Sl=Object.keys(Jo);return reactDomExports.createPortal(reactExports.createElement(reactExports.Fragment,null,Sl.map(function($l){var Pl=Jo[$l],Dl=reactExports.createElement(NoticeList,{key:$l,configList:Pl,placement:$l,prefixCls:is,className:ds==null?void 0:ds($l),style:hs==null?void 0:hs($l),motion:as,onNoticeClose:Go,onAllNoticeRemoved:_l,stack:io});return fo?fo(Dl,{prefixCls:is,key:$l}):Dl})),os)}),_excluded$7=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],defaultGetContainer=function(){return document.body},uniqueKey=0;function mergeConfig$1(){for(var Fn={},Mn=arguments.length,rs=new Array(Mn),is=0;is<Mn;is++)rs[is]=arguments[is];return rs.forEach(function(os){os&&Object.keys(os).forEach(function(as){var us=os[as];us!==void 0&&(Fn[as]=us)})}),Fn}function useNotification$1(){var Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mn=Fn.getContainer,rs=Mn===void 0?defaultGetContainer:Mn,is=Fn.motion,os=Fn.prefixCls,as=Fn.maxCount,us=Fn.className,ds=Fn.style,hs=Fn.onAllRemoved,ps=Fn.stack,io=Fn.renderNotifications,fo=_objectWithoutProperties$1(Fn,_excluded$7),mo=reactExports.useState(),Ao=_slicedToArray(mo,2),$o=Ao[0],Lo=Ao[1],Go=reactExports.useRef(),Yo=reactExports.createElement(Notifications,{container:$o,ref:Go,prefixCls:os,motion:is,maxCount:as,className:us,style:ds,onAllRemoved:hs,stack:ps,renderNotifications:io}),Wo=reactExports.useState([]),Jo=_slicedToArray(Wo,2),xl=Jo[0],_l=Jo[1],Tl=reactExports.useMemo(function(){return{open:function($l){var Pl=mergeConfig$1(fo,$l);(Pl.key===null||Pl.key===void 0)&&(Pl.key="rc-notification-".concat(uniqueKey),uniqueKey+=1),_l(function(Dl){return[].concat(_toConsumableArray(Dl),[{type:"open",config:Pl}])})},close:function($l){_l(function(Pl){return[].concat(_toConsumableArray(Pl),[{type:"close",key:$l}])})},destroy:function(){_l(function($l){return[].concat(_toConsumableArray($l),[{type:"destroy"}])})}}},[]);return reactExports.useEffect(function(){Lo(rs())}),reactExports.useEffect(function(){Go.current&&xl.length&&(xl.forEach(function(Sl){switch(Sl.type){case"open":Go.current.open(Sl.config);break;case"close":Go.current.close(Sl.key);break;case"destroy":Go.current.destroy();break}}),_l(function(Sl){return Sl.filter(function($l){return!xl.includes($l)})}))},[xl]),[Tl,Yo]}var LoadingOutlined$1={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},LoadingOutlined=function(Mn,rs){return reactExports.createElement(Icon,_extends$4({},Mn,{ref:rs,icon:LoadingOutlined$1}))},RefIcon$1=reactExports.forwardRef(LoadingOutlined);const zIndexContext=React.createContext(void 0),CONTAINER_OFFSET=100,CONTAINER_OFFSET_MAX_COUNT=10,CONTAINER_MAX_OFFSET=CONTAINER_OFFSET*CONTAINER_OFFSET_MAX_COUNT,containerBaseZIndexOffset={Modal:CONTAINER_OFFSET,Drawer:CONTAINER_OFFSET,Popover:CONTAINER_OFFSET,Popconfirm:CONTAINER_OFFSET,Tooltip:CONTAINER_OFFSET,Tour:CONTAINER_OFFSET},consumerBaseZIndexOffset={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function isContainerType(Fn){return Fn in containerBaseZIndexOffset}function useZIndex(Fn,Mn){const[,rs]=useToken(),is=React.useContext(zIndexContext),os=isContainerType(Fn);let as;if(Mn!==void 0)as=[Mn,Mn];else{let us=is??0;os?us+=(is?0:rs.zIndexPopupBase)+containerBaseZIndexOffset[Fn]:us+=consumerBaseZIndexOffset[Fn],as=[is===void 0?Mn:us,us]}return as}function _regeneratorRuntime(){_regeneratorRuntime=function(){return Mn};var Fn,Mn={},rs=Object.prototype,is=rs.hasOwnProperty,os=Object.defineProperty||function(Qo,El,Xo){Qo[El]=Xo.value},as=typeof Symbol=="function"?Symbol:{},us=as.iterator||"@@iterator",ds=as.asyncIterator||"@@asyncIterator",hs=as.toStringTag||"@@toStringTag";function ps(Qo,El,Xo){return Object.defineProperty(Qo,El,{value:Xo,enumerable:!0,configurable:!0,writable:!0}),Qo[El]}try{ps({},"")}catch{ps=function(Xo,Al,wl){return Xo[Al]=wl}}function io(Qo,El,Xo,Al){var wl=El&&El.prototype instanceof Yo?El:Yo,yl=Object.create(wl.prototype),Il=new jo(Al||[]);return os(yl,"_invoke",{value:Dl(Qo,Xo,Il)}),yl}function fo(Qo,El,Xo){try{return{type:"normal",arg:Qo.call(El,Xo)}}catch(Al){return{type:"throw",arg:Al}}}Mn.wrap=io;var mo="suspendedStart",Ao="suspendedYield",$o="executing",Lo="completed",Go={};function Yo(){}function Wo(){}function Jo(){}var xl={};ps(xl,us,function(){return this});var _l=Object.getPrototypeOf,Tl=_l&&_l(_l(Ho([])));Tl&&Tl!==rs&&is.call(Tl,us)&&(xl=Tl);var Sl=Jo.prototype=Yo.prototype=Object.create(xl);function $l(Qo){["next","throw","return"].forEach(function(El){ps(Qo,El,function(Xo){return this._invoke(El,Xo)})})}function Pl(Qo,El){function Xo(wl,yl,Il,Bl){var Gl=fo(Qo[wl],Qo,yl);if(Gl.type!=="throw"){var Nl=Gl.arg,zl=Nl.value;return zl&&_typeof$4(zl)=="object"&&is.call(zl,"__await")?El.resolve(zl.__await).then(function(Vl){Xo("next",Vl,Il,Bl)},function(Vl){Xo("throw",Vl,Il,Bl)}):El.resolve(zl).then(function(Vl){Nl.value=Vl,Il(Nl)},function(Vl){return Xo("throw",Vl,Il,Bl)})}Bl(Gl.arg)}var Al;os(this,"_invoke",{value:function(yl,Il){function Bl(){return new El(function(Gl,Nl){Xo(yl,Il,Gl,Nl)})}return Al=Al?Al.then(Bl,Bl):Bl()}})}function Dl(Qo,El,Xo){var Al=mo;return function(wl,yl){if(Al===$o)throw Error("Generator is already running");if(Al===Lo){if(wl==="throw")throw yl;return{value:Fn,done:!0}}for(Xo.method=wl,Xo.arg=yl;;){var Il=Xo.delegate;if(Il){var Bl=Ol(Il,Xo);if(Bl){if(Bl===Go)continue;return Bl}}if(Xo.method==="next")Xo.sent=Xo._sent=Xo.arg;else if(Xo.method==="throw"){if(Al===mo)throw Al=Lo,Xo.arg;Xo.dispatchException(Xo.arg)}else Xo.method==="return"&&Xo.abrupt("return",Xo.arg);Al=$o;var Gl=fo(Qo,El,Xo);if(Gl.type==="normal"){if(Al=Xo.done?Lo:Ao,Gl.arg===Go)continue;return{value:Gl.arg,done:Xo.done}}Gl.type==="throw"&&(Al=Lo,Xo.method="throw",Xo.arg=Gl.arg)}}}function Ol(Qo,El){var Xo=El.method,Al=Qo.iterator[Xo];if(Al===Fn)return El.delegate=null,Xo==="throw"&&Qo.iterator.return&&(El.method="return",El.arg=Fn,Ol(Qo,El),El.method==="throw")||Xo!=="return"&&(El.method="throw",El.arg=new TypeError("The iterator does not provide a '"+Xo+"' method")),Go;var wl=fo(Al,Qo.iterator,El.arg);if(wl.type==="throw")return El.method="throw",El.arg=wl.arg,El.delegate=null,Go;var yl=wl.arg;return yl?yl.done?(El[Qo.resultName]=yl.value,El.next=Qo.nextLoc,El.method!=="return"&&(El.method="next",El.arg=Fn),El.delegate=null,Go):yl:(El.method="throw",El.arg=new TypeError("iterator result is not an object"),El.delegate=null,Go)}function Rl(Qo){var El={tryLoc:Qo[0]};1 in Qo&&(El.catchLoc=Qo[1]),2 in Qo&&(El.finallyLoc=Qo[2],El.afterLoc=Qo[3]),this.tryEntries.push(El)}function Vo(Qo){var El=Qo.completion||{};El.type="normal",delete El.arg,Qo.completion=El}function jo(Qo){this.tryEntries=[{tryLoc:"root"}],Qo.forEach(Rl,this),this.reset(!0)}function Ho(Qo){if(Qo||Qo===""){var El=Qo[us];if(El)return El.call(Qo);if(typeof Qo.next=="function")return Qo;if(!isNaN(Qo.length)){var Xo=-1,Al=function wl(){for(;++Xo<Qo.length;)if(is.call(Qo,Xo))return wl.value=Qo[Xo],wl.done=!1,wl;return wl.value=Fn,wl.done=!0,wl};return Al.next=Al}}throw new TypeError(_typeof$4(Qo)+" is not iterable")}return Wo.prototype=Jo,os(Sl,"constructor",{value:Jo,configurable:!0}),os(Jo,"constructor",{value:Wo,configurable:!0}),Wo.displayName=ps(Jo,hs,"GeneratorFunction"),Mn.isGeneratorFunction=function(Qo){var El=typeof Qo=="function"&&Qo.constructor;return!!El&&(El===Wo||(El.displayName||El.name)==="GeneratorFunction")},Mn.mark=function(Qo){return Object.setPrototypeOf?Object.setPrototypeOf(Qo,Jo):(Qo.__proto__=Jo,ps(Qo,hs,"GeneratorFunction")),Qo.prototype=Object.create(Sl),Qo},Mn.awrap=function(Qo){return{__await:Qo}},$l(Pl.prototype),ps(Pl.prototype,ds,function(){return this}),Mn.AsyncIterator=Pl,Mn.async=function(Qo,El,Xo,Al,wl){wl===void 0&&(wl=Promise);var yl=new Pl(io(Qo,El,Xo,Al),wl);return Mn.isGeneratorFunction(El)?yl:yl.next().then(function(Il){return Il.done?Il.value:yl.next()})},$l(Sl),ps(Sl,hs,"Generator"),ps(Sl,us,function(){return this}),ps(Sl,"toString",function(){return"[object Generator]"}),Mn.keys=function(Qo){var El=Object(Qo),Xo=[];for(var Al in El)Xo.push(Al);return Xo.reverse(),function wl(){for(;Xo.length;){var yl=Xo.pop();if(yl in El)return wl.value=yl,wl.done=!1,wl}return wl.done=!0,wl}},Mn.values=Ho,jo.prototype={constructor:jo,reset:function(El){if(this.prev=0,this.next=0,this.sent=this._sent=Fn,this.done=!1,this.delegate=null,this.method="next",this.arg=Fn,this.tryEntries.forEach(Vo),!El)for(var Xo in this)Xo.charAt(0)==="t"&&is.call(this,Xo)&&!isNaN(+Xo.slice(1))&&(this[Xo]=Fn)},stop:function(){this.done=!0;var El=this.tryEntries[0].completion;if(El.type==="throw")throw El.arg;return this.rval},dispatchException:function(El){if(this.done)throw El;var Xo=this;function Al(Nl,zl){return Il.type="throw",Il.arg=El,Xo.next=Nl,zl&&(Xo.method="next",Xo.arg=Fn),!!zl}for(var wl=this.tryEntries.length-1;wl>=0;--wl){var yl=this.tryEntries[wl],Il=yl.completion;if(yl.tryLoc==="root")return Al("end");if(yl.tryLoc<=this.prev){var Bl=is.call(yl,"catchLoc"),Gl=is.call(yl,"finallyLoc");if(Bl&&Gl){if(this.prev<yl.catchLoc)return Al(yl.catchLoc,!0);if(this.prev<yl.finallyLoc)return Al(yl.finallyLoc)}else if(Bl){if(this.prev<yl.catchLoc)return Al(yl.catchLoc,!0)}else{if(!Gl)throw Error("try statement without catch or finally");if(this.prev<yl.finallyLoc)return Al(yl.finallyLoc)}}}},abrupt:function(El,Xo){for(var Al=this.tryEntries.length-1;Al>=0;--Al){var wl=this.tryEntries[Al];if(wl.tryLoc<=this.prev&&is.call(wl,"finallyLoc")&&this.prev<wl.finallyLoc){var yl=wl;break}}yl&&(El==="break"||El==="continue")&&yl.tryLoc<=Xo&&Xo<=yl.finallyLoc&&(yl=null);var Il=yl?yl.completion:{};return Il.type=El,Il.arg=Xo,yl?(this.method="next",this.next=yl.finallyLoc,Go):this.complete(Il)},complete:function(El,Xo){if(El.type==="throw")throw El.arg;return El.type==="break"||El.type==="continue"?this.next=El.arg:El.type==="return"?(this.rval=this.arg=El.arg,this.method="return",this.next="end"):El.type==="normal"&&Xo&&(this.next=Xo),Go},finish:function(El){for(var Xo=this.tryEntries.length-1;Xo>=0;--Xo){var Al=this.tryEntries[Xo];if(Al.finallyLoc===El)return this.complete(Al.completion,Al.afterLoc),Vo(Al),Go}},catch:function(El){for(var Xo=this.tryEntries.length-1;Xo>=0;--Xo){var Al=this.tryEntries[Xo];if(Al.tryLoc===El){var wl=Al.completion;if(wl.type==="throw"){var yl=wl.arg;Vo(Al)}return yl}}throw Error("illegal catch attempt")},delegateYield:function(El,Xo,Al){return this.delegate={iterator:Ho(El),resultName:Xo,nextLoc:Al},this.method==="next"&&(this.arg=Fn),Go}},Mn}function asyncGeneratorStep(Fn,Mn,rs,is,os,as,us){try{var ds=Fn[as](us),hs=ds.value}catch(ps){return void rs(ps)}ds.done?Mn(hs):Promise.resolve(hs).then(is,os)}function _asyncToGenerator(Fn){return function(){var Mn=this,rs=arguments;return new Promise(function(is,os){var as=Fn.apply(Mn,rs);function us(hs){asyncGeneratorStep(as,is,os,us,ds,"next",hs)}function ds(hs){asyncGeneratorStep(as,is,os,us,ds,"throw",hs)}us(void 0)})}}var fullClone=_objectSpread2({},ReactDOM$1),version$s=fullClone.version,reactRender=fullClone.render,unmountComponentAtNode=fullClone.unmountComponentAtNode,createRoot;try{var mainVersion=Number((version$s||"").split(".")[0]);mainVersion>=18&&(createRoot=fullClone.createRoot)}catch{}function toggleWarning(Fn){var Mn=fullClone.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Mn&&_typeof$4(Mn)==="object"&&(Mn.usingClientEntryPoint=Fn)}var MARK="__rc_react_root__";function modernRender(Fn,Mn){toggleWarning(!0);var rs=Mn[MARK]||createRoot(Mn);toggleWarning(!1),rs.render(Fn),Mn[MARK]=rs}function legacyRender(Fn,Mn){reactRender(Fn,Mn)}function render(Fn,Mn){if(createRoot){modernRender(Fn,Mn);return}legacyRender(Fn,Mn)}function modernUnmount(Fn){return _modernUnmount.apply(this,arguments)}function _modernUnmount(){return _modernUnmount=_asyncToGenerator(_regeneratorRuntime().mark(function Fn(Mn){return _regeneratorRuntime().wrap(function(is){for(;;)switch(is.prev=is.next){case 0:return is.abrupt("return",Promise.resolve().then(function(){var os;(os=Mn[MARK])===null||os===void 0||os.unmount(),delete Mn[MARK]}));case 1:case"end":return is.stop()}},Fn)})),_modernUnmount.apply(this,arguments)}function legacyUnmount(Fn){unmountComponentAtNode(Fn)}function unmount(Fn){return _unmount.apply(this,arguments)}function _unmount(){return _unmount=_asyncToGenerator(_regeneratorRuntime().mark(function Fn(Mn){return _regeneratorRuntime().wrap(function(is){for(;;)switch(is.prev=is.next){case 0:if(createRoot===void 0){is.next=2;break}return is.abrupt("return",modernUnmount(Mn));case 2:legacyUnmount(Mn);case 3:case"end":return is.stop()}},Fn)})),_unmount.apply(this,arguments)}const getTransitionName=(Fn,Mn,rs)=>rs!==void 0?rs:`${Fn}-${Mn}`,isVisible=function(Fn){if(!Fn)return!1;if(Fn instanceof Element){if(Fn.offsetParent)return!0;if(Fn.getBBox){var Mn=Fn.getBBox(),rs=Mn.width,is=Mn.height;if(rs||is)return!0}if(Fn.getBoundingClientRect){var os=Fn.getBoundingClientRect(),as=os.width,us=os.height;if(as||us)return!0}}return!1},genWaveStyle=Fn=>{const{componentCls:Mn,colorPrimary:rs}=Fn;return{[Mn]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${rs})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${Fn.motionEaseOutCirc}`,`opacity 2s ${Fn.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow ${Fn.motionDurationSlow} ${Fn.motionEaseInOut}`,`opacity ${Fn.motionDurationSlow} ${Fn.motionEaseInOut}`].join(",")}}}}},useStyle$5=genComponentStyleHook("Wave",Fn=>[genWaveStyle(Fn)]),TARGET_CLS=`${defaultPrefixCls}-wave-target`;function isNotGrey(Fn){const Mn=(Fn||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return Mn&&Mn[1]&&Mn[2]&&Mn[3]?!(Mn[1]===Mn[2]&&Mn[2]===Mn[3]):!0}function isValidWaveColor(Fn){return Fn&&Fn!=="#fff"&&Fn!=="#ffffff"&&Fn!=="rgb(255, 255, 255)"&&Fn!=="rgba(255, 255, 255, 1)"&&isNotGrey(Fn)&&!/rgba\((?:\d*, ){3}0\)/.test(Fn)&&Fn!=="transparent"}function getTargetWaveColor(Fn){const{borderTopColor:Mn,borderColor:rs,backgroundColor:is}=getComputedStyle(Fn);return isValidWaveColor(Mn)?Mn:isValidWaveColor(rs)?rs:isValidWaveColor(is)?is:null}function validateNum(Fn){return Number.isNaN(Fn)?0:Fn}const WaveEffect=Fn=>{const{className:Mn,target:rs,component:is}=Fn,os=reactExports.useRef(null),[as,us]=reactExports.useState(null),[ds,hs]=reactExports.useState([]),[ps,io]=reactExports.useState(0),[fo,mo]=reactExports.useState(0),[Ao,$o]=reactExports.useState(0),[Lo,Go]=reactExports.useState(0),[Yo,Wo]=reactExports.useState(!1),Jo={left:ps,top:fo,width:Ao,height:Lo,borderRadius:ds.map(Tl=>`${Tl}px`).join(" ")};as&&(Jo["--wave-color"]=as);function xl(){const Tl=getComputedStyle(rs);us(getTargetWaveColor(rs));const Sl=Tl.position==="static",{borderLeftWidth:$l,borderTopWidth:Pl}=Tl;io(Sl?rs.offsetLeft:validateNum(-parseFloat($l))),mo(Sl?rs.offsetTop:validateNum(-parseFloat(Pl))),$o(rs.offsetWidth),Go(rs.offsetHeight);const{borderTopLeftRadius:Dl,borderTopRightRadius:Ol,borderBottomLeftRadius:Rl,borderBottomRightRadius:Vo}=Tl;hs([Dl,Ol,Vo,Rl].map(jo=>validateNum(parseFloat(jo))))}if(reactExports.useEffect(()=>{if(rs){const Tl=wrapperRaf(()=>{xl(),Wo(!0)});let Sl;return typeof ResizeObserver<"u"&&(Sl=new ResizeObserver(xl),Sl.observe(rs)),()=>{wrapperRaf.cancel(Tl),Sl==null||Sl.disconnect()}}},[]),!Yo)return null;const _l=(is==="Checkbox"||is==="Radio")&&(rs==null?void 0:rs.classList.contains(TARGET_CLS));return reactExports.createElement(CSSMotion,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(Tl,Sl)=>{var $l;if(Sl.deadline||Sl.propertyName==="opacity"){const Pl=($l=os.current)===null||$l===void 0?void 0:$l.parentElement;unmount(Pl).then(()=>{Pl==null||Pl.remove()})}return!1}},(Tl,Sl)=>{let{className:$l}=Tl;return reactExports.createElement("div",{ref:composeRef(os,Sl),className:classNames(Mn,$l,{"wave-quick":_l}),style:Jo})})},showWaveEffect=(Fn,Mn)=>{var rs;const{component:is}=Mn;if(is==="Checkbox"&&!(!((rs=Fn.querySelector("input"))===null||rs===void 0)&&rs.checked))return;const os=document.createElement("div");os.style.position="absolute",os.style.left="0px",os.style.top="0px",Fn==null||Fn.insertBefore(os,Fn==null?void 0:Fn.firstChild),render(reactExports.createElement(WaveEffect,Object.assign({},Mn,{target:Fn})),os)},useWave=(Fn,Mn,rs)=>{const{wave:is}=reactExports.useContext(ConfigContext),[,os,as]=useToken(),us=useEvent(ps=>{const io=Fn.current;if(is!=null&&is.disabled||!io)return;const fo=io.querySelector(`.${TARGET_CLS}`)||io,{showEffect:mo}=is||{};(mo||showWaveEffect)(fo,{className:Mn,token:os,component:rs,event:ps,hashId:as})}),ds=reactExports.useRef();return ps=>{wrapperRaf.cancel(ds.current),ds.current=wrapperRaf(()=>{us(ps)})}},Wave=Fn=>{const{children:Mn,disabled:rs,component:is}=Fn,{getPrefixCls:os}=reactExports.useContext(ConfigContext),as=reactExports.useRef(null),us=os("wave"),[,ds]=useStyle$5(us),hs=useWave(as,classNames(us,ds),is);if(React.useEffect(()=>{const io=as.current;if(!io||io.nodeType!==1||rs)return;const fo=mo=>{!isVisible(mo.target)||!io.getAttribute||io.getAttribute("disabled")||io.disabled||io.className.includes("disabled")||io.className.includes("-leave")||hs(mo)};return io.addEventListener("click",fo,!0),()=>{io.removeEventListener("click",fo,!0)}},[rs]),!React.isValidElement(Mn))return Mn??null;const ps=supportRef(Mn)?composeRef(Mn.ref,as):as;return cloneElement(Mn,{ref:ps})},useSize=Fn=>{const Mn=React.useContext(SizeContext);return React.useMemo(()=>Fn?typeof Fn=="string"?Fn??Mn:Fn instanceof Function?Fn(Mn):Mn:Mn,[Fn,Mn])},SpaceCompactItemContext=reactExports.createContext(null),useCompactItemContext=(Fn,Mn)=>{const rs=reactExports.useContext(SpaceCompactItemContext),is=reactExports.useMemo(()=>{if(!rs)return"";const{compactDirection:os,isFirstItem:as,isLastItem:us}=rs,ds=os==="vertical"?"-vertical-":"-";return classNames(`${Fn}-compact${ds}item`,{[`${Fn}-compact${ds}first-item`]:as,[`${Fn}-compact${ds}last-item`]:us,[`${Fn}-compact${ds}item-rtl`]:Mn==="rtl"})},[Fn,Mn,rs]);return{compactSize:rs==null?void 0:rs.compactSize,compactDirection:rs==null?void 0:rs.compactDirection,compactItemClassnames:is}},NoCompactStyle=Fn=>{let{children:Mn}=Fn;return reactExports.createElement(SpaceCompactItemContext.Provider,{value:null},Mn)};var __rest$9=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};const GroupSizeContext=reactExports.createContext(void 0),ButtonGroup=Fn=>{const{getPrefixCls:Mn,direction:rs}=reactExports.useContext(ConfigContext),{prefixCls:is,size:os,className:as}=Fn,us=__rest$9(Fn,["prefixCls","size","className"]),ds=Mn("btn-group",is),[,,hs]=useToken();let ps="";switch(os){case"large":ps="lg";break;case"small":ps="sm";break}const io=classNames(ds,{[`${ds}-${ps}`]:ps,[`${ds}-rtl`]:rs==="rtl"},as,hs);return reactExports.createElement(GroupSizeContext.Provider,{value:os},reactExports.createElement("div",Object.assign({},us,{className:io})))},rxTwoCNChar=/^[\u4e00-\u9fa5]{2}$/,isTwoCNChar=rxTwoCNChar.test.bind(rxTwoCNChar);function isString$1(Fn){return typeof Fn=="string"}function isUnBorderedButtonType(Fn){return Fn==="text"||Fn==="link"}function splitCNCharsBySpace(Fn,Mn){if(Fn==null)return;const rs=Mn?" ":"";return typeof Fn!="string"&&typeof Fn!="number"&&isString$1(Fn.type)&&isTwoCNChar(Fn.props.children)?cloneElement(Fn,{children:Fn.props.children.split("").join(rs)}):isString$1(Fn)?isTwoCNChar(Fn)?React.createElement("span",null,Fn.split("").join(rs)):React.createElement("span",null,Fn):isFragment$1(Fn)?React.createElement("span",null,Fn):Fn}function spaceChildren(Fn,Mn){let rs=!1;const is=[];return React.Children.forEach(Fn,os=>{const as=typeof os,us=as==="string"||as==="number";if(rs&&us){const ds=is.length-1,hs=is[ds];is[ds]=`${hs}${os}`}else is.push(os);rs=us}),React.Children.map(is,os=>splitCNCharsBySpace(os,Mn))}const IconWrapper=reactExports.forwardRef((Fn,Mn)=>{const{className:rs,style:is,children:os,prefixCls:as}=Fn,us=classNames(`${as}-icon`,rs);return React.createElement("span",{ref:Mn,className:us,style:is},os)}),InnerLoadingIcon=reactExports.forwardRef((Fn,Mn)=>{const{prefixCls:rs,className:is,style:os,iconClassName:as}=Fn,us=classNames(`${rs}-loading-icon`,is);return React.createElement(IconWrapper,{prefixCls:rs,className:us,style:os,ref:Mn},React.createElement(RefIcon$1,{className:as}))}),getCollapsedWidth=()=>({width:0,opacity:0,transform:"scale(0)"}),getRealWidth=Fn=>({width:Fn.scrollWidth,opacity:1,transform:"scale(1)"}),LoadingIcon=Fn=>{const{prefixCls:Mn,loading:rs,existIcon:is,className:os,style:as}=Fn,us=!!rs;return is?React.createElement(InnerLoadingIcon,{prefixCls:Mn,className:os,style:as}):React.createElement(CSSMotion,{visible:us,motionName:`${Mn}-loading-icon-motion`,motionLeave:us,removeOnLeave:!0,onAppearStart:getCollapsedWidth,onAppearActive:getRealWidth,onEnterStart:getCollapsedWidth,onEnterActive:getRealWidth,onLeaveStart:getRealWidth,onLeaveActive:getCollapsedWidth},(ds,hs)=>{let{className:ps,style:io}=ds;return React.createElement(InnerLoadingIcon,{prefixCls:Mn,className:os,style:Object.assign(Object.assign({},as),io),ref:hs,iconClassName:ps})})},genButtonBorderStyle=(Fn,Mn)=>({[`> span, > ${Fn}`]:{"&:not(:last-child)":{[`&, & > ${Fn}`]:{"&:not(:disabled)":{borderInlineEndColor:Mn}}},"&:not(:first-child)":{[`&, & > ${Fn}`]:{"&:not(:disabled)":{borderInlineStartColor:Mn}}}}}),genGroupStyle=Fn=>{const{componentCls:Mn,fontSize:rs,lineWidth:is,groupBorderColor:os,colorErrorHover:as}=Fn;return{[`${Mn}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${Mn}`]:{"&:not(:last-child)":{[`&, & > ${Mn}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:Fn.calc(is).mul(-1).equal(),[`&, & > ${Mn}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[Mn]:{position:"relative",zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${Mn}-icon-only`]:{fontSize:rs}},genButtonBorderStyle(`${Mn}-primary`,os),genButtonBorderStyle(`${Mn}-danger`,as)]}},prepareToken=Fn=>{const{paddingInline:Mn,onlyIconSize:rs,paddingBlock:is}=Fn;return merge$2(Fn,{buttonPaddingHorizontal:Mn,buttonPaddingVertical:is,buttonIconOnlyFontSize:rs})},prepareComponentToken$4=Fn=>{var Mn,rs,is,os,as,us;const ds=(Mn=Fn.contentFontSize)!==null&&Mn!==void 0?Mn:Fn.fontSize,hs=(rs=Fn.contentFontSizeSM)!==null&&rs!==void 0?rs:Fn.fontSize,ps=(is=Fn.contentFontSizeLG)!==null&&is!==void 0?is:Fn.fontSizeLG,io=(os=Fn.contentLineHeight)!==null&&os!==void 0?os:getLineHeight(ds),fo=(as=Fn.contentLineHeightSM)!==null&&as!==void 0?as:getLineHeight(hs),mo=(us=Fn.contentLineHeightLG)!==null&&us!==void 0?us:getLineHeight(ps);return{fontWeight:400,defaultShadow:`0 ${Fn.controlOutlineWidth}px 0 ${Fn.controlTmpOutline}`,primaryShadow:`0 ${Fn.controlOutlineWidth}px 0 ${Fn.controlOutline}`,dangerShadow:`0 ${Fn.controlOutlineWidth}px 0 ${Fn.colorErrorOutline}`,primaryColor:Fn.colorTextLightSolid,dangerColor:Fn.colorTextLightSolid,borderColorDisabled:Fn.colorBorder,defaultGhostColor:Fn.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:Fn.colorBgContainer,paddingInline:Fn.paddingContentHorizontal-Fn.lineWidth,paddingInlineLG:Fn.paddingContentHorizontal-Fn.lineWidth,paddingInlineSM:8-Fn.lineWidth,onlyIconSize:Fn.fontSizeLG,onlyIconSizeSM:Fn.fontSizeLG-2,onlyIconSizeLG:Fn.fontSizeLG+2,groupBorderColor:Fn.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:Fn.colorBgTextHover,defaultColor:Fn.colorText,defaultBg:Fn.colorBgContainer,defaultBorderColor:Fn.colorBorder,defaultBorderColorDisabled:Fn.colorBorder,defaultHoverBg:Fn.colorBgContainer,defaultHoverColor:Fn.colorPrimaryHover,defaultHoverBorderColor:Fn.colorPrimaryHover,defaultActiveBg:Fn.colorBgContainer,defaultActiveColor:Fn.colorPrimaryActive,defaultActiveBorderColor:Fn.colorPrimaryActive,contentFontSize:ds,contentFontSizeSM:hs,contentFontSizeLG:ps,contentLineHeight:io,contentLineHeightSM:fo,contentLineHeightLG:mo,paddingBlock:Math.max((Fn.controlHeight-ds*io)/2-Fn.lineWidth,0),paddingBlockSM:Math.max((Fn.controlHeightSM-hs*fo)/2-Fn.lineWidth,0),paddingBlockLG:Math.max((Fn.controlHeightLG-ps*mo)/2-Fn.lineWidth,0)}},genSharedButtonStyle=Fn=>{const{componentCls:Mn,iconCls:rs,fontWeight:is}=Fn;return{[Mn]:{outline:"none",position:"relative",display:"inline-flex",gap:Fn.marginXS,alignItems:"center",justifyContent:"center",fontWeight:is,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:`${unit$1(Fn.lineWidth)} ${Fn.lineType} transparent`,cursor:"pointer",transition:`all ${Fn.motionDurationMid} ${Fn.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",color:Fn.colorText,"&:disabled > *":{pointerEvents:"none"},"> span":{display:"inline-block"},[`${Mn}-icon`]:{lineHeight:1},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},genFocusStyle(Fn)),[`&${Mn}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${Mn}-two-chinese-chars > *:not(${rs})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},"&-icon-end":{flexDirection:"row-reverse"}}}},genHoverActiveButtonStyle=(Fn,Mn,rs)=>({[`&:not(:disabled):not(${Fn}-disabled)`]:{"&:hover":Mn,"&:active":rs}}),genCircleButtonStyle=Fn=>({minWidth:Fn.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),genRoundButtonStyle=Fn=>({borderRadius:Fn.controlHeight,paddingInlineStart:Fn.calc(Fn.controlHeight).div(2).equal(),paddingInlineEnd:Fn.calc(Fn.controlHeight).div(2).equal()}),genDisabledStyle=Fn=>({cursor:"not-allowed",borderColor:Fn.borderColorDisabled,color:Fn.colorTextDisabled,background:Fn.colorBgContainerDisabled,boxShadow:"none"}),genGhostButtonStyle=(Fn,Mn,rs,is,os,as,us,ds)=>({[`&${Fn}-background-ghost`]:Object.assign(Object.assign({color:rs||void 0,background:Mn,borderColor:is||void 0,boxShadow:"none"},genHoverActiveButtonStyle(Fn,Object.assign({background:Mn},us),Object.assign({background:Mn},ds))),{"&:disabled":{cursor:"not-allowed",color:os||void 0,borderColor:as||void 0}})}),genSolidDisabledButtonStyle=Fn=>({[`&:disabled, &${Fn.componentCls}-disabled`]:Object.assign({},genDisabledStyle(Fn))}),genSolidButtonStyle=Fn=>Object.assign({},genSolidDisabledButtonStyle(Fn)),genPureDisabledButtonStyle=Fn=>({[`&:disabled, &${Fn.componentCls}-disabled`]:{cursor:"not-allowed",color:Fn.colorTextDisabled}}),genDefaultButtonStyle=Fn=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},genSolidButtonStyle(Fn)),{background:Fn.defaultBg,borderColor:Fn.defaultBorderColor,color:Fn.defaultColor,boxShadow:Fn.defaultShadow}),genHoverActiveButtonStyle(Fn.componentCls,{color:Fn.defaultHoverColor,borderColor:Fn.defaultHoverBorderColor,background:Fn.defaultHoverBg},{color:Fn.defaultActiveColor,borderColor:Fn.defaultActiveBorderColor,background:Fn.defaultActiveBg})),genGhostButtonStyle(Fn.componentCls,Fn.ghostBg,Fn.defaultGhostColor,Fn.defaultGhostBorderColor,Fn.colorTextDisabled,Fn.colorBorder)),{[`&${Fn.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:Fn.colorError,borderColor:Fn.colorError},genHoverActiveButtonStyle(Fn.componentCls,{color:Fn.colorErrorHover,borderColor:Fn.colorErrorBorderHover},{color:Fn.colorErrorActive,borderColor:Fn.colorErrorActive})),genGhostButtonStyle(Fn.componentCls,Fn.ghostBg,Fn.colorError,Fn.colorError,Fn.colorTextDisabled,Fn.colorBorder)),genSolidDisabledButtonStyle(Fn))}),genPrimaryButtonStyle=Fn=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},genSolidButtonStyle(Fn)),{color:Fn.primaryColor,background:Fn.colorPrimary,boxShadow:Fn.primaryShadow}),genHoverActiveButtonStyle(Fn.componentCls,{color:Fn.colorTextLightSolid,background:Fn.colorPrimaryHover},{color:Fn.colorTextLightSolid,background:Fn.colorPrimaryActive})),genGhostButtonStyle(Fn.componentCls,Fn.ghostBg,Fn.colorPrimary,Fn.colorPrimary,Fn.colorTextDisabled,Fn.colorBorder,{color:Fn.colorPrimaryHover,borderColor:Fn.colorPrimaryHover},{color:Fn.colorPrimaryActive,borderColor:Fn.colorPrimaryActive})),{[`&${Fn.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({background:Fn.colorError,boxShadow:Fn.dangerShadow,color:Fn.dangerColor},genHoverActiveButtonStyle(Fn.componentCls,{background:Fn.colorErrorHover},{background:Fn.colorErrorActive})),genGhostButtonStyle(Fn.componentCls,Fn.ghostBg,Fn.colorError,Fn.colorError,Fn.colorTextDisabled,Fn.colorBorder,{color:Fn.colorErrorHover,borderColor:Fn.colorErrorHover},{color:Fn.colorErrorActive,borderColor:Fn.colorErrorActive})),genSolidDisabledButtonStyle(Fn))}),genDashedButtonStyle=Fn=>Object.assign(Object.assign({},genDefaultButtonStyle(Fn)),{borderStyle:"dashed"}),genLinkButtonStyle=Fn=>Object.assign(Object.assign(Object.assign({color:Fn.colorLink},genHoverActiveButtonStyle(Fn.componentCls,{color:Fn.colorLinkHover,background:Fn.linkHoverBg},{color:Fn.colorLinkActive})),genPureDisabledButtonStyle(Fn)),{[`&${Fn.componentCls}-dangerous`]:Object.assign(Object.assign({color:Fn.colorError},genHoverActiveButtonStyle(Fn.componentCls,{color:Fn.colorErrorHover},{color:Fn.colorErrorActive})),genPureDisabledButtonStyle(Fn))}),genTextButtonStyle=Fn=>Object.assign(Object.assign(Object.assign({},genHoverActiveButtonStyle(Fn.componentCls,{color:Fn.colorText,background:Fn.textHoverBg},{color:Fn.colorText,background:Fn.colorBgTextActive})),genPureDisabledButtonStyle(Fn)),{[`&${Fn.componentCls}-dangerous`]:Object.assign(Object.assign({color:Fn.colorError},genPureDisabledButtonStyle(Fn)),genHoverActiveButtonStyle(Fn.componentCls,{color:Fn.colorErrorHover,background:Fn.colorErrorBg},{color:Fn.colorErrorHover,background:Fn.colorErrorBgActive}))}),genTypeButtonStyle=Fn=>{const{componentCls:Mn}=Fn;return{[`${Mn}-default`]:genDefaultButtonStyle(Fn),[`${Mn}-primary`]:genPrimaryButtonStyle(Fn),[`${Mn}-dashed`]:genDashedButtonStyle(Fn),[`${Mn}-link`]:genLinkButtonStyle(Fn),[`${Mn}-text`]:genTextButtonStyle(Fn),[`${Mn}-ghost`]:genGhostButtonStyle(Fn.componentCls,Fn.ghostBg,Fn.colorBgContainer,Fn.colorBgContainer,Fn.colorTextDisabled,Fn.colorBorder)}},genButtonStyle=function(Fn){let Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:rs,controlHeight:is,fontSize:os,lineHeight:as,borderRadius:us,buttonPaddingHorizontal:ds,iconCls:hs,buttonPaddingVertical:ps}=Fn,io=`${rs}-icon-only`;return[{[Mn]:{fontSize:os,lineHeight:as,height:is,padding:`${unit$1(ps)} ${unit$1(ds)}`,borderRadius:us,[`&${io}`]:{width:is,paddingInline:0,[`&${rs}-compact-item`]:{flex:"none"},[`&${rs}-round`]:{width:"auto"},[hs]:{fontSize:Fn.buttonIconOnlyFontSize}},[`&${rs}-loading`]:{opacity:Fn.opacityLoading,cursor:"default"},[`${rs}-loading-icon`]:{transition:`width ${Fn.motionDurationSlow} ${Fn.motionEaseInOut}, opacity ${Fn.motionDurationSlow} ${Fn.motionEaseInOut}`}}},{[`${rs}${rs}-circle${Mn}`]:genCircleButtonStyle(Fn)},{[`${rs}${rs}-round${Mn}`]:genRoundButtonStyle(Fn)}]},genSizeBaseButtonStyle=Fn=>{const Mn=merge$2(Fn,{fontSize:Fn.contentFontSize,lineHeight:Fn.contentLineHeight});return genButtonStyle(Mn,Fn.componentCls)},genSizeSmallButtonStyle=Fn=>{const Mn=merge$2(Fn,{controlHeight:Fn.controlHeightSM,fontSize:Fn.contentFontSizeSM,lineHeight:Fn.contentLineHeightSM,padding:Fn.paddingXS,buttonPaddingHorizontal:Fn.paddingInlineSM,buttonPaddingVertical:Fn.paddingBlockSM,borderRadius:Fn.borderRadiusSM,buttonIconOnlyFontSize:Fn.onlyIconSizeSM});return genButtonStyle(Mn,`${Fn.componentCls}-sm`)},genSizeLargeButtonStyle=Fn=>{const Mn=merge$2(Fn,{controlHeight:Fn.controlHeightLG,fontSize:Fn.contentFontSizeLG,lineHeight:Fn.contentLineHeightLG,buttonPaddingHorizontal:Fn.paddingInlineLG,buttonPaddingVertical:Fn.paddingBlockLG,borderRadius:Fn.borderRadiusLG,buttonIconOnlyFontSize:Fn.onlyIconSizeLG});return genButtonStyle(Mn,`${Fn.componentCls}-lg`)},genBlockButtonStyle=Fn=>{const{componentCls:Mn}=Fn;return{[Mn]:{[`&${Mn}-block`]:{width:"100%"}}}},useStyle$4=genStyleHooks("Button",Fn=>{const Mn=prepareToken(Fn);return[genSharedButtonStyle(Mn),genSizeBaseButtonStyle(Mn),genSizeSmallButtonStyle(Mn),genSizeLargeButtonStyle(Mn),genBlockButtonStyle(Mn),genTypeButtonStyle(Mn),genGroupStyle(Mn)]},prepareComponentToken$4,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function compactItemBorder(Fn,Mn,rs){const{focusElCls:is,focus:os,borderElCls:as}=rs,us=as?"> *":"",ds=["hover",os?"focus":null,"active"].filter(Boolean).map(hs=>`&:${hs} ${us}`).join(",");return{[`&-item:not(${Mn}-last-item)`]:{marginInlineEnd:Fn.calc(Fn.lineWidth).mul(-1).equal()},"&-item":Object.assign(Object.assign({[ds]:{zIndex:2}},is?{[`&${is}`]:{zIndex:2}}:{}),{[`&[disabled] ${us}`]:{zIndex:0}})}}function compactItemBorderRadius(Fn,Mn,rs){const{borderElCls:is}=rs,os=is?`> ${is}`:"";return{[`&-item:not(${Mn}-first-item):not(${Mn}-last-item) ${os}`]:{borderRadius:0},[`&-item:not(${Mn}-last-item)${Mn}-first-item`]:{[`& ${os}, &${Fn}-sm ${os}, &${Fn}-lg ${os}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${Mn}-first-item)${Mn}-last-item`]:{[`& ${os}, &${Fn}-sm ${os}, &${Fn}-lg ${os}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function genCompactItemStyle(Fn){let Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:rs}=Fn,is=`${rs}-compact`;return{[is]:Object.assign(Object.assign({},compactItemBorder(Fn,is,Mn)),compactItemBorderRadius(rs,is,Mn))}}function compactItemVerticalBorder(Fn,Mn){return{[`&-item:not(${Mn}-last-item)`]:{marginBottom:Fn.calc(Fn.lineWidth).mul(-1).equal()},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function compactItemBorderVerticalRadius(Fn,Mn){return{[`&-item:not(${Mn}-first-item):not(${Mn}-last-item)`]:{borderRadius:0},[`&-item${Mn}-first-item:not(${Mn}-last-item)`]:{[`&, &${Fn}-sm, &${Fn}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${Mn}-last-item:not(${Mn}-first-item)`]:{[`&, &${Fn}-sm, &${Fn}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function genCompactItemVerticalStyle(Fn){const Mn=`${Fn.componentCls}-compact-vertical`;return{[Mn]:Object.assign(Object.assign({},compactItemVerticalBorder(Fn,Mn)),compactItemBorderVerticalRadius(Fn.componentCls,Mn))}}const genButtonCompactStyle=Fn=>{const{componentCls:Mn,calc:rs}=Fn;return{[Mn]:{[`&-compact-item${Mn}-primary`]:{[`&:not([disabled]) + ${Mn}-compact-item${Mn}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:rs(Fn.lineWidth).mul(-1).equal(),insetInlineStart:rs(Fn.lineWidth).mul(-1).equal(),display:"inline-block",width:Fn.lineWidth,height:`calc(100% + ${unit$1(Fn.lineWidth)} * 2)`,backgroundColor:Fn.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${Mn}-primary`]:{[`&:not([disabled]) + ${Mn}-compact-vertical-item${Mn}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:rs(Fn.lineWidth).mul(-1).equal(),insetInlineStart:rs(Fn.lineWidth).mul(-1).equal(),display:"inline-block",width:`calc(100% + ${unit$1(Fn.lineWidth)} * 2)`,height:Fn.lineWidth,backgroundColor:Fn.colorPrimaryHover,content:'""'}}}}}}},CompactCmp=genSubStyleComponent(["Button","compact"],Fn=>{const Mn=prepareToken(Fn);return[genCompactItemStyle(Mn),genCompactItemVerticalStyle(Mn),genButtonCompactStyle(Mn)]},prepareComponentToken$4);var __rest$8=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};function getLoadingConfig(Fn){if(typeof Fn=="object"&&Fn){let Mn=Fn==null?void 0:Fn.delay;return Mn=!Number.isNaN(Mn)&&typeof Mn=="number"?Mn:0,{loading:Mn<=0,delay:Mn}}return{loading:!!Fn,delay:0}}const InternalCompoundedButton=React.forwardRef((Fn,Mn)=>{var rs,is,os;const{loading:as=!1,prefixCls:us,type:ds,danger:hs=!1,shape:ps="default",size:io,styles:fo,disabled:mo,className:Ao,rootClassName:$o,children:Lo,icon:Go,iconPosition:Yo="start",ghost:Wo=!1,block:Jo=!1,htmlType:xl="button",classNames:_l,style:Tl={},autoInsertSpace:Sl}=Fn,$l=__rest$8(Fn,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace"]),Pl=ds||"default",{getPrefixCls:Dl,direction:Ol,button:Rl}=reactExports.useContext(ConfigContext),Vo=(rs=Sl??(Rl==null?void 0:Rl.autoInsertSpace))!==null&&rs!==void 0?rs:!0,jo=Dl("btn",us),[Ho,Qo,El]=useStyle$4(jo),Xo=reactExports.useContext(DisabledContext),Al=mo??Xo,wl=reactExports.useContext(GroupSizeContext),yl=reactExports.useMemo(()=>getLoadingConfig(as),[as]),[Il,Bl]=reactExports.useState(yl.loading),[Gl,Nl]=reactExports.useState(!1),Vl=composeRef(Mn,reactExports.createRef()),Hl=reactExports.Children.count(Lo)===1&&!Go&&!isUnBorderedButtonType(Pl);reactExports.useEffect(()=>{let fp=null;yl.delay>0?fp=setTimeout(()=>{fp=null,Bl(!0)},yl.delay):Bl(yl.loading);function hp(){fp&&(clearTimeout(fp),fp=null)}return hp},[yl]),reactExports.useEffect(()=>{if(!Vl||!Vl.current||!Vo)return;const fp=Vl.current.textContent;Hl&&isTwoCNChar(fp)?Gl||Nl(!0):Gl&&Nl(!1)},[Vl]);const Yl=fp=>{const{onClick:hp}=Fn;if(Il||Al){fp.preventDefault();return}hp==null||hp(fp)},{compactSize:Ll,compactItemClassnames:Zl}=useCompactItemContext(jo,Ol),Xl={large:"lg",small:"sm",middle:void 0},wu=useSize(fp=>{var hp,xp;return(xp=(hp=io??Ll)!==null&&hp!==void 0?hp:wl)!==null&&xp!==void 0?xp:fp}),yu=wu&&Xl[wu]||"",rp=Il?"loading":Go,dp=omit$1($l,["navigate"]),up=classNames(jo,Qo,El,{[`${jo}-${ps}`]:ps!=="default"&&ps,[`${jo}-${Pl}`]:Pl,[`${jo}-${yu}`]:yu,[`${jo}-icon-only`]:!Lo&&Lo!==0&&!!rp,[`${jo}-background-ghost`]:Wo&&!isUnBorderedButtonType(Pl),[`${jo}-loading`]:Il,[`${jo}-two-chinese-chars`]:Gl&&Vo&&!Il,[`${jo}-block`]:Jo,[`${jo}-dangerous`]:hs,[`${jo}-rtl`]:Ol==="rtl",[`${jo}-icon-end`]:Yo==="end"},Zl,Ao,$o,Rl==null?void 0:Rl.className),wp=Object.assign(Object.assign({},Rl==null?void 0:Rl.style),Tl),vp=classNames(_l==null?void 0:_l.icon,(is=Rl==null?void 0:Rl.classNames)===null||is===void 0?void 0:is.icon),pp=Object.assign(Object.assign({},(fo==null?void 0:fo.icon)||{}),((os=Rl==null?void 0:Rl.styles)===null||os===void 0?void 0:os.icon)||{}),cp=Go&&!Il?React.createElement(IconWrapper,{prefixCls:jo,className:vp,style:pp},Go):React.createElement(LoadingIcon,{existIcon:!!Go,prefixCls:jo,loading:Il}),gp=Lo||Lo===0?spaceChildren(Lo,Hl&&Vo):null;if(dp.href!==void 0)return Ho(React.createElement("a",Object.assign({},dp,{className:classNames(up,{[`${jo}-disabled`]:Al}),href:Al?void 0:dp.href,style:wp,onClick:Yl,ref:Vl,tabIndex:Al?-1:0}),cp,gp));let mp=React.createElement("button",Object.assign({},$l,{type:xl,className:up,style:wp,onClick:Yl,disabled:Al,ref:Vl}),cp,gp,!!Zl&&React.createElement(CompactCmp,{key:"compact",prefixCls:jo}));return isUnBorderedButtonType(Pl)||(mp=React.createElement(Wave,{component:"Button",disabled:Il},mp)),Ho(mp)}),Button$1=InternalCompoundedButton;Button$1.Group=ButtonGroup;Button$1.__ANT_BUTTON=!0;var OrderContext=reactExports.createContext(null),EMPTY_LIST=[];function useDom(Fn,Mn){var rs=reactExports.useState(function(){if(!canUseDom())return null;var $o=document.createElement("div");return $o}),is=_slicedToArray(rs,1),os=is[0],as=reactExports.useRef(!1),us=reactExports.useContext(OrderContext),ds=reactExports.useState(EMPTY_LIST),hs=_slicedToArray(ds,2),ps=hs[0],io=hs[1],fo=us||(as.current?void 0:function($o){io(function(Lo){var Go=[$o].concat(_toConsumableArray(Lo));return Go})});function mo(){os.parentElement||document.body.appendChild(os),as.current=!0}function Ao(){var $o;($o=os.parentElement)===null||$o===void 0||$o.removeChild(os),as.current=!1}return useLayoutEffect(function(){return Fn?us?us(mo):mo():Ao(),Ao},[Fn]),useLayoutEffect(function(){ps.length&&(ps.forEach(function($o){return $o()}),io(EMPTY_LIST))},[ps]),[os,fo]}function measureScrollbarSize(Fn){var Mn="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),rs=document.createElement("div");rs.id=Mn;var is=rs.style;is.position="absolute",is.left="0",is.top="0",is.width="100px",is.height="100px",is.overflow="scroll";var os,as;if(Fn){var us=getComputedStyle(Fn);is.scrollbarColor=us.scrollbarColor,is.scrollbarWidth=us.scrollbarWidth;var ds=getComputedStyle(Fn,"::-webkit-scrollbar"),hs=parseInt(ds.width,10),ps=parseInt(ds.height,10);try{var io=hs?"width: ".concat(ds.width,";"):"",fo=ps?"height: ".concat(ds.height,";"):"";updateCSS(`
#`.concat(Mn,`::-webkit-scrollbar {
`).concat(io,`
`).concat(fo,`
}`),Mn)}catch($o){console.error($o),os=hs,as=ps}}document.body.appendChild(rs);var mo=Fn&&os&&!isNaN(os)?os:rs.offsetWidth-rs.clientWidth,Ao=Fn&&as&&!isNaN(as)?as:rs.offsetHeight-rs.clientHeight;return document.body.removeChild(rs),removeCSS(Mn),{width:mo,height:Ao}}function getTargetScrollBarSize(Fn){return typeof document>"u"||!Fn||!(Fn instanceof Element)?{width:0,height:0}:measureScrollbarSize(Fn)}function isBodyOverflowing(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var UNIQUE_ID="rc-util-locker-".concat(Date.now()),uuid$2=0;function useScrollLocker(Fn){var Mn=!!Fn,rs=reactExports.useState(function(){return uuid$2+=1,"".concat(UNIQUE_ID,"_").concat(uuid$2)}),is=_slicedToArray(rs,1),os=is[0];useLayoutEffect(function(){if(Mn){var as=getTargetScrollBarSize(document.body).width,us=isBodyOverflowing();updateCSS(`
html body {
  overflow-y: hidden;
  `.concat(us?"width: calc(100% - ".concat(as,"px);"):"",`
}`),os)}else removeCSS(os);return function(){removeCSS(os)}},[Mn,os])}var inline=!1;function inlineMock(Fn){return inline}var getPortalContainer=function(Mn){return Mn===!1?!1:!canUseDom()||!Mn?null:typeof Mn=="string"?document.querySelector(Mn):typeof Mn=="function"?Mn():Mn},Portal$1=reactExports.forwardRef(function(Fn,Mn){var rs=Fn.open,is=Fn.autoLock,os=Fn.getContainer;Fn.debug;var as=Fn.autoDestroy,us=as===void 0?!0:as,ds=Fn.children,hs=reactExports.useState(rs),ps=_slicedToArray(hs,2),io=ps[0],fo=ps[1],mo=io||rs;reactExports.useEffect(function(){(us||rs)&&fo(rs)},[rs,us]);var Ao=reactExports.useState(function(){return getPortalContainer(os)}),$o=_slicedToArray(Ao,2),Lo=$o[0],Go=$o[1];reactExports.useEffect(function(){var Ol=getPortalContainer(os);Go(Ol??null)});var Yo=useDom(mo&&!Lo),Wo=_slicedToArray(Yo,2),Jo=Wo[0],xl=Wo[1],_l=Lo??Jo;useScrollLocker(is&&rs&&canUseDom()&&(_l===Jo||_l===document.body));var Tl=null;if(ds&&supportRef(ds)&&Mn){var Sl=ds;Tl=Sl.ref}var $l=useComposeRef(Tl,Mn);if(!mo||!canUseDom()||Lo===void 0)return null;var Pl=_l===!1||inlineMock(),Dl=ds;return Mn&&(Dl=reactExports.cloneElement(ds,{ref:$l})),reactExports.createElement(OrderContext.Provider,{value:xl},Pl?Dl:reactDomExports.createPortal(Dl,_l))});function getUseId(){var Fn=_objectSpread2({},React$1);return Fn.useId}var uuid$1=0,useOriginId=getUseId();const useId$1=useOriginId?function(Mn){var rs=useOriginId();return Mn||rs}:function(Mn){var rs=reactExports.useState("ssr-id"),is=_slicedToArray(rs,2),os=is[0],as=is[1];return reactExports.useEffect(function(){var us=uuid$1;uuid$1+=1,as("rc_unique_".concat(us))},[]),Mn||os};var HOOK_MARK="RC_FORM_INTERNAL_HOOKS",warningFunc=function(){warningOnce(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Context=reactExports.createContext({getFieldValue:warningFunc,getFieldsValue:warningFunc,getFieldError:warningFunc,getFieldWarning:warningFunc,getFieldsError:warningFunc,isFieldsTouched:warningFunc,isFieldTouched:warningFunc,isFieldValidating:warningFunc,isFieldsValidating:warningFunc,resetFields:warningFunc,setFields:warningFunc,setFieldValue:warningFunc,setFieldsValue:warningFunc,validateFields:warningFunc,submit:warningFunc,getInternalHooks:function(){return warningFunc(),{dispatch:warningFunc,initEntityValue:warningFunc,registerField:warningFunc,useSubscribe:warningFunc,setInitialValues:warningFunc,destroyForm:warningFunc,setCallbacks:warningFunc,registerWatch:warningFunc,getFields:warningFunc,setValidateMessages:warningFunc,setPreserve:warningFunc,getInitialValue:warningFunc}}}),ListContext=reactExports.createContext(null);function toArray$4(Fn){return Fn==null?[]:Array.isArray(Fn)?Fn:[Fn]}function isFormInstance(Fn){return Fn&&!!Fn._init}function newMessages(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var Mn=JSON.parse(JSON.stringify(this));return Mn.clone=this.clone,Mn}}}var messages=newMessages();function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;typeof global$2.setTimeout=="function"&&(cachedSetTimeout=setTimeout);typeof global$2.clearTimeout=="function"&&(cachedClearTimeout=clearTimeout);function runTimeout(Fn){if(cachedSetTimeout===setTimeout)return setTimeout(Fn,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(Fn,0);try{return cachedSetTimeout(Fn,0)}catch{try{return cachedSetTimeout.call(null,Fn,0)}catch{return cachedSetTimeout.call(this,Fn,0)}}}function runClearTimeout(Fn){if(cachedClearTimeout===clearTimeout)return clearTimeout(Fn);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(Fn);try{return cachedClearTimeout(Fn)}catch{try{return cachedClearTimeout.call(null,Fn)}catch{return cachedClearTimeout.call(this,Fn)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var Fn=runTimeout(cleanUpNextTick);draining=!0;for(var Mn=queue.length;Mn;){for(currentQueue=queue,queue=[];++queueIndex<Mn;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,Mn=queue.length}currentQueue=null,draining=!1,runClearTimeout(Fn)}}function nextTick(Fn){var Mn=new Array(arguments.length-1);if(arguments.length>1)for(var rs=1;rs<arguments.length;rs++)Mn[rs-1]=arguments[rs];queue.push(new Item(Fn,Mn)),queue.length===1&&!draining&&runTimeout(drainQueue)}function Item(Fn,Mn){this.fun=Fn,this.array=Mn}Item.prototype.run=function(){this.fun.apply(null,this.array)};var title="browser",platform$2="browser",browser$3=!0,env$1={},argv=[],version$r="",versions={},release={},config={};function noop$7(){}var on$3=noop$7,addListener$1=noop$7,once$1=noop$7,off=noop$7,removeListener$1=noop$7,removeAllListeners=noop$7,emit=noop$7;function binding(Fn){throw new Error("process.binding is not supported")}function cwd(){return"/"}function chdir(Fn){throw new Error("process.chdir is not supported")}function umask(){return 0}var performance$1=global$2.performance||{},performanceNow=performance$1.now||performance$1.mozNow||performance$1.msNow||performance$1.oNow||performance$1.webkitNow||function(){return new Date().getTime()};function hrtime(Fn){var Mn=performanceNow.call(performance$1)*.001,rs=Math.floor(Mn),is=Math.floor(Mn%1*1e9);return Fn&&(rs=rs-Fn[0],is=is-Fn[1],is<0&&(rs--,is+=1e9)),[rs,is]}var startTime=new Date;function uptime(){var Fn=new Date,Mn=Fn-startTime;return Mn/1e3}var browser$1$1={nextTick,title,browser:browser$3,env:env$1,argv,version:version$r,versions,on:on$3,addListener:addListener$1,once:once$1,off,removeListener:removeListener$1,removeAllListeners,emit,binding,cwd,chdir,umask,hrtime,platform:platform$2,release,config,uptime};function _isNativeFunction(Fn){try{return Function.toString.call(Fn).indexOf("[native code]")!==-1}catch{return typeof Fn=="function"}}function _construct(Fn,Mn,rs){if(_isNativeReflectConstruct$4())return Reflect.construct.apply(null,arguments);var is=[null];is.push.apply(is,Mn);var os=new(Fn.bind.apply(Fn,is));return rs&&_setPrototypeOf$4(os,rs.prototype),os}function _wrapNativeSuper(Fn){var Mn=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(is){if(is===null||!_isNativeFunction(is))return is;if(typeof is!="function")throw new TypeError("Super expression must either be null or a function");if(Mn!==void 0){if(Mn.has(is))return Mn.get(is);Mn.set(is,os)}function os(){return _construct(is,arguments,_getPrototypeOf$4(this).constructor)}return os.prototype=Object.create(is.prototype,{constructor:{value:os,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$4(os,is)},_wrapNativeSuper(Fn)}var define_process_env_default$3={},formatRegExp=/%[sdj%]/g,warning=function(){};typeof browser$1$1<"u";function convertFieldsError(Fn){if(!Fn||!Fn.length)return null;var Mn={};return Fn.forEach(function(rs){var is=rs.field;Mn[is]=Mn[is]||[],Mn[is].push(rs)}),Mn}function format$2(Fn){for(var Mn=arguments.length,rs=new Array(Mn>1?Mn-1:0),is=1;is<Mn;is++)rs[is-1]=arguments[is];var os=0,as=rs.length;if(typeof Fn=="function")return Fn.apply(null,rs);if(typeof Fn=="string"){var us=Fn.replace(formatRegExp,function(ds){if(ds==="%%")return"%";if(os>=as)return ds;switch(ds){case"%s":return String(rs[os++]);case"%d":return Number(rs[os++]);case"%j":try{return JSON.stringify(rs[os++])}catch{return"[Circular]"}break;default:return ds}});return us}return Fn}function isNativeStringType(Fn){return Fn==="string"||Fn==="url"||Fn==="hex"||Fn==="email"||Fn==="date"||Fn==="pattern"}function isEmptyValue(Fn,Mn){return!!(Fn==null||Mn==="array"&&Array.isArray(Fn)&&!Fn.length||isNativeStringType(Mn)&&typeof Fn=="string"&&!Fn)}function asyncParallelArray(Fn,Mn,rs){var is=[],os=0,as=Fn.length;function us(ds){is.push.apply(is,_toConsumableArray(ds||[])),os++,os===as&&rs(is)}Fn.forEach(function(ds){Mn(ds,us)})}function asyncSerialArray(Fn,Mn,rs){var is=0,os=Fn.length;function as(us){if(us&&us.length){rs(us);return}var ds=is;is=is+1,ds<os?Mn(Fn[ds],as):rs([])}as([])}function flattenObjArr(Fn){var Mn=[];return Object.keys(Fn).forEach(function(rs){Mn.push.apply(Mn,_toConsumableArray(Fn[rs]||[]))}),Mn}var AsyncValidationError=function(Fn){_inherits$4(rs,Fn);var Mn=_createSuper$4(rs);function rs(is,os){var as;return _classCallCheck$4(this,rs),as=Mn.call(this,"Async Validation Error"),_defineProperty$5(_assertThisInitialized$4(as),"errors",void 0),_defineProperty$5(_assertThisInitialized$4(as),"fields",void 0),as.errors=is,as.fields=os,as}return _createClass$4(rs)}(_wrapNativeSuper(Error));function asyncMap(Fn,Mn,rs,is,os){if(Mn.first){var as=new Promise(function(mo,Ao){var $o=function(Yo){return is(Yo),Yo.length?Ao(new AsyncValidationError(Yo,convertFieldsError(Yo))):mo(os)},Lo=flattenObjArr(Fn);asyncSerialArray(Lo,rs,$o)});return as.catch(function(mo){return mo}),as}var us=Mn.firstFields===!0?Object.keys(Fn):Mn.firstFields||[],ds=Object.keys(Fn),hs=ds.length,ps=0,io=[],fo=new Promise(function(mo,Ao){var $o=function(Go){if(io.push.apply(io,Go),ps++,ps===hs)return is(io),io.length?Ao(new AsyncValidationError(io,convertFieldsError(io))):mo(os)};ds.length||(is(io),mo(os)),ds.forEach(function(Lo){var Go=Fn[Lo];us.indexOf(Lo)!==-1?asyncSerialArray(Go,rs,$o):asyncParallelArray(Go,rs,$o)})});return fo.catch(function(mo){return mo}),fo}function isErrorObj(Fn){return!!(Fn&&Fn.message!==void 0)}function getValue(Fn,Mn){for(var rs=Fn,is=0;is<Mn.length;is++){if(rs==null)return rs;rs=rs[Mn[is]]}return rs}function complementError(Fn,Mn){return function(rs){var is;return Fn.fullFields?is=getValue(Mn,Fn.fullFields):is=Mn[rs.field||Fn.fullField],isErrorObj(rs)?(rs.field=rs.field||Fn.fullField,rs.fieldValue=is,rs):{message:typeof rs=="function"?rs():rs,fieldValue:is,field:rs.field||Fn.fullField}}}function deepMerge(Fn,Mn){if(Mn){for(var rs in Mn)if(Mn.hasOwnProperty(rs)){var is=Mn[rs];_typeof$4(is)==="object"&&_typeof$4(Fn[rs])==="object"?Fn[rs]=_objectSpread2(_objectSpread2({},Fn[rs]),is):Fn[rs]=is}}return Fn}var ENUM$1="enum",enumerable$1=function(Mn,rs,is,os,as){Mn[ENUM$1]=Array.isArray(Mn[ENUM$1])?Mn[ENUM$1]:[],Mn[ENUM$1].indexOf(rs)===-1&&os.push(format$2(as.messages[ENUM$1],Mn.fullField,Mn[ENUM$1].join(", ")))},pattern$2=function(Mn,rs,is,os,as){if(Mn.pattern){if(Mn.pattern instanceof RegExp)Mn.pattern.lastIndex=0,Mn.pattern.test(rs)||os.push(format$2(as.messages.pattern.mismatch,Mn.fullField,rs,Mn.pattern));else if(typeof Mn.pattern=="string"){var us=new RegExp(Mn.pattern);us.test(rs)||os.push(format$2(as.messages.pattern.mismatch,Mn.fullField,rs,Mn.pattern))}}},range=function(Mn,rs,is,os,as){var us=typeof Mn.len=="number",ds=typeof Mn.min=="number",hs=typeof Mn.max=="number",ps=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,io=rs,fo=null,mo=typeof rs=="number",Ao=typeof rs=="string",$o=Array.isArray(rs);if(mo?fo="number":Ao?fo="string":$o&&(fo="array"),!fo)return!1;$o&&(io=rs.length),Ao&&(io=rs.replace(ps,"_").length),us?io!==Mn.len&&os.push(format$2(as.messages[fo].len,Mn.fullField,Mn.len)):ds&&!hs&&io<Mn.min?os.push(format$2(as.messages[fo].min,Mn.fullField,Mn.min)):hs&&!ds&&io>Mn.max?os.push(format$2(as.messages[fo].max,Mn.fullField,Mn.max)):ds&&hs&&(io<Mn.min||io>Mn.max)&&os.push(format$2(as.messages[fo].range,Mn.fullField,Mn.min,Mn.max))},required$1=function(Mn,rs,is,os,as,us){Mn.required&&(!is.hasOwnProperty(Mn.field)||isEmptyValue(rs,us||Mn.type))&&os.push(format$2(as.messages.required,Mn.fullField))},urlReg;const getUrlRegex=function(){if(urlReg)return urlReg;var Fn="[a-fA-F\\d:]",Mn=function(Tl){return Tl&&Tl.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(Fn,")|(?<=").concat(Fn,")(?=\\s|$))"):""},rs="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",is="[a-fA-F\\d]{1,4}",os=["(?:".concat(is,":){7}(?:").concat(is,"|:)"),"(?:".concat(is,":){6}(?:").concat(rs,"|:").concat(is,"|:)"),"(?:".concat(is,":){5}(?::").concat(rs,"|(?::").concat(is,"){1,2}|:)"),"(?:".concat(is,":){4}(?:(?::").concat(is,"){0,1}:").concat(rs,"|(?::").concat(is,"){1,3}|:)"),"(?:".concat(is,":){3}(?:(?::").concat(is,"){0,2}:").concat(rs,"|(?::").concat(is,"){1,4}|:)"),"(?:".concat(is,":){2}(?:(?::").concat(is,"){0,3}:").concat(rs,"|(?::").concat(is,"){1,5}|:)"),"(?:".concat(is,":){1}(?:(?::").concat(is,"){0,4}:").concat(rs,"|(?::").concat(is,"){1,6}|:)"),"(?::(?:(?::".concat(is,"){0,5}:").concat(rs,"|(?::").concat(is,"){1,7}|:))")],as="(?:%[0-9a-zA-Z]{1,})?",us="(?:".concat(os.join("|"),")").concat(as),ds=new RegExp("(?:^".concat(rs,"$)|(?:^").concat(us,"$)")),hs=new RegExp("^".concat(rs,"$")),ps=new RegExp("^".concat(us,"$")),io=function(Tl){return Tl&&Tl.exact?ds:new RegExp("(?:".concat(Mn(Tl)).concat(rs).concat(Mn(Tl),")|(?:").concat(Mn(Tl)).concat(us).concat(Mn(Tl),")"),"g")};io.v4=function(_l){return _l&&_l.exact?hs:new RegExp("".concat(Mn(_l)).concat(rs).concat(Mn(_l)),"g")},io.v6=function(_l){return _l&&_l.exact?ps:new RegExp("".concat(Mn(_l)).concat(us).concat(Mn(_l)),"g")};var fo="(?:(?:[a-z]+:)?//)",mo="(?:\\S+(?::\\S*)?@)?",Ao=io.v4().source,$o=io.v6().source,Lo="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",Go="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",Yo="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",Wo="(?::\\d{2,5})?",Jo='(?:[/?#][^\\s"]*)?',xl="(?:".concat(fo,"|www\\.)").concat(mo,"(?:localhost|").concat(Ao,"|").concat($o,"|").concat(Lo).concat(Go).concat(Yo,")").concat(Wo).concat(Jo);return urlReg=new RegExp("(?:^".concat(xl,"$)"),"i"),urlReg};var pattern$1={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},types$1={integer:function(Mn){return types$1.number(Mn)&&parseInt(Mn,10)===Mn},float:function(Mn){return types$1.number(Mn)&&!types$1.integer(Mn)},array:function(Mn){return Array.isArray(Mn)},regexp:function(Mn){if(Mn instanceof RegExp)return!0;try{return!!new RegExp(Mn)}catch{return!1}},date:function(Mn){return typeof Mn.getTime=="function"&&typeof Mn.getMonth=="function"&&typeof Mn.getYear=="function"&&!isNaN(Mn.getTime())},number:function(Mn){return isNaN(Mn)?!1:typeof Mn=="number"},object:function(Mn){return _typeof$4(Mn)==="object"&&!types$1.array(Mn)},method:function(Mn){return typeof Mn=="function"},email:function(Mn){return typeof Mn=="string"&&Mn.length<=320&&!!Mn.match(pattern$1.email)},url:function(Mn){return typeof Mn=="string"&&Mn.length<=2048&&!!Mn.match(getUrlRegex())},hex:function(Mn){return typeof Mn=="string"&&!!Mn.match(pattern$1.hex)}},type$1=function(Mn,rs,is,os,as){if(Mn.required&&rs===void 0){required$1(Mn,rs,is,os,as);return}var us=["integer","float","array","regexp","object","method","email","number","date","url","hex"],ds=Mn.type;us.indexOf(ds)>-1?types$1[ds](rs)||os.push(format$2(as.messages.types[ds],Mn.fullField,Mn.type)):ds&&_typeof$4(rs)!==Mn.type&&os.push(format$2(as.messages.types[ds],Mn.fullField,Mn.type))},whitespace=function(Mn,rs,is,os,as){(/^\s+$/.test(rs)||rs==="")&&os.push(format$2(as.messages.whitespace,Mn.fullField))};const rules={required:required$1,whitespace,type:type$1,range,enum:enumerable$1,pattern:pattern$2};var any=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs)&&!Mn.required)return is();rules.required(Mn,rs,os,us,as)}is(us)},array$1=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(rs==null&&!Mn.required)return is();rules.required(Mn,rs,os,us,as,"array"),rs!=null&&(rules.type(Mn,rs,os,us,as),rules.range(Mn,rs,os,us,as))}is(us)},boolean=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs)&&!Mn.required)return is();rules.required(Mn,rs,os,us,as),rs!==void 0&&rules.type(Mn,rs,os,us,as)}is(us)},date=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs,"date")&&!Mn.required)return is();if(rules.required(Mn,rs,os,us,as),!isEmptyValue(rs,"date")){var hs;rs instanceof Date?hs=rs:hs=new Date(rs),rules.type(Mn,hs,os,us,as),hs&&rules.range(Mn,hs.getTime(),os,us,as)}}is(us)},ENUM="enum",enumerable=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs)&&!Mn.required)return is();rules.required(Mn,rs,os,us,as),rs!==void 0&&rules[ENUM](Mn,rs,os,us,as)}is(us)},floatFn=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs)&&!Mn.required)return is();rules.required(Mn,rs,os,us,as),rs!==void 0&&(rules.type(Mn,rs,os,us,as),rules.range(Mn,rs,os,us,as))}is(us)},integer=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs)&&!Mn.required)return is();rules.required(Mn,rs,os,us,as),rs!==void 0&&(rules.type(Mn,rs,os,us,as),rules.range(Mn,rs,os,us,as))}is(us)},method=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs)&&!Mn.required)return is();rules.required(Mn,rs,os,us,as),rs!==void 0&&rules.type(Mn,rs,os,us,as)}is(us)},number$2=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(rs===""&&(rs=void 0),isEmptyValue(rs)&&!Mn.required)return is();rules.required(Mn,rs,os,us,as),rs!==void 0&&(rules.type(Mn,rs,os,us,as),rules.range(Mn,rs,os,us,as))}is(us)},object$1=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs)&&!Mn.required)return is();rules.required(Mn,rs,os,us,as),rs!==void 0&&rules.type(Mn,rs,os,us,as)}is(us)},pattern=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs,"string")&&!Mn.required)return is();rules.required(Mn,rs,os,us,as),isEmptyValue(rs,"string")||rules.pattern(Mn,rs,os,us,as)}is(us)},regexp=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs)&&!Mn.required)return is();rules.required(Mn,rs,os,us,as),isEmptyValue(rs)||rules.type(Mn,rs,os,us,as)}is(us)},required=function(Mn,rs,is,os,as){var us=[],ds=Array.isArray(rs)?"array":_typeof$4(rs);rules.required(Mn,rs,os,us,as,ds),is(us)},string$3=function(Mn,rs,is,os,as){var us=[],ds=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(ds){if(isEmptyValue(rs,"string")&&!Mn.required)return is();rules.required(Mn,rs,os,us,as,"string"),isEmptyValue(rs,"string")||(rules.type(Mn,rs,os,us,as),rules.range(Mn,rs,os,us,as),rules.pattern(Mn,rs,os,us,as),Mn.whitespace===!0&&rules.whitespace(Mn,rs,os,us,as))}is(us)},type=function(Mn,rs,is,os,as){var us=Mn.type,ds=[],hs=Mn.required||!Mn.required&&os.hasOwnProperty(Mn.field);if(hs){if(isEmptyValue(rs,us)&&!Mn.required)return is();rules.required(Mn,rs,os,ds,as,us),isEmptyValue(rs,us)||rules.type(Mn,rs,os,ds,as)}is(ds)};const validators$2={string:string$3,method,number:number$2,boolean,regexp,integer,float:floatFn,array:array$1,object:object$1,enum:enumerable,pattern,date,url:type,hex:type,email:type,required,any};var Schema=function(){function Fn(Mn){_classCallCheck$4(this,Fn),_defineProperty$5(this,"rules",null),_defineProperty$5(this,"_messages",messages),this.define(Mn)}return _createClass$4(Fn,[{key:"define",value:function(rs){var is=this;if(!rs)throw new Error("Cannot configure a schema with no rules");if(_typeof$4(rs)!=="object"||Array.isArray(rs))throw new Error("Rules must be an object");this.rules={},Object.keys(rs).forEach(function(os){var as=rs[os];is.rules[os]=Array.isArray(as)?as:[as]})}},{key:"messages",value:function(rs){return rs&&(this._messages=deepMerge(newMessages(),rs)),this._messages}},{key:"validate",value:function(rs){var is=this,os=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},as=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},us=rs,ds=os,hs=as;if(typeof ds=="function"&&(hs=ds,ds={}),!this.rules||Object.keys(this.rules).length===0)return hs&&hs(null,us),Promise.resolve(us);function ps($o){var Lo=[],Go={};function Yo(Jo){if(Array.isArray(Jo)){var xl;Lo=(xl=Lo).concat.apply(xl,_toConsumableArray(Jo))}else Lo.push(Jo)}for(var Wo=0;Wo<$o.length;Wo++)Yo($o[Wo]);Lo.length?(Go=convertFieldsError(Lo),hs(Lo,Go)):hs(null,us)}if(ds.messages){var io=this.messages();io===messages&&(io=newMessages()),deepMerge(io,ds.messages),ds.messages=io}else ds.messages=this.messages();var fo={},mo=ds.keys||Object.keys(this.rules);mo.forEach(function($o){var Lo=is.rules[$o],Go=us[$o];Lo.forEach(function(Yo){var Wo=Yo;typeof Wo.transform=="function"&&(us===rs&&(us=_objectSpread2({},us)),Go=us[$o]=Wo.transform(Go),Go!=null&&(Wo.type=Wo.type||(Array.isArray(Go)?"array":_typeof$4(Go)))),typeof Wo=="function"?Wo={validator:Wo}:Wo=_objectSpread2({},Wo),Wo.validator=is.getValidationMethod(Wo),Wo.validator&&(Wo.field=$o,Wo.fullField=Wo.fullField||$o,Wo.type=is.getType(Wo),fo[$o]=fo[$o]||[],fo[$o].push({rule:Wo,value:Go,source:us,field:$o}))})});var Ao={};return asyncMap(fo,ds,function($o,Lo){var Go=$o.rule,Yo=(Go.type==="object"||Go.type==="array")&&(_typeof$4(Go.fields)==="object"||_typeof$4(Go.defaultField)==="object");Yo=Yo&&(Go.required||!Go.required&&$o.value),Go.field=$o.field;function Wo(Sl,$l){return _objectSpread2(_objectSpread2({},$l),{},{fullField:"".concat(Go.fullField,".").concat(Sl),fullFields:Go.fullFields?[].concat(_toConsumableArray(Go.fullFields),[Sl]):[Sl]})}function Jo(){var Sl=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$l=Array.isArray(Sl)?Sl:[Sl];!ds.suppressWarning&&$l.length&&Fn.warning("async-validator:",$l),$l.length&&Go.message!==void 0&&($l=[].concat(Go.message));var Pl=$l.map(complementError(Go,us));if(ds.first&&Pl.length)return Ao[Go.field]=1,Lo(Pl);if(!Yo)Lo(Pl);else{if(Go.required&&!$o.value)return Go.message!==void 0?Pl=[].concat(Go.message).map(complementError(Go,us)):ds.error&&(Pl=[ds.error(Go,format$2(ds.messages.required,Go.field))]),Lo(Pl);var Dl={};Go.defaultField&&Object.keys($o.value).map(function(Vo){Dl[Vo]=Go.defaultField}),Dl=_objectSpread2(_objectSpread2({},Dl),$o.rule.fields);var Ol={};Object.keys(Dl).forEach(function(Vo){var jo=Dl[Vo],Ho=Array.isArray(jo)?jo:[jo];Ol[Vo]=Ho.map(Wo.bind(null,Vo))});var Rl=new Fn(Ol);Rl.messages(ds.messages),$o.rule.options&&($o.rule.options.messages=ds.messages,$o.rule.options.error=ds.error),Rl.validate($o.value,$o.rule.options||ds,function(Vo){var jo=[];Pl&&Pl.length&&jo.push.apply(jo,_toConsumableArray(Pl)),Vo&&Vo.length&&jo.push.apply(jo,_toConsumableArray(Vo)),Lo(jo.length?jo:null)})}}var xl;if(Go.asyncValidator)xl=Go.asyncValidator(Go,$o.value,Jo,$o.source,ds);else if(Go.validator){try{xl=Go.validator(Go,$o.value,Jo,$o.source,ds)}catch(Sl){var _l,Tl;(_l=(Tl=console).error)===null||_l===void 0||_l.call(Tl,Sl),ds.suppressValidatorError||setTimeout(function(){throw Sl},0),Jo(Sl.message)}xl===!0?Jo():xl===!1?Jo(typeof Go.message=="function"?Go.message(Go.fullField||Go.field):Go.message||"".concat(Go.fullField||Go.field," fails")):xl instanceof Array?Jo(xl):xl instanceof Error&&Jo(xl.message)}xl&&xl.then&&xl.then(function(){return Jo()},function(Sl){return Jo(Sl)})},function($o){ps($o)},us)}},{key:"getType",value:function(rs){if(rs.type===void 0&&rs.pattern instanceof RegExp&&(rs.type="pattern"),typeof rs.validator!="function"&&rs.type&&!validators$2.hasOwnProperty(rs.type))throw new Error(format$2("Unknown rule type %s",rs.type));return rs.type||"string"}},{key:"getValidationMethod",value:function(rs){if(typeof rs.validator=="function")return rs.validator;var is=Object.keys(rs),os=is.indexOf("message");return os!==-1&&is.splice(os,1),is.length===1&&is[0]==="required"?validators$2.required:validators$2[this.getType(rs)]||void 0}}]),Fn}();_defineProperty$5(Schema,"register",function(Mn,rs){if(typeof rs!="function")throw new Error("Cannot register a validator by type, validator is not a function");validators$2[Mn]=rs});_defineProperty$5(Schema,"warning",warning);_defineProperty$5(Schema,"messages",messages);_defineProperty$5(Schema,"validators",validators$2);var typeTemplate="'${name}' is not a valid ${type}",defaultValidateMessages={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:typeTemplate,method:typeTemplate,array:typeTemplate,object:typeTemplate,number:typeTemplate,date:typeTemplate,boolean:typeTemplate,integer:typeTemplate,float:typeTemplate,regexp:typeTemplate,email:typeTemplate,url:typeTemplate,hex:typeTemplate},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},AsyncValidator=Schema;function replaceMessage(Fn,Mn){return Fn.replace(/\$\{\w+\}/g,function(rs){var is=rs.slice(2,-1);return Mn[is]})}var CODE_LOGIC_ERROR="CODE_LOGIC_ERROR";function validateRule(Fn,Mn,rs,is,os){return _validateRule.apply(this,arguments)}function _validateRule(){return _validateRule=_asyncToGenerator(_regeneratorRuntime().mark(function Fn(Mn,rs,is,os,as){var us,ds,hs,ps,io,fo,mo,Ao,$o;return _regeneratorRuntime().wrap(function(Go){for(;;)switch(Go.prev=Go.next){case 0:return us=_objectSpread2({},is),delete us.ruleIndex,AsyncValidator.warning=function(){},us.validator&&(ds=us.validator,us.validator=function(){try{return ds.apply(void 0,arguments)}catch(Yo){return console.error(Yo),Promise.reject(CODE_LOGIC_ERROR)}}),hs=null,us&&us.type==="array"&&us.defaultField&&(hs=us.defaultField,delete us.defaultField),ps=new AsyncValidator(_defineProperty$5({},Mn,[us])),io=merge$3(defaultValidateMessages,os.validateMessages),ps.messages(io),fo=[],Go.prev=10,Go.next=13,Promise.resolve(ps.validate(_defineProperty$5({},Mn,rs),_objectSpread2({},os)));case 13:Go.next=18;break;case 15:Go.prev=15,Go.t0=Go.catch(10),Go.t0.errors&&(fo=Go.t0.errors.map(function(Yo,Wo){var Jo=Yo.message,xl=Jo===CODE_LOGIC_ERROR?io.default:Jo;return reactExports.isValidElement(xl)?reactExports.cloneElement(xl,{key:"error_".concat(Wo)}):xl}));case 18:if(!(!fo.length&&hs)){Go.next=23;break}return Go.next=21,Promise.all(rs.map(function(Yo,Wo){return validateRule("".concat(Mn,".").concat(Wo),Yo,hs,os,as)}));case 21:return mo=Go.sent,Go.abrupt("return",mo.reduce(function(Yo,Wo){return[].concat(_toConsumableArray(Yo),_toConsumableArray(Wo))},[]));case 23:return Ao=_objectSpread2(_objectSpread2({},is),{},{name:Mn,enum:(is.enum||[]).join(", ")},as),$o=fo.map(function(Yo){return typeof Yo=="string"?replaceMessage(Yo,Ao):Yo}),Go.abrupt("return",$o);case 26:case"end":return Go.stop()}},Fn,null,[[10,15]])})),_validateRule.apply(this,arguments)}function validateRules(Fn,Mn,rs,is,os,as){var us=Fn.join("."),ds=rs.map(function(io,fo){var mo=io.validator,Ao=_objectSpread2(_objectSpread2({},io),{},{ruleIndex:fo});return mo&&(Ao.validator=function($o,Lo,Go){var Yo=!1,Wo=function(){for(var _l=arguments.length,Tl=new Array(_l),Sl=0;Sl<_l;Sl++)Tl[Sl]=arguments[Sl];Promise.resolve().then(function(){warningOnce(!Yo,"Your validator function has already return a promise. `callback` will be ignored."),Yo||Go.apply(void 0,Tl)})},Jo=mo($o,Lo,Wo);Yo=Jo&&typeof Jo.then=="function"&&typeof Jo.catch=="function",warningOnce(Yo,"`callback` is deprecated. Please return a promise instead."),Yo&&Jo.then(function(){Go()}).catch(function(xl){Go(xl||" ")})}),Ao}).sort(function(io,fo){var mo=io.warningOnly,Ao=io.ruleIndex,$o=fo.warningOnly,Lo=fo.ruleIndex;return!!mo==!!$o?Ao-Lo:mo?1:-1}),hs;if(os===!0)hs=new Promise(function(){var io=_asyncToGenerator(_regeneratorRuntime().mark(function fo(mo,Ao){var $o,Lo,Go;return _regeneratorRuntime().wrap(function(Wo){for(;;)switch(Wo.prev=Wo.next){case 0:$o=0;case 1:if(!($o<ds.length)){Wo.next=12;break}return Lo=ds[$o],Wo.next=5,validateRule(us,Mn,Lo,is,as);case 5:if(Go=Wo.sent,!Go.length){Wo.next=9;break}return Ao([{errors:Go,rule:Lo}]),Wo.abrupt("return");case 9:$o+=1,Wo.next=1;break;case 12:mo([]);case 13:case"end":return Wo.stop()}},fo)}));return function(fo,mo){return io.apply(this,arguments)}}());else{var ps=ds.map(function(io){return validateRule(us,Mn,io,is,as).then(function(fo){return{errors:fo,rule:io}})});hs=(os?finishOnFirstFailed(ps):finishOnAllFailed(ps)).then(function(io){return Promise.reject(io)})}return hs.catch(function(io){return io}),hs}function finishOnAllFailed(Fn){return _finishOnAllFailed.apply(this,arguments)}function _finishOnAllFailed(){return _finishOnAllFailed=_asyncToGenerator(_regeneratorRuntime().mark(function Fn(Mn){return _regeneratorRuntime().wrap(function(is){for(;;)switch(is.prev=is.next){case 0:return is.abrupt("return",Promise.all(Mn).then(function(os){var as,us=(as=[]).concat.apply(as,_toConsumableArray(os));return us}));case 1:case"end":return is.stop()}},Fn)})),_finishOnAllFailed.apply(this,arguments)}function finishOnFirstFailed(Fn){return _finishOnFirstFailed.apply(this,arguments)}function _finishOnFirstFailed(){return _finishOnFirstFailed=_asyncToGenerator(_regeneratorRuntime().mark(function Fn(Mn){var rs;return _regeneratorRuntime().wrap(function(os){for(;;)switch(os.prev=os.next){case 0:return rs=0,os.abrupt("return",new Promise(function(as){Mn.forEach(function(us){us.then(function(ds){ds.errors.length&&as([ds]),rs+=1,rs===Mn.length&&as([])})})}));case 2:case"end":return os.stop()}},Fn)})),_finishOnFirstFailed.apply(this,arguments)}function getNamePath(Fn){return toArray$4(Fn)}function cloneByNamePathList(Fn,Mn){var rs={};return Mn.forEach(function(is){var os=get$2(Fn,is);rs=set$3(rs,is,os)}),rs}function containsNamePath(Fn,Mn){var rs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Fn&&Fn.some(function(is){return matchNamePath(Mn,is,rs)})}function matchNamePath(Fn,Mn){var rs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!Fn||!Mn||!rs&&Fn.length!==Mn.length?!1:Mn.every(function(is,os){return Fn[os]===is})}function isSimilar(Fn,Mn){if(Fn===Mn)return!0;if(!Fn&&Mn||Fn&&!Mn||!Fn||!Mn||_typeof$4(Fn)!=="object"||_typeof$4(Mn)!=="object")return!1;var rs=Object.keys(Fn),is=Object.keys(Mn),os=new Set([].concat(rs,is));return _toConsumableArray(os).every(function(as){var us=Fn[as],ds=Mn[as];return typeof us=="function"&&typeof ds=="function"?!0:us===ds})}function defaultGetValueFromEvent(Fn){var Mn=arguments.length<=1?void 0:arguments[1];return Mn&&Mn.target&&_typeof$4(Mn.target)==="object"&&Fn in Mn.target?Mn.target[Fn]:Mn}function move(Fn,Mn,rs){var is=Fn.length;if(Mn<0||Mn>=is||rs<0||rs>=is)return Fn;var os=Fn[Mn],as=Mn-rs;return as>0?[].concat(_toConsumableArray(Fn.slice(0,rs)),[os],_toConsumableArray(Fn.slice(rs,Mn)),_toConsumableArray(Fn.slice(Mn+1,is))):as<0?[].concat(_toConsumableArray(Fn.slice(0,Mn)),_toConsumableArray(Fn.slice(Mn+1,rs+1)),[os],_toConsumableArray(Fn.slice(rs+1,is))):Fn}var _excluded$6=["name"],EMPTY_ERRORS=[];function requireUpdate(Fn,Mn,rs,is,os,as){return typeof Fn=="function"?Fn(Mn,rs,"source"in as?{source:as.source}:{}):is!==os}var Field=function(Fn){_inherits$4(rs,Fn);var Mn=_createSuper$4(rs);function rs(is){var os;if(_classCallCheck$4(this,rs),os=Mn.call(this,is),_defineProperty$5(_assertThisInitialized$4(os),"state",{resetCount:0}),_defineProperty$5(_assertThisInitialized$4(os),"cancelRegisterFunc",null),_defineProperty$5(_assertThisInitialized$4(os),"mounted",!1),_defineProperty$5(_assertThisInitialized$4(os),"touched",!1),_defineProperty$5(_assertThisInitialized$4(os),"dirty",!1),_defineProperty$5(_assertThisInitialized$4(os),"validatePromise",void 0),_defineProperty$5(_assertThisInitialized$4(os),"prevValidating",void 0),_defineProperty$5(_assertThisInitialized$4(os),"errors",EMPTY_ERRORS),_defineProperty$5(_assertThisInitialized$4(os),"warnings",EMPTY_ERRORS),_defineProperty$5(_assertThisInitialized$4(os),"cancelRegister",function(){var hs=os.props,ps=hs.preserve,io=hs.isListField,fo=hs.name;os.cancelRegisterFunc&&os.cancelRegisterFunc(io,ps,getNamePath(fo)),os.cancelRegisterFunc=null}),_defineProperty$5(_assertThisInitialized$4(os),"getNamePath",function(){var hs=os.props,ps=hs.name,io=hs.fieldContext,fo=io.prefixName,mo=fo===void 0?[]:fo;return ps!==void 0?[].concat(_toConsumableArray(mo),_toConsumableArray(ps)):[]}),_defineProperty$5(_assertThisInitialized$4(os),"getRules",function(){var hs=os.props,ps=hs.rules,io=ps===void 0?[]:ps,fo=hs.fieldContext;return io.map(function(mo){return typeof mo=="function"?mo(fo):mo})}),_defineProperty$5(_assertThisInitialized$4(os),"refresh",function(){os.mounted&&os.setState(function(hs){var ps=hs.resetCount;return{resetCount:ps+1}})}),_defineProperty$5(_assertThisInitialized$4(os),"metaCache",null),_defineProperty$5(_assertThisInitialized$4(os),"triggerMetaEvent",function(hs){var ps=os.props.onMetaChange;if(ps){var io=_objectSpread2(_objectSpread2({},os.getMeta()),{},{destroy:hs});isEqual$1(os.metaCache,io)||ps(io),os.metaCache=io}else os.metaCache=null}),_defineProperty$5(_assertThisInitialized$4(os),"onStoreChange",function(hs,ps,io){var fo=os.props,mo=fo.shouldUpdate,Ao=fo.dependencies,$o=Ao===void 0?[]:Ao,Lo=fo.onReset,Go=io.store,Yo=os.getNamePath(),Wo=os.getValue(hs),Jo=os.getValue(Go),xl=ps&&containsNamePath(ps,Yo);switch(io.type==="valueUpdate"&&io.source==="external"&&!isEqual$1(Wo,Jo)&&(os.touched=!0,os.dirty=!0,os.validatePromise=null,os.errors=EMPTY_ERRORS,os.warnings=EMPTY_ERRORS,os.triggerMetaEvent()),io.type){case"reset":if(!ps||xl){os.touched=!1,os.dirty=!1,os.validatePromise=void 0,os.errors=EMPTY_ERRORS,os.warnings=EMPTY_ERRORS,os.triggerMetaEvent(),Lo==null||Lo(),os.refresh();return}break;case"remove":{if(mo&&requireUpdate(mo,hs,Go,Wo,Jo,io)){os.reRender();return}break}case"setField":{var _l=io.data;if(xl){"touched"in _l&&(os.touched=_l.touched),"validating"in _l&&!("originRCField"in _l)&&(os.validatePromise=_l.validating?Promise.resolve([]):null),"errors"in _l&&(os.errors=_l.errors||EMPTY_ERRORS),"warnings"in _l&&(os.warnings=_l.warnings||EMPTY_ERRORS),os.dirty=!0,os.triggerMetaEvent(),os.reRender();return}else if("value"in _l&&containsNamePath(ps,Yo,!0)){os.reRender();return}if(mo&&!Yo.length&&requireUpdate(mo,hs,Go,Wo,Jo,io)){os.reRender();return}break}case"dependenciesUpdate":{var Tl=$o.map(getNamePath);if(Tl.some(function(Sl){return containsNamePath(io.relatedFields,Sl)})){os.reRender();return}break}default:if(xl||(!$o.length||Yo.length||mo)&&requireUpdate(mo,hs,Go,Wo,Jo,io)){os.reRender();return}break}mo===!0&&os.reRender()}),_defineProperty$5(_assertThisInitialized$4(os),"validateRules",function(hs){var ps=os.getNamePath(),io=os.getValue(),fo=hs||{},mo=fo.triggerName,Ao=fo.validateOnly,$o=Ao===void 0?!1:Ao,Lo=Promise.resolve().then(_asyncToGenerator(_regeneratorRuntime().mark(function Go(){var Yo,Wo,Jo,xl,_l,Tl,Sl;return _regeneratorRuntime().wrap(function(Pl){for(;;)switch(Pl.prev=Pl.next){case 0:if(os.mounted){Pl.next=2;break}return Pl.abrupt("return",[]);case 2:if(Yo=os.props,Wo=Yo.validateFirst,Jo=Wo===void 0?!1:Wo,xl=Yo.messageVariables,_l=Yo.validateDebounce,Tl=os.getRules(),mo&&(Tl=Tl.filter(function(Dl){return Dl}).filter(function(Dl){var Ol=Dl.validateTrigger;if(!Ol)return!0;var Rl=toArray$4(Ol);return Rl.includes(mo)})),!(_l&&mo)){Pl.next=10;break}return Pl.next=8,new Promise(function(Dl){setTimeout(Dl,_l)});case 8:if(os.validatePromise===Lo){Pl.next=10;break}return Pl.abrupt("return",[]);case 10:return Sl=validateRules(ps,io,Tl,hs,Jo,xl),Sl.catch(function(Dl){return Dl}).then(function(){var Dl=arguments.length>0&&arguments[0]!==void 0?arguments[0]:EMPTY_ERRORS;if(os.validatePromise===Lo){var Ol;os.validatePromise=null;var Rl=[],Vo=[];(Ol=Dl.forEach)===null||Ol===void 0||Ol.call(Dl,function(jo){var Ho=jo.rule.warningOnly,Qo=jo.errors,El=Qo===void 0?EMPTY_ERRORS:Qo;Ho?Vo.push.apply(Vo,_toConsumableArray(El)):Rl.push.apply(Rl,_toConsumableArray(El))}),os.errors=Rl,os.warnings=Vo,os.triggerMetaEvent(),os.reRender()}}),Pl.abrupt("return",Sl);case 13:case"end":return Pl.stop()}},Go)})));return $o||(os.validatePromise=Lo,os.dirty=!0,os.errors=EMPTY_ERRORS,os.warnings=EMPTY_ERRORS,os.triggerMetaEvent(),os.reRender()),Lo}),_defineProperty$5(_assertThisInitialized$4(os),"isFieldValidating",function(){return!!os.validatePromise}),_defineProperty$5(_assertThisInitialized$4(os),"isFieldTouched",function(){return os.touched}),_defineProperty$5(_assertThisInitialized$4(os),"isFieldDirty",function(){if(os.dirty||os.props.initialValue!==void 0)return!0;var hs=os.props.fieldContext,ps=hs.getInternalHooks(HOOK_MARK),io=ps.getInitialValue;return io(os.getNamePath())!==void 0}),_defineProperty$5(_assertThisInitialized$4(os),"getErrors",function(){return os.errors}),_defineProperty$5(_assertThisInitialized$4(os),"getWarnings",function(){return os.warnings}),_defineProperty$5(_assertThisInitialized$4(os),"isListField",function(){return os.props.isListField}),_defineProperty$5(_assertThisInitialized$4(os),"isList",function(){return os.props.isList}),_defineProperty$5(_assertThisInitialized$4(os),"isPreserve",function(){return os.props.preserve}),_defineProperty$5(_assertThisInitialized$4(os),"getMeta",function(){os.prevValidating=os.isFieldValidating();var hs={touched:os.isFieldTouched(),validating:os.prevValidating,errors:os.errors,warnings:os.warnings,name:os.getNamePath(),validated:os.validatePromise===null};return hs}),_defineProperty$5(_assertThisInitialized$4(os),"getOnlyChild",function(hs){if(typeof hs=="function"){var ps=os.getMeta();return _objectSpread2(_objectSpread2({},os.getOnlyChild(hs(os.getControlled(),ps,os.props.fieldContext))),{},{isFunction:!0})}var io=toArray$5(hs);return io.length!==1||!reactExports.isValidElement(io[0])?{child:io,isFunction:!1}:{child:io[0],isFunction:!1}}),_defineProperty$5(_assertThisInitialized$4(os),"getValue",function(hs){var ps=os.props.fieldContext.getFieldsValue,io=os.getNamePath();return get$2(hs||ps(!0),io)}),_defineProperty$5(_assertThisInitialized$4(os),"getControlled",function(){var hs=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ps=os.props,io=ps.name,fo=ps.trigger,mo=ps.validateTrigger,Ao=ps.getValueFromEvent,$o=ps.normalize,Lo=ps.valuePropName,Go=ps.getValueProps,Yo=ps.fieldContext,Wo=mo!==void 0?mo:Yo.validateTrigger,Jo=os.getNamePath(),xl=Yo.getInternalHooks,_l=Yo.getFieldsValue,Tl=xl(HOOK_MARK),Sl=Tl.dispatch,$l=os.getValue(),Pl=Go||function(jo){return _defineProperty$5({},Lo,jo)},Dl=hs[fo],Ol=io!==void 0?Pl($l):{},Rl=_objectSpread2(_objectSpread2({},hs),Ol);Rl[fo]=function(){os.touched=!0,os.dirty=!0,os.triggerMetaEvent();for(var jo,Ho=arguments.length,Qo=new Array(Ho),El=0;El<Ho;El++)Qo[El]=arguments[El];Ao?jo=Ao.apply(void 0,Qo):jo=defaultGetValueFromEvent.apply(void 0,[Lo].concat(Qo)),$o&&(jo=$o(jo,$l,_l(!0))),Sl({type:"updateValue",namePath:Jo,value:jo}),Dl&&Dl.apply(void 0,Qo)};var Vo=toArray$4(Wo||[]);return Vo.forEach(function(jo){var Ho=Rl[jo];Rl[jo]=function(){Ho&&Ho.apply(void 0,arguments);var Qo=os.props.rules;Qo&&Qo.length&&Sl({type:"validateField",namePath:Jo,triggerName:jo})}}),Rl}),is.fieldContext){var as=is.fieldContext.getInternalHooks,us=as(HOOK_MARK),ds=us.initEntityValue;ds(_assertThisInitialized$4(os))}return os}return _createClass$4(rs,[{key:"componentDidMount",value:function(){var os=this.props,as=os.shouldUpdate,us=os.fieldContext;if(this.mounted=!0,us){var ds=us.getInternalHooks,hs=ds(HOOK_MARK),ps=hs.registerField;this.cancelRegisterFunc=ps(this)}as===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var os=this.state.resetCount,as=this.props.children,us=this.getOnlyChild(as),ds=us.child,hs=us.isFunction,ps;return hs?ps=ds:reactExports.isValidElement(ds)?ps=reactExports.cloneElement(ds,this.getControlled(ds.props)):(warningOnce(!ds,"`children` of Field is not validate ReactElement."),ps=ds),reactExports.createElement(reactExports.Fragment,{key:os},ps)}}]),rs}(reactExports.Component);_defineProperty$5(Field,"contextType",Context);_defineProperty$5(Field,"defaultProps",{trigger:"onChange",valuePropName:"value"});function WrapperField(Fn){var Mn=Fn.name,rs=_objectWithoutProperties$1(Fn,_excluded$6),is=reactExports.useContext(Context),os=reactExports.useContext(ListContext),as=Mn!==void 0?getNamePath(Mn):void 0,us="keep";return rs.isListField||(us="_".concat((as||[]).join("_"))),reactExports.createElement(Field,_extends$4({key:us,name:as,isListField:!!os},rs,{fieldContext:is}))}function List(Fn){var Mn=Fn.name,rs=Fn.initialValue,is=Fn.children,os=Fn.rules,as=Fn.validateTrigger,us=Fn.isListField,ds=reactExports.useContext(Context),hs=reactExports.useContext(ListContext),ps=reactExports.useRef({keys:[],id:0}),io=ps.current,fo=reactExports.useMemo(function(){var Lo=getNamePath(ds.prefixName)||[];return[].concat(_toConsumableArray(Lo),_toConsumableArray(getNamePath(Mn)))},[ds.prefixName,Mn]),mo=reactExports.useMemo(function(){return _objectSpread2(_objectSpread2({},ds),{},{prefixName:fo})},[ds,fo]),Ao=reactExports.useMemo(function(){return{getKey:function(Go){var Yo=fo.length,Wo=Go[Yo];return[io.keys[Wo],Go.slice(Yo+1)]}}},[fo]);if(typeof is!="function")return warningOnce(!1,"Form.List only accepts function as children."),null;var $o=function(Go,Yo,Wo){var Jo=Wo.source;return Jo==="internal"?!1:Go!==Yo};return reactExports.createElement(ListContext.Provider,{value:Ao},reactExports.createElement(Context.Provider,{value:mo},reactExports.createElement(WrapperField,{name:[],shouldUpdate:$o,rules:os,validateTrigger:as,initialValue:rs,isList:!0,isListField:us??!!hs},function(Lo,Go){var Yo=Lo.value,Wo=Yo===void 0?[]:Yo,Jo=Lo.onChange,xl=ds.getFieldValue,_l=function(){var Pl=xl(fo||[]);return Pl||[]},Tl={add:function(Pl,Dl){var Ol=_l();Dl>=0&&Dl<=Ol.length?(io.keys=[].concat(_toConsumableArray(io.keys.slice(0,Dl)),[io.id],_toConsumableArray(io.keys.slice(Dl))),Jo([].concat(_toConsumableArray(Ol.slice(0,Dl)),[Pl],_toConsumableArray(Ol.slice(Dl))))):(io.keys=[].concat(_toConsumableArray(io.keys),[io.id]),Jo([].concat(_toConsumableArray(Ol),[Pl]))),io.id+=1},remove:function(Pl){var Dl=_l(),Ol=new Set(Array.isArray(Pl)?Pl:[Pl]);Ol.size<=0||(io.keys=io.keys.filter(function(Rl,Vo){return!Ol.has(Vo)}),Jo(Dl.filter(function(Rl,Vo){return!Ol.has(Vo)})))},move:function(Pl,Dl){if(Pl!==Dl){var Ol=_l();Pl<0||Pl>=Ol.length||Dl<0||Dl>=Ol.length||(io.keys=move(io.keys,Pl,Dl),Jo(move(Ol,Pl,Dl)))}}},Sl=Wo||[];return Array.isArray(Sl)||(Sl=[]),is(Sl.map(function($l,Pl){var Dl=io.keys[Pl];return Dl===void 0&&(io.keys[Pl]=io.id,Dl=io.keys[Pl],io.id+=1),{name:Pl,key:Dl,isListField:!0}}),Tl,Go)})))}function allPromiseFinish(Fn){var Mn=!1,rs=Fn.length,is=[];return Fn.length?new Promise(function(os,as){Fn.forEach(function(us,ds){us.catch(function(hs){return Mn=!0,hs}).then(function(hs){rs-=1,is[ds]=hs,!(rs>0)&&(Mn&&as(is),os(is))})})}):Promise.resolve([])}var SPLIT="__@field_split__";function normalize$2(Fn){return Fn.map(function(Mn){return"".concat(_typeof$4(Mn),":").concat(Mn)}).join(SPLIT)}var NameMap=function(){function Fn(){_classCallCheck$4(this,Fn),_defineProperty$5(this,"kvs",new Map)}return _createClass$4(Fn,[{key:"set",value:function(rs,is){this.kvs.set(normalize$2(rs),is)}},{key:"get",value:function(rs){return this.kvs.get(normalize$2(rs))}},{key:"update",value:function(rs,is){var os=this.get(rs),as=is(os);as?this.set(rs,as):this.delete(rs)}},{key:"delete",value:function(rs){this.kvs.delete(normalize$2(rs))}},{key:"map",value:function(rs){return _toConsumableArray(this.kvs.entries()).map(function(is){var os=_slicedToArray(is,2),as=os[0],us=os[1],ds=as.split(SPLIT);return rs({key:ds.map(function(hs){var ps=hs.match(/^([^:]*):(.*)$/),io=_slicedToArray(ps,3),fo=io[1],mo=io[2];return fo==="number"?Number(mo):mo}),value:us})})}},{key:"toJSON",value:function(){var rs={};return this.map(function(is){var os=is.key,as=is.value;return rs[os.join(".")]=as,null}),rs}}]),Fn}(),_excluded$5=["name"],FormStore=_createClass$4(function Fn(Mn){var rs=this;_classCallCheck$4(this,Fn),_defineProperty$5(this,"formHooked",!1),_defineProperty$5(this,"forceRootUpdate",void 0),_defineProperty$5(this,"subscribable",!0),_defineProperty$5(this,"store",{}),_defineProperty$5(this,"fieldEntities",[]),_defineProperty$5(this,"initialValues",{}),_defineProperty$5(this,"callbacks",{}),_defineProperty$5(this,"validateMessages",null),_defineProperty$5(this,"preserve",null),_defineProperty$5(this,"lastValidatePromise",null),_defineProperty$5(this,"getForm",function(){return{getFieldValue:rs.getFieldValue,getFieldsValue:rs.getFieldsValue,getFieldError:rs.getFieldError,getFieldWarning:rs.getFieldWarning,getFieldsError:rs.getFieldsError,isFieldsTouched:rs.isFieldsTouched,isFieldTouched:rs.isFieldTouched,isFieldValidating:rs.isFieldValidating,isFieldsValidating:rs.isFieldsValidating,resetFields:rs.resetFields,setFields:rs.setFields,setFieldValue:rs.setFieldValue,setFieldsValue:rs.setFieldsValue,validateFields:rs.validateFields,submit:rs.submit,_init:!0,getInternalHooks:rs.getInternalHooks}}),_defineProperty$5(this,"getInternalHooks",function(is){return is===HOOK_MARK?(rs.formHooked=!0,{dispatch:rs.dispatch,initEntityValue:rs.initEntityValue,registerField:rs.registerField,useSubscribe:rs.useSubscribe,setInitialValues:rs.setInitialValues,destroyForm:rs.destroyForm,setCallbacks:rs.setCallbacks,setValidateMessages:rs.setValidateMessages,getFields:rs.getFields,setPreserve:rs.setPreserve,getInitialValue:rs.getInitialValue,registerWatch:rs.registerWatch}):(warningOnce(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),_defineProperty$5(this,"useSubscribe",function(is){rs.subscribable=is}),_defineProperty$5(this,"prevWithoutPreserves",null),_defineProperty$5(this,"setInitialValues",function(is,os){if(rs.initialValues=is||{},os){var as,us=merge$3(is,rs.store);(as=rs.prevWithoutPreserves)===null||as===void 0||as.map(function(ds){var hs=ds.key;us=set$3(us,hs,get$2(is,hs))}),rs.prevWithoutPreserves=null,rs.updateStore(us)}}),_defineProperty$5(this,"destroyForm",function(is){if(is)rs.updateStore({});else{var os=new NameMap;rs.getFieldEntities(!0).forEach(function(as){rs.isMergedPreserve(as.isPreserve())||os.set(as.getNamePath(),!0)}),rs.prevWithoutPreserves=os}}),_defineProperty$5(this,"getInitialValue",function(is){var os=get$2(rs.initialValues,is);return is.length?merge$3(os):os}),_defineProperty$5(this,"setCallbacks",function(is){rs.callbacks=is}),_defineProperty$5(this,"setValidateMessages",function(is){rs.validateMessages=is}),_defineProperty$5(this,"setPreserve",function(is){rs.preserve=is}),_defineProperty$5(this,"watchList",[]),_defineProperty$5(this,"registerWatch",function(is){return rs.watchList.push(is),function(){rs.watchList=rs.watchList.filter(function(os){return os!==is})}}),_defineProperty$5(this,"notifyWatch",function(){var is=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(rs.watchList.length){var os=rs.getFieldsValue(),as=rs.getFieldsValue(!0);rs.watchList.forEach(function(us){us(os,as,is)})}}),_defineProperty$5(this,"timeoutId",null),_defineProperty$5(this,"warningUnhooked",function(){}),_defineProperty$5(this,"updateStore",function(is){rs.store=is}),_defineProperty$5(this,"getFieldEntities",function(){var is=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return is?rs.fieldEntities.filter(function(os){return os.getNamePath().length}):rs.fieldEntities}),_defineProperty$5(this,"getFieldsMap",function(){var is=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,os=new NameMap;return rs.getFieldEntities(is).forEach(function(as){var us=as.getNamePath();os.set(us,as)}),os}),_defineProperty$5(this,"getFieldEntitiesForNamePathList",function(is){if(!is)return rs.getFieldEntities(!0);var os=rs.getFieldsMap(!0);return is.map(function(as){var us=getNamePath(as);return os.get(us)||{INVALIDATE_NAME_PATH:getNamePath(as)}})}),_defineProperty$5(this,"getFieldsValue",function(is,os){rs.warningUnhooked();var as,us,ds;if(is===!0||Array.isArray(is)?(as=is,us=os):is&&_typeof$4(is)==="object"&&(ds=is.strict,us=is.filter),as===!0&&!us)return rs.store;var hs=rs.getFieldEntitiesForNamePathList(Array.isArray(as)?as:null),ps=[];return hs.forEach(function(io){var fo,mo,Ao="INVALIDATE_NAME_PATH"in io?io.INVALIDATE_NAME_PATH:io.getNamePath();if(ds){var $o,Lo;if(($o=(Lo=io).isList)!==null&&$o!==void 0&&$o.call(Lo))return}else if(!as&&(fo=(mo=io).isListField)!==null&&fo!==void 0&&fo.call(mo))return;if(!us)ps.push(Ao);else{var Go="getMeta"in io?io.getMeta():null;us(Go)&&ps.push(Ao)}}),cloneByNamePathList(rs.store,ps.map(getNamePath))}),_defineProperty$5(this,"getFieldValue",function(is){rs.warningUnhooked();var os=getNamePath(is);return get$2(rs.store,os)}),_defineProperty$5(this,"getFieldsError",function(is){rs.warningUnhooked();var os=rs.getFieldEntitiesForNamePathList(is);return os.map(function(as,us){return as&&!("INVALIDATE_NAME_PATH"in as)?{name:as.getNamePath(),errors:as.getErrors(),warnings:as.getWarnings()}:{name:getNamePath(is[us]),errors:[],warnings:[]}})}),_defineProperty$5(this,"getFieldError",function(is){rs.warningUnhooked();var os=getNamePath(is),as=rs.getFieldsError([os])[0];return as.errors}),_defineProperty$5(this,"getFieldWarning",function(is){rs.warningUnhooked();var os=getNamePath(is),as=rs.getFieldsError([os])[0];return as.warnings}),_defineProperty$5(this,"isFieldsTouched",function(){rs.warningUnhooked();for(var is=arguments.length,os=new Array(is),as=0;as<is;as++)os[as]=arguments[as];var us=os[0],ds=os[1],hs,ps=!1;os.length===0?hs=null:os.length===1?Array.isArray(us)?(hs=us.map(getNamePath),ps=!1):(hs=null,ps=us):(hs=us.map(getNamePath),ps=ds);var io=rs.getFieldEntities(!0),fo=function(Go){return Go.isFieldTouched()};if(!hs)return ps?io.every(function(Lo){return fo(Lo)||Lo.isList()}):io.some(fo);var mo=new NameMap;hs.forEach(function(Lo){mo.set(Lo,[])}),io.forEach(function(Lo){var Go=Lo.getNamePath();hs.forEach(function(Yo){Yo.every(function(Wo,Jo){return Go[Jo]===Wo})&&mo.update(Yo,function(Wo){return[].concat(_toConsumableArray(Wo),[Lo])})})});var Ao=function(Go){return Go.some(fo)},$o=mo.map(function(Lo){var Go=Lo.value;return Go});return ps?$o.every(Ao):$o.some(Ao)}),_defineProperty$5(this,"isFieldTouched",function(is){return rs.warningUnhooked(),rs.isFieldsTouched([is])}),_defineProperty$5(this,"isFieldsValidating",function(is){rs.warningUnhooked();var os=rs.getFieldEntities();if(!is)return os.some(function(us){return us.isFieldValidating()});var as=is.map(getNamePath);return os.some(function(us){var ds=us.getNamePath();return containsNamePath(as,ds)&&us.isFieldValidating()})}),_defineProperty$5(this,"isFieldValidating",function(is){return rs.warningUnhooked(),rs.isFieldsValidating([is])}),_defineProperty$5(this,"resetWithFieldInitialValue",function(){var is=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},os=new NameMap,as=rs.getFieldEntities(!0);as.forEach(function(hs){var ps=hs.props.initialValue,io=hs.getNamePath();if(ps!==void 0){var fo=os.get(io)||new Set;fo.add({entity:hs,value:ps}),os.set(io,fo)}});var us=function(ps){ps.forEach(function(io){var fo=io.props.initialValue;if(fo!==void 0){var mo=io.getNamePath(),Ao=rs.getInitialValue(mo);if(Ao!==void 0)warningOnce(!1,"Form already set 'initialValues' with path '".concat(mo.join("."),"'. Field can not overwrite it."));else{var $o=os.get(mo);if($o&&$o.size>1)warningOnce(!1,"Multiple Field with path '".concat(mo.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if($o){var Lo=rs.getFieldValue(mo),Go=io.isListField();!Go&&(!is.skipExist||Lo===void 0)&&rs.updateStore(set$3(rs.store,mo,_toConsumableArray($o)[0].value))}}}})},ds;is.entities?ds=is.entities:is.namePathList?(ds=[],is.namePathList.forEach(function(hs){var ps=os.get(hs);if(ps){var io;(io=ds).push.apply(io,_toConsumableArray(_toConsumableArray(ps).map(function(fo){return fo.entity})))}})):ds=as,us(ds)}),_defineProperty$5(this,"resetFields",function(is){rs.warningUnhooked();var os=rs.store;if(!is){rs.updateStore(merge$3(rs.initialValues)),rs.resetWithFieldInitialValue(),rs.notifyObservers(os,null,{type:"reset"}),rs.notifyWatch();return}var as=is.map(getNamePath);as.forEach(function(us){var ds=rs.getInitialValue(us);rs.updateStore(set$3(rs.store,us,ds))}),rs.resetWithFieldInitialValue({namePathList:as}),rs.notifyObservers(os,as,{type:"reset"}),rs.notifyWatch(as)}),_defineProperty$5(this,"setFields",function(is){rs.warningUnhooked();var os=rs.store,as=[];is.forEach(function(us){var ds=us.name,hs=_objectWithoutProperties$1(us,_excluded$5),ps=getNamePath(ds);as.push(ps),"value"in hs&&rs.updateStore(set$3(rs.store,ps,hs.value)),rs.notifyObservers(os,[ps],{type:"setField",data:us})}),rs.notifyWatch(as)}),_defineProperty$5(this,"getFields",function(){var is=rs.getFieldEntities(!0),os=is.map(function(as){var us=as.getNamePath(),ds=as.getMeta(),hs=_objectSpread2(_objectSpread2({},ds),{},{name:us,value:rs.getFieldValue(us)});return Object.defineProperty(hs,"originRCField",{value:!0}),hs});return os}),_defineProperty$5(this,"initEntityValue",function(is){var os=is.props.initialValue;if(os!==void 0){var as=is.getNamePath(),us=get$2(rs.store,as);us===void 0&&rs.updateStore(set$3(rs.store,as,os))}}),_defineProperty$5(this,"isMergedPreserve",function(is){var os=is!==void 0?is:rs.preserve;return os??!0}),_defineProperty$5(this,"registerField",function(is){rs.fieldEntities.push(is);var os=is.getNamePath();if(rs.notifyWatch([os]),is.props.initialValue!==void 0){var as=rs.store;rs.resetWithFieldInitialValue({entities:[is],skipExist:!0}),rs.notifyObservers(as,[is.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(us,ds){var hs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(rs.fieldEntities=rs.fieldEntities.filter(function(fo){return fo!==is}),!rs.isMergedPreserve(ds)&&(!us||hs.length>1)){var ps=us?void 0:rs.getInitialValue(os);if(os.length&&rs.getFieldValue(os)!==ps&&rs.fieldEntities.every(function(fo){return!matchNamePath(fo.getNamePath(),os)})){var io=rs.store;rs.updateStore(set$3(io,os,ps,!0)),rs.notifyObservers(io,[os],{type:"remove"}),rs.triggerDependenciesUpdate(io,os)}}rs.notifyWatch([os])}}),_defineProperty$5(this,"dispatch",function(is){switch(is.type){case"updateValue":{var os=is.namePath,as=is.value;rs.updateValue(os,as);break}case"validateField":{var us=is.namePath,ds=is.triggerName;rs.validateFields([us],{triggerName:ds});break}}}),_defineProperty$5(this,"notifyObservers",function(is,os,as){if(rs.subscribable){var us=_objectSpread2(_objectSpread2({},as),{},{store:rs.getFieldsValue(!0)});rs.getFieldEntities().forEach(function(ds){var hs=ds.onStoreChange;hs(is,os,us)})}else rs.forceRootUpdate()}),_defineProperty$5(this,"triggerDependenciesUpdate",function(is,os){var as=rs.getDependencyChildrenFields(os);return as.length&&rs.validateFields(as),rs.notifyObservers(is,as,{type:"dependenciesUpdate",relatedFields:[os].concat(_toConsumableArray(as))}),as}),_defineProperty$5(this,"updateValue",function(is,os){var as=getNamePath(is),us=rs.store;rs.updateStore(set$3(rs.store,as,os)),rs.notifyObservers(us,[as],{type:"valueUpdate",source:"internal"}),rs.notifyWatch([as]);var ds=rs.triggerDependenciesUpdate(us,as),hs=rs.callbacks.onValuesChange;if(hs){var ps=cloneByNamePathList(rs.store,[as]);hs(ps,rs.getFieldsValue())}rs.triggerOnFieldsChange([as].concat(_toConsumableArray(ds)))}),_defineProperty$5(this,"setFieldsValue",function(is){rs.warningUnhooked();var os=rs.store;if(is){var as=merge$3(rs.store,is);rs.updateStore(as)}rs.notifyObservers(os,null,{type:"valueUpdate",source:"external"}),rs.notifyWatch()}),_defineProperty$5(this,"setFieldValue",function(is,os){rs.setFields([{name:is,value:os}])}),_defineProperty$5(this,"getDependencyChildrenFields",function(is){var os=new Set,as=[],us=new NameMap;rs.getFieldEntities().forEach(function(hs){var ps=hs.props.dependencies;(ps||[]).forEach(function(io){var fo=getNamePath(io);us.update(fo,function(){var mo=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return mo.add(hs),mo})})});var ds=function hs(ps){var io=us.get(ps)||new Set;io.forEach(function(fo){if(!os.has(fo)){os.add(fo);var mo=fo.getNamePath();fo.isFieldDirty()&&mo.length&&(as.push(mo),hs(mo))}})};return ds(is),as}),_defineProperty$5(this,"triggerOnFieldsChange",function(is,os){var as=rs.callbacks.onFieldsChange;if(as){var us=rs.getFields();if(os){var ds=new NameMap;os.forEach(function(ps){var io=ps.name,fo=ps.errors;ds.set(io,fo)}),us.forEach(function(ps){ps.errors=ds.get(ps.name)||ps.errors})}var hs=us.filter(function(ps){var io=ps.name;return containsNamePath(is,io)});hs.length&&as(hs,us)}}),_defineProperty$5(this,"validateFields",function(is,os){rs.warningUnhooked();var as,us;Array.isArray(is)||typeof is=="string"||typeof os=="string"?(as=is,us=os):us=is;var ds=!!as,hs=ds?as.map(getNamePath):[],ps=[],io=String(Date.now()),fo=new Set,mo=us||{},Ao=mo.recursive,$o=mo.dirty;rs.getFieldEntities(!0).forEach(function(Wo){if(ds||hs.push(Wo.getNamePath()),!(!Wo.props.rules||!Wo.props.rules.length)&&!($o&&!Wo.isFieldDirty())){var Jo=Wo.getNamePath();if(fo.add(Jo.join(io)),!ds||containsNamePath(hs,Jo,Ao)){var xl=Wo.validateRules(_objectSpread2({validateMessages:_objectSpread2(_objectSpread2({},defaultValidateMessages),rs.validateMessages)},us));ps.push(xl.then(function(){return{name:Jo,errors:[],warnings:[]}}).catch(function(_l){var Tl,Sl=[],$l=[];return(Tl=_l.forEach)===null||Tl===void 0||Tl.call(_l,function(Pl){var Dl=Pl.rule.warningOnly,Ol=Pl.errors;Dl?$l.push.apply($l,_toConsumableArray(Ol)):Sl.push.apply(Sl,_toConsumableArray(Ol))}),Sl.length?Promise.reject({name:Jo,errors:Sl,warnings:$l}):{name:Jo,errors:Sl,warnings:$l}}))}}});var Lo=allPromiseFinish(ps);rs.lastValidatePromise=Lo,Lo.catch(function(Wo){return Wo}).then(function(Wo){var Jo=Wo.map(function(xl){var _l=xl.name;return _l});rs.notifyObservers(rs.store,Jo,{type:"validateFinish"}),rs.triggerOnFieldsChange(Jo,Wo)});var Go=Lo.then(function(){return rs.lastValidatePromise===Lo?Promise.resolve(rs.getFieldsValue(hs)):Promise.reject([])}).catch(function(Wo){var Jo=Wo.filter(function(xl){return xl&&xl.errors.length});return Promise.reject({values:rs.getFieldsValue(hs),errorFields:Jo,outOfDate:rs.lastValidatePromise!==Lo})});Go.catch(function(Wo){return Wo});var Yo=hs.filter(function(Wo){return fo.has(Wo.join(io))});return rs.triggerOnFieldsChange(Yo),Go}),_defineProperty$5(this,"submit",function(){rs.warningUnhooked(),rs.validateFields().then(function(is){var os=rs.callbacks.onFinish;if(os)try{os(is)}catch(as){console.error(as)}}).catch(function(is){var os=rs.callbacks.onFinishFailed;os&&os(is)})}),this.forceRootUpdate=Mn});function useForm(Fn){var Mn=reactExports.useRef(),rs=reactExports.useState({}),is=_slicedToArray(rs,2),os=is[1];if(!Mn.current)if(Fn)Mn.current=Fn;else{var as=function(){os({})},us=new FormStore(as);Mn.current=us.getForm()}return[Mn.current]}var FormContext=reactExports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),FormProvider=function(Mn){var rs=Mn.validateMessages,is=Mn.onFormChange,os=Mn.onFormFinish,as=Mn.children,us=reactExports.useContext(FormContext),ds=reactExports.useRef({});return reactExports.createElement(FormContext.Provider,{value:_objectSpread2(_objectSpread2({},us),{},{validateMessages:_objectSpread2(_objectSpread2({},us.validateMessages),rs),triggerFormChange:function(ps,io){is&&is(ps,{changedFields:io,forms:ds.current}),us.triggerFormChange(ps,io)},triggerFormFinish:function(ps,io){os&&os(ps,{values:io,forms:ds.current}),us.triggerFormFinish(ps,io)},registerForm:function(ps,io){ps&&(ds.current=_objectSpread2(_objectSpread2({},ds.current),{},_defineProperty$5({},ps,io))),us.registerForm(ps,io)},unregisterForm:function(ps){var io=_objectSpread2({},ds.current);delete io[ps],ds.current=io,us.unregisterForm(ps)}})},as)},_excluded$4=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],Form=function(Mn,rs){var is=Mn.name,os=Mn.initialValues,as=Mn.fields,us=Mn.form,ds=Mn.preserve,hs=Mn.children,ps=Mn.component,io=ps===void 0?"form":ps,fo=Mn.validateMessages,mo=Mn.validateTrigger,Ao=mo===void 0?"onChange":mo,$o=Mn.onValuesChange,Lo=Mn.onFieldsChange,Go=Mn.onFinish,Yo=Mn.onFinishFailed,Wo=Mn.clearOnDestroy,Jo=_objectWithoutProperties$1(Mn,_excluded$4),xl=reactExports.useRef(null),_l=reactExports.useContext(FormContext),Tl=useForm(us),Sl=_slicedToArray(Tl,1),$l=Sl[0],Pl=$l.getInternalHooks(HOOK_MARK),Dl=Pl.useSubscribe,Ol=Pl.setInitialValues,Rl=Pl.setCallbacks,Vo=Pl.setValidateMessages,jo=Pl.setPreserve,Ho=Pl.destroyForm;reactExports.useImperativeHandle(rs,function(){return _objectSpread2(_objectSpread2({},$l),{},{nativeElement:xl.current})}),reactExports.useEffect(function(){return _l.registerForm(is,$l),function(){_l.unregisterForm(is)}},[_l,$l,is]),Vo(_objectSpread2(_objectSpread2({},_l.validateMessages),fo)),Rl({onValuesChange:$o,onFieldsChange:function(Gl){if(_l.triggerFormChange(is,Gl),Lo){for(var Nl=arguments.length,zl=new Array(Nl>1?Nl-1:0),Vl=1;Vl<Nl;Vl++)zl[Vl-1]=arguments[Vl];Lo.apply(void 0,[Gl].concat(zl))}},onFinish:function(Gl){_l.triggerFormFinish(is,Gl),Go&&Go(Gl)},onFinishFailed:Yo}),jo(ds);var Qo=reactExports.useRef(null);Ol(os,!Qo.current),Qo.current||(Qo.current=!0),reactExports.useEffect(function(){return function(){return Ho(Wo)}},[]);var El,Xo=typeof hs=="function";if(Xo){var Al=$l.getFieldsValue(!0);El=hs(Al,$l)}else El=hs;Dl(!Xo);var wl=reactExports.useRef();reactExports.useEffect(function(){isSimilar(wl.current||[],as||[])||$l.setFields(as||[]),wl.current=as},[as,$l]);var yl=reactExports.useMemo(function(){return _objectSpread2(_objectSpread2({},$l),{},{validateTrigger:Ao})},[$l,Ao]),Il=reactExports.createElement(ListContext.Provider,{value:null},reactExports.createElement(Context.Provider,{value:yl},El));return io===!1?Il:reactExports.createElement(io,_extends$4({},Jo,{ref:xl,onSubmit:function(Gl){Gl.preventDefault(),Gl.stopPropagation(),$l.submit()},onReset:function(Gl){var Nl;Gl.preventDefault(),$l.resetFields(),(Nl=Jo.onReset)===null||Nl===void 0||Nl.call(Jo,Gl)}}),Il)};function stringify$2(Fn){try{return JSON.stringify(Fn)}catch{return Math.random()}}function useWatch$1(){for(var Fn=arguments.length,Mn=new Array(Fn),rs=0;rs<Fn;rs++)Mn[rs]=arguments[rs];var is=Mn[0],os=Mn[1],as=os===void 0?{}:os,us=isFormInstance(as)?{form:as}:as,ds=us.form,hs=reactExports.useState(),ps=_slicedToArray(hs,2),io=ps[0],fo=ps[1],mo=reactExports.useMemo(function(){return stringify$2(io)},[io]),Ao=reactExports.useRef(mo);Ao.current=mo;var $o=reactExports.useContext(Context),Lo=ds||$o,Go=Lo&&Lo._init,Yo=getNamePath(is),Wo=reactExports.useRef(Yo);return Wo.current=Yo,reactExports.useEffect(function(){if(Go){var Jo=Lo.getFieldsValue,xl=Lo.getInternalHooks,_l=xl(HOOK_MARK),Tl=_l.registerWatch,Sl=function(Ol,Rl){var Vo=us.preserve?Rl:Ol;return typeof is=="function"?is(Vo):get$2(Vo,Wo.current)},$l=Tl(function(Dl,Ol){var Rl=Sl(Dl,Ol),Vo=stringify$2(Rl);Ao.current!==Vo&&(Ao.current=Vo,fo(Rl))}),Pl=Sl(Jo(),Jo(!0));return io!==Pl&&fo(Pl),$l}},[Go]),io}var InternalForm=reactExports.forwardRef(Form),RefForm=InternalForm;RefForm.FormProvider=FormProvider;RefForm.Field=WrapperField;RefForm.List=List;RefForm.useForm=useForm;RefForm.useWatch=useWatch$1;const FormItemInputContext=reactExports.createContext({}),NoFormStyle=Fn=>{let{children:Mn,status:rs,override:is}=Fn;const os=reactExports.useContext(FormItemInputContext),as=reactExports.useMemo(()=>{const us=Object.assign({},os);return is&&delete us.isFormItemInput,rs&&(delete us.status,delete us.hasFeedback,delete us.feedbackIcon),us},[rs,is,os]);return reactExports.createElement(FormItemInputContext.Provider,{value:as},Mn)},ContextIsolator=Fn=>{const{space:Mn,form:rs,children:is}=Fn;if(is==null)return null;let os=is;return rs&&(os=React.createElement(NoFormStyle,{override:!0,status:!0},os)),Mn&&(os=React.createElement(NoCompactStyle,null,os)),os};function useClosableConfig(Fn){const{closable:Mn,closeIcon:rs}=Fn||{};return React.useMemo(()=>{if(!Mn&&(Mn===!1||rs===!1||rs===null))return!1;if(Mn===void 0&&rs===void 0)return null;let is={closeIcon:typeof rs!="boolean"&&rs!==null?rs:void 0};return Mn&&typeof Mn=="object"&&(is=Object.assign(Object.assign({},is),Mn)),is},[Mn,rs])}function assignWithoutUndefined(){const Fn={};for(var Mn=arguments.length,rs=new Array(Mn),is=0;is<Mn;is++)rs[is]=arguments[is];return rs.forEach(os=>{os&&Object.keys(os).forEach(as=>{os[as]!==void 0&&(Fn[as]=os[as])})}),Fn}const EmptyFallbackCloseCollection={};function useClosable$1(Fn,Mn){let rs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:EmptyFallbackCloseCollection;const is=useClosableConfig(Fn),os=useClosableConfig(Mn),as=React.useMemo(()=>Object.assign({closeIcon:React.createElement(RefIcon$4,null)},rs),[rs]),us=React.useMemo(()=>is===!1?!1:is?assignWithoutUndefined(as,os,is):os===!1?!1:os?assignWithoutUndefined(as,os):as.closable?as:!1,[is,os,as]);return React.useMemo(()=>{if(us===!1)return[!1,null];const{closeIconRender:ds}=as,{closeIcon:hs}=us;let ps=hs;if(ps!=null){ds&&(ps=ds(hs));const io=pickAttrs(us,!0);Object.keys(io).length&&(ps=React.isValidElement(ps)?React.cloneElement(ps,io):React.createElement("span",Object.assign({},io),ps))}return[!0,ps]},[us,as])}const initMotionCommon=Fn=>({animationDuration:Fn,animationFillMode:"both"}),initMotionCommonLeave=Fn=>({animationDuration:Fn,animationFillMode:"both"}),initMotion=function(Fn,Mn,rs,is){const as=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[`
      ${as}${Fn}-enter,
      ${as}${Fn}-appear
    `]:Object.assign(Object.assign({},initMotionCommon(is)),{animationPlayState:"paused"}),[`${as}${Fn}-leave`]:Object.assign(Object.assign({},initMotionCommonLeave(is)),{animationPlayState:"paused"}),[`
      ${as}${Fn}-enter${Fn}-enter-active,
      ${as}${Fn}-appear${Fn}-appear-active
    `]:{animationName:Mn,animationPlayState:"running"},[`${as}${Fn}-leave${Fn}-leave-active`]:{animationName:rs,animationPlayState:"running",pointerEvents:"none"}}},zoomIn=new Keyframe("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),zoomOut=new Keyframe("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),zoomBigIn=new Keyframe("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),zoomBigOut=new Keyframe("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),zoomUpIn=new Keyframe("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),zoomUpOut=new Keyframe("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),zoomLeftIn=new Keyframe("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),zoomLeftOut=new Keyframe("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),zoomRightIn=new Keyframe("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),zoomRightOut=new Keyframe("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),zoomDownIn=new Keyframe("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),zoomDownOut=new Keyframe("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),zoomMotion={zoom:{inKeyframes:zoomIn,outKeyframes:zoomOut},"zoom-big":{inKeyframes:zoomBigIn,outKeyframes:zoomBigOut},"zoom-big-fast":{inKeyframes:zoomBigIn,outKeyframes:zoomBigOut},"zoom-left":{inKeyframes:zoomLeftIn,outKeyframes:zoomLeftOut},"zoom-right":{inKeyframes:zoomRightIn,outKeyframes:zoomRightOut},"zoom-up":{inKeyframes:zoomUpIn,outKeyframes:zoomUpOut},"zoom-down":{inKeyframes:zoomDownIn,outKeyframes:zoomDownOut}},initZoomMotion=(Fn,Mn)=>{const{antCls:rs}=Fn,is=`${rs}-${Mn}`,{inKeyframes:os,outKeyframes:as}=zoomMotion[Mn];return[initMotion(is,os,as,Fn.motionDurationFast),{[`
        ${is}-enter,
        ${is}-appear
      `]:{transform:"scale(0)",opacity:0,animationTimingFunction:Fn.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${is}-leave`]:{animationTimingFunction:Fn.motionEaseInOutCirc}}]},genNotificationPlacementStyle=Fn=>{const{componentCls:Mn,notificationMarginEdge:rs,animationMaxHeight:is}=Fn,os=`${Mn}-notice`,as=new Keyframe("antNotificationFadeIn",{"0%":{transform:"translate3d(100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}}),us=new Keyframe("antNotificationTopFadeIn",{"0%":{top:-is,opacity:0},"100%":{top:0,opacity:1}}),ds=new Keyframe("antNotificationBottomFadeIn",{"0%":{bottom:Fn.calc(is).mul(-1).equal(),opacity:0},"100%":{bottom:0,opacity:1}}),hs=new Keyframe("antNotificationLeftFadeIn",{"0%":{transform:"translate3d(-100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}});return{[Mn]:{[`&${Mn}-top, &${Mn}-bottom`]:{marginInline:0,[os]:{marginInline:"auto auto"}},[`&${Mn}-top`]:{[`${Mn}-fade-enter${Mn}-fade-enter-active, ${Mn}-fade-appear${Mn}-fade-appear-active`]:{animationName:us}},[`&${Mn}-bottom`]:{[`${Mn}-fade-enter${Mn}-fade-enter-active, ${Mn}-fade-appear${Mn}-fade-appear-active`]:{animationName:ds}},[`&${Mn}-topRight, &${Mn}-bottomRight`]:{[`${Mn}-fade-enter${Mn}-fade-enter-active, ${Mn}-fade-appear${Mn}-fade-appear-active`]:{animationName:as}},[`&${Mn}-topLeft, &${Mn}-bottomLeft`]:{marginRight:{value:0,_skip_check_:!0},marginLeft:{value:rs,_skip_check_:!0},[os]:{marginInlineEnd:"auto",marginInlineStart:0},[`${Mn}-fade-enter${Mn}-fade-enter-active, ${Mn}-fade-appear${Mn}-fade-appear-active`]:{animationName:hs}}}}},NotificationPlacements=["top","topLeft","topRight","bottom","bottomLeft","bottomRight"],placementAlignProperty={topLeft:"left",topRight:"right",bottomLeft:"left",bottomRight:"right",top:"left",bottom:"left"},genPlacementStackStyle=(Fn,Mn)=>{const{componentCls:rs}=Fn;return{[`${rs}-${Mn}`]:{[`&${rs}-stack > ${rs}-notice-wrapper`]:{[Mn.startsWith("top")?"top":"bottom"]:0,[placementAlignProperty[Mn]]:{value:0,_skip_check_:!0}}}}},genStackChildrenStyle=Fn=>{const Mn={};for(let rs=1;rs<Fn.notificationStackLayer;rs++)Mn[`&:nth-last-child(${rs+1})`]={overflow:"hidden",[`& > ${Fn.componentCls}-notice`]:{opacity:0,transition:`opacity ${Fn.motionDurationMid}`}};return Object.assign({[`&:not(:nth-last-child(-n+${Fn.notificationStackLayer}))`]:{opacity:0,overflow:"hidden",color:"transparent",pointerEvents:"none"}},Mn)},genStackedNoticeStyle=Fn=>{const Mn={};for(let rs=1;rs<Fn.notificationStackLayer;rs++)Mn[`&:nth-last-child(${rs+1})`]={background:Fn.colorBgBlur,backdropFilter:"blur(10px)","-webkit-backdrop-filter":"blur(10px)"};return Object.assign({},Mn)},genStackStyle=Fn=>{const{componentCls:Mn}=Fn;return Object.assign({[`${Mn}-stack`]:{[`& > ${Mn}-notice-wrapper`]:Object.assign({transition:`all ${Fn.motionDurationSlow}, backdrop-filter 0s`,position:"absolute"},genStackChildrenStyle(Fn))},[`${Mn}-stack:not(${Mn}-stack-expanded)`]:{[`& > ${Mn}-notice-wrapper`]:Object.assign({},genStackedNoticeStyle(Fn))},[`${Mn}-stack${Mn}-stack-expanded`]:{[`& > ${Mn}-notice-wrapper`]:{"&:not(:nth-last-child(-n + 1))":{opacity:1,overflow:"unset",color:"inherit",pointerEvents:"auto",[`& > ${Fn.componentCls}-notice`]:{opacity:1}},"&:after":{content:'""',position:"absolute",height:Fn.margin,width:"100%",insetInline:0,bottom:Fn.calc(Fn.margin).mul(-1).equal(),background:"transparent",pointerEvents:"auto"}}}},NotificationPlacements.map(rs=>genPlacementStackStyle(Fn,rs)).reduce((rs,is)=>Object.assign(Object.assign({},rs),is),{}))},genNoticeStyle=Fn=>{const{iconCls:Mn,componentCls:rs,boxShadow:is,fontSizeLG:os,notificationMarginBottom:as,borderRadiusLG:us,colorSuccess:ds,colorInfo:hs,colorWarning:ps,colorError:io,colorTextHeading:fo,notificationBg:mo,notificationPadding:Ao,notificationMarginEdge:$o,notificationProgressBg:Lo,notificationProgressHeight:Go,fontSize:Yo,lineHeight:Wo,width:Jo,notificationIconSize:xl,colorText:_l}=Fn,Tl=`${rs}-notice`;return{position:"relative",marginBottom:as,marginInlineStart:"auto",background:mo,borderRadius:us,boxShadow:is,[Tl]:{padding:Ao,width:Jo,maxWidth:`calc(100vw - ${unit$1(Fn.calc($o).mul(2).equal())})`,overflow:"hidden",lineHeight:Wo,wordWrap:"break-word"},[`${Tl}-message`]:{marginBottom:Fn.marginXS,color:fo,fontSize:os,lineHeight:Fn.lineHeightLG},[`${Tl}-description`]:{fontSize:Yo,color:_l},[`${Tl}-closable ${Tl}-message`]:{paddingInlineEnd:Fn.paddingLG},[`${Tl}-with-icon ${Tl}-message`]:{marginBottom:Fn.marginXS,marginInlineStart:Fn.calc(Fn.marginSM).add(xl).equal(),fontSize:os},[`${Tl}-with-icon ${Tl}-description`]:{marginInlineStart:Fn.calc(Fn.marginSM).add(xl).equal(),fontSize:Yo},[`${Tl}-icon`]:{position:"absolute",fontSize:xl,lineHeight:1,[`&-success${Mn}`]:{color:ds},[`&-info${Mn}`]:{color:hs},[`&-warning${Mn}`]:{color:ps},[`&-error${Mn}`]:{color:io}},[`${Tl}-close`]:Object.assign({position:"absolute",top:Fn.notificationPaddingVertical,insetInlineEnd:Fn.notificationPaddingHorizontal,color:Fn.colorIcon,outline:"none",width:Fn.notificationCloseButtonSize,height:Fn.notificationCloseButtonSize,borderRadius:Fn.borderRadiusSM,transition:`background-color ${Fn.motionDurationMid}, color ${Fn.motionDurationMid}`,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:Fn.colorIconHover,backgroundColor:Fn.colorBgTextHover},"&:active":{backgroundColor:Fn.colorBgTextActive}},genFocusStyle(Fn)),[`${Tl}-progress`]:{position:"absolute",display:"block",appearance:"none",WebkitAppearance:"none",inlineSize:`calc(100% - ${unit$1(us)} * 2)`,left:{_skip_check_:!0,value:us},right:{_skip_check_:!0,value:us},bottom:0,blockSize:Go,border:0,"&, &::-webkit-progress-bar":{borderRadius:us,backgroundColor:"rgba(0, 0, 0, 0.04)"},"&::-moz-progress-bar":{background:Lo},"&::-webkit-progress-value":{borderRadius:us,background:Lo}},[`${Tl}-btn`]:{float:"right",marginTop:Fn.marginSM}}},genNotificationStyle=Fn=>{const{componentCls:Mn,notificationMarginBottom:rs,notificationMarginEdge:is,motionDurationMid:os,motionEaseInOut:as}=Fn,us=`${Mn}-notice`,ds=new Keyframe("antNotificationFadeOut",{"0%":{maxHeight:Fn.animationMaxHeight,marginBottom:rs},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}});return[{[Mn]:Object.assign(Object.assign({},resetComponent(Fn)),{position:"fixed",zIndex:Fn.zIndexPopup,marginRight:{value:is,_skip_check_:!0},[`${Mn}-hook-holder`]:{position:"relative"},[`${Mn}-fade-appear-prepare`]:{opacity:"0 !important"},[`${Mn}-fade-enter, ${Mn}-fade-appear`]:{animationDuration:Fn.motionDurationMid,animationTimingFunction:as,animationFillMode:"both",opacity:0,animationPlayState:"paused"},[`${Mn}-fade-leave`]:{animationTimingFunction:as,animationFillMode:"both",animationDuration:os,animationPlayState:"paused"},[`${Mn}-fade-enter${Mn}-fade-enter-active, ${Mn}-fade-appear${Mn}-fade-appear-active`]:{animationPlayState:"running"},[`${Mn}-fade-leave${Mn}-fade-leave-active`]:{animationName:ds,animationPlayState:"running"},"&-rtl":{direction:"rtl",[`${us}-btn`]:{float:"left"}}})},{[Mn]:{[`${us}-wrapper`]:Object.assign({},genNoticeStyle(Fn))}}]},prepareComponentToken$3=Fn=>({zIndexPopup:Fn.zIndexPopupBase+CONTAINER_MAX_OFFSET+50,width:384}),prepareNotificationToken=Fn=>{const Mn=Fn.paddingMD,rs=Fn.paddingLG;return merge$2(Fn,{notificationBg:Fn.colorBgElevated,notificationPaddingVertical:Mn,notificationPaddingHorizontal:rs,notificationIconSize:Fn.calc(Fn.fontSizeLG).mul(Fn.lineHeightLG).equal(),notificationCloseButtonSize:Fn.calc(Fn.controlHeightLG).mul(.55).equal(),notificationMarginBottom:Fn.margin,notificationPadding:`${unit$1(Fn.paddingMD)} ${unit$1(Fn.paddingContentHorizontalLG)}`,notificationMarginEdge:Fn.marginLG,animationMaxHeight:150,notificationStackLayer:3,notificationProgressHeight:2,notificationProgressBg:`linear-gradient(90deg, ${Fn.colorPrimaryBorderHover}, ${Fn.colorPrimary})`})},useStyle$3=genStyleHooks("Notification",Fn=>{const Mn=prepareNotificationToken(Fn);return[genNotificationStyle(Mn),genNotificationPlacementStyle(Mn),genStackStyle(Mn)]},prepareComponentToken$3),PurePanelStyle=genSubStyleComponent(["Notification","PurePanel"],Fn=>{const Mn=`${Fn.componentCls}-notice`,rs=prepareNotificationToken(Fn);return{[`${Mn}-pure-panel`]:Object.assign(Object.assign({},genNoticeStyle(rs)),{width:rs.width,maxWidth:`calc(100vw - ${unit$1(Fn.calc(rs.notificationMarginEdge).mul(2).equal())})`,margin:0})}},prepareComponentToken$3);var __rest$7=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};function getCloseIcon(Fn,Mn){return Mn===null||Mn===!1?null:Mn||reactExports.createElement(RefIcon$4,{className:`${Fn}-close-icon`})}const typeToIcon={success:RefIcon$6,info:RefIcon$2,error:RefIcon$5,warning:RefIcon$3},PureContent=Fn=>{const{prefixCls:Mn,icon:rs,type:is,message:os,description:as,btn:us,role:ds="alert"}=Fn;let hs=null;return rs?hs=reactExports.createElement("span",{className:`${Mn}-icon`},rs):is&&(hs=reactExports.createElement(typeToIcon[is]||null,{className:classNames(`${Mn}-icon`,`${Mn}-icon-${is}`)})),reactExports.createElement("div",{className:classNames({[`${Mn}-with-icon`]:hs}),role:ds},hs,reactExports.createElement("div",{className:`${Mn}-message`},os),reactExports.createElement("div",{className:`${Mn}-description`},as),us&&reactExports.createElement("div",{className:`${Mn}-btn`},us))},PurePanel$3=Fn=>{const{prefixCls:Mn,className:rs,icon:is,type:os,message:as,description:us,btn:ds,closable:hs=!0,closeIcon:ps,className:io}=Fn,fo=__rest$7(Fn,["prefixCls","className","icon","type","message","description","btn","closable","closeIcon","className"]),{getPrefixCls:mo}=reactExports.useContext(ConfigContext),Ao=Mn||mo("notification"),$o=`${Ao}-notice`,Lo=useCSSVarCls(Ao),[Go,Yo,Wo]=useStyle$3(Ao,Lo);return Go(reactExports.createElement("div",{className:classNames(`${$o}-pure-panel`,Yo,rs,Wo,Lo)},reactExports.createElement(PurePanelStyle,{prefixCls:Ao}),reactExports.createElement(Notify,Object.assign({},fo,{prefixCls:Ao,eventKey:"pure",duration:null,closable:hs,className:classNames({notificationClassName:io}),closeIcon:getCloseIcon(Ao,ps),content:reactExports.createElement(PureContent,{prefixCls:$o,icon:is,type:os,message:as,description:us,btn:ds})}))))};function getPlacementStyle(Fn,Mn,rs){let is;switch(Fn){case"top":is={left:"50%",transform:"translateX(-50%)",right:"auto",top:Mn,bottom:"auto"};break;case"topLeft":is={left:0,top:Mn,bottom:"auto"};break;case"topRight":is={right:0,top:Mn,bottom:"auto"};break;case"bottom":is={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:rs};break;case"bottomLeft":is={left:0,top:"auto",bottom:rs};break;default:is={right:0,top:"auto",bottom:rs};break}return is}function getMotion$1(Fn){return{motionName:`${Fn}-fade`}}var __rest$6=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};const DEFAULT_OFFSET=24,DEFAULT_DURATION=4.5,DEFAULT_PLACEMENT="topRight",Wrapper=Fn=>{let{children:Mn,prefixCls:rs}=Fn;const is=useCSSVarCls(rs),[os,as,us]=useStyle$3(rs,is);return os(React.createElement(NotificationProvider,{classNames:{list:classNames(as,us,is)}},Mn))},renderNotifications=(Fn,Mn)=>{let{prefixCls:rs,key:is}=Mn;return React.createElement(Wrapper,{prefixCls:rs,key:is},Fn)},Holder=React.forwardRef((Fn,Mn)=>{const{top:rs,bottom:is,prefixCls:os,getContainer:as,maxCount:us,rtl:ds,onAllRemoved:hs,stack:ps,duration:io,pauseOnHover:fo=!0,showProgress:mo}=Fn,{getPrefixCls:Ao,getPopupContainer:$o,notification:Lo,direction:Go}=reactExports.useContext(ConfigContext),[,Yo]=useToken(),Wo=os||Ao("notification"),Jo=$l=>getPlacementStyle($l,rs??DEFAULT_OFFSET,is??DEFAULT_OFFSET),xl=()=>classNames({[`${Wo}-rtl`]:ds??Go==="rtl"}),_l=()=>getMotion$1(Wo),[Tl,Sl]=useNotification$1({prefixCls:Wo,style:Jo,className:xl,motion:_l,closable:!0,closeIcon:getCloseIcon(Wo),duration:io??DEFAULT_DURATION,getContainer:()=>(as==null?void 0:as())||($o==null?void 0:$o())||document.body,maxCount:us,pauseOnHover:fo,showProgress:mo,onAllRemoved:hs,renderNotifications,stack:ps===!1?!1:{threshold:typeof ps=="object"?ps==null?void 0:ps.threshold:void 0,offset:8,gap:Yo.margin}});return React.useImperativeHandle(Mn,()=>Object.assign(Object.assign({},Tl),{prefixCls:Wo,notification:Lo})),Sl});function useInternalNotification(Fn){const Mn=React.useRef(null);return devUseWarning(),[React.useMemo(()=>{const is=ds=>{var hs;if(!Mn.current)return;const{open:ps,prefixCls:io,notification:fo}=Mn.current,mo=`${io}-notice`,{message:Ao,description:$o,icon:Lo,type:Go,btn:Yo,className:Wo,style:Jo,role:xl="alert",closeIcon:_l,closable:Tl}=ds,Sl=__rest$6(ds,["message","description","icon","type","btn","className","style","role","closeIcon","closable"]),$l=getCloseIcon(mo,typeof _l<"u"?_l:fo==null?void 0:fo.closeIcon);return ps(Object.assign(Object.assign({placement:(hs=Fn==null?void 0:Fn.placement)!==null&&hs!==void 0?hs:DEFAULT_PLACEMENT},Sl),{content:React.createElement(PureContent,{prefixCls:mo,icon:Lo,type:Go,message:Ao,description:$o,btn:Yo,role:xl}),className:classNames(Go&&`${mo}-${Go}`,Wo,fo==null?void 0:fo.className),style:Object.assign(Object.assign({},fo==null?void 0:fo.style),Jo),closeIcon:$l,closable:Tl??!!$l}))},as={open:is,destroy:ds=>{var hs,ps;ds!==void 0?(hs=Mn.current)===null||hs===void 0||hs.close(ds):(ps=Mn.current)===null||ps===void 0||ps.destroy()}};return["success","info","warning","error"].forEach(ds=>{as[ds]=hs=>is(Object.assign(Object.assign({},hs),{type:ds}))}),as},[]),React.createElement(Holder,Object.assign({key:"notification-holder"},Fn,{ref:Mn}))]}function useNotification(Fn){return useInternalNotification(Fn)}const AppConfigContext=React.createContext({});function withPureRenderTheme(Fn){return Mn=>reactExports.createElement(ConfigProvider,{theme:{token:{motion:!1,zIndexPopupBase:0}}},reactExports.createElement(Fn,Object.assign({},Mn)))}const isMobile=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var Fn=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Fn)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Fn==null?void 0:Fn.substr(0,4))};function Arrow(Fn){var Mn=Fn.prefixCls,rs=Fn.align,is=Fn.arrow,os=Fn.arrowPos,as=is||{},us=as.className,ds=as.content,hs=os.x,ps=hs===void 0?0:hs,io=os.y,fo=io===void 0?0:io,mo=reactExports.useRef();if(!rs||!rs.points)return null;var Ao={position:"absolute"};if(rs.autoArrow!==!1){var $o=rs.points[0],Lo=rs.points[1],Go=$o[0],Yo=$o[1],Wo=Lo[0],Jo=Lo[1];Go===Wo||!["t","b"].includes(Go)?Ao.top=fo:Go==="t"?Ao.top=0:Ao.bottom=0,Yo===Jo||!["l","r"].includes(Yo)?Ao.left=ps:Yo==="l"?Ao.left=0:Ao.right=0}return reactExports.createElement("div",{ref:mo,className:classNames("".concat(Mn,"-arrow"),us),style:Ao},ds)}function Mask$1(Fn){var Mn=Fn.prefixCls,rs=Fn.open,is=Fn.zIndex,os=Fn.mask,as=Fn.motion;return os?reactExports.createElement(CSSMotion,_extends$4({},as,{motionAppear:!0,visible:rs,removeOnLeave:!0}),function(us){var ds=us.className;return reactExports.createElement("div",{style:{zIndex:is},className:classNames("".concat(Mn,"-mask"),ds)})}):null}var PopupContent=reactExports.memo(function(Fn){var Mn=Fn.children;return Mn},function(Fn,Mn){return Mn.cache}),Popup$1=reactExports.forwardRef(function(Fn,Mn){var rs=Fn.popup,is=Fn.className,os=Fn.prefixCls,as=Fn.style,us=Fn.target,ds=Fn.onVisibleChanged,hs=Fn.open,ps=Fn.keepDom,io=Fn.fresh,fo=Fn.onClick,mo=Fn.mask,Ao=Fn.arrow,$o=Fn.arrowPos,Lo=Fn.align,Go=Fn.motion,Yo=Fn.maskMotion,Wo=Fn.forceRender,Jo=Fn.getPopupContainer,xl=Fn.autoDestroy,_l=Fn.portal,Tl=Fn.zIndex,Sl=Fn.onMouseEnter,$l=Fn.onMouseLeave,Pl=Fn.onPointerEnter,Dl=Fn.ready,Ol=Fn.offsetX,Rl=Fn.offsetY,Vo=Fn.offsetR,jo=Fn.offsetB,Ho=Fn.onAlign,Qo=Fn.onPrepare,El=Fn.stretch,Xo=Fn.targetWidth,Al=Fn.targetHeight,wl=typeof rs=="function"?rs():rs,yl=hs||ps,Il=(Jo==null?void 0:Jo.length)>0,Bl=reactExports.useState(!Jo||!Il),Gl=_slicedToArray(Bl,2),Nl=Gl[0],zl=Gl[1];if(useLayoutEffect(function(){!Nl&&Il&&us&&zl(!0)},[Nl,Il,us]),!Nl)return null;var Vl="auto",Hl={left:"-1000vw",top:"-1000vh",right:Vl,bottom:Vl};if(Dl||!hs){var Yl,Ll=Lo.points,Zl=Lo.dynamicInset||((Yl=Lo._experimental)===null||Yl===void 0?void 0:Yl.dynamicInset),Xl=Zl&&Ll[0][1]==="r",wu=Zl&&Ll[0][0]==="b";Xl?(Hl.right=Vo,Hl.left=Vl):(Hl.left=Ol,Hl.right=Vl),wu?(Hl.bottom=jo,Hl.top=Vl):(Hl.top=Rl,Hl.bottom=Vl)}var yu={};return El&&(El.includes("height")&&Al?yu.height=Al:El.includes("minHeight")&&Al&&(yu.minHeight=Al),El.includes("width")&&Xo?yu.width=Xo:El.includes("minWidth")&&Xo&&(yu.minWidth=Xo)),hs||(yu.pointerEvents="none"),reactExports.createElement(_l,{open:Wo||yl,getContainer:Jo&&function(){return Jo(us)},autoDestroy:xl},reactExports.createElement(Mask$1,{prefixCls:os,open:hs,zIndex:Tl,mask:mo,motion:Yo}),reactExports.createElement(RefResizeObserver,{onResize:Ho,disabled:!hs},function(rp){return reactExports.createElement(CSSMotion,_extends$4({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Wo,leavedClassName:"".concat(os,"-hidden")},Go,{onAppearPrepare:Qo,onEnterPrepare:Qo,visible:hs,onVisibleChanged:function(up){var wp;Go==null||(wp=Go.onVisibleChanged)===null||wp===void 0||wp.call(Go,up),ds(up)}}),function(dp,up){var wp=dp.className,vp=dp.style,pp=classNames(os,wp,is);return reactExports.createElement("div",{ref:composeRef(rp,Mn,up),className:pp,style:_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({"--arrow-x":"".concat($o.x||0,"px"),"--arrow-y":"".concat($o.y||0,"px")},Hl),yu),vp),{},{boxSizing:"border-box",zIndex:Tl},as),onMouseEnter:Sl,onMouseLeave:$l,onPointerEnter:Pl,onClick:fo},Ao&&reactExports.createElement(Arrow,{prefixCls:os,arrow:Ao,arrowPos:$o,align:Lo}),reactExports.createElement(PopupContent,{cache:!hs&&!io},wl))})}))}),TriggerWrapper=reactExports.forwardRef(function(Fn,Mn){var rs=Fn.children,is=Fn.getTriggerDOMNode,os=supportRef(rs),as=reactExports.useCallback(function(ds){fillRef(Mn,is?is(ds):ds)},[is]),us=useComposeRef(as,rs.ref);return os?reactExports.cloneElement(rs,{ref:us}):rs}),TriggerContext=reactExports.createContext(null);function toArray$3(Fn){return Fn?Array.isArray(Fn)?Fn:[Fn]:[]}function useAction(Fn,Mn,rs,is){return reactExports.useMemo(function(){var os=toArray$3(rs??Mn),as=toArray$3(is??Mn),us=new Set(os),ds=new Set(as);return Fn&&(us.has("hover")&&(us.delete("hover"),us.add("click")),ds.has("hover")&&(ds.delete("hover"),ds.add("click"))),[us,ds]},[Fn,Mn,rs,is])}function isPointsEq(){var Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],rs=arguments.length>2?arguments[2]:void 0;return rs?Fn[0]===Mn[0]:Fn[0]===Mn[0]&&Fn[1]===Mn[1]}function getAlignPopupClassName(Fn,Mn,rs,is){for(var os=rs.points,as=Object.keys(Fn),us=0;us<as.length;us+=1){var ds,hs=as[us];if(isPointsEq((ds=Fn[hs])===null||ds===void 0?void 0:ds.points,os,is))return"".concat(Mn,"-placement-").concat(hs)}return""}function getMotion(Fn,Mn,rs,is){return Mn||(rs?{motionName:"".concat(Fn,"-").concat(rs)}:is?{motionName:is}:null)}function getWin(Fn){return Fn.ownerDocument.defaultView}function collectScroller(Fn){for(var Mn=[],rs=Fn==null?void 0:Fn.parentElement,is=["hidden","scroll","clip","auto"];rs;){var os=getWin(rs).getComputedStyle(rs),as=os.overflowX,us=os.overflowY,ds=os.overflow;[as,us,ds].some(function(hs){return is.includes(hs)})&&Mn.push(rs),rs=rs.parentElement}return Mn}function toNum(Fn){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Fn)?Mn:Fn}function getPxValue(Fn){return toNum(parseFloat(Fn),0)}function getVisibleArea(Fn,Mn){var rs=_objectSpread2({},Fn);return(Mn||[]).forEach(function(is){if(!(is instanceof HTMLBodyElement||is instanceof HTMLHtmlElement)){var os=getWin(is).getComputedStyle(is),as=os.overflow,us=os.overflowClipMargin,ds=os.borderTopWidth,hs=os.borderBottomWidth,ps=os.borderLeftWidth,io=os.borderRightWidth,fo=is.getBoundingClientRect(),mo=is.offsetHeight,Ao=is.clientHeight,$o=is.offsetWidth,Lo=is.clientWidth,Go=getPxValue(ds),Yo=getPxValue(hs),Wo=getPxValue(ps),Jo=getPxValue(io),xl=toNum(Math.round(fo.width/$o*1e3)/1e3),_l=toNum(Math.round(fo.height/mo*1e3)/1e3),Tl=($o-Lo-Wo-Jo)*xl,Sl=(mo-Ao-Go-Yo)*_l,$l=Go*_l,Pl=Yo*_l,Dl=Wo*xl,Ol=Jo*xl,Rl=0,Vo=0;if(as==="clip"){var jo=getPxValue(us);Rl=jo*xl,Vo=jo*_l}var Ho=fo.x+Dl-Rl,Qo=fo.y+$l-Vo,El=Ho+fo.width+2*Rl-Dl-Ol-Tl,Xo=Qo+fo.height+2*Vo-$l-Pl-Sl;rs.left=Math.max(rs.left,Ho),rs.top=Math.max(rs.top,Qo),rs.right=Math.min(rs.right,El),rs.bottom=Math.min(rs.bottom,Xo)}}),rs}function getUnitOffset(Fn){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,rs="".concat(Mn),is=rs.match(/^(.*)\%$/);return is?Fn*(parseFloat(is[1])/100):parseFloat(rs)}function getNumberOffset(Fn,Mn){var rs=Mn||[],is=_slicedToArray(rs,2),os=is[0],as=is[1];return[getUnitOffset(Fn.width,os),getUnitOffset(Fn.height,as)]}function splitPoints(){var Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Fn[0],Fn[1]]}function getAlignPoint(Fn,Mn){var rs=Mn[0],is=Mn[1],os,as;return rs==="t"?as=Fn.y:rs==="b"?as=Fn.y+Fn.height:as=Fn.y+Fn.height/2,is==="l"?os=Fn.x:is==="r"?os=Fn.x+Fn.width:os=Fn.x+Fn.width/2,{x:os,y:as}}function reversePoints(Fn,Mn){var rs={t:"b",b:"t",l:"r",r:"l"};return Fn.map(function(is,os){return os===Mn?rs[is]||"c":is}).join("")}function useAlign(Fn,Mn,rs,is,os,as,us){var ds=reactExports.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:os[is]||{}}),hs=_slicedToArray(ds,2),ps=hs[0],io=hs[1],fo=reactExports.useRef(0),mo=reactExports.useMemo(function(){return Mn?collectScroller(Mn):[]},[Mn]),Ao=reactExports.useRef({}),$o=function(){Ao.current={}};Fn||$o();var Lo=useEvent(function(){if(Mn&&rs&&Fn){let v1=function(a1,Z1){var Y1=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pp,Q1=wl.x+a1,o2=wl.y+Z1,m2=Q1+Yl,Up=o2+Hl,im=Math.max(Q1,Y1.left),mm=Math.max(o2,Y1.top),Wm=Math.min(m2,Y1.right),Pm=Math.min(Up,Y1.bottom);return Math.max(0,(Wm-im)*(Pm-mm))},$2=function(){Vp=wl.y+Rp,tm=Vp+Hl,g0=wl.x+Np,rm=g0+Yl};var Wo,Jo,xl=Mn,_l=xl.ownerDocument,Tl=getWin(xl),Sl=Tl.getComputedStyle(xl),$l=Sl.width,Pl=Sl.height,Dl=Sl.position,Ol=xl.style.left,Rl=xl.style.top,Vo=xl.style.right,jo=xl.style.bottom,Ho=xl.style.overflow,Qo=_objectSpread2(_objectSpread2({},os[is]),as),El=_l.createElement("div");(Wo=xl.parentElement)===null||Wo===void 0||Wo.appendChild(El),El.style.left="".concat(xl.offsetLeft,"px"),El.style.top="".concat(xl.offsetTop,"px"),El.style.position=Dl,El.style.height="".concat(xl.offsetHeight,"px"),El.style.width="".concat(xl.offsetWidth,"px"),xl.style.left="0",xl.style.top="0",xl.style.right="auto",xl.style.bottom="auto",xl.style.overflow="hidden";var Xo;if(Array.isArray(rs))Xo={x:rs[0],y:rs[1],width:0,height:0};else{var Al=rs.getBoundingClientRect();Xo={x:Al.x,y:Al.y,width:Al.width,height:Al.height}}var wl=xl.getBoundingClientRect(),yl=_l.documentElement,Il=yl.clientWidth,Bl=yl.clientHeight,Gl=yl.scrollWidth,Nl=yl.scrollHeight,zl=yl.scrollTop,Vl=yl.scrollLeft,Hl=wl.height,Yl=wl.width,Ll=Xo.height,Zl=Xo.width,Xl={left:0,top:0,right:Il,bottom:Bl},wu={left:-Vl,top:-zl,right:Gl-Vl,bottom:Nl-zl},yu=Qo.htmlRegion,rp="visible",dp="visibleFirst";yu!=="scroll"&&yu!==dp&&(yu=rp);var up=yu===dp,wp=getVisibleArea(wu,mo),vp=getVisibleArea(Xl,mo),pp=yu===rp?vp:wp,cp=up?vp:pp;xl.style.left="auto",xl.style.top="auto",xl.style.right="0",xl.style.bottom="0";var gp=xl.getBoundingClientRect();xl.style.left=Ol,xl.style.top=Rl,xl.style.right=Vo,xl.style.bottom=jo,xl.style.overflow=Ho,(Jo=xl.parentElement)===null||Jo===void 0||Jo.removeChild(El);var mp=toNum(Math.round(Yl/parseFloat($l)*1e3)/1e3),fp=toNum(Math.round(Hl/parseFloat(Pl)*1e3)/1e3);if(mp===0||fp===0||isDOM(rs)&&!isVisible(rs))return;var hp=Qo.offset,xp=Qo.targetOffset,Kl=getNumberOffset(wl,hp),Fl=_slicedToArray(Kl,2),Ul=Fl[0],Jl=Fl[1],fu=getNumberOffset(Xo,xp),_d=_slicedToArray(fu,2),tp=_d[0],yp=_d[1];Xo.x-=tp,Xo.y-=yp;var _p=Qo.points||[],Sp=_slicedToArray(_p,2),Ap=Sp[0],Op=Sp[1],Zp=splitPoints(Op),Qp=splitPoints(Ap),Xp=getAlignPoint(Xo,Zp),h0=getAlignPoint(wl,Qp),Wp=_objectSpread2({},Qo),Np=Xp.x-h0.x+Ul,Rp=Xp.y-h0.y+Jl,Pp=v1(Np,Rp),Hp=v1(Np,Rp,vp),kp=getAlignPoint(Xo,["t","l"]),Gp=getAlignPoint(wl,["t","l"]),Yp=getAlignPoint(Xo,["b","r"]),Mp=getAlignPoint(wl,["b","r"]),Ip=Qo.overflow||{},Dp=Ip.adjustX,Lp=Ip.adjustY,zp=Ip.shiftX,Bp=Ip.shiftY,qp=function(Z1){return typeof Z1=="boolean"?Z1:Z1>=0},Vp,tm,g0,rm;$2();var Jp=qp(Lp),lm=Qp[0]===Zp[0];if(Jp&&Qp[0]==="t"&&(tm>cp.bottom||Ao.current.bt)){var $m=Rp;lm?$m-=Hl-Ll:$m=kp.y-Mp.y-Jl;var km=v1(Np,$m),Cm=v1(Np,$m,vp);km>Pp||km===Pp&&(!up||Cm>=Hp)?(Ao.current.bt=!0,Rp=$m,Jl=-Jl,Wp.points=[reversePoints(Qp,0),reversePoints(Zp,0)]):Ao.current.bt=!1}if(Jp&&Qp[0]==="b"&&(Vp<cp.top||Ao.current.tb)){var Am=Rp;lm?Am+=Hl-Ll:Am=Yp.y-Gp.y-Jl;var pm=v1(Np,Am),Ym=v1(Np,Am,vp);pm>Pp||pm===Pp&&(!up||Ym>=Hp)?(Ao.current.tb=!0,Rp=Am,Jl=-Jl,Wp.points=[reversePoints(Qp,0),reversePoints(Zp,0)]):Ao.current.tb=!1}var u1=qp(Dp),qm=Qp[1]===Zp[1];if(u1&&Qp[1]==="l"&&(rm>cp.right||Ao.current.rl)){var Qm=Np;qm?Qm-=Yl-Zl:Qm=kp.x-Mp.x-Ul;var o1=v1(Qm,Rp),e1=v1(Qm,Rp,vp);o1>Pp||o1===Pp&&(!up||e1>=Hp)?(Ao.current.rl=!0,Np=Qm,Ul=-Ul,Wp.points=[reversePoints(Qp,1),reversePoints(Zp,1)]):Ao.current.rl=!1}if(u1&&Qp[1]==="r"&&(g0<cp.left||Ao.current.lr)){var Zm=Np;qm?Zm+=Yl-Zl:Zm=Yp.x-Gp.x-Ul;var t1=v1(Zm,Rp),Bm=v1(Zm,Rp,vp);t1>Pp||t1===Pp&&(!up||Bm>=Hp)?(Ao.current.lr=!0,Np=Zm,Ul=-Ul,Wp.points=[reversePoints(Qp,1),reversePoints(Zp,1)]):Ao.current.lr=!1}$2();var Dm=zp===!0?0:zp;typeof Dm=="number"&&(g0<vp.left&&(Np-=g0-vp.left-Ul,Xo.x+Zl<vp.left+Dm&&(Np+=Xo.x-vp.left+Zl-Dm)),rm>vp.right&&(Np-=rm-vp.right-Ul,Xo.x>vp.right-Dm&&(Np+=Xo.x-vp.right+Dm)));var Om=Bp===!0?0:Bp;typeof Om=="number"&&(Vp<vp.top&&(Rp-=Vp-vp.top-Jl,Xo.y+Ll<vp.top+Om&&(Rp+=Xo.y-vp.top+Ll-Om)),tm>vp.bottom&&(Rp-=tm-vp.bottom-Jl,Xo.y>vp.bottom-Om&&(Rp+=Xo.y-vp.bottom+Om)));var r1=wl.x+Np,g1=r1+Yl,b1=wl.y+Rp,F1=b1+Hl,P1=Xo.x,K1=P1+Zl,w1=Xo.y,S2=w1+Ll,n2=Math.max(r1,P1),i2=Math.min(g1,K1),p2=(n2+i2)/2,O2=p2-r1,M2=Math.max(b1,w1),s2=Math.min(F1,S2),D2=(M2+s2)/2,L2=D2-b1;us==null||us(Mn,Wp);var q1=gp.right-wl.x-(Np+wl.width),k1=gp.bottom-wl.y-(Rp+wl.height);mp===1&&(Np=Math.round(Np),q1=Math.round(q1)),fp===1&&(Rp=Math.round(Rp),k1=Math.round(k1));var E1={ready:!0,offsetX:Np/mp,offsetY:Rp/fp,offsetR:q1/mp,offsetB:k1/fp,arrowX:O2/mp,arrowY:L2/fp,scaleX:mp,scaleY:fp,align:Wp};io(E1)}}),Go=function(){fo.current+=1;var Jo=fo.current;Promise.resolve().then(function(){fo.current===Jo&&Lo()})},Yo=function(){io(function(Jo){return _objectSpread2(_objectSpread2({},Jo),{},{ready:!1})})};return useLayoutEffect(Yo,[is]),useLayoutEffect(function(){Fn||Yo()},[Fn]),[ps.ready,ps.offsetX,ps.offsetY,ps.offsetR,ps.offsetB,ps.arrowX,ps.arrowY,ps.scaleX,ps.scaleY,ps.align,Go]}function useWatch(Fn,Mn,rs,is,os){useLayoutEffect(function(){if(Fn&&Mn&&rs){let fo=function(){is(),os()};var as=Mn,us=rs,ds=collectScroller(as),hs=collectScroller(us),ps=getWin(us),io=new Set([ps].concat(_toConsumableArray(ds),_toConsumableArray(hs)));return io.forEach(function(mo){mo.addEventListener("scroll",fo,{passive:!0})}),ps.addEventListener("resize",fo,{passive:!0}),is(),function(){io.forEach(function(mo){mo.removeEventListener("scroll",fo),ps.removeEventListener("resize",fo)})}}},[Fn,Mn,rs])}function useWinClick(Fn,Mn,rs,is,os,as,us,ds){var hs=reactExports.useRef(Fn);hs.current=Fn,reactExports.useEffect(function(){if(Mn&&is&&(!os||as)){var ps=function(Ao){var $o;hs.current&&!us((($o=Ao.composedPath)===null||$o===void 0||($o=$o.call(Ao))===null||$o===void 0?void 0:$o[0])||Ao.target)&&ds(!1)},io=getWin(is);io.addEventListener("mousedown",ps,!0),io.addEventListener("contextmenu",ps,!0);var fo=getShadowRoot(rs);return fo&&(fo.addEventListener("mousedown",ps,!0),fo.addEventListener("contextmenu",ps,!0)),function(){io.removeEventListener("mousedown",ps,!0),io.removeEventListener("contextmenu",ps,!0),fo&&(fo.removeEventListener("mousedown",ps,!0),fo.removeEventListener("contextmenu",ps,!0))}}},[Mn,rs,is,os,as])}var _excluded$3=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function generateTrigger(){var Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Portal$1,Mn=reactExports.forwardRef(function(rs,is){var os=rs.prefixCls,as=os===void 0?"rc-trigger-popup":os,us=rs.children,ds=rs.action,hs=ds===void 0?"hover":ds,ps=rs.showAction,io=rs.hideAction,fo=rs.popupVisible,mo=rs.defaultPopupVisible,Ao=rs.onPopupVisibleChange,$o=rs.afterPopupVisibleChange,Lo=rs.mouseEnterDelay,Go=rs.mouseLeaveDelay,Yo=Go===void 0?.1:Go,Wo=rs.focusDelay,Jo=rs.blurDelay,xl=rs.mask,_l=rs.maskClosable,Tl=_l===void 0?!0:_l,Sl=rs.getPopupContainer,$l=rs.forceRender,Pl=rs.autoDestroy,Dl=rs.destroyPopupOnHide,Ol=rs.popup,Rl=rs.popupClassName,Vo=rs.popupStyle,jo=rs.popupPlacement,Ho=rs.builtinPlacements,Qo=Ho===void 0?{}:Ho,El=rs.popupAlign,Xo=rs.zIndex,Al=rs.stretch,wl=rs.getPopupClassNameFromAlign,yl=rs.fresh,Il=rs.alignPoint,Bl=rs.onPopupClick,Gl=rs.onPopupAlign,Nl=rs.arrow,zl=rs.popupMotion,Vl=rs.maskMotion,Hl=rs.popupTransitionName,Yl=rs.popupAnimation,Ll=rs.maskTransitionName,Zl=rs.maskAnimation,Xl=rs.className,wu=rs.getTriggerDOMNode,yu=_objectWithoutProperties$1(rs,_excluded$3),rp=Pl||Dl||!1,dp=reactExports.useState(!1),up=_slicedToArray(dp,2),wp=up[0],vp=up[1];useLayoutEffect(function(){vp(isMobile())},[]);var pp=reactExports.useRef({}),cp=reactExports.useContext(TriggerContext),gp=reactExports.useMemo(function(){return{registerSubPopup:function(cm,Lm){pp.current[cm]=Lm,cp==null||cp.registerSubPopup(cm,Lm)}}},[cp]),mp=useId$1(),fp=reactExports.useState(null),hp=_slicedToArray(fp,2),xp=hp[0],Kl=hp[1],Fl=reactExports.useRef(null),Ul=useEvent(function(Kp){Fl.current=Kp,isDOM(Kp)&&xp!==Kp&&Kl(Kp),cp==null||cp.registerSubPopup(mp,Kp)}),Jl=reactExports.useState(null),fu=_slicedToArray(Jl,2),_d=fu[0],tp=fu[1],yp=reactExports.useRef(null),_p=useEvent(function(Kp){isDOM(Kp)&&_d!==Kp&&(tp(Kp),yp.current=Kp)}),Sp=reactExports.Children.only(us),Ap=(Sp==null?void 0:Sp.props)||{},Op={},Zp=useEvent(function(Kp){var cm,Lm,n1=_d;return(n1==null?void 0:n1.contains(Kp))||((cm=getShadowRoot(n1))===null||cm===void 0?void 0:cm.host)===Kp||Kp===n1||(xp==null?void 0:xp.contains(Kp))||((Lm=getShadowRoot(xp))===null||Lm===void 0?void 0:Lm.host)===Kp||Kp===xp||Object.values(pp.current).some(function(zm){return(zm==null?void 0:zm.contains(Kp))||Kp===zm})}),Qp=getMotion(as,zl,Yl,Hl),Xp=getMotion(as,Vl,Zl,Ll),h0=reactExports.useState(mo||!1),Wp=_slicedToArray(h0,2),Np=Wp[0],Rp=Wp[1],Pp=fo??Np,Hp=useEvent(function(Kp){fo===void 0&&Rp(Kp)});useLayoutEffect(function(){Rp(fo||!1)},[fo]);var kp=reactExports.useRef(Pp);kp.current=Pp;var Gp=reactExports.useRef([]);Gp.current=[];var Yp=useEvent(function(Kp){var cm;Hp(Kp),((cm=Gp.current[Gp.current.length-1])!==null&&cm!==void 0?cm:Pp)!==Kp&&(Gp.current.push(Kp),Ao==null||Ao(Kp))}),Mp=reactExports.useRef(),Ip=function(){clearTimeout(Mp.current)},Dp=function(cm){var Lm=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Ip(),Lm===0?Yp(cm):Mp.current=setTimeout(function(){Yp(cm)},Lm*1e3)};reactExports.useEffect(function(){return Ip},[]);var Lp=reactExports.useState(!1),zp=_slicedToArray(Lp,2),Bp=zp[0],qp=zp[1];useLayoutEffect(function(Kp){(!Kp||Pp)&&qp(!0)},[Pp]);var Vp=reactExports.useState(null),tm=_slicedToArray(Vp,2),g0=tm[0],rm=tm[1],Jp=reactExports.useState([0,0]),lm=_slicedToArray(Jp,2),$m=lm[0],km=lm[1],Cm=function(cm){km([cm.clientX,cm.clientY])},Am=useAlign(Pp,xp,Il?$m:_d,jo,Qo,El,Gl),pm=_slicedToArray(Am,11),Ym=pm[0],u1=pm[1],qm=pm[2],Qm=pm[3],o1=pm[4],e1=pm[5],Zm=pm[6],t1=pm[7],Bm=pm[8],Dm=pm[9],Om=pm[10],r1=useAction(wp,hs,ps,io),g1=_slicedToArray(r1,2),b1=g1[0],F1=g1[1],P1=b1.has("click"),K1=F1.has("click")||F1.has("contextMenu"),w1=useEvent(function(){Bp||Om()}),S2=function(){kp.current&&Il&&K1&&Dp(!1)};useWatch(Pp,_d,xp,w1,S2),useLayoutEffect(function(){w1()},[$m,jo]),useLayoutEffect(function(){Pp&&!(Qo!=null&&Qo[jo])&&w1()},[JSON.stringify(El)]);var n2=reactExports.useMemo(function(){var Kp=getAlignPopupClassName(Qo,as,Dm,Il);return classNames(Kp,wl==null?void 0:wl(Dm))},[Dm,wl,Qo,as,Il]);reactExports.useImperativeHandle(is,function(){return{nativeElement:yp.current,popupElement:Fl.current,forceAlign:w1}});var i2=reactExports.useState(0),p2=_slicedToArray(i2,2),O2=p2[0],M2=p2[1],s2=reactExports.useState(0),D2=_slicedToArray(s2,2),L2=D2[0],q1=D2[1],k1=function(){if(Al&&_d){var cm=_d.getBoundingClientRect();M2(cm.width),q1(cm.height)}},E1=function(){k1(),w1()},v1=function(cm){qp(!1),Om(),$o==null||$o(cm)},$2=function(){return new Promise(function(cm){k1(),rm(function(){return cm})})};useLayoutEffect(function(){g0&&(Om(),g0(),rm(null))},[g0]);function a1(Kp,cm,Lm,n1){Op[Kp]=function(zm){var g2;n1==null||n1(zm),Dp(cm,Lm);for(var $v=arguments.length,ay=new Array($v>1?$v-1:0),jm=1;jm<$v;jm++)ay[jm-1]=arguments[jm];(g2=Ap[Kp])===null||g2===void 0||g2.call.apply(g2,[Ap,zm].concat(ay))}}(P1||K1)&&(Op.onClick=function(Kp){var cm;kp.current&&K1?Dp(!1):!kp.current&&P1&&(Cm(Kp),Dp(!0));for(var Lm=arguments.length,n1=new Array(Lm>1?Lm-1:0),zm=1;zm<Lm;zm++)n1[zm-1]=arguments[zm];(cm=Ap.onClick)===null||cm===void 0||cm.call.apply(cm,[Ap,Kp].concat(n1))}),useWinClick(Pp,K1,_d,xp,xl,Tl,Zp,Dp);var Z1=b1.has("hover"),Y1=F1.has("hover"),Q1,o2;Z1&&(a1("onMouseEnter",!0,Lo,function(Kp){Cm(Kp)}),a1("onPointerEnter",!0,Lo,function(Kp){Cm(Kp)}),Q1=function(cm){(Pp||Bp)&&xp!==null&&xp!==void 0&&xp.contains(cm.target)&&Dp(!0,Lo)},Il&&(Op.onMouseMove=function(Kp){var cm;(cm=Ap.onMouseMove)===null||cm===void 0||cm.call(Ap,Kp)})),Y1&&(a1("onMouseLeave",!1,Yo),a1("onPointerLeave",!1,Yo),o2=function(){Dp(!1,Yo)}),b1.has("focus")&&a1("onFocus",!0,Wo),F1.has("focus")&&a1("onBlur",!1,Jo),b1.has("contextMenu")&&(Op.onContextMenu=function(Kp){var cm;kp.current&&F1.has("contextMenu")?Dp(!1):(Cm(Kp),Dp(!0)),Kp.preventDefault();for(var Lm=arguments.length,n1=new Array(Lm>1?Lm-1:0),zm=1;zm<Lm;zm++)n1[zm-1]=arguments[zm];(cm=Ap.onContextMenu)===null||cm===void 0||cm.call.apply(cm,[Ap,Kp].concat(n1))}),Xl&&(Op.className=classNames(Ap.className,Xl));var m2=_objectSpread2(_objectSpread2({},Ap),Op),Up={},im=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];im.forEach(function(Kp){yu[Kp]&&(Up[Kp]=function(){for(var cm,Lm=arguments.length,n1=new Array(Lm),zm=0;zm<Lm;zm++)n1[zm]=arguments[zm];(cm=m2[Kp])===null||cm===void 0||cm.call.apply(cm,[m2].concat(n1)),yu[Kp].apply(yu,n1)})});var mm=reactExports.cloneElement(Sp,_objectSpread2(_objectSpread2({},m2),Up)),Wm={x:e1,y:Zm},Pm=Nl?_objectSpread2({},Nl!==!0?Nl:{}):null;return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(RefResizeObserver,{disabled:!Pp,ref:_p,onResize:E1},reactExports.createElement(TriggerWrapper,{getTriggerDOMNode:wu},mm)),reactExports.createElement(TriggerContext.Provider,{value:gp},reactExports.createElement(Popup$1,{portal:Fn,ref:Ul,prefixCls:as,popup:Ol,className:classNames(Rl,n2),style:Vo,target:_d,onMouseEnter:Q1,onMouseLeave:o2,onPointerEnter:Q1,zIndex:Xo,open:Pp,keepDom:Bp,fresh:yl,onClick:Bl,mask:xl,motion:Qp,maskMotion:Xp,onVisibleChanged:v1,onPrepare:$2,forceRender:$l,autoDestroy:rp,getPopupContainer:Sl,align:Dm,arrow:Pm,arrowPos:Wm,ready:Ym,offsetX:u1,offsetY:qm,offsetR:Qm,offsetB:o1,onAlign:w1,stretch:Al,targetWidth:O2/t1,targetHeight:L2/Bm})))});return Mn}const Trigger=generateTrigger(Portal$1);var CheckOutlined$1={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},CheckOutlined=function(Mn,rs){return reactExports.createElement(Icon,_extends$4({},Mn,{ref:rs,icon:CheckOutlined$1}))},RefIcon=reactExports.forwardRef(CheckOutlined);const getRenderPropValue=Fn=>Fn?typeof Fn=="function"?Fn():Fn:null;function Popup(Fn){var Mn=Fn.children,rs=Fn.prefixCls,is=Fn.id,os=Fn.overlayInnerStyle,as=Fn.className,us=Fn.style;return reactExports.createElement("div",{className:classNames("".concat(rs,"-content"),as),style:us},reactExports.createElement("div",{className:"".concat(rs,"-inner"),id:is,role:"tooltip",style:os},typeof Mn=="function"?Mn():Mn))}var autoAdjustOverflowTopBottom={shiftX:64,adjustY:1},autoAdjustOverflowLeftRight={adjustX:1,shiftY:!0},targetOffset$1=[0,0],placements={left:{points:["cr","cl"],overflow:autoAdjustOverflowLeftRight,offset:[-4,0],targetOffset:targetOffset$1},right:{points:["cl","cr"],overflow:autoAdjustOverflowLeftRight,offset:[4,0],targetOffset:targetOffset$1},top:{points:["bc","tc"],overflow:autoAdjustOverflowTopBottom,offset:[0,-4],targetOffset:targetOffset$1},bottom:{points:["tc","bc"],overflow:autoAdjustOverflowTopBottom,offset:[0,4],targetOffset:targetOffset$1},topLeft:{points:["bl","tl"],overflow:autoAdjustOverflowTopBottom,offset:[0,-4],targetOffset:targetOffset$1},leftTop:{points:["tr","tl"],overflow:autoAdjustOverflowLeftRight,offset:[-4,0],targetOffset:targetOffset$1},topRight:{points:["br","tr"],overflow:autoAdjustOverflowTopBottom,offset:[0,-4],targetOffset:targetOffset$1},rightTop:{points:["tl","tr"],overflow:autoAdjustOverflowLeftRight,offset:[4,0],targetOffset:targetOffset$1},bottomRight:{points:["tr","br"],overflow:autoAdjustOverflowTopBottom,offset:[0,4],targetOffset:targetOffset$1},rightBottom:{points:["bl","br"],overflow:autoAdjustOverflowLeftRight,offset:[4,0],targetOffset:targetOffset$1},bottomLeft:{points:["tl","bl"],overflow:autoAdjustOverflowTopBottom,offset:[0,4],targetOffset:targetOffset$1},leftBottom:{points:["br","bl"],overflow:autoAdjustOverflowLeftRight,offset:[-4,0],targetOffset:targetOffset$1}},_excluded$2=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"],Tooltip$2=function(Mn,rs){var is=Mn.overlayClassName,os=Mn.trigger,as=os===void 0?["hover"]:os,us=Mn.mouseEnterDelay,ds=us===void 0?0:us,hs=Mn.mouseLeaveDelay,ps=hs===void 0?.1:hs,io=Mn.overlayStyle,fo=Mn.prefixCls,mo=fo===void 0?"rc-tooltip":fo,Ao=Mn.children,$o=Mn.onVisibleChange,Lo=Mn.afterVisibleChange,Go=Mn.transitionName,Yo=Mn.animation,Wo=Mn.motion,Jo=Mn.placement,xl=Jo===void 0?"right":Jo,_l=Mn.align,Tl=_l===void 0?{}:_l,Sl=Mn.destroyTooltipOnHide,$l=Sl===void 0?!1:Sl,Pl=Mn.defaultVisible,Dl=Mn.getTooltipContainer,Ol=Mn.overlayInnerStyle;Mn.arrowContent;var Rl=Mn.overlay,Vo=Mn.id,jo=Mn.showArrow,Ho=jo===void 0?!0:jo,Qo=_objectWithoutProperties$1(Mn,_excluded$2),El=reactExports.useRef(null);reactExports.useImperativeHandle(rs,function(){return El.current});var Xo=_objectSpread2({},Qo);"visible"in Mn&&(Xo.popupVisible=Mn.visible);var Al=function(){return reactExports.createElement(Popup,{key:"content",prefixCls:mo,id:Vo,overlayInnerStyle:Ol},Rl)};return reactExports.createElement(Trigger,_extends$4({popupClassName:is,prefixCls:mo,popup:Al,action:as,builtinPlacements:placements,popupPlacement:xl,ref:El,popupAlign:Tl,getPopupContainer:Dl,onPopupVisibleChange:$o,afterPopupVisibleChange:Lo,popupTransitionName:Go,popupAnimation:Yo,popupMotion:Wo,defaultPopupVisible:Pl,autoDestroy:$l,mouseLeaveDelay:ps,popupStyle:io,mouseEnterDelay:ds,arrow:Ho},Xo),Ao)};const Tooltip$3=reactExports.forwardRef(Tooltip$2);function getArrowToken(Fn){const{sizePopupArrow:Mn,borderRadiusXS:rs,borderRadiusOuter:is}=Fn,os=Mn/2,as=0,us=os,ds=is*1/Math.sqrt(2),hs=os-is*(1-1/Math.sqrt(2)),ps=os-rs*(1/Math.sqrt(2)),io=is*(Math.sqrt(2)-1)+rs*(1/Math.sqrt(2)),fo=2*os-ps,mo=io,Ao=2*os-ds,$o=hs,Lo=2*os-as,Go=us,Yo=os*Math.sqrt(2)+is*(Math.sqrt(2)-2),Wo=is*(Math.sqrt(2)-1),Jo=`polygon(${Wo}px 100%, 50% ${Wo}px, ${2*os-Wo}px 100%, ${Wo}px 100%)`,xl=`path('M ${as} ${us} A ${is} ${is} 0 0 0 ${ds} ${hs} L ${ps} ${io} A ${rs} ${rs} 0 0 1 ${fo} ${mo} L ${Ao} ${$o} A ${is} ${is} 0 0 0 ${Lo} ${Go} Z')`;return{arrowShadowWidth:Yo,arrowPath:xl,arrowPolygon:Jo}}const genRoundedArrow=(Fn,Mn,rs)=>{const{sizePopupArrow:is,arrowPolygon:os,arrowPath:as,arrowShadowWidth:us,borderRadiusXS:ds,calc:hs}=Fn;return{pointerEvents:"none",width:is,height:is,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:is,height:hs(is).div(2).equal(),background:Mn,clipPath:{_multi_value_:!0,value:[os,as]},content:'""'},"&::after":{content:'""',position:"absolute",width:us,height:us,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${unit$1(ds)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:rs,zIndex:0,background:"transparent"}}},MAX_VERTICAL_CONTENT_RADIUS=8;function getArrowOffsetToken(Fn){const{contentRadius:Mn,limitVerticalRadius:rs}=Fn,is=Mn>12?Mn+2:12;return{arrowOffsetHorizontal:is,arrowOffsetVertical:rs?MAX_VERTICAL_CONTENT_RADIUS:is}}function isInject(Fn,Mn){return Fn?Mn:{}}function getArrowStyle(Fn,Mn,rs){const{componentCls:is,boxShadowPopoverArrow:os,arrowOffsetVertical:as,arrowOffsetHorizontal:us}=Fn,{arrowDistance:ds=0,arrowPlacement:hs={left:!0,right:!0,top:!0,bottom:!0}}={};return{[is]:Object.assign(Object.assign(Object.assign(Object.assign({[`${is}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},genRoundedArrow(Fn,Mn,os)),{"&:before":{background:Mn}})]},isInject(!!hs.top,{[[`&-placement-top > ${is}-arrow`,`&-placement-topLeft > ${is}-arrow`,`&-placement-topRight > ${is}-arrow`].join(",")]:{bottom:ds,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${is}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":us,[`> ${is}-arrow`]:{left:{_skip_check_:!0,value:us}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${unit$1(us)})`,[`> ${is}-arrow`]:{right:{_skip_check_:!0,value:us}}}})),isInject(!!hs.bottom,{[[`&-placement-bottom > ${is}-arrow`,`&-placement-bottomLeft > ${is}-arrow`,`&-placement-bottomRight > ${is}-arrow`].join(",")]:{top:ds,transform:"translateY(-100%)"},[`&-placement-bottom > ${is}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":us,[`> ${is}-arrow`]:{left:{_skip_check_:!0,value:us}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${unit$1(us)})`,[`> ${is}-arrow`]:{right:{_skip_check_:!0,value:us}}}})),isInject(!!hs.left,{[[`&-placement-left > ${is}-arrow`,`&-placement-leftTop > ${is}-arrow`,`&-placement-leftBottom > ${is}-arrow`].join(",")]:{right:{_skip_check_:!0,value:ds},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${is}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${is}-arrow`]:{top:as},[`&-placement-leftBottom > ${is}-arrow`]:{bottom:as}})),isInject(!!hs.right,{[[`&-placement-right > ${is}-arrow`,`&-placement-rightTop > ${is}-arrow`,`&-placement-rightBottom > ${is}-arrow`].join(",")]:{left:{_skip_check_:!0,value:ds},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${is}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${is}-arrow`]:{top:as},[`&-placement-rightBottom > ${is}-arrow`]:{bottom:as}}))}}function getOverflowOptions(Fn,Mn,rs,is){if(is===!1)return{adjustX:!1,adjustY:!1};const os=is&&typeof is=="object"?is:{},as={};switch(Fn){case"top":case"bottom":as.shiftX=Mn.arrowOffsetHorizontal*2+rs,as.shiftY=!0,as.adjustY=!0;break;case"left":case"right":as.shiftY=Mn.arrowOffsetVertical*2+rs,as.shiftX=!0,as.adjustX=!0;break}const us=Object.assign(Object.assign({},as),os);return us.shiftX||(us.adjustX=!0),us.shiftY||(us.adjustY=!0),us}const PlacementAlignMap={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},ArrowCenterPlacementAlignMap={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},DisableAutoArrowList=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function getPlacements$1(Fn){const{arrowWidth:Mn,autoAdjustOverflow:rs,arrowPointAtCenter:is,offset:os,borderRadius:as,visibleFirst:us}=Fn,ds=Mn/2,hs={};return Object.keys(PlacementAlignMap).forEach(ps=>{const io=is&&ArrowCenterPlacementAlignMap[ps]||PlacementAlignMap[ps],fo=Object.assign(Object.assign({},io),{offset:[0,0],dynamicInset:!0});switch(hs[ps]=fo,DisableAutoArrowList.has(ps)&&(fo.autoArrow=!1),ps){case"top":case"topLeft":case"topRight":fo.offset[1]=-ds-os;break;case"bottom":case"bottomLeft":case"bottomRight":fo.offset[1]=ds+os;break;case"left":case"leftTop":case"leftBottom":fo.offset[0]=-ds-os;break;case"right":case"rightTop":case"rightBottom":fo.offset[0]=ds+os;break}const mo=getArrowOffsetToken({contentRadius:as,limitVerticalRadius:!0});if(is)switch(ps){case"topLeft":case"bottomLeft":fo.offset[0]=-mo.arrowOffsetHorizontal-ds;break;case"topRight":case"bottomRight":fo.offset[0]=mo.arrowOffsetHorizontal+ds;break;case"leftTop":case"rightTop":fo.offset[1]=-mo.arrowOffsetHorizontal-ds;break;case"leftBottom":case"rightBottom":fo.offset[1]=mo.arrowOffsetHorizontal+ds;break}fo.overflow=getOverflowOptions(ps,mo,Mn,rs),us&&(fo.htmlRegion="visibleFirst")}),hs}const genTooltipStyle=Fn=>{const{componentCls:Mn,tooltipMaxWidth:rs,tooltipColor:is,tooltipBg:os,tooltipBorderRadius:as,zIndexPopup:us,controlHeight:ds,boxShadowSecondary:hs,paddingSM:ps,paddingXS:io}=Fn;return[{[Mn]:Object.assign(Object.assign(Object.assign(Object.assign({},resetComponent(Fn)),{position:"absolute",zIndex:us,display:"block",width:"max-content",maxWidth:rs,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":os,[`${Mn}-inner`]:{minWidth:"1em",minHeight:ds,padding:`${unit$1(Fn.calc(ps).div(2).equal())} ${unit$1(io)}`,color:is,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:os,borderRadius:as,boxShadow:hs,boxSizing:"border-box"},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${Mn}-inner`]:{borderRadius:Fn.min(as,MAX_VERTICAL_CONTENT_RADIUS)}},[`${Mn}-content`]:{position:"relative"}}),genPresetColor(Fn,(fo,mo)=>{let{darkColor:Ao}=mo;return{[`&${Mn}-${fo}`]:{[`${Mn}-inner`]:{backgroundColor:Ao},[`${Mn}-arrow`]:{"--antd-arrow-background-color":Ao}}}})),{"&-rtl":{direction:"rtl"}})},getArrowStyle(Fn,"var(--antd-arrow-background-color)"),{[`${Mn}-pure`]:{position:"relative",maxWidth:"none",margin:Fn.sizePopupArrow}}]},prepareComponentToken$2=Fn=>Object.assign(Object.assign({zIndexPopup:Fn.zIndexPopupBase+70},getArrowOffsetToken({contentRadius:Fn.borderRadius,limitVerticalRadius:!0})),getArrowToken(merge$2(Fn,{borderRadiusOuter:Math.min(Fn.borderRadiusOuter,4)}))),useStyle$2=function(Fn){let Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return genStyleHooks("Tooltip",is=>{const{borderRadius:os,colorTextLightSolid:as,colorBgSpotlight:us}=is,ds=merge$2(is,{tooltipMaxWidth:250,tooltipColor:as,tooltipBorderRadius:os,tooltipBg:us});return[genTooltipStyle(ds),initZoomMotion(is,"zoom-big-fast")]},prepareComponentToken$2,{resetStyle:!1,injectStyle:Mn})(Fn)},inverseColors=PresetColors.map(Fn=>`${Fn}-inverse`);function isPresetColor(Fn){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)?[].concat(_toConsumableArray(inverseColors),_toConsumableArray(PresetColors)).includes(Fn):PresetColors.includes(Fn)}function parseColor(Fn,Mn){const rs=isPresetColor(Mn),is=classNames({[`${Fn}-${Mn}`]:Mn&&rs}),os={},as={};return Mn&&!rs&&(os.background=Mn,as["--antd-arrow-background-color"]=Mn),{className:is,overlayStyle:os,arrowStyle:as}}const PurePanel$2=Fn=>{const{prefixCls:Mn,className:rs,placement:is="top",title:os,color:as,overlayInnerStyle:us}=Fn,{getPrefixCls:ds}=reactExports.useContext(ConfigContext),hs=ds("tooltip",Mn),[ps,io,fo]=useStyle$2(hs),mo=parseColor(hs,as),Ao=mo.arrowStyle,$o=Object.assign(Object.assign({},us),mo.overlayStyle),Lo=classNames(io,fo,hs,`${hs}-pure`,`${hs}-placement-${is}`,rs,mo.className);return ps(reactExports.createElement("div",{className:Lo,style:Ao},reactExports.createElement("div",{className:`${hs}-arrow`}),reactExports.createElement(Popup,Object.assign({},Fn,{className:io,prefixCls:hs,overlayInnerStyle:$o}),os)))};var __rest$5=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};const InternalTooltip=reactExports.forwardRef((Fn,Mn)=>{var rs,is;const{prefixCls:os,openClassName:as,getTooltipContainer:us,overlayClassName:ds,color:hs,overlayInnerStyle:ps,children:io,afterOpenChange:fo,afterVisibleChange:mo,destroyTooltipOnHide:Ao,arrow:$o=!0,title:Lo,overlay:Go,builtinPlacements:Yo,arrowPointAtCenter:Wo=!1,autoAdjustOverflow:Jo=!0}=Fn,xl=!!$o,[,_l]=useToken(),{getPopupContainer:Tl,getPrefixCls:Sl,direction:$l}=reactExports.useContext(ConfigContext),Pl=devUseWarning(),Dl=reactExports.useRef(null),Ol=()=>{var mp;(mp=Dl.current)===null||mp===void 0||mp.forceAlign()};reactExports.useImperativeHandle(Mn,()=>{var mp;return{forceAlign:Ol,forcePopupAlign:()=>{Pl.deprecated(!1,"forcePopupAlign","forceAlign"),Ol()},nativeElement:(mp=Dl.current)===null||mp===void 0?void 0:mp.nativeElement}});const[Rl,Vo]=useMergedState(!1,{value:(rs=Fn.open)!==null&&rs!==void 0?rs:Fn.visible,defaultValue:(is=Fn.defaultOpen)!==null&&is!==void 0?is:Fn.defaultVisible}),jo=!Lo&&!Go&&Lo!==0,Ho=mp=>{var fp,hp;Vo(jo?!1:mp),jo||((fp=Fn.onOpenChange)===null||fp===void 0||fp.call(Fn,mp),(hp=Fn.onVisibleChange)===null||hp===void 0||hp.call(Fn,mp))},Qo=reactExports.useMemo(()=>{var mp,fp;let hp=Wo;return typeof $o=="object"&&(hp=(fp=(mp=$o.pointAtCenter)!==null&&mp!==void 0?mp:$o.arrowPointAtCenter)!==null&&fp!==void 0?fp:Wo),Yo||getPlacements$1({arrowPointAtCenter:hp,autoAdjustOverflow:Jo,arrowWidth:xl?_l.sizePopupArrow:0,borderRadius:_l.borderRadius,offset:_l.marginXXS,visibleFirst:!0})},[Wo,$o,Yo,_l]),El=reactExports.useMemo(()=>Lo===0?Lo:Go||Lo||"",[Go,Lo]),Xo=reactExports.createElement(ContextIsolator,{space:!0},typeof El=="function"?El():El),{getPopupContainer:Al,placement:wl="top",mouseEnterDelay:yl=.1,mouseLeaveDelay:Il=.1,overlayStyle:Bl,rootClassName:Gl}=Fn,Nl=__rest$5(Fn,["getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName"]),zl=Sl("tooltip",os),Vl=Sl(),Hl=Fn["data-popover-inject"];let Yl=Rl;!("open"in Fn)&&!("visible"in Fn)&&jo&&(Yl=!1);const Ll=reactExports.isValidElement(io)&&!isFragment$1(io)?io:reactExports.createElement("span",null,io),Zl=Ll.props,Xl=!Zl.className||typeof Zl.className=="string"?classNames(Zl.className,as||`${zl}-open`):Zl.className,[wu,yu,rp]=useStyle$2(zl,!Hl),dp=parseColor(zl,hs),up=dp.arrowStyle,wp=Object.assign(Object.assign({},ps),dp.overlayStyle),vp=classNames(ds,{[`${zl}-rtl`]:$l==="rtl"},dp.className,Gl,yu,rp),[pp,cp]=useZIndex("Tooltip",Nl.zIndex),gp=reactExports.createElement(Tooltip$3,Object.assign({},Nl,{zIndex:pp,showArrow:xl,placement:wl,mouseEnterDelay:yl,mouseLeaveDelay:Il,prefixCls:zl,overlayClassName:vp,overlayStyle:Object.assign(Object.assign({},up),Bl),getTooltipContainer:Al||us||Tl,ref:Dl,builtinPlacements:Qo,overlay:Xo,visible:Yl,onVisibleChange:Ho,afterVisibleChange:fo??mo,overlayInnerStyle:wp,arrowContent:reactExports.createElement("span",{className:`${zl}-arrow-content`}),motion:{motionName:getTransitionName(Vl,"zoom-big-fast",Fn.transitionName),motionDeadline:1e3},destroyTooltipOnHide:!!Ao}),Yl?cloneElement(Ll,{className:Xl}):Ll);return wu(reactExports.createElement(zIndexContext.Provider,{value:cp},gp))}),Tooltip$1=InternalTooltip;Tooltip$1._InternalPanelDoNotUseOrYouWillBeFired=PurePanel$2;const Overlay=Fn=>{let{title:Mn,content:rs,prefixCls:is}=Fn;return!Mn&&!rs?null:reactExports.createElement(reactExports.Fragment,null,Mn&&reactExports.createElement("div",{className:`${is}-title`},Mn),rs&&reactExports.createElement("div",{className:`${is}-inner-content`},rs))},RawPurePanel=Fn=>{const{hashId:Mn,prefixCls:rs,className:is,style:os,placement:as="top",title:us,content:ds,children:hs}=Fn,ps=getRenderPropValue(us),io=getRenderPropValue(ds),fo=classNames(Mn,rs,`${rs}-pure`,`${rs}-placement-${as}`,is);return reactExports.createElement("div",{className:fo,style:os},reactExports.createElement("div",{className:`${rs}-arrow`}),reactExports.createElement(Popup,Object.assign({},Fn,{className:Mn,prefixCls:rs}),hs||reactExports.createElement(Overlay,{prefixCls:rs,title:ps,content:io})))};var camel2hyphen$1=function(Fn){return Fn.replace(/[A-Z]/g,function(Mn){return"-"+Mn.toLowerCase()}).toLowerCase()},camel2hyphen_1=camel2hyphen$1,camel2hyphen=camel2hyphen_1,isDimension=function(Fn){var Mn=/[height|width]$/;return Mn.test(Fn)},obj2mq=function(Fn){var Mn="",rs=Object.keys(Fn);return rs.forEach(function(is,os){var as=Fn[is];is=camel2hyphen(is),isDimension(is)&&typeof as=="number"&&(as=as+"px"),as===!0?Mn+=is:as===!1?Mn+="not "+is:Mn+="("+is+": "+as+")",os<rs.length-1&&(Mn+=" and ")}),Mn},json2mq=function(Fn){var Mn="";return typeof Fn=="string"?Fn:Fn instanceof Array?(Fn.forEach(function(rs,is){Mn+=obj2mq(rs),is<Fn.length-1&&(Mn+=", ")}),Mn):obj2mq(Fn)},json2mq_1=json2mq;let notification=null,act=Fn=>Fn(),taskQueue=[],defaultGlobalConfig={};function getGlobalContext(){const{getContainer:Fn,rtl:Mn,maxCount:rs,top:is,bottom:os,showProgress:as,pauseOnHover:us}=defaultGlobalConfig,ds=(Fn==null?void 0:Fn())||document.body;return{getContainer:()=>ds,rtl:Mn,maxCount:rs,top:is,bottom:os,showProgress:as,pauseOnHover:us}}const GlobalHolder=React.forwardRef((Fn,Mn)=>{const{notificationConfig:rs,sync:is}=Fn,{getPrefixCls:os}=reactExports.useContext(ConfigContext),as=defaultGlobalConfig.prefixCls||os("notification"),us=reactExports.useContext(AppConfigContext),[ds,hs]=useInternalNotification(Object.assign(Object.assign(Object.assign({},rs),{prefixCls:as}),us.notification));return React.useEffect(is,[]),React.useImperativeHandle(Mn,()=>{const ps=Object.assign({},ds);return Object.keys(ps).forEach(io=>{ps[io]=function(){return is(),ds[io].apply(ds,arguments)}}),{instance:ps,sync:is}}),hs}),GlobalHolderWrapper=React.forwardRef((Fn,Mn)=>{const[rs,is]=React.useState(getGlobalContext),os=()=>{is(getGlobalContext)};React.useEffect(os,[]);const as=globalConfig(),us=as.getRootPrefixCls(),ds=as.getIconPrefixCls(),hs=as.getTheme(),ps=React.createElement(GlobalHolder,{ref:Mn,sync:os,notificationConfig:rs});return React.createElement(ConfigProvider,{prefixCls:us,iconPrefixCls:ds,theme:hs},as.holderRender?as.holderRender(ps):ps)});function flushNotice(){if(!notification){const Fn=document.createDocumentFragment(),Mn={fragment:Fn};notification=Mn,act(()=>{render(React.createElement(GlobalHolderWrapper,{ref:rs=>{const{instance:is,sync:os}=rs||{};Promise.resolve().then(()=>{!Mn.instance&&is&&(Mn.instance=is,Mn.sync=os,flushNotice())})}}),Fn)});return}notification.instance&&(taskQueue.forEach(Fn=>{switch(Fn.type){case"open":{act(()=>{notification.instance.open(Object.assign(Object.assign({},defaultGlobalConfig),Fn.config))});break}case"destroy":act(()=>{notification==null||notification.instance.destroy(Fn.key)});break}}),taskQueue=[])}function setNotificationGlobalConfig(Fn){defaultGlobalConfig=Object.assign(Object.assign({},defaultGlobalConfig),Fn),act(()=>{var Mn;(Mn=notification==null?void 0:notification.sync)===null||Mn===void 0||Mn.call(notification)})}function open$1(Fn){taskQueue.push({type:"open",config:Fn}),flushNotice()}const destroy=Fn=>{taskQueue.push({type:"destroy",key:Fn}),flushNotice()},methods=["success","info","warning","error"],baseStaticMethods={open:open$1,destroy,config:setNotificationGlobalConfig,useNotification,_InternalPanelDoNotUseOrYouWillBeFired:PurePanel$3},staticMethods=baseStaticMethods;methods.forEach(Fn=>{staticMethods[Fn]=Mn=>open$1(Object.assign(Object.assign({},Mn),{type:Fn}))});var defaultProps$7={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},useTransitionDuration=function(){var Mn=reactExports.useRef([]),rs=reactExports.useRef(null);return reactExports.useEffect(function(){var is=Date.now(),os=!1;Mn.current.forEach(function(as){if(as){os=!0;var us=as.style;us.transitionDuration=".3s, .3s, .3s, .06s",rs.current&&is-rs.current<100&&(us.transitionDuration="0s, 0s")}}),os&&(rs.current=Date.now())}),Mn.current},uuid=0,isBrowserClient=canUseDom();function getUUID(){var Fn;return isBrowserClient?(Fn=uuid,uuid+=1):Fn="TEST_OR_SSR",Fn}const useId=function(Fn){var Mn=reactExports.useState(),rs=_slicedToArray(Mn,2),is=rs[0],os=rs[1];return reactExports.useEffect(function(){os("rc_progress_".concat(getUUID()))},[]),Fn||is};var Block=function(Mn){var rs=Mn.bg,is=Mn.children;return reactExports.createElement("div",{style:{width:"100%",height:"100%",background:rs}},is)};function getPtgColors(Fn,Mn){return Object.keys(Fn).map(function(rs){var is=parseFloat(rs),os="".concat(Math.floor(is*Mn),"%");return"".concat(Fn[rs]," ").concat(os)})}var PtgCircle=reactExports.forwardRef(function(Fn,Mn){var rs=Fn.prefixCls,is=Fn.color,os=Fn.gradientId,as=Fn.radius,us=Fn.style,ds=Fn.ptg,hs=Fn.strokeLinecap,ps=Fn.strokeWidth,io=Fn.size,fo=Fn.gapDegree,mo=is&&_typeof$4(is)==="object",Ao=mo?"#FFF":void 0,$o=io/2,Lo=reactExports.createElement("circle",{className:"".concat(rs,"-circle-path"),r:as,cx:$o,cy:$o,stroke:Ao,strokeLinecap:hs,strokeWidth:ps,opacity:ds===0?0:1,style:us,ref:Mn});if(!mo)return Lo;var Go="".concat(os,"-conic"),Yo=fo?"".concat(180+fo/2,"deg"):"0deg",Wo=getPtgColors(is,(360-fo)/360),Jo=getPtgColors(is,1),xl="conic-gradient(from ".concat(Yo,", ").concat(Wo.join(", "),")"),_l="linear-gradient(to ".concat(fo?"bottom":"top",", ").concat(Jo.join(", "),")");return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("mask",{id:Go},Lo),reactExports.createElement("foreignObject",{x:0,y:0,width:io,height:io,mask:"url(#".concat(Go,")")},reactExports.createElement(Block,{bg:_l},reactExports.createElement(Block,{bg:xl}))))}),VIEW_BOX_SIZE=100,getCircleStyle=function(Mn,rs,is,os,as,us,ds,hs,ps,io){var fo=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,mo=is/100*360*((360-us)/360),Ao=us===0?0:{bottom:0,top:180,left:90,right:-90}[ds],$o=(100-os)/100*rs;ps==="round"&&os!==100&&($o+=io/2,$o>=rs&&($o=rs-.01));var Lo=VIEW_BOX_SIZE/2;return{stroke:typeof hs=="string"?hs:void 0,strokeDasharray:"".concat(rs,"px ").concat(Mn),strokeDashoffset:$o+fo,transform:"rotate(".concat(as+mo+Ao,"deg)"),transformOrigin:"".concat(Lo,"px ").concat(Lo,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},_excluded$1=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function toArray$2(Fn){var Mn=Fn??[];return Array.isArray(Mn)?Mn:[Mn]}var Circle$1=function(Mn){var rs=_objectSpread2(_objectSpread2({},defaultProps$7),Mn),is=rs.id,os=rs.prefixCls,as=rs.steps,us=rs.strokeWidth,ds=rs.trailWidth,hs=rs.gapDegree,ps=hs===void 0?0:hs,io=rs.gapPosition,fo=rs.trailColor,mo=rs.strokeLinecap,Ao=rs.style,$o=rs.className,Lo=rs.strokeColor,Go=rs.percent,Yo=_objectWithoutProperties$1(rs,_excluded$1),Wo=VIEW_BOX_SIZE/2,Jo=useId(is),xl="".concat(Jo,"-gradient"),_l=Wo-us/2,Tl=Math.PI*2*_l,Sl=ps>0?90+ps/2:-90,$l=Tl*((360-ps)/360),Pl=_typeof$4(as)==="object"?as:{count:as,gap:2},Dl=Pl.count,Ol=Pl.gap,Rl=toArray$2(Go),Vo=toArray$2(Lo),jo=Vo.find(function(yl){return yl&&_typeof$4(yl)==="object"}),Ho=jo&&_typeof$4(jo)==="object",Qo=Ho?"butt":mo,El=getCircleStyle(Tl,$l,0,100,Sl,ps,io,fo,Qo,us),Xo=useTransitionDuration(),Al=function(){var Il=0;return Rl.map(function(Bl,Gl){var Nl=Vo[Gl]||Vo[Vo.length-1],zl=getCircleStyle(Tl,$l,Il,Bl,Sl,ps,io,Nl,Qo,us);return Il+=Bl,reactExports.createElement(PtgCircle,{key:Gl,color:Nl,ptg:Bl,radius:_l,prefixCls:os,gradientId:xl,style:zl,strokeLinecap:Qo,strokeWidth:us,gapDegree:ps,ref:function(Hl){Xo[Gl]=Hl},size:VIEW_BOX_SIZE})}).reverse()},wl=function(){var Il=Math.round(Dl*(Rl[0]/100)),Bl=100/Dl,Gl=0;return new Array(Dl).fill(null).map(function(Nl,zl){var Vl=zl<=Il-1?Vo[0]:fo,Hl=Vl&&_typeof$4(Vl)==="object"?"url(#".concat(xl,")"):void 0,Yl=getCircleStyle(Tl,$l,Gl,Bl,Sl,ps,io,Vl,"butt",us,Ol);return Gl+=($l-Yl.strokeDashoffset+Ol)*100/$l,reactExports.createElement("circle",{key:zl,className:"".concat(os,"-circle-path"),r:_l,cx:Wo,cy:Wo,stroke:Hl,strokeWidth:us,opacity:1,style:Yl,ref:function(Zl){Xo[zl]=Zl}})})};return reactExports.createElement("svg",_extends$4({className:classNames("".concat(os,"-circle"),$o),viewBox:"0 0 ".concat(VIEW_BOX_SIZE," ").concat(VIEW_BOX_SIZE),style:Ao,id:is,role:"presentation"},Yo),!Dl&&reactExports.createElement("circle",{className:"".concat(os,"-circle-trail"),r:_l,cx:Wo,cy:Wo,stroke:fo,strokeLinecap:Qo,strokeWidth:ds||us,style:El}),Dl?wl():Al())};function validProgress(Fn){return!Fn||Fn<0?0:Fn>100?100:Fn}function getSuccessPercent(Fn){let{success:Mn,successPercent:rs}=Fn,is=rs;return Mn&&"progress"in Mn&&(is=Mn.progress),Mn&&"percent"in Mn&&(is=Mn.percent),is}const getPercentage=Fn=>{let{percent:Mn,success:rs,successPercent:is}=Fn;const os=validProgress(getSuccessPercent({success:rs,successPercent:is}));return[os,validProgress(validProgress(Mn)-os)]},getStrokeColor=Fn=>{let{success:Mn={},strokeColor:rs}=Fn;const{strokeColor:is}=Mn;return[is||presetPrimaryColors.green,rs||null]},getSize=(Fn,Mn,rs)=>{var is,os,as,us;let ds=-1,hs=-1;if(Mn==="step"){const ps=rs.steps,io=rs.strokeWidth;typeof Fn=="string"||typeof Fn>"u"?(ds=Fn==="small"?2:14,hs=io??8):typeof Fn=="number"?[ds,hs]=[Fn,Fn]:[ds=14,hs=8]=Array.isArray(Fn)?Fn:[Fn.width,Fn.height],ds*=ps}else if(Mn==="line"){const ps=rs==null?void 0:rs.strokeWidth;typeof Fn=="string"||typeof Fn>"u"?hs=ps||(Fn==="small"?6:8):typeof Fn=="number"?[ds,hs]=[Fn,Fn]:[ds=-1,hs=8]=Array.isArray(Fn)?Fn:[Fn.width,Fn.height]}else(Mn==="circle"||Mn==="dashboard")&&(typeof Fn=="string"||typeof Fn>"u"?[ds,hs]=Fn==="small"?[60,60]:[120,120]:typeof Fn=="number"?[ds,hs]=[Fn,Fn]:Array.isArray(Fn)&&(ds=(os=(is=Fn[0])!==null&&is!==void 0?is:Fn[1])!==null&&os!==void 0?os:120,hs=(us=(as=Fn[0])!==null&&as!==void 0?as:Fn[1])!==null&&us!==void 0?us:120));return[ds,hs]},CIRCLE_MIN_STROKE_WIDTH=3,getMinPercent=Fn=>CIRCLE_MIN_STROKE_WIDTH/Fn*100,Circle=Fn=>{const{prefixCls:Mn,trailColor:rs=null,strokeLinecap:is="round",gapPosition:os,gapDegree:as,width:us=120,type:ds,children:hs,success:ps,size:io=us,steps:fo}=Fn,[mo,Ao]=getSize(io,"circle");let{strokeWidth:$o}=Fn;$o===void 0&&($o=Math.max(getMinPercent(mo),6));const Lo={width:mo,height:Ao,fontSize:mo*.15+6},Go=reactExports.useMemo(()=>{if(as||as===0)return as;if(ds==="dashboard")return 75},[as,ds]),Yo=getPercentage(Fn),Wo=os||ds==="dashboard"&&"bottom"||void 0,Jo=Object.prototype.toString.call(Fn.strokeColor)==="[object Object]",xl=getStrokeColor({success:ps,strokeColor:Fn.strokeColor}),_l=classNames(`${Mn}-inner`,{[`${Mn}-circle-gradient`]:Jo}),Tl=reactExports.createElement(Circle$1,{steps:fo,percent:fo?Yo[1]:Yo,strokeWidth:$o,trailWidth:$o,strokeColor:fo?xl[1]:xl,strokeLinecap:is,trailColor:rs,prefixCls:Mn,gapDegree:Go,gapPosition:Wo}),Sl=mo<=20,$l=reactExports.createElement("div",{className:_l,style:Lo},Tl,!Sl&&hs);return Sl?reactExports.createElement(Tooltip$1,{title:hs},$l):$l},LineStrokeColorVar="--progress-line-stroke-color",Percent="--progress-percent",genAntProgressActive=Fn=>{const Mn=Fn?"100%":"-100%";return new Keyframe(`antProgress${Fn?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${Mn}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${Mn}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},genBaseStyle$1=Fn=>{const{componentCls:Mn,iconCls:rs}=Fn;return{[Mn]:Object.assign(Object.assign({},resetComponent(Fn)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:Fn.fontSize},[`${Mn}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${Mn}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:Fn.remainingColor,borderRadius:Fn.lineBorderRadius},[`${Mn}-inner:not(${Mn}-circle-gradient)`]:{[`${Mn}-circle-path`]:{stroke:Fn.defaultColor}},[`${Mn}-success-bg, ${Mn}-bg`]:{position:"relative",background:Fn.defaultColor,borderRadius:Fn.lineBorderRadius,transition:`all ${Fn.motionDurationSlow} ${Fn.motionEaseInOutCirc}`},[`${Mn}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${Mn}-text`]:{width:"max-content",marginInlineStart:0,marginTop:Fn.marginXXS}},[`${Mn}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${LineStrokeColorVar})`]},height:"100%",width:`calc(1 / var(${Percent}) * 100%)`,display:"block"},[`&${Mn}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${Mn}-text-inner`]:{color:Fn.colorWhite,[`&${Mn}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${Mn}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:Fn.colorSuccess},[`${Mn}-text`]:{display:"inline-block",marginInlineStart:Fn.marginXS,color:Fn.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[rs]:{fontSize:Fn.fontSize},[`&${Mn}-text-outer`]:{width:"max-content"},[`&${Mn}-text-outer${Mn}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:Fn.marginXS}},[`${Mn}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${unit$1(Fn.paddingXXS)}`,[`&${Mn}-text-start`]:{justifyContent:"start"},[`&${Mn}-text-end`]:{justifyContent:"end"}},[`&${Mn}-status-active`]:{[`${Mn}-bg::before`]:{position:"absolute",inset:0,backgroundColor:Fn.colorBgContainer,borderRadius:Fn.lineBorderRadius,opacity:0,animationName:genAntProgressActive(),animationDuration:Fn.progressActiveMotionDuration,animationTimingFunction:Fn.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${Mn}-rtl${Mn}-status-active`]:{[`${Mn}-bg::before`]:{animationName:genAntProgressActive(!0)}},[`&${Mn}-status-exception`]:{[`${Mn}-bg`]:{backgroundColor:Fn.colorError},[`${Mn}-text`]:{color:Fn.colorError}},[`&${Mn}-status-exception ${Mn}-inner:not(${Mn}-circle-gradient)`]:{[`${Mn}-circle-path`]:{stroke:Fn.colorError}},[`&${Mn}-status-success`]:{[`${Mn}-bg`]:{backgroundColor:Fn.colorSuccess},[`${Mn}-text`]:{color:Fn.colorSuccess}},[`&${Mn}-status-success ${Mn}-inner:not(${Mn}-circle-gradient)`]:{[`${Mn}-circle-path`]:{stroke:Fn.colorSuccess}}})}},genCircleStyle=Fn=>{const{componentCls:Mn,iconCls:rs}=Fn;return{[Mn]:{[`${Mn}-circle-trail`]:{stroke:Fn.remainingColor},[`&${Mn}-circle ${Mn}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${Mn}-circle ${Mn}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:Fn.circleTextColor,fontSize:Fn.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[rs]:{fontSize:Fn.circleIconFontSize}},[`${Mn}-circle&-status-exception`]:{[`${Mn}-text`]:{color:Fn.colorError}},[`${Mn}-circle&-status-success`]:{[`${Mn}-text`]:{color:Fn.colorSuccess}}},[`${Mn}-inline-circle`]:{lineHeight:1,[`${Mn}-inner`]:{verticalAlign:"bottom"}}}},genStepStyle=Fn=>{const{componentCls:Mn}=Fn;return{[Mn]:{[`${Mn}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:Fn.progressStepMinWidth,marginInlineEnd:Fn.progressStepMarginInlineEnd,backgroundColor:Fn.remainingColor,transition:`all ${Fn.motionDurationSlow}`,"&-active":{backgroundColor:Fn.defaultColor}}}}}},genSmallLine=Fn=>{const{componentCls:Mn,iconCls:rs}=Fn;return{[Mn]:{[`${Mn}-small&-line, ${Mn}-small&-line ${Mn}-text ${rs}`]:{fontSize:Fn.fontSizeSM}}}},prepareComponentToken$1=Fn=>({circleTextColor:Fn.colorText,defaultColor:Fn.colorInfo,remainingColor:Fn.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${Fn.fontSize/Fn.fontSizeSM}em`}),useStyle$1=genStyleHooks("Progress",Fn=>{const Mn=Fn.calc(Fn.marginXXS).div(2).equal(),rs=merge$2(Fn,{progressStepMarginInlineEnd:Mn,progressStepMinWidth:Mn,progressActiveMotionDuration:"2.4s"});return[genBaseStyle$1(rs),genCircleStyle(rs),genStepStyle(rs),genSmallLine(rs)]},prepareComponentToken$1);var __rest$4=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};const sortGradient=Fn=>{let Mn=[];return Object.keys(Fn).forEach(rs=>{const is=parseFloat(rs.replace(/%/g,""));isNaN(is)||Mn.push({key:is,value:Fn[rs]})}),Mn=Mn.sort((rs,is)=>rs.key-is.key),Mn.map(rs=>{let{key:is,value:os}=rs;return`${os} ${is}%`}).join(", ")},handleGradient=(Fn,Mn)=>{const{from:rs=presetPrimaryColors.blue,to:is=presetPrimaryColors.blue,direction:os=Mn==="rtl"?"to left":"to right"}=Fn,as=__rest$4(Fn,["from","to","direction"]);if(Object.keys(as).length!==0){const ds=sortGradient(as),hs=`linear-gradient(${os}, ${ds})`;return{background:hs,[LineStrokeColorVar]:hs}}const us=`linear-gradient(${os}, ${rs}, ${is})`;return{background:us,[LineStrokeColorVar]:us}},Line=Fn=>{const{prefixCls:Mn,direction:rs,percent:is,size:os,strokeWidth:as,strokeColor:us,strokeLinecap:ds="round",children:hs,trailColor:ps=null,percentPosition:io,success:fo}=Fn,{align:mo,type:Ao}=io,$o=us&&typeof us!="string"?handleGradient(us,rs):{[LineStrokeColorVar]:us,background:us},Lo=ds==="square"||ds==="butt"?0:void 0,Go=os??[-1,as||(os==="small"?6:8)],[Yo,Wo]=getSize(Go,"line",{strokeWidth:as}),Jo={backgroundColor:ps||void 0,borderRadius:Lo},xl=Object.assign(Object.assign({width:`${validProgress(is)}%`,height:Wo,borderRadius:Lo},$o),{[Percent]:validProgress(is)/100}),_l=getSuccessPercent(Fn),Tl={width:`${validProgress(_l)}%`,height:Wo,borderRadius:Lo,backgroundColor:fo==null?void 0:fo.strokeColor},Sl={width:Yo<0?"100%":Yo},$l=reactExports.createElement("div",{className:`${Mn}-inner`,style:Jo},reactExports.createElement("div",{className:classNames(`${Mn}-bg`,`${Mn}-bg-${Ao}`),style:xl},Ao==="inner"&&hs),_l!==void 0&&reactExports.createElement("div",{className:`${Mn}-success-bg`,style:Tl})),Pl=Ao==="outer"&&mo==="start",Dl=Ao==="outer"&&mo==="end";return Ao==="outer"&&mo==="center"?reactExports.createElement("div",{className:`${Mn}-layout-bottom`},$l,hs):reactExports.createElement("div",{className:`${Mn}-outer`,style:Sl},Pl&&hs,$l,Dl&&hs)},Steps=Fn=>{const{size:Mn,steps:rs,percent:is=0,strokeWidth:os=8,strokeColor:as,trailColor:us=null,prefixCls:ds,children:hs}=Fn,ps=Math.round(rs*(is/100)),fo=Mn??[Mn==="small"?2:14,os],[mo,Ao]=getSize(fo,"step",{steps:rs,strokeWidth:os}),$o=mo/rs,Lo=new Array(rs);for(let Go=0;Go<rs;Go++){const Yo=Array.isArray(as)?as[Go]:as;Lo[Go]=reactExports.createElement("div",{key:Go,className:classNames(`${ds}-steps-item`,{[`${ds}-steps-item-active`]:Go<=ps-1}),style:{backgroundColor:Go<=ps-1?Yo:us,width:$o,height:Ao}})}return reactExports.createElement("div",{className:`${ds}-steps-outer`},Lo,hs)};var __rest$3=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};const ProgressStatuses=["normal","exception","active","success"],Progress=reactExports.forwardRef((Fn,Mn)=>{const{prefixCls:rs,className:is,rootClassName:os,steps:as,strokeColor:us,percent:ds=0,size:hs="default",showInfo:ps=!0,type:io="line",status:fo,format:mo,style:Ao,percentPosition:$o={}}=Fn,Lo=__rest$3(Fn,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:Go="end",type:Yo="outer"}=$o,Wo=Array.isArray(us)?us[0]:us,Jo=typeof us=="string"||Array.isArray(us)?us:void 0,xl=reactExports.useMemo(()=>{if(Wo){const Al=typeof Wo=="string"?Wo:Object.values(Wo)[0];return new TinyColor(Al).isLight()}return!1},[us]),_l=reactExports.useMemo(()=>{var Al,wl;const yl=getSuccessPercent(Fn);return parseInt(yl!==void 0?(Al=yl??0)===null||Al===void 0?void 0:Al.toString():(wl=ds??0)===null||wl===void 0?void 0:wl.toString(),10)},[ds,Fn.success,Fn.successPercent]),Tl=reactExports.useMemo(()=>!ProgressStatuses.includes(fo)&&_l>=100?"success":fo||"normal",[fo,_l]),{getPrefixCls:Sl,direction:$l,progress:Pl}=reactExports.useContext(ConfigContext),Dl=Sl("progress",rs),[Ol,Rl,Vo]=useStyle$1(Dl),jo=io==="line",Ho=jo&&!as,Qo=reactExports.useMemo(()=>{if(!ps)return null;const Al=getSuccessPercent(Fn);let wl;const yl=mo||(Bl=>`${Bl}%`),Il=jo&&xl&&Yo==="inner";return Yo==="inner"||mo||Tl!=="exception"&&Tl!=="success"?wl=yl(validProgress(ds),validProgress(Al)):Tl==="exception"?wl=jo?reactExports.createElement(RefIcon$5,null):reactExports.createElement(RefIcon$4,null):Tl==="success"&&(wl=jo?reactExports.createElement(RefIcon$6,null):reactExports.createElement(RefIcon,null)),reactExports.createElement("span",{className:classNames(`${Dl}-text`,{[`${Dl}-text-bright`]:Il,[`${Dl}-text-${Go}`]:Ho,[`${Dl}-text-${Yo}`]:Ho}),title:typeof wl=="string"?wl:void 0},wl)},[ps,ds,_l,Tl,io,Dl,mo]);let El;io==="line"?El=as?reactExports.createElement(Steps,Object.assign({},Fn,{strokeColor:Jo,prefixCls:Dl,steps:typeof as=="object"?as.count:as}),Qo):reactExports.createElement(Line,Object.assign({},Fn,{strokeColor:Wo,prefixCls:Dl,direction:$l,percentPosition:{align:Go,type:Yo}}),Qo):(io==="circle"||io==="dashboard")&&(El=reactExports.createElement(Circle,Object.assign({},Fn,{strokeColor:Wo,prefixCls:Dl,progressStatus:Tl}),Qo));const Xo=classNames(Dl,`${Dl}-status-${Tl}`,{[`${Dl}-${io==="dashboard"&&"circle"||io}`]:io!=="line",[`${Dl}-inline-circle`]:io==="circle"&&getSize(hs,"circle")[0]<=20,[`${Dl}-line`]:Ho,[`${Dl}-line-align-${Go}`]:Ho,[`${Dl}-line-position-${Yo}`]:Ho,[`${Dl}-steps`]:as,[`${Dl}-show-info`]:ps,[`${Dl}-${hs}`]:typeof hs=="string",[`${Dl}-rtl`]:$l==="rtl"},Pl==null?void 0:Pl.className,is,os,Rl,Vo);return Ol(reactExports.createElement("div",Object.assign({ref:Mn,style:Object.assign(Object.assign({},Pl==null?void 0:Pl.style),Ao),className:Xo,role:"progressbar","aria-valuenow":_l,"aria-valuemin":0,"aria-valuemax":100},omit$1(Lo,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),El))});function isConfigObj(Fn){return Fn!==null&&_typeof$4(Fn)==="object"}function getClosableConfig(Fn,Mn,rs){if(Fn===!1||Mn===!1&&(!isConfigObj(Fn)||!Fn.closeIcon))return null;var is=typeof Mn!="boolean"?Mn:void 0;if(isConfigObj(Fn)){var os;return _objectSpread2(_objectSpread2({},Fn),{},{closeIcon:(os=Fn.closeIcon)!==null&&os!==void 0?os:is})}return rs||Fn||Mn?{closeIcon:is}:"empty"}function useClosable(Fn,Mn,rs,is){return reactExports.useMemo(function(){var os=getClosableConfig(Fn,Mn,!1),as=getClosableConfig(rs,is,!0);return os!=="empty"?os:as},[rs,is,Fn,Mn])}function isInViewPort(Fn){var Mn=window.innerWidth||document.documentElement.clientWidth,rs=window.innerHeight||document.documentElement.clientHeight,is=Fn.getBoundingClientRect(),os=is.top,as=is.right,us=is.bottom,ds=is.left;return os>=0&&ds>=0&&as<=Mn&&us<=rs}function getPlacement(Fn,Mn,rs){var is;return(is=rs??Mn)!==null&&is!==void 0?is:Fn===null?"center":"bottom"}function useTarget(Fn,Mn,rs,is){var os=reactExports.useState(void 0),as=_slicedToArray(os,2),us=as[0],ds=as[1];useLayoutEffect(function(){var Lo=typeof Fn=="function"?Fn():Fn;ds(Lo||null)});var hs=reactExports.useState(null),ps=_slicedToArray(hs,2),io=ps[0],fo=ps[1],mo=useEvent(function(){if(us){!isInViewPort(us)&&Mn&&us.scrollIntoView(is);var Lo=us.getBoundingClientRect(),Go=Lo.left,Yo=Lo.top,Wo=Lo.width,Jo=Lo.height,xl={left:Go,top:Yo,width:Wo,height:Jo,radius:0};fo(function(_l){return JSON.stringify(_l)!==JSON.stringify(xl)?xl:_l})}else fo(null)}),Ao=function(Go){var Yo;return(Yo=Array.isArray(rs==null?void 0:rs.offset)?rs==null?void 0:rs.offset[Go]:rs==null?void 0:rs.offset)!==null&&Yo!==void 0?Yo:6};useLayoutEffect(function(){return mo(),window.addEventListener("resize",mo),function(){window.removeEventListener("resize",mo)}},[us,Mn,mo]);var $o=reactExports.useMemo(function(){if(!io)return io;var Lo=Ao(0),Go=Ao(1),Yo=(rs==null?void 0:rs.radius)||2;return{left:io.left-Lo,top:io.top-Go,width:io.width+Lo*2,height:io.height+Go*2,radius:Yo}},[io,rs]);return[$o,us]}var COVER_PROPS={fill:"transparent",pointerEvents:"auto"},Mask=function(Mn){var rs=Mn.prefixCls,is=Mn.rootClassName,os=Mn.pos,as=Mn.showMask,us=Mn.style,ds=us===void 0?{}:us,hs=Mn.fill,ps=hs===void 0?"rgba(0,0,0,0.5)":hs,io=Mn.open,fo=Mn.animated,mo=Mn.zIndex,Ao=Mn.disabledInteraction,$o=useId$1(),Lo="".concat(rs,"-mask-").concat($o),Go=_typeof$4(fo)==="object"?fo==null?void 0:fo.placeholder:fo,Yo=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Wo=Yo?{width:"100%",height:"100%"}:{width:"100vw",height:"100vh"};return React.createElement(Portal$1,{open:io,autoLock:!0},React.createElement("div",{className:classNames("".concat(rs,"-mask"),is),style:_objectSpread2({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:mo,pointerEvents:os&&!Ao?"none":"auto"},ds)},as?React.createElement("svg",{style:{width:"100%",height:"100%"}},React.createElement("defs",null,React.createElement("mask",{id:Lo},React.createElement("rect",_extends$4({x:"0",y:"0"},Wo,{fill:"white"})),os&&React.createElement("rect",{x:os.left,y:os.top,rx:os.radius,width:os.width,height:os.height,fill:"black",className:Go?"".concat(rs,"-placeholder-animated"):""}))),React.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:ps,mask:"url(#".concat(Lo,")")}),os&&React.createElement(React.Fragment,null,React.createElement("rect",_extends$4({},COVER_PROPS,{x:"0",y:"0",width:"100%",height:os.top})),React.createElement("rect",_extends$4({},COVER_PROPS,{x:"0",y:"0",width:os.left,height:"100%"})),React.createElement("rect",_extends$4({},COVER_PROPS,{x:"0",y:os.top+os.height,width:"100%",height:"calc(100vh - ".concat(os.top+os.height,"px)")})),React.createElement("rect",_extends$4({},COVER_PROPS,{x:os.left+os.width,y:"0",width:"calc(100vw - ".concat(os.left+os.width,"px)"),height:"100%"})))):null))},targetOffset=[0,0],basePlacements={left:{points:["cr","cl"],offset:[-8,0]},right:{points:["cl","cr"],offset:[8,0]},top:{points:["bc","tc"],offset:[0,-8]},bottom:{points:["tc","bc"],offset:[0,8]},topLeft:{points:["bl","tl"],offset:[0,-8]},leftTop:{points:["tr","tl"],offset:[-8,0]},topRight:{points:["br","tr"],offset:[0,-8]},rightTop:{points:["tl","tr"],offset:[8,0]},bottomRight:{points:["tr","br"],offset:[0,8]},rightBottom:{points:["bl","br"],offset:[8,0]},bottomLeft:{points:["tl","bl"],offset:[0,8]},leftBottom:{points:["br","bl"],offset:[-8,0]}};function getPlacements(){var Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Mn={};return Object.keys(basePlacements).forEach(function(rs){Mn[rs]=_objectSpread2(_objectSpread2({},basePlacements[rs]),{},{autoArrow:Fn,targetOffset})}),Mn}getPlacements();function DefaultPanel(Fn){var Mn,rs=Fn.prefixCls,is=Fn.current,os=Fn.total,as=Fn.title,us=Fn.description,ds=Fn.onClose,hs=Fn.onPrev,ps=Fn.onNext,io=Fn.onFinish,fo=Fn.className,mo=Fn.closable,Ao=pickAttrs(mo||{},!0),$o=(Mn=mo==null?void 0:mo.closeIcon)!==null&&Mn!==void 0?Mn:reactExports.createElement("span",{className:"".concat(rs,"-close-x")},"×"),Lo=!!mo;return reactExports.createElement("div",{className:classNames("".concat(rs,"-content"),fo)},reactExports.createElement("div",{className:"".concat(rs,"-inner")},Lo&&reactExports.createElement("button",_extends$4({type:"button",onClick:ds,"aria-label":"Close"},Ao,{className:"".concat(rs,"-close")}),$o),reactExports.createElement("div",{className:"".concat(rs,"-header")},reactExports.createElement("div",{className:"".concat(rs,"-title")},as)),reactExports.createElement("div",{className:"".concat(rs,"-description")},us),reactExports.createElement("div",{className:"".concat(rs,"-footer")},reactExports.createElement("div",{className:"".concat(rs,"-sliders")},os>1?_toConsumableArray(Array.from({length:os}).keys()).map(function(Go,Yo){return reactExports.createElement("span",{key:Go,className:Yo===is?"active":""})}):null),reactExports.createElement("div",{className:"".concat(rs,"-buttons")},is!==0?reactExports.createElement("button",{className:"".concat(rs,"-prev-btn"),onClick:hs},"Prev"):null,is===os-1?reactExports.createElement("button",{className:"".concat(rs,"-finish-btn"),onClick:io},"Finish"):reactExports.createElement("button",{className:"".concat(rs,"-next-btn"),onClick:ps},"Next")))))}var TourStep=function(Mn){var rs=Mn.current,is=Mn.renderPanel;return reactExports.createElement(reactExports.Fragment,null,typeof is=="function"?is(Mn,rs):reactExports.createElement(DefaultPanel,Mn))},_excluded=["prefixCls","steps","defaultCurrent","current","onChange","onClose","onFinish","open","mask","arrow","rootClassName","placement","renderPanel","gap","animated","scrollIntoViewOptions","zIndex","closeIcon","closable","builtinPlacements","disabledInteraction"],CENTER_PLACEHOLDER={left:"50%",top:"50%",width:1,height:1},defaultScrollIntoViewOptions={block:"center",inline:"center"},Tour$1=function(Mn){var rs=Mn.prefixCls,is=rs===void 0?"rc-tour":rs,os=Mn.steps,as=os===void 0?[]:os,us=Mn.defaultCurrent,ds=Mn.current,hs=Mn.onChange,ps=Mn.onClose,io=Mn.onFinish,fo=Mn.open,mo=Mn.mask,Ao=mo===void 0?!0:mo,$o=Mn.arrow,Lo=$o===void 0?!0:$o,Go=Mn.rootClassName,Yo=Mn.placement,Wo=Mn.renderPanel,Jo=Mn.gap,xl=Mn.animated,_l=Mn.scrollIntoViewOptions,Tl=_l===void 0?defaultScrollIntoViewOptions:_l,Sl=Mn.zIndex,$l=Sl===void 0?1001:Sl,Pl=Mn.closeIcon,Dl=Mn.closable,Ol=Mn.builtinPlacements,Rl=Mn.disabledInteraction,Vo=_objectWithoutProperties$1(Mn,_excluded),jo=reactExports.useRef(),Ho=useMergedState(0,{value:ds,defaultValue:us}),Qo=_slicedToArray(Ho,2),El=Qo[0],Xo=Qo[1],Al=useMergedState(void 0,{value:fo,postState:function(Ap){return El<0||El>=as.length?!1:Ap??!0}}),wl=_slicedToArray(Al,2),yl=wl[0],Il=wl[1],Bl=reactExports.useState(yl),Gl=_slicedToArray(Bl,2),Nl=Gl[0],zl=Gl[1],Vl=reactExports.useRef(yl);useLayoutEffect(function(){yl&&(Vl.current||Xo(0),zl(!0)),Vl.current=yl},[yl]);var Hl=as[El]||{},Yl=Hl.target,Ll=Hl.placement,Zl=Hl.style,Xl=Hl.arrow,wu=Hl.className,yu=Hl.mask,rp=Hl.scrollIntoViewOptions,dp=rp===void 0?defaultScrollIntoViewOptions:rp,up=Hl.closeIcon,wp=Hl.closable,vp=useClosable(wp,up,Dl,Pl),pp=yl&&(yu??Ao),cp=dp??Tl,gp=useTarget(Yl,fo,Jo,cp),mp=_slicedToArray(gp,2),fp=mp[0],hp=mp[1],xp=getPlacement(hp,Yo,Ll),Kl=hp?typeof Xl>"u"?Lo:Xl:!1,Fl=_typeof$4(Kl)==="object"?Kl.pointAtCenter:!1;useLayoutEffect(function(){var Sp;(Sp=jo.current)===null||Sp===void 0||Sp.forceAlign()},[Fl,El]);var Ul=function(Ap){Xo(Ap),hs==null||hs(Ap)},Jl=reactExports.useMemo(function(){return Ol?typeof Ol=="function"?Ol({arrowPointAtCenter:Fl}):Ol:getPlacements(Fl)},[Ol,Fl]);if(hp===void 0||!Nl)return null;var fu=function(){Il(!1),ps==null||ps(El)},_d=function(){return reactExports.createElement(TourStep,_extends$4({arrow:Kl,key:"content",prefixCls:is,total:as.length,renderPanel:Wo,onPrev:function(){Ul(El-1)},onNext:function(){Ul(El+1)},onClose:fu,current:El,onFinish:function(){fu(),io==null||io()}},as[El],{closable:vp}))},tp=typeof pp=="boolean"?pp:!!pp,yp=typeof pp=="boolean"?void 0:pp,_p=function(Ap){return Ap||hp||document.body};return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(Mask,{zIndex:$l,prefixCls:is,pos:fp,showMask:tp,style:yp==null?void 0:yp.style,fill:yp==null?void 0:yp.color,open:yl,animated:xl,rootClassName:Go,disabledInteraction:Rl}),reactExports.createElement(Trigger,_extends$4({},Vo,{builtinPlacements:Jl,ref:jo,popupStyle:Zl,popupPlacement:xp,popupVisible:yl,popupClassName:classNames(Go,wu),prefixCls:is,popup:_d,forceRender:!1,destroyPopupOnHide:!0,zIndex:$l,getTriggerDOMNode:_p,arrow:!!Kl}),reactExports.createElement(Portal$1,{open:yl,autoLock:!0},reactExports.createElement("div",{className:classNames(Go,"".concat(is,"-target-placeholder")),style:_objectSpread2(_objectSpread2({},fp||CENTER_PLACEHOLDER),{},{position:"fixed",pointerEvents:"none"})}))))};function isValidNode(Fn){return Fn!=null}const TourPanel=Fn=>{var Mn,rs;const{stepProps:is,current:os,type:as,indicatorsRender:us}=Fn,{prefixCls:ds,total:hs=1,title:ps,onClose:io,onPrev:fo,onNext:mo,onFinish:Ao,cover:$o,description:Lo,nextButtonProps:Go,prevButtonProps:Yo,type:Wo,closable:Jo}=is,xl=Wo??as,_l=React.createElement("button",{type:"button",onClick:io,className:`${ds}-close`},(Jo==null?void 0:Jo.closeIcon)||React.createElement(RefIcon$4,{className:`${ds}-close-icon`})),Tl=os===hs-1,Sl=()=>{var Qo;fo==null||fo(),(Qo=Yo==null?void 0:Yo.onClick)===null||Qo===void 0||Qo.call(Yo)},$l=()=>{var Qo;Tl?Ao==null||Ao():mo==null||mo(),(Qo=Go==null?void 0:Go.onClick)===null||Qo===void 0||Qo.call(Go)},Pl=isValidNode(ps)?React.createElement("div",{className:`${ds}-header`},React.createElement("div",{className:`${ds}-title`},ps)):null,Dl=isValidNode(Lo)?React.createElement("div",{className:`${ds}-description`},Lo):null,Ol=isValidNode($o)?React.createElement("div",{className:`${ds}-cover`},$o):null;let Rl;us?Rl=us(os,hs):Rl=_toConsumableArray(Array.from({length:hs}).keys()).map((Qo,El)=>React.createElement("span",{key:Qo,className:classNames(El===os&&`${ds}-indicator-active`,`${ds}-indicator`)}));const Vo=xl==="primary"?"default":"primary",jo={type:"default",ghost:xl==="primary"},[Ho]=useLocale("Tour",localeValues.Tour);return React.createElement("div",{className:`${ds}-content`},React.createElement("div",{className:`${ds}-inner`},Jo&&_l,Ol,Pl,Dl,React.createElement("div",{className:`${ds}-footer`},hs>1&&React.createElement("div",{className:`${ds}-indicators`},Rl),React.createElement("div",{className:`${ds}-buttons`},os!==0?React.createElement(Button$1,Object.assign({},jo,Yo,{onClick:Sl,size:"small",className:classNames(`${ds}-prev-btn`,Yo==null?void 0:Yo.className)}),(Mn=Yo==null?void 0:Yo.children)!==null&&Mn!==void 0?Mn:Ho==null?void 0:Ho.Previous):null,React.createElement(Button$1,Object.assign({type:Vo},Go,{onClick:$l,size:"small",className:classNames(`${ds}-next-btn`,Go==null?void 0:Go.className)}),(rs=Go==null?void 0:Go.children)!==null&&rs!==void 0?rs:Tl?Ho==null?void 0:Ho.Finish:Ho==null?void 0:Ho.Next)))))},genBaseStyle=Fn=>{const{componentCls:Mn,padding:rs,paddingXS:is,borderRadius:os,borderRadiusXS:as,colorPrimary:us,colorFill:ds,indicatorHeight:hs,indicatorWidth:ps,boxShadowTertiary:io,zIndexPopup:fo,colorBgElevated:mo,fontWeightStrong:Ao,marginXS:$o,colorTextLightSolid:Lo,tourBorderRadius:Go,colorWhite:Yo,primaryNextBtnHoverBg:Wo,closeBtnSize:Jo,motionDurationSlow:xl,antCls:_l,primaryPrevBtnBg:Tl}=Fn;return[{[Mn]:Object.assign(Object.assign({},resetComponent(Fn)),{position:"absolute",zIndex:fo,maxWidth:"fit-content",visibility:"visible",width:520,"--antd-arrow-background-color":mo,"&-pure":{maxWidth:"100%",position:"relative"},[`&${Mn}-hidden`]:{display:"none"},[`${Mn}-content`]:{position:"relative"},[`${Mn}-inner`]:{textAlign:"start",textDecoration:"none",borderRadius:Go,boxShadow:io,position:"relative",backgroundColor:mo,border:"none",backgroundClip:"padding-box",[`${Mn}-close`]:Object.assign({position:"absolute",top:rs,insetInlineEnd:rs,color:Fn.colorIcon,background:"none",border:"none",width:Jo,height:Jo,borderRadius:Fn.borderRadiusSM,transition:`background-color ${Fn.motionDurationMid}, color ${Fn.motionDurationMid}`,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer","&:hover":{color:Fn.colorIconHover,backgroundColor:Fn.colorBgTextHover},"&:active":{backgroundColor:Fn.colorBgTextActive}},genFocusStyle(Fn)),[`${Mn}-cover`]:{textAlign:"center",padding:`${unit$1(Fn.calc(rs).add(Jo).add(is).equal())} ${unit$1(rs)} 0`,img:{width:"100%"}},[`${Mn}-header`]:{padding:`${unit$1(rs)} ${unit$1(rs)} ${unit$1(is)}`,[`${Mn}-title`]:{fontWeight:Ao}},[`${Mn}-description`]:{padding:`0 ${unit$1(rs)}`,wordWrap:"break-word"},[`${Mn}-footer`]:{padding:`${unit$1(is)} ${unit$1(rs)} ${unit$1(rs)}`,textAlign:"end",borderRadius:`0 0 ${unit$1(as)} ${unit$1(as)}`,display:"flex",[`${Mn}-indicators`]:{display:"inline-block",[`${Mn}-indicator`]:{width:ps,height:hs,display:"inline-block",borderRadius:"50%",background:ds,"&:not(:last-child)":{marginInlineEnd:hs},"&-active":{background:us}}},[`${Mn}-buttons`]:{marginInlineStart:"auto",[`${_l}-btn`]:{marginInlineStart:$o}}}},[`${Mn}-primary, &${Mn}-primary`]:{"--antd-arrow-background-color":us,[`${Mn}-inner`]:{color:Lo,textAlign:"start",textDecoration:"none",backgroundColor:us,borderRadius:os,boxShadow:io,[`${Mn}-close`]:{color:Lo},[`${Mn}-indicators`]:{[`${Mn}-indicator`]:{background:Tl,"&-active":{background:Lo}}},[`${Mn}-prev-btn`]:{color:Lo,borderColor:Tl,backgroundColor:us,"&:hover":{backgroundColor:Tl,borderColor:"transparent"}},[`${Mn}-next-btn`]:{color:us,borderColor:"transparent",background:Yo,"&:hover":{background:Wo}}}}}),[`${Mn}-mask`]:{[`${Mn}-placeholder-animated`]:{transition:`all ${xl}`}},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${Mn}-inner`]:{borderRadius:Fn.min(Go,MAX_VERTICAL_CONTENT_RADIUS)}}},getArrowStyle(Fn,"var(--antd-arrow-background-color)")]},prepareComponentToken=Fn=>Object.assign(Object.assign({zIndexPopup:Fn.zIndexPopupBase+70,closeBtnSize:Fn.fontSize*Fn.lineHeight,primaryPrevBtnBg:new TinyColor(Fn.colorTextLightSolid).setAlpha(.15).toRgbString(),primaryNextBtnHoverBg:new TinyColor(Fn.colorBgTextHover).onBackground(Fn.colorWhite).toRgbString()},getArrowOffsetToken({contentRadius:Fn.borderRadiusLG,limitVerticalRadius:!0})),getArrowToken(Fn)),useStyle=genStyleHooks("Tour",Fn=>{const{borderRadiusLG:Mn}=Fn,rs=merge$2(Fn,{indicatorWidth:6,indicatorHeight:6,tourBorderRadius:Mn});return[genBaseStyle(rs)]},prepareComponentToken);var __rest$2=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};const PurePanel=Fn=>{const{prefixCls:Mn,current:rs=0,total:is=6,className:os,style:as,type:us,closable:ds,closeIcon:hs}=Fn,ps=__rest$2(Fn,["prefixCls","current","total","className","style","type","closable","closeIcon"]),{getPrefixCls:io}=reactExports.useContext(ConfigContext),fo=io("tour",Mn),[mo,Ao,$o]=useStyle(fo),[Lo,Go]=useClosable$1({closable:ds,closeIcon:hs},null,{closable:!0,closeIconRender:Yo=>reactExports.isValidElement(Yo)?cloneElement(Yo,{className:classNames(Yo.props.className,`${fo}-close-icon`)}):Yo});return mo(reactExports.createElement(RawPurePanel,{prefixCls:fo,hashId:Ao,className:classNames(os,`${fo}-pure`,us&&`${fo}-${us}`,$o),style:as},reactExports.createElement(TourPanel,{stepProps:Object.assign(Object.assign({},ps),{prefixCls:fo,total:is,closable:Lo?{closeIcon:Go}:void 0}),current:rs,type:us})))},PurePanel$1=withPureRenderTheme(PurePanel);var __rest$1=function(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs};const Tour=Fn=>{const{prefixCls:Mn,type:rs,rootClassName:is,indicatorsRender:os,steps:as,closeIcon:us}=Fn,ds=__rest$1(Fn,["prefixCls","type","rootClassName","indicatorsRender","steps","closeIcon"]),{getPrefixCls:hs,direction:ps,tour:io}=reactExports.useContext(ConfigContext),fo=hs("tour",Mn),[mo,Ao,$o]=useStyle(fo),[,Lo]=useToken(),Go=React.useMemo(()=>as==null?void 0:as.map(Tl=>{var Sl;return Object.assign(Object.assign({},Tl),{className:classNames(Tl.className,{[`${fo}-primary`]:((Sl=Tl.type)!==null&&Sl!==void 0?Sl:rs)==="primary"})})}),[as,rs]),Yo=Tl=>{var Sl;return getPlacements$1({arrowPointAtCenter:(Sl=Tl==null?void 0:Tl.arrowPointAtCenter)!==null&&Sl!==void 0?Sl:!0,autoAdjustOverflow:!0,offset:Lo.marginXXS,arrowWidth:Lo.sizePopupArrow,borderRadius:Lo.borderRadius})},Wo=classNames({[`${fo}-rtl`]:ps==="rtl"},Ao,$o,is),Jo=(Tl,Sl)=>React.createElement(TourPanel,{type:rs,stepProps:Tl,current:Sl,indicatorsRender:os}),[xl,_l]=useZIndex("Tour",ds.zIndex);return mo(React.createElement(zIndexContext.Provider,{value:_l},React.createElement(Tour$1,Object.assign({},ds,{closeIcon:us??(io==null?void 0:io.closeIcon),zIndex:xl,rootClassName:Wo,prefixCls:fo,animated:!0,renderPanel:Jo,builtinPlacements:Yo,steps:Go}))))};Tour._InternalPanelDoNotUseOrYouWillBeFired=PurePanel$1;const Trade_dark="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='M5.33333%208.66667V11.3333M10.6667%207.33333V11.3333M8%204.66667V11.3333M5.2%2014H10.8C11.9201%2014%2012.4802%2014%2012.908%2013.782C13.2843%2013.5903%2013.5903%2013.2843%2013.782%2012.908C14%2012.4802%2014%2011.9201%2014%2010.8V5.2C14%204.0799%2014%203.51984%2013.782%203.09202C13.5903%202.71569%2013.2843%202.40973%2012.908%202.21799C12.4802%202%2011.9201%202%2010.8%202H5.2C4.0799%202%203.51984%202%203.09202%202.21799C2.71569%202.40973%202.40973%202.71569%202.21799%203.09202C2%203.51984%202%204.0799%202%205.2V10.8C2%2011.9201%202%2012.4802%202.21799%2012.908C2.40973%2013.2843%202.71569%2013.5903%203.09202%2013.782C3.51984%2014%204.0799%2014%205.2%2014Z'%20stroke='%230C0C0D'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",TradeIcon="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='M5.33333%208.66667V11.3333M10.6667%207.33333V11.3333M8%204.66667V11.3333M5.2%2014H10.8C11.9201%2014%2012.4802%2014%2012.908%2013.782C13.2843%2013.5903%2013.5903%2013.2843%2013.782%2012.908C14%2012.4802%2014%2011.9201%2014%2010.8V5.2C14%204.0799%2014%203.51984%2013.782%203.09202C13.5903%202.71569%2013.2843%202.40973%2012.908%202.21799C12.4802%202%2011.9201%202%2010.8%202H5.2C4.0799%202%203.51984%202%203.09202%202.21799C2.71569%202.40973%202.40973%202.71569%202.21799%203.09202C2%203.51984%202%204.0799%202%205.2V10.8C2%2011.9201%202%2012.4802%202.21799%2012.908C2.40973%2013.2843%202.71569%2013.5903%203.09202%2013.782C3.51984%2014%204.0799%2014%205.2%2014Z'%20stroke='white'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Kana="data:image/svg+xml,%3csvg%20width='25'%20height='32'%20viewBox='0%200%2025%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.1881%200.979866C16.1881%200.422193%2015.7452%20-0.0332032%2015.2005%200.00190261C13.4781%200.11291%2011.7831%200.513722%2010.1845%201.19031C8.28115%201.99589%206.55171%203.17664%205.09494%204.66516C3.63816%206.15367%202.48259%207.92079%201.69418%209.86563C0.905784%2011.8105%200.5%2013.8949%200.5%2016C0.5%2018.1051%200.905785%2020.1895%201.69419%2022.1344C2.48259%2024.0792%203.63816%2025.8463%205.09494%2027.3348C6.55171%2028.8234%208.28116%2030.0041%2010.1845%2030.8097C11.7831%2031.4863%2013.4781%2031.8871%2015.2005%2031.9981C15.7452%2032.0332%2016.1881%2031.5778%2016.1881%2031.0201L16.1881%200.979866Z'%20fill='url(%23paint0_linear_322_4790)'/%3e%3cpath%20d='M24.5882%204.26159C24.5882%203.70392%2024.1449%203.24751%2023.601%203.29341C20.719%203.5366%2018.0004%204.83869%2015.9408%206.98569C13.6473%209.37644%2012.3589%2012.619%2012.3589%2016C12.3589%2019.381%2013.6473%2022.6236%2015.9408%2025.0143C18.0004%2027.1613%2020.719%2028.4634%2023.601%2028.7066C24.1449%2028.7525%2024.5882%2028.2961%2024.5882%2027.7384V4.26159Z'%20fill='url(%23paint1_linear_322_4790)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_322_4790'%20x1='0.30976'%20y1='35.3987'%20x2='25.6221'%20y2='-3.54155'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%230194FF'/%3e%3cstop%20offset='1'%20stop-color='%231FF8D1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_322_4790'%20x1='12.2106'%20y1='31.4096'%20x2='32.4692'%20y2='0.825992'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%230194FF'/%3e%3cstop%20offset='1'%20stop-color='%231FF8D1'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",Swap="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_507_718)'%3e%3cpath%20d='M3.9987%203.99992L5.33203%202.66659M5.33203%202.66659L3.9987%201.33325M5.33203%202.66659H3.9987C2.52594%202.66659%201.33203%203.86049%201.33203%205.33325M11.9987%2011.9999L10.6654%2013.3333M10.6654%2013.3333L11.9987%2014.6666M10.6654%2013.3333H11.9987C13.4715%2013.3333%2014.6654%2012.1393%2014.6654%2010.6666M8.94348%208.9447C9.46498%209.19379%2010.0489%209.33325%2010.6654%209.33325C12.8745%209.33325%2014.6654%207.54239%2014.6654%205.33325C14.6654%203.12411%2012.8745%201.33325%2010.6654%201.33325C8.45623%201.33325%206.66536%203.12411%206.66536%205.33325C6.66536%205.94973%206.80482%206.53363%207.05392%207.05514M9.33203%2010.6666C9.33203%2012.8757%207.54117%2014.6666%205.33203%2014.6666C3.12289%2014.6666%201.33203%2012.8757%201.33203%2010.6666C1.33203%208.45745%203.12289%206.66658%205.33203%206.66658C7.54117%206.66658%209.33203%208.45745%209.33203%2010.6666Z'%20stroke='white'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_507_718'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",SwapDark="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_507_718)'%3e%3cpath%20d='M3.9987%203.99992L5.33203%202.66659M5.33203%202.66659L3.9987%201.33325M5.33203%202.66659H3.9987C2.52594%202.66659%201.33203%203.86049%201.33203%205.33325M11.9987%2011.9999L10.6654%2013.3333M10.6654%2013.3333L11.9987%2014.6666M10.6654%2013.3333H11.9987C13.4715%2013.3333%2014.6654%2012.1393%2014.6654%2010.6666M8.94348%208.9447C9.46498%209.19379%2010.0489%209.33325%2010.6654%209.33325C12.8745%209.33325%2014.6654%207.54239%2014.6654%205.33325C14.6654%203.12411%2012.8745%201.33325%2010.6654%201.33325C8.45623%201.33325%206.66536%203.12411%206.66536%205.33325C6.66536%205.94973%206.80482%206.53363%207.05392%207.05514M9.33203%2010.6666C9.33203%2012.8757%207.54117%2014.6666%205.33203%2014.6666C3.12289%2014.6666%201.33203%2012.8757%201.33203%2010.6666C1.33203%208.45745%203.12289%206.66658%205.33203%206.66658C7.54117%206.66658%209.33203%208.45745%209.33203%2010.6666Z'%20stroke='%230C0C0D'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_507_718'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Leaderboard="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.6673%2012L12.6673%2010M12.6673%2010L14.6673%2012M12.6673%2010V14M10.334%202.19384C11.3113%202.58943%2012.0007%203.54754%2012.0007%204.66667C12.0007%205.78579%2011.3113%206.7439%2010.334%207.13949M8.00065%2010H5.33398C4.09147%2010%203.47022%2010%202.98016%2010.203C2.32675%2010.4736%201.80762%2010.9928%201.53697%2011.6462C1.33398%2012.1362%201.33398%2012.7575%201.33398%2014M9.00065%204.66667C9.00065%206.13943%207.80674%207.33333%206.33398%207.33333C4.86122%207.33333%203.66732%206.13943%203.66732%204.66667C3.66732%203.19391%204.86122%202%206.33398%202C7.80674%202%209.00065%203.19391%209.00065%204.66667Z'%20stroke='white'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",LeaderboardDark="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.6673%2012L12.6673%2010M12.6673%2010L14.6673%2012M12.6673%2010V14M10.334%202.19384C11.3113%202.58943%2012.0007%203.54754%2012.0007%204.66667C12.0007%205.78579%2011.3113%206.7439%2010.334%207.13949M8.00065%2010H5.33398C4.09147%2010%203.47022%2010%202.98016%2010.203C2.32675%2010.4736%201.80762%2010.9928%201.53697%2011.6462C1.33398%2012.1362%201.33398%2012.7575%201.33398%2014M9.00065%204.66667C9.00065%206.13943%207.80674%207.33333%206.33398%207.33333C4.86122%207.33333%203.66732%206.13943%203.66732%204.66667C3.66732%203.19391%204.86122%202%206.33398%202C7.80674%202%209.00065%203.19391%209.00065%204.66667Z'%20stroke='%230C0C0D'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Referral="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_603_905)'%3e%3cpath%20d='M7.99992%203.99998V14.6666M7.99992%203.99998H5.64278C5.29547%203.99998%204.96239%203.8595%204.7168%203.60946C4.47122%203.35941%204.33325%203.02027%204.33325%202.66665C4.33325%202.31302%204.47122%201.97389%204.7168%201.72384C4.96239%201.47379%205.29547%201.33331%205.64278%201.33331C7.47611%201.33331%207.99992%203.99998%207.99992%203.99998ZM7.99992%203.99998H10.3571C10.7044%203.99998%2011.0375%203.8595%2011.283%203.60946C11.5286%203.35941%2011.6666%203.02027%2011.6666%202.66665C11.6666%202.31302%2011.5286%201.97389%2011.283%201.72384C11.0375%201.47379%2010.7044%201.33331%2010.3571%201.33331C8.52373%201.33331%207.99992%203.99998%207.99992%203.99998ZM13.3333%207.33331V12.5333C13.3333%2013.2801%2013.3333%2013.6534%2013.1879%2013.9386C13.0601%2014.1895%2012.8561%2014.3935%2012.6052%2014.5213C12.32%2014.6666%2011.9467%2014.6666%2011.1999%2014.6666L4.79992%2014.6666C4.05318%2014.6666%203.67981%2014.6666%203.3946%2014.5213C3.14372%2014.3935%202.93974%2014.1895%202.81191%2013.9386C2.66659%2013.6534%202.66659%2013.28%202.66659%2012.5333V7.33331M1.33325%205.06665L1.33325%206.26665C1.33325%206.64001%201.33325%206.8267%201.40591%206.96931C1.46983%207.09475%201.57182%207.19673%201.69726%207.26065C1.83987%207.33331%202.02655%207.33331%202.39992%207.33331L13.5999%207.33331C13.9733%207.33331%2014.16%207.33331%2014.3026%207.26065C14.428%207.19674%2014.53%207.09475%2014.5939%206.96931C14.6666%206.8267%2014.6666%206.64001%2014.6666%206.26665V5.06665C14.6666%204.69328%2014.6666%204.50659%2014.5939%204.36399C14.53%204.23855%2014.428%204.13656%2014.3026%204.07264C14.16%203.99998%2013.9733%203.99998%2013.5999%203.99998L2.39992%203.99998C2.02655%203.99998%201.83987%203.99998%201.69726%204.07264C1.57182%204.13656%201.46983%204.23854%201.40591%204.36399C1.33325%204.50659%201.33325%204.69328%201.33325%205.06665Z'%20stroke='white'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_603_905'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ReferralDark="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_603_905)'%3e%3cpath%20d='M7.99992%203.99998V14.6666M7.99992%203.99998H5.64278C5.29547%203.99998%204.96239%203.8595%204.7168%203.60946C4.47122%203.35941%204.33325%203.02027%204.33325%202.66665C4.33325%202.31302%204.47122%201.97389%204.7168%201.72384C4.96239%201.47379%205.29547%201.33331%205.64278%201.33331C7.47611%201.33331%207.99992%203.99998%207.99992%203.99998ZM7.99992%203.99998H10.3571C10.7044%203.99998%2011.0375%203.8595%2011.283%203.60946C11.5286%203.35941%2011.6666%203.02027%2011.6666%202.66665C11.6666%202.31302%2011.5286%201.97389%2011.283%201.72384C11.0375%201.47379%2010.7044%201.33331%2010.3571%201.33331C8.52373%201.33331%207.99992%203.99998%207.99992%203.99998ZM13.3333%207.33331V12.5333C13.3333%2013.2801%2013.3333%2013.6534%2013.1879%2013.9386C13.0601%2014.1895%2012.8561%2014.3935%2012.6052%2014.5213C12.32%2014.6666%2011.9467%2014.6666%2011.1999%2014.6666L4.79992%2014.6666C4.05318%2014.6666%203.67981%2014.6666%203.3946%2014.5213C3.14372%2014.3935%202.93974%2014.1895%202.81191%2013.9386C2.66659%2013.6534%202.66659%2013.28%202.66659%2012.5333V7.33331M1.33325%205.06665L1.33325%206.26665C1.33325%206.64001%201.33325%206.8267%201.40591%206.96931C1.46983%207.09475%201.57182%207.19673%201.69726%207.26065C1.83987%207.33331%202.02655%207.33331%202.39992%207.33331L13.5999%207.33331C13.9733%207.33331%2014.16%207.33331%2014.3026%207.26065C14.428%207.19674%2014.53%207.09475%2014.5939%206.96931C14.6666%206.8267%2014.6666%206.64001%2014.6666%206.26665V5.06665C14.6666%204.69328%2014.6666%204.50659%2014.5939%204.36399C14.53%204.23855%2014.428%204.13656%2014.3026%204.07264C14.16%203.99998%2013.9733%203.99998%2013.5999%203.99998L2.39992%203.99998C2.02655%203.99998%201.83987%203.99998%201.69726%204.07264C1.57182%204.13656%201.46983%204.23854%201.40591%204.36399C1.33325%204.50659%201.33325%204.69328%201.33325%205.06665Z'%20stroke='%230C0C0D'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_603_905'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ChevronDown="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='M6%209L12%2015L18%209'%20stroke='%23D2D2D2'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ChevronDownDark="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='M6%209L12%2015L18%209'%20stroke='%230C0C0D'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",version$q="2.21.14";let errorConfig={getDocsUrl:({docsBaseUrl:Fn,docsPath:Mn="",docsSlug:rs})=>Mn?`${Fn??"https://viem.sh"}${Mn}${rs?`#${rs}`:""}`:void 0,version:version$q},BaseError$3=class Bw extends Error{constructor(Mn,rs={}){var ds;const is=(()=>{var hs;return rs.cause instanceof Bw?rs.cause.details:(hs=rs.cause)!=null&&hs.message?rs.cause.message:rs.details})(),os=rs.cause instanceof Bw&&rs.cause.docsPath||rs.docsPath,as=(ds=errorConfig.getDocsUrl)==null?void 0:ds.call(errorConfig,{...rs,docsPath:os}),us=[Mn||"An error occurred.","",...rs.metaMessages?[...rs.metaMessages,""]:[],...as?[`Docs: ${as}`]:[],...is?[`Details: ${is}`]:[],`Version: ${errorConfig.version}`].join(`
`);super(us,rs.cause?{cause:rs.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=is,this.docsPath=os,this.metaMessages=rs.metaMessages,this.name=rs.name??this.name,this.shortMessage=Mn,this.version=version$q}walk(Mn){return walk(this,Mn)}};function walk(Fn,Mn){return Mn!=null&&Mn(Fn)?Fn:Fn&&typeof Fn=="object"&&"cause"in Fn?walk(Fn.cause,Mn):Mn?null:Fn}class IntegerOutOfRangeError extends BaseError$3{constructor({max:Mn,min:rs,signed:is,size:os,value:as}){super(`Number "${as}" is not in safe ${os?`${os*8}-bit ${is?"signed":"unsigned"} `:""}integer range ${Mn?`(${rs} to ${Mn})`:`(above ${rs})`}`,{name:"IntegerOutOfRangeError"})}}class InvalidBytesBooleanError extends BaseError$3{constructor(Mn){super(`Bytes value "${Mn}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class SizeOverflowError extends BaseError$3{constructor({givenSize:Mn,maxSize:rs}){super(`Size cannot exceed ${rs} bytes. Given size: ${Mn} bytes.`,{name:"SizeOverflowError"})}}class SliceOffsetOutOfBoundsError extends BaseError$3{constructor({offset:Mn,position:rs,size:is}){super(`Slice ${rs==="start"?"starting":"ending"} at offset "${Mn}" is out-of-bounds (size: ${is}).`,{name:"SliceOffsetOutOfBoundsError"})}}class SizeExceedsPaddingSizeError extends BaseError$3{constructor({size:Mn,targetSize:rs,type:is}){super(`${is.charAt(0).toUpperCase()}${is.slice(1).toLowerCase()} size (${Mn}) exceeds padding size (${rs}).`,{name:"SizeExceedsPaddingSizeError"})}}class InvalidBytesLengthError extends BaseError$3{constructor({size:Mn,targetSize:rs,type:is}){super(`${is.charAt(0).toUpperCase()}${is.slice(1).toLowerCase()} is expected to be ${rs} ${is} long, but is ${Mn} ${is} long.`,{name:"InvalidBytesLengthError"})}}function pad(Fn,{dir:Mn,size:rs=32}={}){return typeof Fn=="string"?padHex(Fn,{dir:Mn,size:rs}):padBytes(Fn,{dir:Mn,size:rs})}function padHex(Fn,{dir:Mn,size:rs=32}={}){if(rs===null)return Fn;const is=Fn.replace("0x","");if(is.length>rs*2)throw new SizeExceedsPaddingSizeError({size:Math.ceil(is.length/2),targetSize:rs,type:"hex"});return`0x${is[Mn==="right"?"padEnd":"padStart"](rs*2,"0")}`}function padBytes(Fn,{dir:Mn,size:rs=32}={}){if(rs===null)return Fn;if(Fn.length>rs)throw new SizeExceedsPaddingSizeError({size:Fn.length,targetSize:rs,type:"bytes"});const is=new Uint8Array(rs);for(let os=0;os<rs;os++){const as=Mn==="right";is[as?os:rs-os-1]=Fn[as?os:Fn.length-os-1]}return is}function isHex(Fn,{strict:Mn=!0}={}){return!Fn||typeof Fn!="string"?!1:Mn?/^0x[0-9a-fA-F]*$/.test(Fn):Fn.startsWith("0x")}function size$2(Fn){return isHex(Fn,{strict:!1})?Math.ceil((Fn.length-2)/2):Fn.length}function trim$1(Fn,{dir:Mn="left"}={}){let rs=typeof Fn=="string"?Fn.replace("0x",""):Fn,is=0;for(let os=0;os<rs.length-1&&rs[Mn==="left"?os:rs.length-os-1].toString()==="0";os++)is++;return rs=Mn==="left"?rs.slice(is):rs.slice(0,rs.length-is),typeof Fn=="string"?(rs.length===1&&Mn==="right"&&(rs=`${rs}0`),`0x${rs.length%2===1?`0${rs}`:rs}`):rs}const encoder$1=new TextEncoder;function toBytes$1(Fn,Mn={}){return typeof Fn=="number"||typeof Fn=="bigint"?numberToBytes(Fn,Mn):typeof Fn=="boolean"?boolToBytes(Fn,Mn):isHex(Fn)?hexToBytes(Fn,Mn):stringToBytes(Fn,Mn)}function boolToBytes(Fn,Mn={}){const rs=new Uint8Array(1);return rs[0]=Number(Fn),typeof Mn.size=="number"?(assertSize$1(rs,{size:Mn.size}),pad(rs,{size:Mn.size})):rs}const charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function charCodeToBase16(Fn){if(Fn>=charCodeMap.zero&&Fn<=charCodeMap.nine)return Fn-charCodeMap.zero;if(Fn>=charCodeMap.A&&Fn<=charCodeMap.F)return Fn-(charCodeMap.A-10);if(Fn>=charCodeMap.a&&Fn<=charCodeMap.f)return Fn-(charCodeMap.a-10)}function hexToBytes(Fn,Mn={}){let rs=Fn;Mn.size&&(assertSize$1(rs,{size:Mn.size}),rs=pad(rs,{dir:"right",size:Mn.size}));let is=rs.slice(2);is.length%2&&(is=`0${is}`);const os=is.length/2,as=new Uint8Array(os);for(let us=0,ds=0;us<os;us++){const hs=charCodeToBase16(is.charCodeAt(ds++)),ps=charCodeToBase16(is.charCodeAt(ds++));if(hs===void 0||ps===void 0)throw new BaseError$3(`Invalid byte sequence ("${is[ds-2]}${is[ds-1]}" in "${is}").`);as[us]=hs*16+ps}return as}function numberToBytes(Fn,Mn){const rs=numberToHex(Fn,Mn);return hexToBytes(rs)}function stringToBytes(Fn,Mn={}){const rs=encoder$1.encode(Fn);return typeof Mn.size=="number"?(assertSize$1(rs,{size:Mn.size}),pad(rs,{dir:"right",size:Mn.size})):rs}function assertSize$1(Fn,{size:Mn}){if(size$2(Fn)>Mn)throw new SizeOverflowError({givenSize:size$2(Fn),maxSize:Mn})}function hexToBigInt(Fn,Mn={}){const{signed:rs}=Mn;Mn.size&&assertSize$1(Fn,{size:Mn.size});const is=BigInt(Fn);if(!rs)return is;const os=(Fn.length-2)/2,as=(1n<<BigInt(os)*8n-1n)-1n;return is<=as?is:is-BigInt(`0x${"f".padStart(os*2,"f")}`)-1n}function hexToNumber(Fn,Mn={}){return Number(hexToBigInt(Fn,Mn))}function hexToString(Fn,Mn={}){let rs=hexToBytes(Fn);return Mn.size&&(assertSize$1(rs,{size:Mn.size}),rs=trim$1(rs,{dir:"right"})),new TextDecoder().decode(rs)}const hexes=Array.from({length:256},(Fn,Mn)=>Mn.toString(16).padStart(2,"0"));function toHex$3(Fn,Mn={}){return typeof Fn=="number"||typeof Fn=="bigint"?numberToHex(Fn,Mn):typeof Fn=="string"?stringToHex(Fn,Mn):typeof Fn=="boolean"?boolToHex(Fn,Mn):bytesToHex(Fn,Mn)}function boolToHex(Fn,Mn={}){const rs=`0x${Number(Fn)}`;return typeof Mn.size=="number"?(assertSize$1(rs,{size:Mn.size}),pad(rs,{size:Mn.size})):rs}function bytesToHex(Fn,Mn={}){let rs="";for(let os=0;os<Fn.length;os++)rs+=hexes[Fn[os]];const is=`0x${rs}`;return typeof Mn.size=="number"?(assertSize$1(is,{size:Mn.size}),pad(is,{dir:"right",size:Mn.size})):is}function numberToHex(Fn,Mn={}){const{signed:rs,size:is}=Mn,os=BigInt(Fn);let as;is?rs?as=(1n<<BigInt(is)*8n-1n)-1n:as=2n**(BigInt(is)*8n)-1n:typeof Fn=="number"&&(as=BigInt(Number.MAX_SAFE_INTEGER));const us=typeof as=="bigint"&&rs?-as-1n:0;if(as&&os>as||os<us){const hs=typeof Fn=="bigint"?"n":"";throw new IntegerOutOfRangeError({max:as?`${as}${hs}`:void 0,min:`${us}${hs}`,signed:rs,size:is,value:`${Fn}${hs}`})}const ds=`0x${(rs&&os<0?(1n<<BigInt(is*8))+BigInt(os):os).toString(16)}`;return is?pad(ds,{size:is}):ds}const encoder=new TextEncoder;function stringToHex(Fn,Mn={}){const rs=encoder.encode(Fn);return bytesToHex(rs,Mn)}function formatAbiItem$1(Fn,{includeName:Mn=!1}={}){if(Fn.type!=="function"&&Fn.type!=="event"&&Fn.type!=="error")throw new InvalidDefinitionTypeError(Fn.type);return`${Fn.name}(${formatAbiParams(Fn.inputs,{includeName:Mn})})`}function formatAbiParams(Fn,{includeName:Mn=!1}={}){return Fn?Fn.map(rs=>formatAbiParam(rs,{includeName:Mn})).join(Mn?", ":","):""}function formatAbiParam(Fn,{includeName:Mn}){return Fn.type.startsWith("tuple")?`(${formatAbiParams(Fn.components,{includeName:Mn})})${Fn.type.slice(5)}`:Fn.type+(Mn&&Fn.name?` ${Fn.name}`:"")}class AbiConstructorNotFoundError extends BaseError$3{constructor({docsPath:Mn}){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:Mn,name:"AbiConstructorNotFoundError"})}}class AbiConstructorParamsNotFoundError extends BaseError$3{constructor({docsPath:Mn}){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:Mn,name:"AbiConstructorParamsNotFoundError"})}}class AbiDecodingDataSizeTooSmallError extends BaseError$3{constructor({data:Mn,params:rs,size:is}){super([`Data size of ${is} bytes is too small for given parameters.`].join(`
`),{metaMessages:[`Params: (${formatAbiParams(rs,{includeName:!0})})`,`Data:   ${Mn} (${is} 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=Mn,this.params=rs,this.size=is}}class AbiDecodingZeroDataError extends BaseError$3{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class AbiEncodingArrayLengthMismatchError extends BaseError$3{constructor({expectedLength:Mn,givenLength:rs,type:is}){super([`ABI encoding array length mismatch for type ${is}.`,`Expected length: ${Mn}`,`Given length: ${rs}`].join(`
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class AbiEncodingBytesSizeMismatchError extends BaseError$3{constructor({expectedSize:Mn,value:rs}){super(`Size of bytes "${rs}" (bytes${size$2(rs)}) does not match expected size (bytes${Mn}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class AbiEncodingLengthMismatchError extends BaseError$3{constructor({expectedLength:Mn,givenLength:rs}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${Mn}`,`Given length (values): ${rs}`].join(`
`),{name:"AbiEncodingLengthMismatchError"})}}class AbiErrorSignatureNotFoundError extends BaseError$3{constructor(Mn,{docsPath:rs}){super([`Encoded error signature "${Mn}" 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=${Mn}.`].join(`
`),{docsPath:rs,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=Mn}}class AbiFunctionNotFoundError extends BaseError$3{constructor(Mn,{docsPath:rs}={}){super([`Function ${Mn?`"${Mn}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:rs,name:"AbiFunctionNotFoundError"})}}class AbiFunctionOutputsNotFoundError extends BaseError$3{constructor(Mn,{docsPath:rs}){super([`Function "${Mn}" 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:rs,name:"AbiFunctionOutputsNotFoundError"})}}class AbiItemAmbiguityError extends BaseError$3{constructor(Mn,rs){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${Mn.type}\` in \`${formatAbiItem$1(Mn.abiItem)}\`, and`,`\`${rs.type}\` in \`${formatAbiItem$1(rs.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class InvalidAbiEncodingTypeError extends BaseError$3{constructor(Mn,{docsPath:rs}){super([`Type "${Mn}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:rs,name:"InvalidAbiEncodingType"})}}class InvalidAbiDecodingTypeError extends BaseError$3{constructor(Mn,{docsPath:rs}){super([`Type "${Mn}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:rs,name:"InvalidAbiDecodingType"})}}class InvalidArrayError extends BaseError$3{constructor(Mn){super([`Value "${Mn}" is not a valid array.`].join(`
`),{name:"InvalidArrayError"})}}class InvalidDefinitionTypeError extends BaseError$3{constructor(Mn){super([`"${Mn}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
`),{name:"InvalidDefinitionTypeError"})}}function concat$3(Fn){return typeof Fn[0]=="string"?concatHex(Fn):concatBytes$1(Fn)}function concatBytes$1(Fn){let Mn=0;for(const os of Fn)Mn+=os.length;const rs=new Uint8Array(Mn);let is=0;for(const os of Fn)rs.set(os,is),is+=os.length;return rs}function concatHex(Fn){return`0x${Fn.reduce((Mn,rs)=>Mn+rs.replace("0x",""),"")}`}class InvalidAddressError extends BaseError$3{constructor({address:Mn}){super(`Address "${Mn}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class LruMap extends Map{constructor(Mn){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=Mn}get(Mn){const rs=super.get(Mn);return super.has(Mn)&&rs!==void 0&&(this.delete(Mn),super.set(Mn,rs)),rs}set(Mn,rs){if(super.set(Mn,rs),this.maxSize&&this.size>this.maxSize){const is=this.keys().next().value;is&&this.delete(is)}return this}}function number$1(Fn){if(!Number.isSafeInteger(Fn)||Fn<0)throw new Error(`positive integer expected, not ${Fn}`)}function isBytes$1(Fn){return Fn instanceof Uint8Array||Fn!=null&&typeof Fn=="object"&&Fn.constructor.name==="Uint8Array"}function bytes(Fn,...Mn){if(!isBytes$1(Fn))throw new Error("Uint8Array expected");if(Mn.length>0&&!Mn.includes(Fn.length))throw new Error(`Uint8Array expected of length ${Mn}, not of length=${Fn.length}`)}function hash$7(Fn){if(typeof Fn!="function"||typeof Fn.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$1(Fn.outputLen),number$1(Fn.blockLen)}function exists(Fn,Mn=!0){if(Fn.destroyed)throw new Error("Hash instance has been destroyed");if(Mn&&Fn.finished)throw new Error("Hash#digest() has already been called")}function output(Fn,Mn){bytes(Fn);const rs=Mn.outputLen;if(Fn.length<rs)throw new Error(`digestInto() expects output buffer of length at least ${rs}`)}const U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(Fn,Mn=!1){return Mn?{h:Number(Fn&U32_MASK64),l:Number(Fn>>_32n&U32_MASK64)}:{h:Number(Fn>>_32n&U32_MASK64)|0,l:Number(Fn&U32_MASK64)|0}}function split$1(Fn,Mn=!1){let rs=new Uint32Array(Fn.length),is=new Uint32Array(Fn.length);for(let os=0;os<Fn.length;os++){const{h:as,l:us}=fromBig(Fn[os],Mn);[rs[os],is[os]]=[as,us]}return[rs,is]}const rotlSH=(Fn,Mn,rs)=>Fn<<rs|Mn>>>32-rs,rotlSL=(Fn,Mn,rs)=>Mn<<rs|Fn>>>32-rs,rotlBH=(Fn,Mn,rs)=>Mn<<rs-32|Fn>>>64-rs,rotlBL=(Fn,Mn,rs)=>Fn<<rs-32|Mn>>>64-rs,crypto$3=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32=Fn=>new Uint32Array(Fn.buffer,Fn.byteOffset,Math.floor(Fn.byteLength/4)),createView=Fn=>new DataView(Fn.buffer,Fn.byteOffset,Fn.byteLength),rotr=(Fn,Mn)=>Fn<<32-Mn|Fn>>>Mn,isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,byteSwap=Fn=>Fn<<24&4278190080|Fn<<8&16711680|Fn>>>8&65280|Fn>>>24&255;function byteSwap32(Fn){for(let Mn=0;Mn<Fn.length;Mn++)Fn[Mn]=byteSwap(Fn[Mn])}function utf8ToBytes$1(Fn){if(typeof Fn!="string")throw new Error(`utf8ToBytes expected string, got ${typeof Fn}`);return new Uint8Array(new TextEncoder().encode(Fn))}function toBytes(Fn){return typeof Fn=="string"&&(Fn=utf8ToBytes$1(Fn)),bytes(Fn),Fn}function concatBytes(...Fn){let Mn=0;for(let is=0;is<Fn.length;is++){const os=Fn[is];bytes(os),Mn+=os.length}const rs=new Uint8Array(Mn);for(let is=0,os=0;is<Fn.length;is++){const as=Fn[is];rs.set(as,os),os+=as.length}return rs}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(Fn){const Mn=is=>Fn().update(toBytes(is)).digest(),rs=Fn();return Mn.outputLen=rs.outputLen,Mn.blockLen=rs.blockLen,Mn.create=()=>Fn(),Mn}function randomBytes(Fn=32){if(crypto$3&&typeof crypto$3.getRandomValues=="function")return crypto$3.getRandomValues(new Uint8Array(Fn));throw new Error("crypto.getRandomValues must be defined")}const SHA3_PI=[],SHA3_ROTL=[],_SHA3_IOTA=[],_0n=BigInt(0),_1n=BigInt(1),_2n=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let Fn=0,Mn=_1n,rs=1,is=0;Fn<24;Fn++){[rs,is]=[is,(2*rs+3*is)%5],SHA3_PI.push(2*(5*is+rs)),SHA3_ROTL.push((Fn+1)*(Fn+2)/2%64);let os=_0n;for(let as=0;as<7;as++)Mn=(Mn<<_1n^(Mn>>_7n)*_0x71n)%_256n,Mn&_2n&&(os^=_1n<<(_1n<<BigInt(as))-_1n);_SHA3_IOTA.push(os)}const[SHA3_IOTA_H,SHA3_IOTA_L]=split$1(_SHA3_IOTA,!0),rotlH=(Fn,Mn,rs)=>rs>32?rotlBH(Fn,Mn,rs):rotlSH(Fn,Mn,rs),rotlL=(Fn,Mn,rs)=>rs>32?rotlBL(Fn,Mn,rs):rotlSL(Fn,Mn,rs);function keccakP(Fn,Mn=24){const rs=new Uint32Array(10);for(let is=24-Mn;is<24;is++){for(let us=0;us<10;us++)rs[us]=Fn[us]^Fn[us+10]^Fn[us+20]^Fn[us+30]^Fn[us+40];for(let us=0;us<10;us+=2){const ds=(us+8)%10,hs=(us+2)%10,ps=rs[hs],io=rs[hs+1],fo=rotlH(ps,io,1)^rs[ds],mo=rotlL(ps,io,1)^rs[ds+1];for(let Ao=0;Ao<50;Ao+=10)Fn[us+Ao]^=fo,Fn[us+Ao+1]^=mo}let os=Fn[2],as=Fn[3];for(let us=0;us<24;us++){const ds=SHA3_ROTL[us],hs=rotlH(os,as,ds),ps=rotlL(os,as,ds),io=SHA3_PI[us];os=Fn[io],as=Fn[io+1],Fn[io]=hs,Fn[io+1]=ps}for(let us=0;us<50;us+=10){for(let ds=0;ds<10;ds++)rs[ds]=Fn[us+ds];for(let ds=0;ds<10;ds++)Fn[us+ds]^=~rs[(ds+2)%10]&rs[(ds+4)%10]}Fn[0]^=SHA3_IOTA_H[is],Fn[1]^=SHA3_IOTA_L[is]}rs.fill(0)}class Keccak extends Hash{constructor(Mn,rs,is,os=!1,as=24){if(super(),this.blockLen=Mn,this.suffix=rs,this.outputLen=is,this.enableXOF=os,this.rounds=as,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number$1(is),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32(this.state)}keccak(){isLE||byteSwap32(this.state32),keccakP(this.state32,this.rounds),isLE||byteSwap32(this.state32),this.posOut=0,this.pos=0}update(Mn){exists(this);const{blockLen:rs,state:is}=this;Mn=toBytes(Mn);const os=Mn.length;for(let as=0;as<os;){const us=Math.min(rs-this.pos,os-as);for(let ds=0;ds<us;ds++)is[this.pos++]^=Mn[as++];this.pos===rs&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:Mn,suffix:rs,pos:is,blockLen:os}=this;Mn[is]^=rs,rs&128&&is===os-1&&this.keccak(),Mn[os-1]^=128,this.keccak()}writeInto(Mn){exists(this,!1),bytes(Mn),this.finish();const rs=this.state,{blockLen:is}=this;for(let os=0,as=Mn.length;os<as;){this.posOut>=is&&this.keccak();const us=Math.min(is-this.posOut,as-os);Mn.set(rs.subarray(this.posOut,this.posOut+us),os),this.posOut+=us,os+=us}return Mn}xofInto(Mn){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(Mn)}xof(Mn){return number$1(Mn),this.xofInto(new Uint8Array(Mn))}digestInto(Mn){if(output(Mn,this),this.finished)throw new Error("digest() was already called");return this.writeInto(Mn),this.destroy(),Mn}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(Mn){const{blockLen:rs,suffix:is,outputLen:os,rounds:as,enableXOF:us}=this;return Mn||(Mn=new Keccak(rs,is,os,us,as)),Mn.state32.set(this.state32),Mn.pos=this.pos,Mn.posOut=this.posOut,Mn.finished=this.finished,Mn.rounds=as,Mn.suffix=is,Mn.outputLen=os,Mn.enableXOF=us,Mn.destroyed=this.destroyed,Mn}}const gen=(Fn,Mn,rs)=>wrapConstructor(()=>new Keccak(Mn,Fn,rs)),keccak_256=gen(1,136,256/8);function keccak256$1(Fn,Mn){const rs=Mn||"hex",is=keccak_256(isHex(Fn,{strict:!1})?toBytes$1(Fn):Fn);return rs==="bytes"?is:toHex$3(is)}const checksumAddressCache=new LruMap(8192);function checksumAddress(Fn,Mn){if(checksumAddressCache.has(`${Fn}.${Mn}`))return checksumAddressCache.get(`${Fn}.${Mn}`);const rs=Mn?`${Mn}${Fn.toLowerCase()}`:Fn.substring(2).toLowerCase(),is=keccak256$1(stringToBytes(rs),"bytes"),os=(Mn?rs.substring(`${Mn}0x`.length):rs).split("");for(let us=0;us<40;us+=2)is[us>>1]>>4>=8&&os[us]&&(os[us]=os[us].toUpperCase()),(is[us>>1]&15)>=8&&os[us+1]&&(os[us+1]=os[us+1].toUpperCase());const as=`0x${os.join("")}`;return checksumAddressCache.set(`${Fn}.${Mn}`,as),as}function getAddress$1(Fn,Mn){if(!isAddress(Fn,{strict:!1}))throw new InvalidAddressError({address:Fn});return checksumAddress(Fn,Mn)}const addressRegex=/^0x[a-fA-F0-9]{40}$/,isAddressCache=new LruMap(8192);function isAddress(Fn,Mn){const{strict:rs=!0}=Mn??{},is=`${Fn}.${rs}`;if(isAddressCache.has(is))return isAddressCache.get(is);const os=addressRegex.test(Fn)?Fn.toLowerCase()===Fn?!0:rs?checksumAddress(Fn)===Fn:!0:!1;return isAddressCache.set(is,os),os}function slice(Fn,Mn,rs,{strict:is}={}){return isHex(Fn,{strict:!1})?sliceHex(Fn,Mn,rs,{strict:is}):sliceBytes(Fn,Mn,rs,{strict:is})}function assertStartOffset(Fn,Mn){if(typeof Mn=="number"&&Mn>0&&Mn>size$2(Fn)-1)throw new SliceOffsetOutOfBoundsError({offset:Mn,position:"start",size:size$2(Fn)})}function assertEndOffset(Fn,Mn,rs){if(typeof Mn=="number"&&typeof rs=="number"&&size$2(Fn)!==rs-Mn)throw new SliceOffsetOutOfBoundsError({offset:rs,position:"end",size:size$2(Fn)})}function sliceBytes(Fn,Mn,rs,{strict:is}={}){assertStartOffset(Fn,Mn);const os=Fn.slice(Mn,rs);return is&&assertEndOffset(os,Mn,rs),os}function sliceHex(Fn,Mn,rs,{strict:is}={}){assertStartOffset(Fn,Mn);const os=`0x${Fn.replace("0x","").slice((Mn??0)*2,(rs??Fn.length)*2)}`;return is&&assertEndOffset(os,Mn,rs),os}function encodeAbiParameters(Fn,Mn){if(Fn.length!==Mn.length)throw new AbiEncodingLengthMismatchError({expectedLength:Fn.length,givenLength:Mn.length});const rs=prepareParams({params:Fn,values:Mn}),is=encodeParams(rs);return is.length===0?"0x":is}function prepareParams({params:Fn,values:Mn}){const rs=[];for(let is=0;is<Fn.length;is++)rs.push(prepareParam({param:Fn[is],value:Mn[is]}));return rs}function prepareParam({param:Fn,value:Mn}){const rs=getArrayComponents(Fn.type);if(rs){const[is,os]=rs;return encodeArray(Mn,{length:is,param:{...Fn,type:os}})}if(Fn.type==="tuple")return encodeTuple(Mn,{param:Fn});if(Fn.type==="address")return encodeAddress(Mn);if(Fn.type==="bool")return encodeBool(Mn);if(Fn.type.startsWith("uint")||Fn.type.startsWith("int")){const is=Fn.type.startsWith("int");return encodeNumber(Mn,{signed:is})}if(Fn.type.startsWith("bytes"))return encodeBytes$1(Mn,{param:Fn});if(Fn.type==="string")return encodeString(Mn);throw new InvalidAbiEncodingTypeError(Fn.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function encodeParams(Fn){let Mn=0;for(let as=0;as<Fn.length;as++){const{dynamic:us,encoded:ds}=Fn[as];us?Mn+=32:Mn+=size$2(ds)}const rs=[],is=[];let os=0;for(let as=0;as<Fn.length;as++){const{dynamic:us,encoded:ds}=Fn[as];us?(rs.push(numberToHex(Mn+os,{size:32})),is.push(ds),os+=size$2(ds)):rs.push(ds)}return concat$3([...rs,...is])}function encodeAddress(Fn){if(!isAddress(Fn))throw new InvalidAddressError({address:Fn});return{dynamic:!1,encoded:padHex(Fn.toLowerCase())}}function encodeArray(Fn,{length:Mn,param:rs}){const is=Mn===null;if(!Array.isArray(Fn))throw new InvalidArrayError(Fn);if(!is&&Fn.length!==Mn)throw new AbiEncodingArrayLengthMismatchError({expectedLength:Mn,givenLength:Fn.length,type:`${rs.type}[${Mn}]`});let os=!1;const as=[];for(let us=0;us<Fn.length;us++){const ds=prepareParam({param:rs,value:Fn[us]});ds.dynamic&&(os=!0),as.push(ds)}if(is||os){const us=encodeParams(as);if(is){const ds=numberToHex(as.length,{size:32});return{dynamic:!0,encoded:as.length>0?concat$3([ds,us]):ds}}if(os)return{dynamic:!0,encoded:us}}return{dynamic:!1,encoded:concat$3(as.map(({encoded:us})=>us))}}function encodeBytes$1(Fn,{param:Mn}){const[,rs]=Mn.type.split("bytes"),is=size$2(Fn);if(!rs){let os=Fn;return is%32!==0&&(os=padHex(os,{dir:"right",size:Math.ceil((Fn.length-2)/2/32)*32})),{dynamic:!0,encoded:concat$3([padHex(numberToHex(is,{size:32})),os])}}if(is!==Number.parseInt(rs))throw new AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(rs),value:Fn});return{dynamic:!1,encoded:padHex(Fn,{dir:"right"})}}function encodeBool(Fn){if(typeof Fn!="boolean")throw new BaseError$3(`Invalid boolean value: "${Fn}" (type: ${typeof Fn}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:padHex(boolToHex(Fn))}}function encodeNumber(Fn,{signed:Mn}){return{dynamic:!1,encoded:numberToHex(Fn,{size:32,signed:Mn})}}function encodeString(Fn){const Mn=stringToHex(Fn),rs=Math.ceil(size$2(Mn)/32),is=[];for(let os=0;os<rs;os++)is.push(padHex(slice(Mn,os*32,(os+1)*32),{dir:"right"}));return{dynamic:!0,encoded:concat$3([padHex(numberToHex(size$2(Mn),{size:32})),...is])}}function encodeTuple(Fn,{param:Mn}){let rs=!1;const is=[];for(let os=0;os<Mn.components.length;os++){const as=Mn.components[os],us=Array.isArray(Fn)?os:as.name,ds=prepareParam({param:as,value:Fn[us]});is.push(ds),ds.dynamic&&(rs=!0)}return{dynamic:rs,encoded:rs?encodeParams(is):concat$3(is.map(({encoded:os})=>os))}}function getArrayComponents(Fn){const Mn=Fn.match(/^(.*)\[(\d+)?\]$/);return Mn?[Mn[2]?Number(Mn[2]):null,Mn[1]]:void 0}const docsPath$2="/docs/contract/encodeDeployData";function encodeDeployData(Fn){const{abi:Mn,args:rs,bytecode:is}=Fn;if(!rs||rs.length===0)return is;const os=Mn.find(us=>"type"in us&&us.type==="constructor");if(!os)throw new AbiConstructorNotFoundError({docsPath:docsPath$2});if(!("inputs"in os))throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$2});if(!os.inputs||os.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$2});const as=encodeAbiParameters(os.inputs,rs);return concatHex([is,as])}function parseAccount(Fn){return typeof Fn=="string"?{address:Fn,type:"json-rpc"}:Fn}class AccountNotFoundError extends BaseError$3{constructor({docsPath:Mn}={}){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:Mn,docsSlug:"account",name:"AccountNotFoundError"})}}class AccountTypeNotSupportedError extends BaseError$3{constructor({docsPath:Mn,metaMessages:rs,type:is}){super(`Account type "${is}" is not supported.`,{docsPath:Mn,metaMessages:rs,name:"AccountTypeNotSupportedError"})}}function publicKeyToAddress(Fn){const Mn=keccak256$1(`0x${Fn.substring(4)}`).substring(26);return checksumAddress(`0x${Mn}`)}const scriptRel="modulepreload",assetsURL=function(Fn){return"/"+Fn},seen={},__vitePreload=function(Mn,rs,is){let os=Promise.resolve();if(rs&&rs.length>0){document.getElementsByTagName("link");const as=document.querySelector("meta[property=csp-nonce]"),us=(as==null?void 0:as.nonce)||(as==null?void 0:as.getAttribute("nonce"));os=Promise.all(rs.map(ds=>{if(ds=assetsURL(ds),ds in seen)return;seen[ds]=!0;const hs=ds.endsWith(".css"),ps=hs?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${ds}"]${ps}`))return;const io=document.createElement("link");if(io.rel=hs?"stylesheet":scriptRel,hs||(io.as="script",io.crossOrigin=""),io.href=ds,us&&io.setAttribute("nonce",us),document.head.appendChild(io),hs)return new Promise((fo,mo)=>{io.addEventListener("load",fo),io.addEventListener("error",()=>mo(new Error(`Unable to preload CSS for ${ds}`)))})}))}return os.then(()=>Mn()).catch(as=>{const us=new Event("vite:preloadError",{cancelable:!0});if(us.payload=as,window.dispatchEvent(us),!us.defaultPrevented)throw as})};async function recoverPublicKey$1({hash:Fn,signature:Mn}){const rs=isHex(Fn)?Fn:toHex$3(Fn),{secp256k1:is}=await __vitePreload(async()=>{const{secp256k1:us}=await import("./secp256k1-DfWzd6TA.js");return{secp256k1:us}},[]);return`0x${(()=>{if(typeof Mn=="object"&&"r"in Mn&&"s"in Mn){const{r:ps,s:io,v:fo,yParity:mo}=Mn,Ao=Number(mo??fo),$o=toRecoveryBit(Ao);return new is.Signature(hexToBigInt(ps),hexToBigInt(io)).addRecoveryBit($o)}const us=isHex(Mn)?Mn:toHex$3(Mn),ds=hexToNumber(`0x${us.slice(130)}`),hs=toRecoveryBit(ds);return is.Signature.fromCompact(us.substring(2,130)).addRecoveryBit(hs)})().recoverPublicKey(rs.substring(2)).toHex(!1)}`}function toRecoveryBit(Fn){if(Fn===0||Fn===1)return Fn;if(Fn===27)return 0;if(Fn===28)return 1;throw new Error("Invalid yParityOrV value")}async function recoverAddress$1({hash:Fn,signature:Mn}){return publicKeyToAddress(await recoverPublicKey$1({hash:Fn,signature:Mn}))}class NegativeOffsetError extends BaseError$3{constructor({offset:Mn}){super(`Offset \`${Mn}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class PositionOutOfBoundsError extends BaseError$3{constructor({length:Mn,position:rs}){super(`Position \`${rs}\` is out of bounds (\`0 < position < ${Mn}\`).`,{name:"PositionOutOfBoundsError"})}}class RecursiveReadLimitExceededError extends BaseError$3{constructor({count:Mn,limit:rs}){super(`Recursive read limit of \`${rs}\` exceeded (recursive read count: \`${Mn}\`).`,{name:"RecursiveReadLimitExceededError"})}}const staticCursor={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 RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(Fn){if(Fn<0||Fn>this.bytes.length-1)throw new PositionOutOfBoundsError({length:this.bytes.length,position:Fn})},decrementPosition(Fn){if(Fn<0)throw new NegativeOffsetError({offset:Fn});const Mn=this.position-Fn;this.assertPosition(Mn),this.position=Mn},getReadCount(Fn){return this.positionReadCount.get(Fn||this.position)||0},incrementPosition(Fn){if(Fn<0)throw new NegativeOffsetError({offset:Fn});const Mn=this.position+Fn;this.assertPosition(Mn),this.position=Mn},inspectByte(Fn){const Mn=Fn??this.position;return this.assertPosition(Mn),this.bytes[Mn]},inspectBytes(Fn,Mn){const rs=Mn??this.position;return this.assertPosition(rs+Fn-1),this.bytes.subarray(rs,rs+Fn)},inspectUint8(Fn){const Mn=Fn??this.position;return this.assertPosition(Mn),this.bytes[Mn]},inspectUint16(Fn){const Mn=Fn??this.position;return this.assertPosition(Mn+1),this.dataView.getUint16(Mn)},inspectUint24(Fn){const Mn=Fn??this.position;return this.assertPosition(Mn+2),(this.dataView.getUint16(Mn)<<8)+this.dataView.getUint8(Mn+2)},inspectUint32(Fn){const Mn=Fn??this.position;return this.assertPosition(Mn+3),this.dataView.getUint32(Mn)},pushByte(Fn){this.assertPosition(this.position),this.bytes[this.position]=Fn,this.position++},pushBytes(Fn){this.assertPosition(this.position+Fn.length-1),this.bytes.set(Fn,this.position),this.position+=Fn.length},pushUint8(Fn){this.assertPosition(this.position),this.bytes[this.position]=Fn,this.position++},pushUint16(Fn){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,Fn),this.position+=2},pushUint24(Fn){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,Fn>>8),this.dataView.setUint8(this.position+2,Fn&255),this.position+=3},pushUint32(Fn){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,Fn),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const Fn=this.inspectByte();return this.position++,Fn},readBytes(Fn,Mn){this.assertReadLimit(),this._touch();const rs=this.inspectBytes(Fn);return this.position+=Mn??Fn,rs},readUint8(){this.assertReadLimit(),this._touch();const Fn=this.inspectUint8();return this.position+=1,Fn},readUint16(){this.assertReadLimit(),this._touch();const Fn=this.inspectUint16();return this.position+=2,Fn},readUint24(){this.assertReadLimit(),this._touch();const Fn=this.inspectUint24();return this.position+=3,Fn},readUint32(){this.assertReadLimit(),this._touch();const Fn=this.inspectUint32();return this.position+=4,Fn},get remaining(){return this.bytes.length-this.position},setPosition(Fn){const Mn=this.position;return this.assertPosition(Fn),this.position=Fn,()=>this.position=Mn},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const Fn=this.getReadCount();this.positionReadCount.set(this.position,Fn+1),Fn>0&&this.recursiveReadCount++}};function createCursor(Fn,{recursiveReadLimit:Mn=8192}={}){const rs=Object.create(staticCursor);return rs.bytes=Fn,rs.dataView=new DataView(Fn.buffer,Fn.byteOffset,Fn.byteLength),rs.positionReadCount=new Map,rs.recursiveReadLimit=Mn,rs}function toRlp(Fn,Mn="hex"){const rs=getEncodable(Fn),is=createCursor(new Uint8Array(rs.length));return rs.encode(is),Mn==="hex"?bytesToHex(is.bytes):is.bytes}function getEncodable(Fn){return Array.isArray(Fn)?getEncodableList(Fn.map(Mn=>getEncodable(Mn))):getEncodableBytes(Fn)}function getEncodableList(Fn){const Mn=Fn.reduce((os,as)=>os+as.length,0),rs=getSizeOfLength(Mn);return{length:Mn<=55?1+Mn:1+rs+Mn,encode(os){Mn<=55?os.pushByte(192+Mn):(os.pushByte(247+rs),rs===1?os.pushUint8(Mn):rs===2?os.pushUint16(Mn):rs===3?os.pushUint24(Mn):os.pushUint32(Mn));for(const{encode:as}of Fn)as(os)}}}function getEncodableBytes(Fn){const Mn=typeof Fn=="string"?hexToBytes(Fn):Fn,rs=getSizeOfLength(Mn.length);return{length:Mn.length===1&&Mn[0]<128?1:Mn.length<=55?1+Mn.length:1+rs+Mn.length,encode(os){Mn.length===1&&Mn[0]<128?os.pushBytes(Mn):Mn.length<=55?(os.pushByte(128+Mn.length),os.pushBytes(Mn)):(os.pushByte(183+rs),rs===1?os.pushUint8(Mn.length):rs===2?os.pushUint16(Mn.length):rs===3?os.pushUint24(Mn.length):os.pushUint32(Mn.length),os.pushBytes(Mn))}}}function getSizeOfLength(Fn){if(Fn<2**8)return 1;if(Fn<2**16)return 2;if(Fn<2**24)return 3;if(Fn<2**32)return 4;throw new BaseError$3("Length is too large.")}function hashAuthorization(Fn){const{chainId:Mn,contractAddress:rs,nonce:is,to:os}=Fn,as=keccak256$1(concatHex(["0x05",toRlp([numberToHex(Mn),rs,is?numberToHex(is):"0x"])]));return os==="bytes"?hexToBytes(as):as}async function recoverAuthorizationAddress(Fn){const{authorization:Mn,signature:rs}=Fn;return recoverAddress$1({hash:hashAuthorization(Mn),signature:rs??Mn})}class ChainDoesNotSupportContract extends BaseError$3{constructor({blockNumber:Mn,chain:rs,contract:is}){super(`Chain "${rs.name}" does not support contract "${is.name}".`,{metaMessages:["This could be due to any of the following:",...Mn&&is.blockCreated&&is.blockCreated>Mn?[`- The contract "${is.name}" was not deployed until block ${is.blockCreated} (current block ${Mn}).`]:[`- The chain does not have the contract "${is.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class ChainMismatchError extends BaseError$3{constructor({chain:Mn,currentChainId:rs}){super(`The current chain of the wallet (id: ${rs}) does not match the target chain for the transaction (id: ${Mn.id} – ${Mn.name}).`,{metaMessages:[`Current Chain ID:  ${rs}`,`Expected Chain ID: ${Mn.id} – ${Mn.name}`],name:"ChainMismatchError"})}}class ChainNotFoundError extends BaseError$3{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 ClientChainNotConfiguredError extends BaseError$3{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}function assertCurrentChain({chain:Fn,currentChainId:Mn}){if(!Fn)throw new ChainNotFoundError;if(Mn!==Fn.id)throw new ChainMismatchError({chain:Fn,currentChainId:Mn})}const etherUnits={gwei:9,wei:18},gweiUnits={ether:-9,wei:9},weiUnits={ether:-18,gwei:-9};function formatUnits$1(Fn,Mn){let rs=Fn.toString();const is=rs.startsWith("-");is&&(rs=rs.slice(1)),rs=rs.padStart(Mn,"0");let[os,as]=[rs.slice(0,rs.length-Mn),rs.slice(rs.length-Mn)];return as=as.replace(/(0+)$/,""),`${is?"-":""}${os||"0"}${as?`.${as}`:""}`}function formatGwei(Fn,Mn="wei"){return formatUnits$1(Fn,gweiUnits[Mn])}class ExecutionRevertedError extends BaseError$3{constructor({cause:Mn,message:rs}={}){var os;const is=(os=rs==null?void 0:rs.replace("execution reverted: ",""))==null?void 0:os.replace("execution reverted","");super(`Execution reverted ${is?`with reason: ${is}`:"for an unknown reason"}.`,{cause:Mn,name:"ExecutionRevertedError"})}}Object.defineProperty(ExecutionRevertedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ExecutionRevertedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class FeeCapTooHighError extends BaseError$3{constructor({cause:Mn,maxFeePerGas:rs}={}){super(`The fee cap (\`maxFeePerGas\`${rs?` = ${formatGwei(rs)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:Mn,name:"FeeCapTooHighError"})}}Object.defineProperty(FeeCapTooHighError,"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 FeeCapTooLowError extends BaseError$3{constructor({cause:Mn,maxFeePerGas:rs}={}){super(`The fee cap (\`maxFeePerGas\`${rs?` = ${formatGwei(rs)}`:""} gwei) cannot be lower than the block base fee.`,{cause:Mn,name:"FeeCapTooLowError"})}}Object.defineProperty(FeeCapTooLowError,"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 NonceTooHighError extends BaseError$3{constructor({cause:Mn,nonce:rs}={}){super(`Nonce provided for the transaction ${rs?`(${rs}) `:""}is higher than the next one expected.`,{cause:Mn,name:"NonceTooHighError"})}}Object.defineProperty(NonceTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class NonceTooLowError extends BaseError$3{constructor({cause:Mn,nonce:rs}={}){super([`Nonce provided for the transaction ${rs?`(${rs}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
`),{cause:Mn,name:"NonceTooLowError"})}}Object.defineProperty(NonceTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class NonceMaxValueError extends BaseError$3{constructor({cause:Mn,nonce:rs}={}){super(`Nonce provided for the transaction ${rs?`(${rs}) `:""}exceeds the maximum allowed nonce.`,{cause:Mn,name:"NonceMaxValueError"})}}Object.defineProperty(NonceMaxValueError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class InsufficientFundsError extends BaseError$3{constructor({cause:Mn}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
`),{cause:Mn,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(InsufficientFundsError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class IntrinsicGasTooHighError extends BaseError$3{constructor({cause:Mn,gas:rs}={}){super(`The amount of gas ${rs?`(${rs}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:Mn,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(IntrinsicGasTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class IntrinsicGasTooLowError extends BaseError$3{constructor({cause:Mn,gas:rs}={}){super(`The amount of gas ${rs?`(${rs}) `:""}provided for the transaction is too low.`,{cause:Mn,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(IntrinsicGasTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class TransactionTypeNotSupportedError extends BaseError$3{constructor({cause:Mn}){super("The transaction type is not supported for this chain.",{cause:Mn,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(TransactionTypeNotSupportedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class TipAboveFeeCapError extends BaseError$3{constructor({cause:Mn,maxPriorityFeePerGas:rs,maxFeePerGas:is}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${rs?` = ${formatGwei(rs)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${is?` = ${formatGwei(is)} gwei`:""}).`].join(`
`),{cause:Mn,name:"TipAboveFeeCapError"})}}Object.defineProperty(TipAboveFeeCapError,"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 UnknownNodeError extends BaseError$3{constructor({cause:Mn}){super(`An error occurred while executing: ${Mn==null?void 0:Mn.shortMessage}`,{cause:Mn,name:"UnknownNodeError"})}}function formatEther(Fn,Mn="wei"){return formatUnits$1(Fn,etherUnits[Mn])}function prettyPrint(Fn){const Mn=Object.entries(Fn).map(([is,os])=>os===void 0||os===!1?null:[is,os]).filter(Boolean),rs=Mn.reduce((is,[os])=>Math.max(is,os.length),0);return Mn.map(([is,os])=>`  ${`${is}:`.padEnd(rs+1)}  ${os}`).join(`
`)}class FeeConflictError extends BaseError$3{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 InvalidSerializableTransactionError extends BaseError$3{constructor({transaction:Mn}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",prettyPrint(Mn),"}","","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 TransactionExecutionError extends BaseError$3{constructor(Mn,{account:rs,docsPath:is,chain:os,data:as,gas:us,gasPrice:ds,maxFeePerGas:hs,maxPriorityFeePerGas:ps,nonce:io,to:fo,value:mo}){var $o;const Ao=prettyPrint({chain:os&&`${os==null?void 0:os.name} (id: ${os==null?void 0:os.id})`,from:rs==null?void 0:rs.address,to:fo,value:typeof mo<"u"&&`${formatEther(mo)} ${(($o=os==null?void 0:os.nativeCurrency)==null?void 0:$o.symbol)||"ETH"}`,data:as,gas:us,gasPrice:typeof ds<"u"&&`${formatGwei(ds)} gwei`,maxFeePerGas:typeof hs<"u"&&`${formatGwei(hs)} gwei`,maxPriorityFeePerGas:typeof ps<"u"&&`${formatGwei(ps)} gwei`,nonce:io});super(Mn.shortMessage,{cause:Mn,docsPath:is,metaMessages:[...Mn.metaMessages?[...Mn.metaMessages," "]:[],"Request Arguments:",Ao].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=Mn}}class TransactionNotFoundError extends BaseError$3{constructor({blockHash:Mn,blockNumber:rs,blockTag:is,hash:os,index:as}){let us="Transaction";is&&as!==void 0&&(us=`Transaction at block time "${is}" at index "${as}"`),Mn&&as!==void 0&&(us=`Transaction at block hash "${Mn}" at index "${as}"`),rs&&as!==void 0&&(us=`Transaction at block number "${rs}" at index "${as}"`),os&&(us=`Transaction with hash "${os}"`),super(`${us} could not be found.`,{name:"TransactionNotFoundError"})}}class TransactionReceiptNotFoundError extends BaseError$3{constructor({hash:Mn}){super(`Transaction receipt with hash "${Mn}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class WaitForTransactionReceiptTimeoutError extends BaseError$3{constructor({hash:Mn}){super(`Timed out while waiting for transaction with hash "${Mn}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const stringify$1=(Fn,Mn,rs)=>JSON.stringify(Fn,(is,os)=>typeof os=="bigint"?os.toString():os,rs),getContractAddress$1=Fn=>Fn,getUrl$1=Fn=>Fn;class HttpRequestError extends BaseError$3{constructor({body:Mn,cause:rs,details:is,headers:os,status:as,url:us}){super("HTTP request failed.",{cause:rs,details:is,metaMessages:[as&&`Status: ${as}`,`URL: ${getUrl$1(us)}`,Mn&&`Request body: ${stringify$1(Mn)}`].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=Mn,this.headers=os,this.status=as,this.url=us}}class RpcRequestError extends BaseError$3{constructor({body:Mn,error:rs,url:is}){super("RPC Request failed.",{cause:rs,details:rs.message,metaMessages:[`URL: ${getUrl$1(is)}`,`Request body: ${stringify$1(Mn)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=rs.code}}class TimeoutError extends BaseError$3{constructor({body:Mn,url:rs}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${getUrl$1(rs)}`,`Request body: ${stringify$1(Mn)}`],name:"TimeoutError"})}}const unknownErrorCode=-1;class RpcError extends BaseError$3{constructor(Mn,{code:rs,docsPath:is,metaMessages:os,name:as,shortMessage:us}){super(us,{cause:Mn,docsPath:is,metaMessages:os||(Mn==null?void 0:Mn.metaMessages),name:as||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=as||Mn.name,this.code=Mn instanceof RpcRequestError?Mn.code:rs??unknownErrorCode}}class ProviderRpcError extends RpcError{constructor(Mn,rs){super(Mn,rs),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=rs.data}}class ParseRpcError extends RpcError{constructor(Mn){super(Mn,{code:ParseRpcError.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(ParseRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class InvalidRequestRpcError extends RpcError{constructor(Mn){super(Mn,{code:InvalidRequestRpcError.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(InvalidRequestRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class MethodNotFoundRpcError extends RpcError{constructor(Mn,{method:rs}={}){super(Mn,{code:MethodNotFoundRpcError.code,name:"MethodNotFoundRpcError",shortMessage:`The method${rs?` "${rs}"`:""} does not exist / is not available.`})}}Object.defineProperty(MethodNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class InvalidParamsRpcError extends RpcError{constructor(Mn){super(Mn,{code:InvalidParamsRpcError.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(InvalidParamsRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class InternalRpcError extends RpcError{constructor(Mn){super(Mn,{code:InternalRpcError.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(InternalRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class InvalidInputRpcError extends RpcError{constructor(Mn){super(Mn,{code:InvalidInputRpcError.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
`)})}}Object.defineProperty(InvalidInputRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ResourceNotFoundRpcError extends RpcError{constructor(Mn){super(Mn,{code:ResourceNotFoundRpcError.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ResourceNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ResourceUnavailableRpcError extends RpcError{constructor(Mn){super(Mn,{code:ResourceUnavailableRpcError.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ResourceUnavailableRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class TransactionRejectedRpcError extends RpcError{constructor(Mn){super(Mn,{code:TransactionRejectedRpcError.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(TransactionRejectedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class MethodNotSupportedRpcError extends RpcError{constructor(Mn,{method:rs}={}){super(Mn,{code:MethodNotSupportedRpcError.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${rs?` "${rs}"`:""} is not implemented.`})}}Object.defineProperty(MethodNotSupportedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class LimitExceededRpcError extends RpcError{constructor(Mn){super(Mn,{code:LimitExceededRpcError.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(LimitExceededRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class JsonRpcVersionUnsupportedError extends RpcError{constructor(Mn){super(Mn,{code:JsonRpcVersionUnsupportedError.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(JsonRpcVersionUnsupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class UserRejectedRequestError extends ProviderRpcError{constructor(Mn){super(Mn,{code:UserRejectedRequestError.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(UserRejectedRequestError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class UnauthorizedProviderError extends ProviderRpcError{constructor(Mn){super(Mn,{code:UnauthorizedProviderError.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(UnauthorizedProviderError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class UnsupportedProviderMethodError extends ProviderRpcError{constructor(Mn,{method:rs}={}){super(Mn,{code:UnsupportedProviderMethodError.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${rs?` " ${rs}"`:""}.`})}}Object.defineProperty(UnsupportedProviderMethodError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ProviderDisconnectedError extends ProviderRpcError{constructor(Mn){super(Mn,{code:ProviderDisconnectedError.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ProviderDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class ChainDisconnectedError extends ProviderRpcError{constructor(Mn){super(Mn,{code:ChainDisconnectedError.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(ChainDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class SwitchChainError extends ProviderRpcError{constructor(Mn){super(Mn,{code:SwitchChainError.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(SwitchChainError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class UnknownRpcError extends RpcError{constructor(Mn){super(Mn,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function getNodeError(Fn,Mn){const rs=(Fn.details||"").toLowerCase(),is=Fn instanceof BaseError$3?Fn.walk(os=>os.code===ExecutionRevertedError.code):Fn;return is instanceof BaseError$3?new ExecutionRevertedError({cause:Fn,message:is.details}):ExecutionRevertedError.nodeMessage.test(rs)?new ExecutionRevertedError({cause:Fn,message:Fn.details}):FeeCapTooHighError.nodeMessage.test(rs)?new FeeCapTooHighError({cause:Fn,maxFeePerGas:Mn==null?void 0:Mn.maxFeePerGas}):FeeCapTooLowError.nodeMessage.test(rs)?new FeeCapTooLowError({cause:Fn,maxFeePerGas:Mn==null?void 0:Mn.maxFeePerGas}):NonceTooHighError.nodeMessage.test(rs)?new NonceTooHighError({cause:Fn,nonce:Mn==null?void 0:Mn.nonce}):NonceTooLowError.nodeMessage.test(rs)?new NonceTooLowError({cause:Fn,nonce:Mn==null?void 0:Mn.nonce}):NonceMaxValueError.nodeMessage.test(rs)?new NonceMaxValueError({cause:Fn,nonce:Mn==null?void 0:Mn.nonce}):InsufficientFundsError.nodeMessage.test(rs)?new InsufficientFundsError({cause:Fn}):IntrinsicGasTooHighError.nodeMessage.test(rs)?new IntrinsicGasTooHighError({cause:Fn,gas:Mn==null?void 0:Mn.gas}):IntrinsicGasTooLowError.nodeMessage.test(rs)?new IntrinsicGasTooLowError({cause:Fn,gas:Mn==null?void 0:Mn.gas}):TransactionTypeNotSupportedError.nodeMessage.test(rs)?new TransactionTypeNotSupportedError({cause:Fn}):TipAboveFeeCapError.nodeMessage.test(rs)?new TipAboveFeeCapError({cause:Fn,maxFeePerGas:Mn==null?void 0:Mn.maxFeePerGas,maxPriorityFeePerGas:Mn==null?void 0:Mn.maxPriorityFeePerGas}):new UnknownNodeError({cause:Fn})}function getTransactionError(Fn,{docsPath:Mn,...rs}){const is=(()=>{const os=getNodeError(Fn,rs);return os instanceof UnknownNodeError?Fn:os})();return new TransactionExecutionError(is,{docsPath:Mn,...rs})}function extract(Fn,{format:Mn}){if(!Mn)return{};const rs={};function is(as){const us=Object.keys(as);for(const ds of us)ds in Fn&&(rs[ds]=Fn[ds]),as[ds]&&typeof as[ds]=="object"&&!Array.isArray(as[ds])&&is(as[ds])}const os=Mn(Fn||{});return is(os),rs}const rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function formatTransactionRequest(Fn){const Mn={};return typeof Fn.authorizationList<"u"&&(Mn.authorizationList=formatAuthorizationList$1(Fn.authorizationList)),typeof Fn.accessList<"u"&&(Mn.accessList=Fn.accessList),typeof Fn.blobVersionedHashes<"u"&&(Mn.blobVersionedHashes=Fn.blobVersionedHashes),typeof Fn.blobs<"u"&&(typeof Fn.blobs[0]!="string"?Mn.blobs=Fn.blobs.map(rs=>bytesToHex(rs)):Mn.blobs=Fn.blobs),typeof Fn.data<"u"&&(Mn.data=Fn.data),typeof Fn.from<"u"&&(Mn.from=Fn.from),typeof Fn.gas<"u"&&(Mn.gas=numberToHex(Fn.gas)),typeof Fn.gasPrice<"u"&&(Mn.gasPrice=numberToHex(Fn.gasPrice)),typeof Fn.maxFeePerBlobGas<"u"&&(Mn.maxFeePerBlobGas=numberToHex(Fn.maxFeePerBlobGas)),typeof Fn.maxFeePerGas<"u"&&(Mn.maxFeePerGas=numberToHex(Fn.maxFeePerGas)),typeof Fn.maxPriorityFeePerGas<"u"&&(Mn.maxPriorityFeePerGas=numberToHex(Fn.maxPriorityFeePerGas)),typeof Fn.nonce<"u"&&(Mn.nonce=numberToHex(Fn.nonce)),typeof Fn.to<"u"&&(Mn.to=Fn.to),typeof Fn.type<"u"&&(Mn.type=rpcTransactionType[Fn.type]),typeof Fn.value<"u"&&(Mn.value=numberToHex(Fn.value)),Mn}function formatAuthorizationList$1(Fn){return Fn.map(Mn=>({address:Mn.contractAddress,r:Mn.r,s:Mn.s,chainId:numberToHex(Mn.chainId),nonce:numberToHex(Mn.nonce),...typeof Mn.yParity<"u"?{yParity:numberToHex(Mn.yParity)}:{},...typeof Mn.v<"u"&&typeof Mn.yParity>"u"?{v:numberToHex(Mn.v)}:{}}))}function getAction$1(Fn,Mn,rs){const is=Fn[Mn.name];if(typeof is=="function")return is;const os=Fn[rs];return typeof os=="function"?os:as=>Mn(Fn,as)}const maxUint256=2n**256n-1n;function assertRequest(Fn){const{account:Mn,gasPrice:rs,maxFeePerGas:is,maxPriorityFeePerGas:os,to:as}=Fn,us=Mn?parseAccount(Mn):void 0;if(us&&!isAddress(us.address))throw new InvalidAddressError({address:us.address});if(as&&!isAddress(as))throw new InvalidAddressError({address:as});if(typeof rs<"u"&&(typeof is<"u"||typeof os<"u"))throw new FeeConflictError;if(is&&is>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:is});if(os&&is&&os>is)throw new TipAboveFeeCapError({maxFeePerGas:is,maxPriorityFeePerGas:os})}async function getChainId(Fn){const Mn=await Fn.request({method:"eth_chainId"},{dedupe:!0});return hexToNumber(Mn)}class BaseFeeScalarError extends BaseError$3{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Eip1559FeesNotSupportedError extends BaseError$3{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class MaxFeePerGasTooLowError extends BaseError$3{constructor({maxPriorityFeePerGas:Mn}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${formatGwei(Mn)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class BlockNotFoundError extends BaseError$3{constructor({blockHash:Mn,blockNumber:rs}){let is="Block";Mn&&(is=`Block at hash "${Mn}"`),rs&&(is=`Block at number "${rs}"`),super(`${is} could not be found.`,{name:"BlockNotFoundError"})}}const transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function formatTransaction(Fn){const Mn={...Fn,blockHash:Fn.blockHash?Fn.blockHash:null,blockNumber:Fn.blockNumber?BigInt(Fn.blockNumber):null,chainId:Fn.chainId?hexToNumber(Fn.chainId):void 0,gas:Fn.gas?BigInt(Fn.gas):void 0,gasPrice:Fn.gasPrice?BigInt(Fn.gasPrice):void 0,maxFeePerBlobGas:Fn.maxFeePerBlobGas?BigInt(Fn.maxFeePerBlobGas):void 0,maxFeePerGas:Fn.maxFeePerGas?BigInt(Fn.maxFeePerGas):void 0,maxPriorityFeePerGas:Fn.maxPriorityFeePerGas?BigInt(Fn.maxPriorityFeePerGas):void 0,nonce:Fn.nonce?hexToNumber(Fn.nonce):void 0,to:Fn.to?Fn.to:null,transactionIndex:Fn.transactionIndex?Number(Fn.transactionIndex):null,type:Fn.type?transactionType[Fn.type]:void 0,typeHex:Fn.type?Fn.type:void 0,value:Fn.value?BigInt(Fn.value):void 0,v:Fn.v?BigInt(Fn.v):void 0};return Fn.authorizationList&&(Mn.authorizationList=formatAuthorizationList(Fn.authorizationList)),Mn.yParity=(()=>{if(Fn.yParity)return Number(Fn.yParity);if(typeof Mn.v=="bigint"){if(Mn.v===0n||Mn.v===27n)return 0;if(Mn.v===1n||Mn.v===28n)return 1;if(Mn.v>=35n)return Mn.v%2n===0n?1:0}})(),Mn.type==="legacy"&&(delete Mn.accessList,delete Mn.maxFeePerBlobGas,delete Mn.maxFeePerGas,delete Mn.maxPriorityFeePerGas,delete Mn.yParity),Mn.type==="eip2930"&&(delete Mn.maxFeePerBlobGas,delete Mn.maxFeePerGas,delete Mn.maxPriorityFeePerGas),Mn.type==="eip1559"&&delete Mn.maxFeePerBlobGas,Mn}function formatAuthorizationList(Fn){return Fn.map(Mn=>({contractAddress:Mn.address,r:Mn.r,s:Mn.s,chainId:Number(Mn.chainId),nonce:Number(Mn.nonce),...typeof Mn.yParity<"u"?{yParity:Number(Mn.yParity)}:{},...typeof Mn.v<"u"&&typeof Mn.yParity>"u"?{v:Number(Mn.v)}:{}}))}function formatBlock(Fn){var rs;const Mn=(rs=Fn.transactions)==null?void 0:rs.map(is=>typeof is=="string"?is:formatTransaction(is));return{...Fn,baseFeePerGas:Fn.baseFeePerGas?BigInt(Fn.baseFeePerGas):null,blobGasUsed:Fn.blobGasUsed?BigInt(Fn.blobGasUsed):void 0,difficulty:Fn.difficulty?BigInt(Fn.difficulty):void 0,excessBlobGas:Fn.excessBlobGas?BigInt(Fn.excessBlobGas):void 0,gasLimit:Fn.gasLimit?BigInt(Fn.gasLimit):void 0,gasUsed:Fn.gasUsed?BigInt(Fn.gasUsed):void 0,hash:Fn.hash?Fn.hash:null,logsBloom:Fn.logsBloom?Fn.logsBloom:null,nonce:Fn.nonce?Fn.nonce:null,number:Fn.number?BigInt(Fn.number):null,size:Fn.size?BigInt(Fn.size):void 0,timestamp:Fn.timestamp?BigInt(Fn.timestamp):void 0,transactions:Mn,totalDifficulty:Fn.totalDifficulty?BigInt(Fn.totalDifficulty):null}}async function getBlock(Fn,{blockHash:Mn,blockNumber:rs,blockTag:is,includeTransactions:os}={}){var io,fo,mo;const as=is??"latest",us=os??!1,ds=rs!==void 0?numberToHex(rs):void 0;let hs=null;if(Mn?hs=await Fn.request({method:"eth_getBlockByHash",params:[Mn,us]},{dedupe:!0}):hs=await Fn.request({method:"eth_getBlockByNumber",params:[ds||as,us]},{dedupe:!!ds}),!hs)throw new BlockNotFoundError({blockHash:Mn,blockNumber:rs});return(((mo=(fo=(io=Fn.chain)==null?void 0:io.formatters)==null?void 0:fo.block)==null?void 0:mo.format)||formatBlock)(hs)}async function getGasPrice(Fn){const Mn=await Fn.request({method:"eth_gasPrice"});return BigInt(Mn)}async function internal_estimateMaxPriorityFeePerGas(Fn,Mn){var as,us;const{block:rs,chain:is=Fn.chain,request:os}=Mn||{};try{const ds=((as=is==null?void 0:is.fees)==null?void 0:as.maxPriorityFeePerGas)??((us=is==null?void 0:is.fees)==null?void 0:us.defaultPriorityFee);if(typeof ds=="function"){const ps=rs||await getAction$1(Fn,getBlock,"getBlock")({}),io=await ds({block:ps,client:Fn,request:os});if(io===null)throw new Error;return io}if(typeof ds<"u")return ds;const hs=await Fn.request({method:"eth_maxPriorityFeePerGas"});return hexToBigInt(hs)}catch{const[ds,hs]=await Promise.all([rs?Promise.resolve(rs):getAction$1(Fn,getBlock,"getBlock")({}),getAction$1(Fn,getGasPrice,"getGasPrice")({})]);if(typeof ds.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError;const ps=hs-ds.baseFeePerGas;return ps<0n?0n:ps}}async function internal_estimateFeesPerGas(Fn,Mn){var mo,Ao;const{block:rs,chain:is=Fn.chain,request:os,type:as="eip1559"}=Mn||{},us=await(async()=>{var $o,Lo;return typeof(($o=is==null?void 0:is.fees)==null?void 0:$o.baseFeeMultiplier)=="function"?is.fees.baseFeeMultiplier({block:rs,client:Fn,request:os}):((Lo=is==null?void 0:is.fees)==null?void 0:Lo.baseFeeMultiplier)??1.2})();if(us<1)throw new BaseFeeScalarError;const hs=10**(((mo=us.toString().split(".")[1])==null?void 0:mo.length)??0),ps=$o=>$o*BigInt(Math.ceil(us*hs))/BigInt(hs),io=rs||await getAction$1(Fn,getBlock,"getBlock")({});if(typeof((Ao=is==null?void 0:is.fees)==null?void 0:Ao.estimateFeesPerGas)=="function"){const $o=await is.fees.estimateFeesPerGas({block:rs,client:Fn,multiply:ps,request:os,type:as});if($o!==null)return $o}if(as==="eip1559"){if(typeof io.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError;const $o=typeof(os==null?void 0:os.maxPriorityFeePerGas)=="bigint"?os.maxPriorityFeePerGas:await internal_estimateMaxPriorityFeePerGas(Fn,{block:io,chain:is,request:os}),Lo=ps(io.baseFeePerGas);return{maxFeePerGas:(os==null?void 0:os.maxFeePerGas)??Lo+$o,maxPriorityFeePerGas:$o}}return{gasPrice:(os==null?void 0:os.gasPrice)??ps(await getAction$1(Fn,getGasPrice,"getGasPrice")({}))}}class EstimateGasExecutionError extends BaseError$3{constructor(Mn,{account:rs,docsPath:is,chain:os,data:as,gas:us,gasPrice:ds,maxFeePerGas:hs,maxPriorityFeePerGas:ps,nonce:io,to:fo,value:mo}){var $o;const Ao=prettyPrint({from:rs==null?void 0:rs.address,to:fo,value:typeof mo<"u"&&`${formatEther(mo)} ${(($o=os==null?void 0:os.nativeCurrency)==null?void 0:$o.symbol)||"ETH"}`,data:as,gas:us,gasPrice:typeof ds<"u"&&`${formatGwei(ds)} gwei`,maxFeePerGas:typeof hs<"u"&&`${formatGwei(hs)} gwei`,maxPriorityFeePerGas:typeof ps<"u"&&`${formatGwei(ps)} gwei`,nonce:io});super(Mn.shortMessage,{cause:Mn,docsPath:is,metaMessages:[...Mn.metaMessages?[...Mn.metaMessages," "]:[],"Estimate Gas Arguments:",Ao].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=Mn}}function getEstimateGasError(Fn,{docsPath:Mn,...rs}){const is=(()=>{const os=getNodeError(Fn,rs);return os instanceof UnknownNodeError?Fn:os})();return new EstimateGasExecutionError(is,{docsPath:Mn,...rs})}class AccountStateConflictError extends BaseError$3{constructor({address:Mn}){super(`State for account "${Mn}" is set multiple times.`,{name:"AccountStateConflictError"})}}class StateAssignmentConflictError extends BaseError$3{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function prettyStateMapping(Fn){return Fn.reduce((Mn,{slot:rs,value:is})=>`${Mn}        ${rs}: ${is}
`,"")}function prettyStateOverride(Fn){return Fn.reduce((Mn,{address:rs,...is})=>{let os=`${Mn}    ${rs}:
`;return is.nonce&&(os+=`      nonce: ${is.nonce}
`),is.balance&&(os+=`      balance: ${is.balance}
`),is.code&&(os+=`      code: ${is.code}
`),is.state&&(os+=`      state:
`,os+=prettyStateMapping(is.state)),is.stateDiff&&(os+=`      stateDiff:
`,os+=prettyStateMapping(is.stateDiff)),os},`  State Override:
`).slice(0,-1)}function serializeStateMapping(Fn){if(!(!Fn||Fn.length===0))return Fn.reduce((Mn,{slot:rs,value:is})=>{if(rs.length!==66)throw new InvalidBytesLengthError({size:rs.length,targetSize:66,type:"hex"});if(is.length!==66)throw new InvalidBytesLengthError({size:is.length,targetSize:66,type:"hex"});return Mn[rs]=is,Mn},{})}function serializeAccountStateOverride(Fn){const{balance:Mn,nonce:rs,state:is,stateDiff:os,code:as}=Fn,us={};if(as!==void 0&&(us.code=as),Mn!==void 0&&(us.balance=numberToHex(Mn)),rs!==void 0&&(us.nonce=numberToHex(rs)),is!==void 0&&(us.state=serializeStateMapping(is)),os!==void 0){if(us.state)throw new StateAssignmentConflictError;us.stateDiff=serializeStateMapping(os)}return us}function serializeStateOverride(Fn){if(!Fn)return;const Mn={};for(const{address:rs,...is}of Fn){if(!isAddress(rs,{strict:!1}))throw new InvalidAddressError({address:rs});if(Mn[rs])throw new AccountStateConflictError({address:rs});Mn[rs]=serializeAccountStateOverride(is)}return Mn}async function getBalance$1(Fn,{address:Mn,blockNumber:rs,blockTag:is="latest"}){const os=rs?numberToHex(rs):void 0,as=await Fn.request({method:"eth_getBalance",params:[Mn,os||is]});return BigInt(as)}async function estimateGas$1(Fn,Mn){var os,as,us;const rs=Mn.account??Fn.account,is=rs?parseAccount(rs):void 0;try{let jo=function(Qo){const{block:El,request:Xo,rpcStateOverride:Al}=Qo;return Fn.request({method:"eth_estimateGas",params:Al?[Xo,El??"latest",Al]:El?[Xo,El]:[Xo]})};const{accessList:ds,authorizationList:hs,blobs:ps,blobVersionedHashes:io,blockNumber:fo,blockTag:mo,data:Ao,gas:$o,gasPrice:Lo,maxFeePerBlobGas:Go,maxFeePerGas:Yo,maxPriorityFeePerGas:Wo,nonce:Jo,value:xl,stateOverride:_l,...Tl}=await prepareTransactionRequest$1(Fn,{...Mn,parameters:(is==null?void 0:is.type)==="local"?void 0:["blobVersionedHashes"]}),$l=(fo?numberToHex(fo):void 0)||mo,Pl=serializeStateOverride(_l),Dl=await(async()=>{if(Tl.to)return Tl.to;if(hs&&hs.length>0)return await recoverAuthorizationAddress({authorization:hs[0]}).catch(()=>{throw new BaseError$3("`to` is required. Could not infer from `authorizationList`")})})();assertRequest(Mn);const Ol=(us=(as=(os=Fn.chain)==null?void 0:os.formatters)==null?void 0:as.transactionRequest)==null?void 0:us.format,Vo=(Ol||formatTransactionRequest)({...extract(Tl,{format:Ol}),from:is==null?void 0:is.address,accessList:ds,authorizationList:hs,blobs:ps,blobVersionedHashes:io,data:Ao,gas:$o,gasPrice:Lo,maxFeePerBlobGas:Go,maxFeePerGas:Yo,maxPriorityFeePerGas:Wo,nonce:Jo,to:Dl,value:xl});let Ho=BigInt(await jo({block:$l,request:Vo,rpcStateOverride:Pl}));if(hs){const Qo=await getBalance$1(Fn,{address:Vo.from}),El=await Promise.all(hs.map(async Xo=>{const{contractAddress:Al}=Xo,wl=await jo({block:$l,request:{authorizationList:void 0,data:Ao,from:is==null?void 0:is.address,to:Al,value:numberToHex(Qo)},rpcStateOverride:Pl}).catch(()=>100000n);return 2n*BigInt(wl)}));Ho+=El.reduce((Xo,Al)=>Xo+Al,0n)}return Ho}catch(ds){throw getEstimateGasError(ds,{...Mn,account:is,chain:Fn.chain})}}async function getTransactionCount(Fn,{address:Mn,blockTag:rs="latest",blockNumber:is}){const os=await Fn.request({method:"eth_getTransactionCount",params:[Mn,is?numberToHex(is):rs]},{dedupe:!!is});return hexToNumber(os)}function blobsToCommitments(Fn){const{kzg:Mn}=Fn,rs=Fn.to??(typeof Fn.blobs[0]=="string"?"hex":"bytes"),is=typeof Fn.blobs[0]=="string"?Fn.blobs.map(as=>hexToBytes(as)):Fn.blobs,os=[];for(const as of is)os.push(Uint8Array.from(Mn.blobToKzgCommitment(as)));return rs==="bytes"?os:os.map(as=>bytesToHex(as))}function blobsToProofs(Fn){const{kzg:Mn}=Fn,rs=Fn.to??(typeof Fn.blobs[0]=="string"?"hex":"bytes"),is=typeof Fn.blobs[0]=="string"?Fn.blobs.map(us=>hexToBytes(us)):Fn.blobs,os=typeof Fn.commitments[0]=="string"?Fn.commitments.map(us=>hexToBytes(us)):Fn.commitments,as=[];for(let us=0;us<is.length;us++){const ds=is[us],hs=os[us];as.push(Uint8Array.from(Mn.computeBlobKzgProof(ds,hs)))}return rs==="bytes"?as:as.map(us=>bytesToHex(us))}function setBigUint64(Fn,Mn,rs,is){if(typeof Fn.setBigUint64=="function")return Fn.setBigUint64(Mn,rs,is);const os=BigInt(32),as=BigInt(4294967295),us=Number(rs>>os&as),ds=Number(rs&as),hs=is?4:0,ps=is?0:4;Fn.setUint32(Mn+hs,us,is),Fn.setUint32(Mn+ps,ds,is)}const Chi=(Fn,Mn,rs)=>Fn&Mn^~Fn&rs,Maj=(Fn,Mn,rs)=>Fn&Mn^Fn&rs^Mn&rs;class HashMD extends Hash{constructor(Mn,rs,is,os){super(),this.blockLen=Mn,this.outputLen=rs,this.padOffset=is,this.isLE=os,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(Mn),this.view=createView(this.buffer)}update(Mn){exists(this);const{view:rs,buffer:is,blockLen:os}=this;Mn=toBytes(Mn);const as=Mn.length;for(let us=0;us<as;){const ds=Math.min(os-this.pos,as-us);if(ds===os){const hs=createView(Mn);for(;os<=as-us;us+=os)this.process(hs,us);continue}is.set(Mn.subarray(us,us+ds),this.pos),this.pos+=ds,us+=ds,this.pos===os&&(this.process(rs,0),this.pos=0)}return this.length+=Mn.length,this.roundClean(),this}digestInto(Mn){exists(this),output(Mn,this),this.finished=!0;const{buffer:rs,view:is,blockLen:os,isLE:as}=this;let{pos:us}=this;rs[us++]=128,this.buffer.subarray(us).fill(0),this.padOffset>os-us&&(this.process(is,0),us=0);for(let fo=us;fo<os;fo++)rs[fo]=0;setBigUint64(is,os-8,BigInt(this.length*8),as),this.process(is,0);const ds=createView(Mn),hs=this.outputLen;if(hs%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const ps=hs/4,io=this.get();if(ps>io.length)throw new Error("_sha2: outputLen bigger than state");for(let fo=0;fo<ps;fo++)ds.setUint32(4*fo,io[fo],as)}digest(){const{buffer:Mn,outputLen:rs}=this;this.digestInto(Mn);const is=Mn.slice(0,rs);return this.destroy(),is}_cloneInto(Mn){Mn||(Mn=new this.constructor),Mn.set(...this.get());const{blockLen:rs,buffer:is,length:os,finished:as,destroyed:us,pos:ds}=this;return Mn.length=os,Mn.pos=ds,Mn.finished=as,Mn.destroyed=us,os%rs&&Mn.buffer.set(is),Mn}}const SHA256_K=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]),SHA256_IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);let SHA256$2=class extends HashMD{constructor(){super(64,32,8,!1),this.A=SHA256_IV[0]|0,this.B=SHA256_IV[1]|0,this.C=SHA256_IV[2]|0,this.D=SHA256_IV[3]|0,this.E=SHA256_IV[4]|0,this.F=SHA256_IV[5]|0,this.G=SHA256_IV[6]|0,this.H=SHA256_IV[7]|0}get(){const{A:Mn,B:rs,C:is,D:os,E:as,F:us,G:ds,H:hs}=this;return[Mn,rs,is,os,as,us,ds,hs]}set(Mn,rs,is,os,as,us,ds,hs){this.A=Mn|0,this.B=rs|0,this.C=is|0,this.D=os|0,this.E=as|0,this.F=us|0,this.G=ds|0,this.H=hs|0}process(Mn,rs){for(let fo=0;fo<16;fo++,rs+=4)SHA256_W[fo]=Mn.getUint32(rs,!1);for(let fo=16;fo<64;fo++){const mo=SHA256_W[fo-15],Ao=SHA256_W[fo-2],$o=rotr(mo,7)^rotr(mo,18)^mo>>>3,Lo=rotr(Ao,17)^rotr(Ao,19)^Ao>>>10;SHA256_W[fo]=Lo+SHA256_W[fo-7]+$o+SHA256_W[fo-16]|0}let{A:is,B:os,C:as,D:us,E:ds,F:hs,G:ps,H:io}=this;for(let fo=0;fo<64;fo++){const mo=rotr(ds,6)^rotr(ds,11)^rotr(ds,25),Ao=io+mo+Chi(ds,hs,ps)+SHA256_K[fo]+SHA256_W[fo]|0,Lo=(rotr(is,2)^rotr(is,13)^rotr(is,22))+Maj(is,os,as)|0;io=ps,ps=hs,hs=ds,ds=us+Ao|0,us=as,as=os,os=is,is=Ao+Lo|0}is=is+this.A|0,os=os+this.B|0,as=as+this.C|0,us=us+this.D|0,ds=ds+this.E|0,hs=hs+this.F|0,ps=ps+this.G|0,io=io+this.H|0,this.set(is,os,as,us,ds,hs,ps,io)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const sha256$3=wrapConstructor(()=>new SHA256$2);function sha256$2(Fn,Mn){return sha256$3(isHex(Fn,{strict:!1})?toBytes$1(Fn):Fn)}function commitmentToVersionedHash(Fn){const{commitment:Mn,version:rs=1}=Fn,is=Fn.to??(typeof Mn=="string"?"hex":"bytes"),os=sha256$2(Mn);return os.set([rs],0),is==="bytes"?os:bytesToHex(os)}function commitmentsToVersionedHashes(Fn){const{commitments:Mn,version:rs}=Fn,is=Fn.to??(typeof Mn[0]=="string"?"hex":"bytes"),os=[];for(const as of Mn)os.push(commitmentToVersionedHash({commitment:as,to:is,version:rs}));return os}const blobsPerTransaction=6,bytesPerFieldElement=32,fieldElementsPerBlob=4096,bytesPerBlob=bytesPerFieldElement*fieldElementsPerBlob,maxBytesPerTransaction=bytesPerBlob*blobsPerTransaction-1-1*fieldElementsPerBlob*blobsPerTransaction;class BlobSizeTooLargeError extends BaseError$3{constructor({maxSize:Mn,size:rs}){super("Blob size is too large.",{metaMessages:[`Max: ${Mn} bytes`,`Given: ${rs} bytes`],name:"BlobSizeTooLargeError"})}}class EmptyBlobError extends BaseError$3{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function toBlobs(Fn){const Mn=Fn.to??(typeof Fn.data=="string"?"hex":"bytes"),rs=typeof Fn.data=="string"?hexToBytes(Fn.data):Fn.data,is=size$2(rs);if(!is)throw new EmptyBlobError;if(is>maxBytesPerTransaction)throw new BlobSizeTooLargeError({maxSize:maxBytesPerTransaction,size:is});const os=[];let as=!0,us=0;for(;as;){const ds=createCursor(new Uint8Array(bytesPerBlob));let hs=0;for(;hs<fieldElementsPerBlob;){const ps=rs.slice(us,us+(bytesPerFieldElement-1));if(ds.pushByte(0),ds.pushBytes(ps),ps.length<31){ds.pushByte(128),as=!1;break}hs++,us+=31}os.push(ds)}return Mn==="bytes"?os.map(ds=>ds.bytes):os.map(ds=>bytesToHex(ds.bytes))}function toBlobSidecars(Fn){const{data:Mn,kzg:rs,to:is}=Fn,os=Fn.blobs??toBlobs({data:Mn,to:is}),as=Fn.commitments??blobsToCommitments({blobs:os,kzg:rs,to:is}),us=Fn.proofs??blobsToProofs({blobs:os,commitments:as,kzg:rs,to:is}),ds=[];for(let hs=0;hs<os.length;hs++)ds.push({blob:os[hs],commitment:as[hs],proof:us[hs]});return ds}function getTransactionType(Fn){if(Fn.type)return Fn.type;if(typeof Fn.authorizationList<"u")return"eip7702";if(typeof Fn.blobs<"u"||typeof Fn.blobVersionedHashes<"u"||typeof Fn.maxFeePerBlobGas<"u"||typeof Fn.sidecars<"u")return"eip4844";if(typeof Fn.maxFeePerGas<"u"||typeof Fn.maxPriorityFeePerGas<"u")return"eip1559";if(typeof Fn.gasPrice<"u")return typeof Fn.accessList<"u"?"eip2930":"legacy";throw new InvalidSerializableTransactionError({transaction:Fn})}const defaultParameters=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function prepareTransactionRequest$1(Fn,Mn){const{account:rs=Fn.account,blobs:is,chain:os,gas:as,kzg:us,nonce:ds,nonceManager:hs,parameters:ps=defaultParameters,type:io}=Mn,fo=rs?parseAccount(rs):void 0,mo={...Mn,...fo?{from:fo==null?void 0:fo.address}:{}};let Ao;async function $o(){return Ao||(Ao=await getAction$1(Fn,getBlock,"getBlock")({blockTag:"latest"}),Ao)}let Lo;async function Go(){return Lo||(os?os.id:typeof Mn.chainId<"u"?Mn.chainId:(Lo=await getAction$1(Fn,getChainId,"getChainId")({}),Lo))}if((ps.includes("blobVersionedHashes")||ps.includes("sidecars"))&&is&&us){const Yo=blobsToCommitments({blobs:is,kzg:us});if(ps.includes("blobVersionedHashes")){const Wo=commitmentsToVersionedHashes({commitments:Yo,to:"hex"});mo.blobVersionedHashes=Wo}if(ps.includes("sidecars")){const Wo=blobsToProofs({blobs:is,commitments:Yo,kzg:us}),Jo=toBlobSidecars({blobs:is,commitments:Yo,proofs:Wo,to:"hex"});mo.sidecars=Jo}}if(ps.includes("chainId")&&(mo.chainId=await Go()),ps.includes("nonce")&&typeof ds>"u"&&fo)if(hs){const Yo=await Go();mo.nonce=await hs.consume({address:fo.address,chainId:Yo,client:Fn})}else mo.nonce=await getAction$1(Fn,getTransactionCount,"getTransactionCount")({address:fo.address,blockTag:"pending"});if((ps.includes("fees")||ps.includes("type"))&&typeof io>"u")try{mo.type=getTransactionType(mo)}catch{const Yo=await $o();mo.type=typeof(Yo==null?void 0:Yo.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(ps.includes("fees"))if(mo.type!=="legacy"&&mo.type!=="eip2930"){if(typeof mo.maxFeePerGas>"u"||typeof mo.maxPriorityFeePerGas>"u"){const Yo=await $o(),{maxFeePerGas:Wo,maxPriorityFeePerGas:Jo}=await internal_estimateFeesPerGas(Fn,{block:Yo,chain:os,request:mo});if(typeof Mn.maxPriorityFeePerGas>"u"&&Mn.maxFeePerGas&&Mn.maxFeePerGas<Jo)throw new MaxFeePerGasTooLowError({maxPriorityFeePerGas:Jo});mo.maxPriorityFeePerGas=Jo,mo.maxFeePerGas=Wo}}else{if(typeof Mn.maxFeePerGas<"u"||typeof Mn.maxPriorityFeePerGas<"u")throw new Eip1559FeesNotSupportedError;const Yo=await $o(),{gasPrice:Wo}=await internal_estimateFeesPerGas(Fn,{block:Yo,chain:os,request:mo,type:"legacy"});mo.gasPrice=Wo}return ps.includes("gas")&&typeof as>"u"&&(mo.gas=await getAction$1(Fn,estimateGas$1,"estimateGas")({...mo,account:fo?{address:fo.address,type:"json-rpc"}:void 0})),assertRequest(mo),delete mo.parameters,mo}async function sendRawTransaction(Fn,{serializedTransaction:Mn}){return Fn.request({method:"eth_sendRawTransaction",params:[Mn]},{retryCount:0})}async function sendTransaction$1(Fn,Mn){var Yo,Wo,Jo,xl;const{account:rs=Fn.account,chain:is=Fn.chain,accessList:os,authorizationList:as,blobs:us,data:ds,gas:hs,gasPrice:ps,maxFeePerBlobGas:io,maxFeePerGas:fo,maxPriorityFeePerGas:mo,nonce:Ao,value:$o,...Lo}=Mn;if(!rs)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const Go=parseAccount(rs);try{assertRequest(Mn);const _l=await(async()=>{if(Mn.to)return Mn.to;if(as&&as.length>0)return await recoverAuthorizationAddress({authorization:as[0]}).catch(()=>{throw new BaseError$3("`to` is required. Could not infer from `authorizationList`.")})})();if(Go.type==="json-rpc"){let Tl;is!==null&&(Tl=await getAction$1(Fn,getChainId,"getChainId")({}),assertCurrentChain({currentChainId:Tl,chain:is}));const Sl=(Jo=(Wo=(Yo=Fn.chain)==null?void 0:Yo.formatters)==null?void 0:Wo.transactionRequest)==null?void 0:Jo.format,Pl=(Sl||formatTransactionRequest)({...extract(Lo,{format:Sl}),accessList:os,authorizationList:as,blobs:us,chainId:Tl,data:ds,from:Go.address,gas:hs,gasPrice:ps,maxFeePerBlobGas:io,maxFeePerGas:fo,maxPriorityFeePerGas:mo,nonce:Ao,to:_l,value:$o});return await Fn.request({method:"eth_sendTransaction",params:[Pl]},{retryCount:0})}if(Go.type==="local"){const Tl=await getAction$1(Fn,prepareTransactionRequest$1,"prepareTransactionRequest")({account:Go,accessList:os,authorizationList:as,blobs:us,chain:is,data:ds,gas:hs,gasPrice:ps,maxFeePerBlobGas:io,maxFeePerGas:fo,maxPriorityFeePerGas:mo,nonce:Ao,nonceManager:Go.nonceManager,parameters:[...defaultParameters,"sidecars"],value:$o,...Lo,to:_l}),Sl=(xl=is==null?void 0:is.serializers)==null?void 0:xl.transaction,$l=await Go.signTransaction(Tl,{serializer:Sl});return await getAction$1(Fn,sendRawTransaction,"sendRawTransaction")({serializedTransaction:$l})}throw Go.type==="smart"?new AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:Go.type})}catch(_l){throw _l instanceof AccountTypeNotSupportedError?_l:getTransactionError(_l,{...Mn,account:Go,chain:Mn.chain||void 0})}}const multicall3Abi=[{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"}],universalResolverErrors=[{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"}],universalResolverResolveAbi=[...universalResolverErrors,{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"}]}],universalResolverReverseAbi=[...universalResolverErrors,{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"}]}],textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],addressResolverAbi=[{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"}]}];function bytesToBigInt(Fn,Mn={}){typeof Mn.size<"u"&&assertSize$1(Fn,{size:Mn.size});const rs=bytesToHex(Fn,Mn);return hexToBigInt(rs,Mn)}function bytesToBool(Fn,Mn={}){let rs=Fn;if(typeof Mn.size<"u"&&(assertSize$1(rs,{size:Mn.size}),rs=trim$1(rs)),rs.length>1||rs[0]>1)throw new InvalidBytesBooleanError(rs);return!!rs[0]}function bytesToNumber(Fn,Mn={}){typeof Mn.size<"u"&&assertSize$1(Fn,{size:Mn.size});const rs=bytesToHex(Fn,Mn);return hexToNumber(rs,Mn)}function bytesToString(Fn,Mn={}){let rs=Fn;return typeof Mn.size<"u"&&(assertSize$1(rs,{size:Mn.size}),rs=trim$1(rs,{dir:"right"})),new TextDecoder().decode(rs)}function decodeAbiParameters(Fn,Mn){const rs=typeof Mn=="string"?hexToBytes(Mn):Mn,is=createCursor(rs);if(size$2(rs)===0&&Fn.length>0)throw new AbiDecodingZeroDataError;if(size$2(Mn)&&size$2(Mn)<32)throw new AbiDecodingDataSizeTooSmallError({data:typeof Mn=="string"?Mn:bytesToHex(Mn),params:Fn,size:size$2(Mn)});let os=0;const as=[];for(let us=0;us<Fn.length;++us){const ds=Fn[us];is.setPosition(os);const[hs,ps]=decodeParameter(is,ds,{staticPosition:0});os+=ps,as.push(hs)}return as}function decodeParameter(Fn,Mn,{staticPosition:rs}){const is=getArrayComponents(Mn.type);if(is){const[os,as]=is;return decodeArray(Fn,{...Mn,type:as},{length:os,staticPosition:rs})}if(Mn.type==="tuple")return decodeTuple(Fn,Mn,{staticPosition:rs});if(Mn.type==="address")return decodeAddress(Fn);if(Mn.type==="bool")return decodeBool(Fn);if(Mn.type.startsWith("bytes"))return decodeBytes(Fn,Mn,{staticPosition:rs});if(Mn.type.startsWith("uint")||Mn.type.startsWith("int"))return decodeNumber(Fn,Mn);if(Mn.type==="string")return decodeString(Fn,{staticPosition:rs});throw new InvalidAbiDecodingTypeError(Mn.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const sizeOfLength=32,sizeOfOffset=32;function decodeAddress(Fn){const Mn=Fn.readBytes(32);return[checksumAddress(bytesToHex(sliceBytes(Mn,-20))),32]}function decodeArray(Fn,Mn,{length:rs,staticPosition:is}){if(!rs){const us=bytesToNumber(Fn.readBytes(sizeOfOffset)),ds=is+us,hs=ds+sizeOfLength;Fn.setPosition(ds);const ps=bytesToNumber(Fn.readBytes(sizeOfLength)),io=hasDynamicChild(Mn);let fo=0;const mo=[];for(let Ao=0;Ao<ps;++Ao){Fn.setPosition(hs+(io?Ao*32:fo));const[$o,Lo]=decodeParameter(Fn,Mn,{staticPosition:hs});fo+=Lo,mo.push($o)}return Fn.setPosition(is+32),[mo,32]}if(hasDynamicChild(Mn)){const us=bytesToNumber(Fn.readBytes(sizeOfOffset)),ds=is+us,hs=[];for(let ps=0;ps<rs;++ps){Fn.setPosition(ds+ps*32);const[io]=decodeParameter(Fn,Mn,{staticPosition:ds});hs.push(io)}return Fn.setPosition(is+32),[hs,32]}let os=0;const as=[];for(let us=0;us<rs;++us){const[ds,hs]=decodeParameter(Fn,Mn,{staticPosition:is+os});os+=hs,as.push(ds)}return[as,os]}function decodeBool(Fn){return[bytesToBool(Fn.readBytes(32),{size:32}),32]}function decodeBytes(Fn,Mn,{staticPosition:rs}){const[is,os]=Mn.type.split("bytes");if(!os){const us=bytesToNumber(Fn.readBytes(32));Fn.setPosition(rs+us);const ds=bytesToNumber(Fn.readBytes(32));if(ds===0)return Fn.setPosition(rs+32),["0x",32];const hs=Fn.readBytes(ds);return Fn.setPosition(rs+32),[bytesToHex(hs),32]}return[bytesToHex(Fn.readBytes(Number.parseInt(os),32)),32]}function decodeNumber(Fn,Mn){const rs=Mn.type.startsWith("int"),is=Number.parseInt(Mn.type.split("int")[1]||"256"),os=Fn.readBytes(32);return[is>48?bytesToBigInt(os,{signed:rs}):bytesToNumber(os,{signed:rs}),32]}function decodeTuple(Fn,Mn,{staticPosition:rs}){const is=Mn.components.length===0||Mn.components.some(({name:us})=>!us),os=is?[]:{};let as=0;if(hasDynamicChild(Mn)){const us=bytesToNumber(Fn.readBytes(sizeOfOffset)),ds=rs+us;for(let hs=0;hs<Mn.components.length;++hs){const ps=Mn.components[hs];Fn.setPosition(ds+as);const[io,fo]=decodeParameter(Fn,ps,{staticPosition:ds});as+=fo,os[is?hs:ps==null?void 0:ps.name]=io}return Fn.setPosition(rs+32),[os,32]}for(let us=0;us<Mn.components.length;++us){const ds=Mn.components[us],[hs,ps]=decodeParameter(Fn,ds,{staticPosition:rs});os[is?us:ds==null?void 0:ds.name]=hs,as+=ps}return[os,as]}function decodeString(Fn,{staticPosition:Mn}){const rs=bytesToNumber(Fn.readBytes(32)),is=Mn+rs;Fn.setPosition(is);const os=bytesToNumber(Fn.readBytes(32));if(os===0)return Fn.setPosition(Mn+32),["",32];const as=Fn.readBytes(os,32),us=bytesToString(trim$1(as));return Fn.setPosition(Mn+32),[us,32]}function hasDynamicChild(Fn){var is;const{type:Mn}=Fn;if(Mn==="string"||Mn==="bytes"||Mn.endsWith("[]"))return!0;if(Mn==="tuple")return(is=Fn.components)==null?void 0:is.some(hasDynamicChild);const rs=getArrayComponents(Fn.type);return!!(rs&&hasDynamicChild({...Fn,type:rs[1]}))}const hash$6=Fn=>keccak256$1(toBytes$1(Fn));function hashSignature(Fn){return hash$6(Fn)}const version$p="1.0.5";let BaseError$2=class Uw extends Error{constructor(Mn,rs={}){var us;const is=rs.cause instanceof Uw?rs.cause.details:(us=rs.cause)!=null&&us.message?rs.cause.message:rs.details,os=rs.cause instanceof Uw&&rs.cause.docsPath||rs.docsPath,as=[Mn||"An error occurred.","",...rs.metaMessages?[...rs.metaMessages,""]:[],...os?[`Docs: https://abitype.dev${os}`]:[],...is?[`Details: ${is}`]:[],`Version: abitype@${version$p}`].join(`
`);super(as),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"}),rs.cause&&(this.cause=rs.cause),this.details=is,this.docsPath=os,this.metaMessages=rs.metaMessages,this.shortMessage=Mn}};function execTyped(Fn,Mn){const rs=Fn.exec(Mn);return rs==null?void 0:rs.groups}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^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)?$/,isTupleRegex=/^\(.+?\).*?$/,tupleRegex=/^tuple(?<array>(\[(\d*)\])*)$/;function formatAbiParameter(Fn){let Mn=Fn.type;if(tupleRegex.test(Fn.type)&&"components"in Fn){Mn="(";const rs=Fn.components.length;for(let os=0;os<rs;os++){const as=Fn.components[os];Mn+=formatAbiParameter(as),os<rs-1&&(Mn+=", ")}const is=execTyped(tupleRegex,Fn.type);return Mn+=`)${(is==null?void 0:is.array)??""}`,formatAbiParameter({...Fn,type:Mn})}return"indexed"in Fn&&Fn.indexed&&(Mn=`${Mn} indexed`),Fn.name?`${Mn} ${Fn.name}`:Mn}function formatAbiParameters(Fn){let Mn="";const rs=Fn.length;for(let is=0;is<rs;is++){const os=Fn[is];Mn+=formatAbiParameter(os),is!==rs-1&&(Mn+=", ")}return Mn}function formatAbiItem(Fn){return Fn.type==="function"?`function ${Fn.name}(${formatAbiParameters(Fn.inputs)})${Fn.stateMutability&&Fn.stateMutability!=="nonpayable"?` ${Fn.stateMutability}`:""}${Fn.outputs.length?` returns (${formatAbiParameters(Fn.outputs)})`:""}`:Fn.type==="event"?`event ${Fn.name}(${formatAbiParameters(Fn.inputs)})`:Fn.type==="error"?`error ${Fn.name}(${formatAbiParameters(Fn.inputs)})`:Fn.type==="constructor"?`constructor(${formatAbiParameters(Fn.inputs)})${Fn.stateMutability==="payable"?" payable":""}`:Fn.type==="fallback"?"fallback()":"receive() external payable"}const errorSignatureRegex=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function isErrorSignature(Fn){return errorSignatureRegex.test(Fn)}function execErrorSignature(Fn){return execTyped(errorSignatureRegex,Fn)}const eventSignatureRegex=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function isEventSignature(Fn){return eventSignatureRegex.test(Fn)}function execEventSignature(Fn){return execTyped(eventSignatureRegex,Fn)}const functionSignatureRegex=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function isFunctionSignature(Fn){return functionSignatureRegex.test(Fn)}function execFunctionSignature(Fn){return execTyped(functionSignatureRegex,Fn)}const structSignatureRegex=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function isStructSignature(Fn){return structSignatureRegex.test(Fn)}function execStructSignature(Fn){return execTyped(structSignatureRegex,Fn)}const constructorSignatureRegex=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function isConstructorSignature(Fn){return constructorSignatureRegex.test(Fn)}function execConstructorSignature(Fn){return execTyped(constructorSignatureRegex,Fn)}const fallbackSignatureRegex=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function isFallbackSignature(Fn){return fallbackSignatureRegex.test(Fn)}const receiveSignatureRegex=/^receive\(\) external payable$/;function isReceiveSignature(Fn){return receiveSignatureRegex.test(Fn)}const eventModifiers=new Set(["indexed"]),functionModifiers=new Set(["calldata","memory","storage"]);class UnknownTypeError extends BaseError$2{constructor({type:Mn}){super("Unknown type.",{metaMessages:[`Type "${Mn}" 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 UnknownSolidityTypeError extends BaseError$2{constructor({type:Mn}){super("Unknown type.",{metaMessages:[`Type "${Mn}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class InvalidParameterError extends BaseError$2{constructor({param:Mn}){super("Invalid ABI parameter.",{details:Mn}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class SolidityProtectedKeywordError extends BaseError$2{constructor({param:Mn,name:rs}){super("Invalid ABI parameter.",{details:Mn,metaMessages:[`"${rs}" 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 InvalidModifierError extends BaseError$2{constructor({param:Mn,type:rs,modifier:is}){super("Invalid ABI parameter.",{details:Mn,metaMessages:[`Modifier "${is}" not allowed${rs?` in "${rs}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class InvalidFunctionModifierError extends BaseError$2{constructor({param:Mn,type:rs,modifier:is}){super("Invalid ABI parameter.",{details:Mn,metaMessages:[`Modifier "${is}" not allowed${rs?` in "${rs}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${is}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class InvalidAbiTypeParameterError extends BaseError$2{constructor({abiParameter:Mn}){super("Invalid ABI parameter.",{details:JSON.stringify(Mn,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class InvalidSignatureError extends BaseError$2{constructor({signature:Mn,type:rs}){super(`Invalid ${rs} signature.`,{details:Mn}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class UnknownSignatureError extends BaseError$2{constructor({signature:Mn}){super("Unknown signature.",{details:Mn}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class InvalidStructSignatureError extends BaseError$2{constructor({signature:Mn}){super("Invalid struct signature.",{details:Mn,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class CircularReferenceError extends BaseError$2{constructor({type:Mn}){super("Circular reference detected.",{metaMessages:[`Struct "${Mn}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class InvalidParenthesisError extends BaseError$2{constructor({current:Mn,depth:rs}){super("Unbalanced parentheses.",{metaMessages:[`"${Mn.trim()}" has too many ${rs>0?"opening":"closing"} parentheses.`],details:`Depth "${rs}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function getParameterCacheKey(Fn,Mn){return Mn?`${Mn}:${Fn}`:Fn}const parameterCache=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 parseSignature(Fn,Mn={}){if(isFunctionSignature(Fn)){const rs=execFunctionSignature(Fn);if(!rs)throw new InvalidSignatureError({signature:Fn,type:"function"});const is=splitParameters(rs.parameters),os=[],as=is.length;for(let ds=0;ds<as;ds++)os.push(parseAbiParameter(is[ds],{modifiers:functionModifiers,structs:Mn,type:"function"}));const us=[];if(rs.returns){const ds=splitParameters(rs.returns),hs=ds.length;for(let ps=0;ps<hs;ps++)us.push(parseAbiParameter(ds[ps],{modifiers:functionModifiers,structs:Mn,type:"function"}))}return{name:rs.name,type:"function",stateMutability:rs.stateMutability??"nonpayable",inputs:os,outputs:us}}if(isEventSignature(Fn)){const rs=execEventSignature(Fn);if(!rs)throw new InvalidSignatureError({signature:Fn,type:"event"});const is=splitParameters(rs.parameters),os=[],as=is.length;for(let us=0;us<as;us++)os.push(parseAbiParameter(is[us],{modifiers:eventModifiers,structs:Mn,type:"event"}));return{name:rs.name,type:"event",inputs:os}}if(isErrorSignature(Fn)){const rs=execErrorSignature(Fn);if(!rs)throw new InvalidSignatureError({signature:Fn,type:"error"});const is=splitParameters(rs.parameters),os=[],as=is.length;for(let us=0;us<as;us++)os.push(parseAbiParameter(is[us],{structs:Mn,type:"error"}));return{name:rs.name,type:"error",inputs:os}}if(isConstructorSignature(Fn)){const rs=execConstructorSignature(Fn);if(!rs)throw new InvalidSignatureError({signature:Fn,type:"constructor"});const is=splitParameters(rs.parameters),os=[],as=is.length;for(let us=0;us<as;us++)os.push(parseAbiParameter(is[us],{structs:Mn,type:"constructor"}));return{type:"constructor",stateMutability:rs.stateMutability??"nonpayable",inputs:os}}if(isFallbackSignature(Fn))return{type:"fallback"};if(isReceiveSignature(Fn))return{type:"receive",stateMutability:"payable"};throw new UnknownSignatureError({signature:Fn})}const abiParameterWithoutTupleRegex=/^(?<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$_]*))?$/,abiParameterWithTupleRegex=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,dynamicIntegerRegex=/^u?int$/;function parseAbiParameter(Fn,Mn){var fo,mo;const rs=getParameterCacheKey(Fn,Mn==null?void 0:Mn.type);if(parameterCache.has(rs))return parameterCache.get(rs);const is=isTupleRegex.test(Fn),os=execTyped(is?abiParameterWithTupleRegex:abiParameterWithoutTupleRegex,Fn);if(!os)throw new InvalidParameterError({param:Fn});if(os.name&&isSolidityKeyword(os.name))throw new SolidityProtectedKeywordError({param:Fn,name:os.name});const as=os.name?{name:os.name}:{},us=os.modifier==="indexed"?{indexed:!0}:{},ds=(Mn==null?void 0:Mn.structs)??{};let hs,ps={};if(is){hs="tuple";const Ao=splitParameters(os.type),$o=[],Lo=Ao.length;for(let Go=0;Go<Lo;Go++)$o.push(parseAbiParameter(Ao[Go],{structs:ds}));ps={components:$o}}else if(os.type in ds)hs="tuple",ps={components:ds[os.type]};else if(dynamicIntegerRegex.test(os.type))hs=`${os.type}256`;else if(hs=os.type,(Mn==null?void 0:Mn.type)!=="struct"&&!isSolidityType(hs))throw new UnknownSolidityTypeError({type:hs});if(os.modifier){if(!((mo=(fo=Mn==null?void 0:Mn.modifiers)==null?void 0:fo.has)!=null&&mo.call(fo,os.modifier)))throw new InvalidModifierError({param:Fn,type:Mn==null?void 0:Mn.type,modifier:os.modifier});if(functionModifiers.has(os.modifier)&&!isValidDataLocation(hs,!!os.array))throw new InvalidFunctionModifierError({param:Fn,type:Mn==null?void 0:Mn.type,modifier:os.modifier})}const io={type:`${hs}${os.array??""}`,...as,...us,...ps};return parameterCache.set(rs,io),io}function splitParameters(Fn,Mn=[],rs="",is=0){const os=Fn.trim().length;for(let as=0;as<os;as++){const us=Fn[as],ds=Fn.slice(as+1);switch(us){case",":return is===0?splitParameters(ds,[...Mn,rs.trim()]):splitParameters(ds,Mn,`${rs}${us}`,is);case"(":return splitParameters(ds,Mn,`${rs}${us}`,is+1);case")":return splitParameters(ds,Mn,`${rs}${us}`,is-1);default:return splitParameters(ds,Mn,`${rs}${us}`,is)}}if(rs==="")return Mn;if(is!==0)throw new InvalidParenthesisError({current:rs,depth:is});return Mn.push(rs.trim()),Mn}function isSolidityType(Fn){return Fn==="address"||Fn==="bool"||Fn==="function"||Fn==="string"||bytesRegex.test(Fn)||integerRegex.test(Fn)}const protectedKeywordsRegex=/^(?: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 isSolidityKeyword(Fn){return Fn==="address"||Fn==="bool"||Fn==="function"||Fn==="string"||Fn==="tuple"||bytesRegex.test(Fn)||integerRegex.test(Fn)||protectedKeywordsRegex.test(Fn)}function isValidDataLocation(Fn,Mn){return Mn||Fn==="bytes"||Fn==="string"||Fn==="tuple"}function parseStructs(Fn){const Mn={},rs=Fn.length;for(let us=0;us<rs;us++){const ds=Fn[us];if(!isStructSignature(ds))continue;const hs=execStructSignature(ds);if(!hs)throw new InvalidSignatureError({signature:ds,type:"struct"});const ps=hs.properties.split(";"),io=[],fo=ps.length;for(let mo=0;mo<fo;mo++){const $o=ps[mo].trim();if(!$o)continue;const Lo=parseAbiParameter($o,{type:"struct"});io.push(Lo)}if(!io.length)throw new InvalidStructSignatureError({signature:ds});Mn[hs.name]=io}const is={},os=Object.entries(Mn),as=os.length;for(let us=0;us<as;us++){const[ds,hs]=os[us];is[ds]=resolveStructs(hs,Mn)}return is}const typeWithoutTupleRegex=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function resolveStructs(Fn,Mn,rs=new Set){const is=[],os=Fn.length;for(let as=0;as<os;as++){const us=Fn[as];if(isTupleRegex.test(us.type))is.push(us);else{const hs=execTyped(typeWithoutTupleRegex,us.type);if(!(hs!=null&&hs.type))throw new InvalidAbiTypeParameterError({abiParameter:us});const{array:ps,type:io}=hs;if(io in Mn){if(rs.has(io))throw new CircularReferenceError({type:io});is.push({...us,type:`tuple${ps??""}`,components:resolveStructs(Mn[io]??[],Mn,new Set([...rs,io]))})}else if(isSolidityType(io))is.push(us);else throw new UnknownTypeError({type:io})}}return is}function parseAbi(Fn){const Mn=parseStructs(Fn),rs=[],is=Fn.length;for(let os=0;os<is;os++){const as=Fn[os];isStructSignature(as)||rs.push(parseSignature(as,Mn))}return rs}function normalizeSignature(Fn){let Mn=!0,rs="",is=0,os="",as=!1;for(let us=0;us<Fn.length;us++){const ds=Fn[us];if(["(",")",","].includes(ds)&&(Mn=!0),ds==="("&&is++,ds===")"&&is--,!!Mn){if(is===0){if(ds===" "&&["event","function",""].includes(os))os="";else if(os+=ds,ds===")"){as=!0;break}continue}if(ds===" "){Fn[us-1]!==","&&rs!==","&&rs!==",("&&(rs="",Mn=!1);continue}os+=ds,rs+=ds}}if(!as)throw new BaseError$3("Unable to normalize signature.");return os}const toSignature=Fn=>{const Mn=typeof Fn=="string"?Fn:formatAbiItem(Fn);return normalizeSignature(Mn)};function toSignatureHash(Fn){return hashSignature(toSignature(Fn))}const toEventSelector=toSignatureHash,toFunctionSelector=Fn=>slice(toSignatureHash(Fn),0,4);function getAbiItem(Fn){const{abi:Mn,args:rs=[],name:is}=Fn,os=isHex(is,{strict:!1}),as=Mn.filter(ds=>os?ds.type==="function"?toFunctionSelector(ds)===is:ds.type==="event"?toEventSelector(ds)===is:!1:"name"in ds&&ds.name===is);if(as.length===0)return;if(as.length===1)return as[0];let us;for(const ds of as){if(!("inputs"in ds))continue;if(!rs||rs.length===0){if(!ds.inputs||ds.inputs.length===0)return ds;continue}if(!ds.inputs||ds.inputs.length===0||ds.inputs.length!==rs.length)continue;if(rs.every((ps,io)=>{const fo="inputs"in ds&&ds.inputs[io];return fo?isArgOfType(ps,fo):!1})){if(us&&"inputs"in us&&us.inputs){const ps=getAmbiguousTypes(ds.inputs,us.inputs,rs);if(ps)throw new AbiItemAmbiguityError({abiItem:ds,type:ps[0]},{abiItem:us,type:ps[1]})}us=ds}}return us||as[0]}function isArgOfType(Fn,Mn){const rs=typeof Fn,is=Mn.type;switch(is){case"address":return isAddress(Fn,{strict:!1});case"bool":return rs==="boolean";case"function":return rs==="string";case"string":return rs==="string";default:return is==="tuple"&&"components"in Mn?Object.values(Mn.components).every((os,as)=>isArgOfType(Object.values(Fn)[as],os)):/^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(is)?rs==="number"||rs==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(is)?rs==="string"||Fn instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(is)?Array.isArray(Fn)&&Fn.every(os=>isArgOfType(os,{...Mn,type:is.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function getAmbiguousTypes(Fn,Mn,rs){for(const is in Fn){const os=Fn[is],as=Mn[is];if(os.type==="tuple"&&as.type==="tuple"&&"components"in os&&"components"in as)return getAmbiguousTypes(os.components,as.components,rs[is]);const us=[os.type,as.type];if(us.includes("address")&&us.includes("bytes20")?!0:us.includes("address")&&us.includes("string")?isAddress(rs[is],{strict:!1}):us.includes("address")&&us.includes("bytes")?isAddress(rs[is],{strict:!1}):!1)return us}}const docsPath$1="/docs/contract/decodeFunctionResult";function decodeFunctionResult(Fn){const{abi:Mn,args:rs,functionName:is,data:os}=Fn;let as=Mn[0];if(is){const ds=getAbiItem({abi:Mn,args:rs,name:is});if(!ds)throw new AbiFunctionNotFoundError(is,{docsPath:docsPath$1});as=ds}if(as.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$1});if(!as.outputs)throw new AbiFunctionOutputsNotFoundError(as.name,{docsPath:docsPath$1});const us=decodeAbiParameters(as.outputs,os);if(us&&us.length>1)return us;if(us&&us.length===1)return us[0]}const docsPath="/docs/contract/encodeFunctionData";function prepareEncodeFunctionData(Fn){const{abi:Mn,args:rs,functionName:is}=Fn;let os=Mn[0];if(is){const as=getAbiItem({abi:Mn,args:rs,name:is});if(!as)throw new AbiFunctionNotFoundError(is,{docsPath});os=as}if(os.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath});return{abi:[os],functionName:toFunctionSelector(formatAbiItem$1(os))}}function encodeFunctionData(Fn){const{args:Mn}=Fn,{abi:rs,functionName:is}=(()=>{var ds;return Fn.abi.length===1&&((ds=Fn.functionName)!=null&&ds.startsWith("0x"))?Fn:prepareEncodeFunctionData(Fn)})(),os=rs[0],as=is,us="inputs"in os&&os.inputs?encodeAbiParameters(os.inputs,Mn??[]):void 0;return concatHex([as,us??"0x"])}function getChainContractAddress({blockNumber:Fn,chain:Mn,contract:rs}){var os;const is=(os=Mn==null?void 0:Mn.contracts)==null?void 0:os[rs];if(!is)throw new ChainDoesNotSupportContract({chain:Mn,contract:{name:rs}});if(Fn&&is.blockCreated&&is.blockCreated>Fn)throw new ChainDoesNotSupportContract({blockNumber:Fn,chain:Mn,contract:{name:rs,blockCreated:is.blockCreated}});return is.address}const panicReasons={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."},solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function decodeErrorResult(Fn){const{abi:Mn,data:rs}=Fn,is=slice(rs,0,4);if(is==="0x")throw new AbiDecodingZeroDataError;const as=[...Mn||[],solidityError,solidityPanic].find(us=>us.type==="error"&&is===toFunctionSelector(formatAbiItem$1(us)));if(!as)throw new AbiErrorSignatureNotFoundError(is,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:as,args:"inputs"in as&&as.inputs&&as.inputs.length>0?decodeAbiParameters(as.inputs,slice(rs,4)):void 0,errorName:as.name}}function formatAbiItemWithArgs({abiItem:Fn,args:Mn,includeFunctionName:rs=!0,includeName:is=!1}){if("name"in Fn&&"inputs"in Fn&&Fn.inputs)return`${rs?Fn.name:""}(${Fn.inputs.map((os,as)=>`${is&&os.name?`${os.name}: `:""}${typeof Mn[as]=="object"?stringify$1(Mn[as]):Mn[as]}`).join(", ")})`}class CallExecutionError extends BaseError$3{constructor(Mn,{account:rs,docsPath:is,chain:os,data:as,gas:us,gasPrice:ds,maxFeePerGas:hs,maxPriorityFeePerGas:ps,nonce:io,to:fo,value:mo,stateOverride:Ao}){var Go;const $o=rs?parseAccount(rs):void 0;let Lo=prettyPrint({from:$o==null?void 0:$o.address,to:fo,value:typeof mo<"u"&&`${formatEther(mo)} ${((Go=os==null?void 0:os.nativeCurrency)==null?void 0:Go.symbol)||"ETH"}`,data:as,gas:us,gasPrice:typeof ds<"u"&&`${formatGwei(ds)} gwei`,maxFeePerGas:typeof hs<"u"&&`${formatGwei(hs)} gwei`,maxPriorityFeePerGas:typeof ps<"u"&&`${formatGwei(ps)} gwei`,nonce:io});Ao&&(Lo+=`
${prettyStateOverride(Ao)}`),super(Mn.shortMessage,{cause:Mn,docsPath:is,metaMessages:[...Mn.metaMessages?[...Mn.metaMessages," "]:[],"Raw Call Arguments:",Lo].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=Mn}}class ContractFunctionExecutionError extends BaseError$3{constructor(Mn,{abi:rs,args:is,contractAddress:os,docsPath:as,functionName:us,sender:ds}){const hs=getAbiItem({abi:rs,args:is,name:us}),ps=hs?formatAbiItemWithArgs({abiItem:hs,args:is,includeFunctionName:!1,includeName:!1}):void 0,io=hs?formatAbiItem$1(hs,{includeName:!0}):void 0,fo=prettyPrint({address:os&&getContractAddress$1(os),function:io,args:ps&&ps!=="()"&&`${[...Array((us==null?void 0:us.length)??0).keys()].map(()=>" ").join("")}${ps}`,sender:ds});super(Mn.shortMessage||`An unknown error occurred while executing the contract function "${us}".`,{cause:Mn,docsPath:as,metaMessages:[...Mn.metaMessages?[...Mn.metaMessages," "]:[],fo&&"Contract Call:",fo].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=rs,this.args=is,this.cause=Mn,this.contractAddress=os,this.functionName=us,this.sender=ds}}class ContractFunctionRevertedError extends BaseError$3{constructor({abi:Mn,data:rs,functionName:is,message:os}){let as,us,ds,hs;if(rs&&rs!=="0x")try{us=decodeErrorResult({abi:Mn,data:rs});const{abiItem:io,errorName:fo,args:mo}=us;if(fo==="Error")hs=mo[0];else if(fo==="Panic"){const[Ao]=mo;hs=panicReasons[Ao]}else{const Ao=io?formatAbiItem$1(io,{includeName:!0}):void 0,$o=io&&mo?formatAbiItemWithArgs({abiItem:io,args:mo,includeFunctionName:!1,includeName:!1}):void 0;ds=[Ao?`Error: ${Ao}`:"",$o&&$o!=="()"?`       ${[...Array((fo==null?void 0:fo.length)??0).keys()].map(()=>" ").join("")}${$o}`:""]}}catch(io){as=io}else os&&(hs=os);let ps;as instanceof AbiErrorSignatureNotFoundError&&(ps=as.signature,ds=[`Unable to decode signature "${ps}" 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=${ps}.`]),super(hs&&hs!=="execution reverted"||ps?[`The contract function "${is}" reverted with the following ${ps?"signature":"reason"}:`,hs||ps].join(`
`):`The contract function "${is}" reverted.`,{cause:as,metaMessages:ds,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{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=us,this.reason=hs,this.signature=ps}}class ContractFunctionZeroDataError extends BaseError$3{constructor({functionName:Mn}){super(`The contract function "${Mn}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${Mn}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class CounterfactualDeploymentFailedError extends BaseError$3{constructor({factory:Mn}){super(`Deployment for counterfactual contract call failed${Mn?` for factory "${Mn}".`:""}`,{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 RawContractError extends BaseError$3{constructor({data:Mn,message:rs}){super(rs||"",{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=Mn}}function isNullUniversalResolverError(Fn,Mn){var is,os,as,us,ds,hs;if(!(Fn instanceof BaseError$3))return!1;const rs=Fn.walk(ps=>ps instanceof ContractFunctionRevertedError);return rs instanceof ContractFunctionRevertedError?!!(((is=rs.data)==null?void 0:is.errorName)==="ResolverNotFound"||((os=rs.data)==null?void 0:os.errorName)==="ResolverWildcardNotSupported"||((as=rs.data)==null?void 0:as.errorName)==="ResolverNotContract"||((us=rs.data)==null?void 0:us.errorName)==="ResolverError"||((ds=rs.data)==null?void 0:ds.errorName)==="HttpError"||(hs=rs.reason)!=null&&hs.includes("Wildcard on non-extended resolvers is not supported")||Mn==="reverse"&&rs.reason===panicReasons[50]):!1}function encodedLabelToLabelhash(Fn){if(Fn.length!==66||Fn.indexOf("[")!==0||Fn.indexOf("]")!==65)return null;const Mn=`0x${Fn.slice(1,65)}`;return isHex(Mn)?Mn:null}function namehash$1(Fn){let Mn=new Uint8Array(32).fill(0);if(!Fn)return bytesToHex(Mn);const rs=Fn.split(".");for(let is=rs.length-1;is>=0;is-=1){const os=encodedLabelToLabelhash(rs[is]),as=os?toBytes$1(os):keccak256$1(stringToBytes(rs[is]),"bytes");Mn=keccak256$1(concat$3([Mn,as]),"bytes")}return bytesToHex(Mn)}function encodeLabelhash(Fn){return`[${Fn.slice(2)}]`}function labelhash(Fn){const Mn=new Uint8Array(32).fill(0);return Fn?encodedLabelToLabelhash(Fn)||keccak256$1(stringToBytes(Fn)):bytesToHex(Mn)}function packetToBytes(Fn){const Mn=Fn.replace(/^\.|\.$/gm,"");if(Mn.length===0)return new Uint8Array(1);const rs=new Uint8Array(stringToBytes(Mn).byteLength+2);let is=0;const os=Mn.split(".");for(let as=0;as<os.length;as++){let us=stringToBytes(os[as]);us.byteLength>255&&(us=stringToBytes(encodeLabelhash(labelhash(os[as])))),rs[is]=us.length,rs.set(us,is+1),is+=us.length+1}return rs.byteLength!==is+1?rs.slice(0,is+1):rs}const EXECUTION_REVERTED_ERROR_CODE=3;function getContractError(Fn,{abi:Mn,address:rs,args:is,docsPath:os,functionName:as,sender:us}){const{code:ds,data:hs,message:ps,shortMessage:io}=Fn instanceof RawContractError?Fn:Fn instanceof BaseError$3?Fn.walk(mo=>"data"in mo)||Fn.walk():{},fo=Fn instanceof AbiDecodingZeroDataError?new ContractFunctionZeroDataError({functionName:as}):[EXECUTION_REVERTED_ERROR_CODE,InternalRpcError.code].includes(ds)&&(hs||ps||io)?new ContractFunctionRevertedError({abi:Mn,data:typeof hs=="object"?hs.data:hs,functionName:as,message:io??ps}):Fn;return new ContractFunctionExecutionError(fo,{abi:Mn,args:is,contractAddress:rs,docsPath:os,functionName:as,sender:us})}const aggregate3Signature="0x82ad56cb",deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";function getCallError(Fn,{docsPath:Mn,...rs}){const is=(()=>{const os=getNodeError(Fn,rs);return os instanceof UnknownNodeError?Fn:os})();return new CallExecutionError(is,{docsPath:Mn,...rs})}const schedulerCache=new Map;function createBatchScheduler({fn:Fn,id:Mn,shouldSplitBatch:rs,wait:is=0,sort:os}){const as=async()=>{const io=hs();us();const fo=io.map(({args:mo})=>mo);fo.length!==0&&Fn(fo).then(mo=>{var Ao;os&&Array.isArray(mo)&&mo.sort(os);for(let $o=0;$o<io.length;$o++){const{pendingPromise:Lo}=io[$o];(Ao=Lo.resolve)==null||Ao.call(Lo,[mo[$o],mo])}}).catch(mo=>{var Ao;for(let $o=0;$o<io.length;$o++){const{pendingPromise:Lo}=io[$o];(Ao=Lo.reject)==null||Ao.call(Lo,mo)}})},us=()=>schedulerCache.delete(Mn),ds=()=>hs().map(({args:io})=>io),hs=()=>schedulerCache.get(Mn)||[],ps=io=>schedulerCache.set(Mn,[...hs(),io]);return{flush:us,async schedule(io){const fo={},mo=new Promise((Lo,Go)=>{fo.resolve=Lo,fo.reject=Go});return(rs==null?void 0:rs([...ds(),io]))&&as(),hs().length>0?(ps({args:io,pendingPromise:fo}),mo):(ps({args:io,pendingPromise:fo}),setTimeout(as,is),mo)}}}async function call(Fn,Mn){var Ol,Rl,Vo,jo;const{account:rs=Fn.account,batch:is=!!((Ol=Fn.batch)!=null&&Ol.multicall),blockNumber:os,blockTag:as="latest",accessList:us,blobs:ds,code:hs,data:ps,factory:io,factoryData:fo,gas:mo,gasPrice:Ao,maxFeePerBlobGas:$o,maxFeePerGas:Lo,maxPriorityFeePerGas:Go,nonce:Yo,to:Wo,value:Jo,stateOverride:xl,..._l}=Mn,Tl=rs?parseAccount(rs):void 0;if(hs&&(io||fo))throw new BaseError$3("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(hs&&Wo)throw new BaseError$3("Cannot provide both `code` & `to` as parameters.");const Sl=hs&&ps,$l=io&&fo&&Wo&&ps,Pl=Sl||$l,Dl=Sl?toDeploylessCallViaBytecodeData({code:hs,data:ps}):$l?toDeploylessCallViaFactoryData({data:ps,factory:io,factoryData:fo,to:Wo}):ps;try{assertRequest(Mn);const Qo=(os?numberToHex(os):void 0)||as,El=serializeStateOverride(xl),Xo=(jo=(Vo=(Rl=Fn.chain)==null?void 0:Rl.formatters)==null?void 0:Vo.transactionRequest)==null?void 0:jo.format,wl=(Xo||formatTransactionRequest)({...extract(_l,{format:Xo}),from:Tl==null?void 0:Tl.address,accessList:us,blobs:ds,data:Dl,gas:mo,gasPrice:Ao,maxFeePerBlobGas:$o,maxFeePerGas:Lo,maxPriorityFeePerGas:Go,nonce:Yo,to:Pl?void 0:Wo,value:Jo});if(is&&shouldPerformMulticall({request:wl})&&!El)try{return await scheduleMulticall(Fn,{...wl,blockNumber:os,blockTag:as})}catch(Il){if(!(Il instanceof ClientChainNotConfiguredError)&&!(Il instanceof ChainDoesNotSupportContract))throw Il}const yl=await Fn.request({method:"eth_call",params:El?[wl,Qo,El]:[wl,Qo]});return yl==="0x"?{data:void 0}:{data:yl}}catch(Ho){const Qo=getRevertErrorData(Ho),{offchainLookup:El,offchainLookupSignature:Xo}=await __vitePreload(async()=>{const{offchainLookup:Al,offchainLookupSignature:wl}=await import("./ccip-arQEDsDX.js");return{offchainLookup:Al,offchainLookupSignature:wl}},[]);if(Fn.ccipRead!==!1&&(Qo==null?void 0:Qo.slice(0,10))===Xo&&Wo)return{data:await El(Fn,{data:Qo,to:Wo})};throw Pl&&(Qo==null?void 0:Qo.slice(0,10))==="0x101bb98d"?new CounterfactualDeploymentFailedError({factory:io}):getCallError(Ho,{...Mn,account:Tl,chain:Fn.chain})}}function shouldPerformMulticall({request:Fn}){const{data:Mn,to:rs,...is}=Fn;return!(!Mn||Mn.startsWith(aggregate3Signature)||!rs||Object.values(is).filter(os=>typeof os<"u").length>0)}async function scheduleMulticall(Fn,Mn){var Lo;const{batchSize:rs=1024,wait:is=0}=typeof((Lo=Fn.batch)==null?void 0:Lo.multicall)=="object"?Fn.batch.multicall:{},{blockNumber:os,blockTag:as="latest",data:us,multicallAddress:ds,to:hs}=Mn;let ps=ds;if(!ps){if(!Fn.chain)throw new ClientChainNotConfiguredError;ps=getChainContractAddress({blockNumber:os,chain:Fn.chain,contract:"multicall3"})}const fo=(os?numberToHex(os):void 0)||as,{schedule:mo}=createBatchScheduler({id:`${Fn.uid}.${fo}`,wait:is,shouldSplitBatch(Go){return Go.reduce((Wo,{data:Jo})=>Wo+(Jo.length-2),0)>rs*2},fn:async Go=>{const Yo=Go.map(xl=>({allowFailure:!0,callData:xl.data,target:xl.to})),Wo=encodeFunctionData({abi:multicall3Abi,args:[Yo],functionName:"aggregate3"}),Jo=await Fn.request({method:"eth_call",params:[{data:Wo,to:ps},fo]});return decodeFunctionResult({abi:multicall3Abi,args:[Yo],functionName:"aggregate3",data:Jo||"0x"})}}),[{returnData:Ao,success:$o}]=await mo({data:us,to:hs});if(!$o)throw new RawContractError({data:Ao});return Ao==="0x"?{data:void 0}:{data:Ao}}function toDeploylessCallViaBytecodeData(Fn){const{code:Mn,data:rs}=Fn;return encodeDeployData({abi:parseAbi(["constructor(bytes, bytes)"]),bytecode:deploylessCallViaBytecodeBytecode,args:[Mn,rs]})}function toDeploylessCallViaFactoryData(Fn){const{data:Mn,factory:rs,factoryData:is,to:os}=Fn;return encodeDeployData({abi:parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:deploylessCallViaFactoryBytecode,args:[os,Mn,rs,is]})}function getRevertErrorData(Fn){var rs;if(!(Fn instanceof BaseError$3))return;const Mn=Fn.walk();return typeof(Mn==null?void 0:Mn.data)=="object"?(rs=Mn.data)==null?void 0:rs.data:Mn.data}async function readContract$1(Fn,Mn){const{abi:rs,address:is,args:os,functionName:as,...us}=Mn,ds=encodeFunctionData({abi:rs,args:os,functionName:as});try{const{data:hs}=await getAction$1(Fn,call,"call")({...us,data:ds,to:is});return decodeFunctionResult({abi:rs,args:os,functionName:as,data:hs||"0x"})}catch(hs){throw getContractError(hs,{abi:rs,address:is,args:os,docsPath:"/docs/contract/readContract",functionName:as})}}async function getEnsAddress$1(Fn,{blockNumber:Mn,blockTag:rs,coinType:is,name:os,gatewayUrls:as,strict:us,universalResolverAddress:ds}){let hs=ds;if(!hs){if(!Fn.chain)throw new Error("client chain not configured. universalResolverAddress is required.");hs=getChainContractAddress({blockNumber:Mn,chain:Fn.chain,contract:"ensUniversalResolver"})}try{const ps=encodeFunctionData({abi:addressResolverAbi,functionName:"addr",...is!=null?{args:[namehash$1(os),BigInt(is)]}:{args:[namehash$1(os)]}}),io={address:hs,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex$3(packetToBytes(os)),ps],blockNumber:Mn,blockTag:rs},fo=getAction$1(Fn,readContract$1,"readContract"),mo=as?await fo({...io,args:[...io.args,as]}):await fo(io);if(mo[0]==="0x")return null;const Ao=decodeFunctionResult({abi:addressResolverAbi,args:is!=null?[namehash$1(os),BigInt(is)]:void 0,functionName:"addr",data:mo[0]});return Ao==="0x"||trim$1(Ao)==="0x00"?null:Ao}catch(ps){if(us)throw ps;if(isNullUniversalResolverError(ps,"resolve"))return null;throw ps}}class EnsAvatarInvalidMetadataError extends BaseError$3{constructor({data:Mn}){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(Mn)}`],name:"EnsAvatarInvalidMetadataError"})}}class EnsAvatarInvalidNftUriError extends BaseError$3{constructor({reason:Mn}){super(`ENS NFT avatar URI is invalid. ${Mn}`,{name:"EnsAvatarInvalidNftUriError"})}}class EnsAvatarUriResolutionError extends BaseError$3{constructor({uri:Mn}){super(`Unable to resolve ENS avatar URI "${Mn}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class EnsAvatarUnsupportedNamespaceError extends BaseError$3{constructor({namespace:Mn}){super(`ENS NFT avatar namespace "${Mn}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const networkRegex=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,ipfsHashRegex=/^(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>\/.*)?$/,base64Regex=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dataURIRegex=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function isImageUri(Fn){try{const Mn=await fetch(Fn,{method:"HEAD"});if(Mn.status===200){const rs=Mn.headers.get("content-type");return rs==null?void 0:rs.startsWith("image/")}return!1}catch(Mn){return typeof Mn=="object"&&typeof Mn.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(rs=>{const is=new Image;is.onload=()=>{rs(!0)},is.onerror=()=>{rs(!1)},is.src=Fn})}}function getGateway(Fn,Mn){return Fn?Fn.endsWith("/")?Fn.slice(0,-1):Fn:Mn}function resolveAvatarUri({uri:Fn,gatewayUrls:Mn}){const rs=base64Regex.test(Fn);if(rs)return{uri:Fn,isOnChain:!0,isEncoded:rs};const is=getGateway(Mn==null?void 0:Mn.ipfs,"https://ipfs.io"),os=getGateway(Mn==null?void 0:Mn.arweave,"https://arweave.net"),as=Fn.match(networkRegex),{protocol:us,subpath:ds,target:hs,subtarget:ps=""}=(as==null?void 0:as.groups)||{},io=us==="ipns:/"||ds==="ipns/",fo=us==="ipfs:/"||ds==="ipfs/"||ipfsHashRegex.test(Fn);if(Fn.startsWith("http")&&!io&&!fo){let Ao=Fn;return Mn!=null&&Mn.arweave&&(Ao=Fn.replace(/https:\/\/arweave.net/g,Mn==null?void 0:Mn.arweave)),{uri:Ao,isOnChain:!1,isEncoded:!1}}if((io||fo)&&hs)return{uri:`${is}/${io?"ipns":"ipfs"}/${hs}${ps}`,isOnChain:!1,isEncoded:!1};if(us==="ar:/"&&hs)return{uri:`${os}/${hs}${ps||""}`,isOnChain:!1,isEncoded:!1};let mo=Fn.replace(dataURIRegex,"");if(mo.startsWith("<svg")&&(mo=`data:image/svg+xml;base64,${btoa(mo)}`),mo.startsWith("data:")||mo.startsWith("{"))return{uri:mo,isOnChain:!0,isEncoded:!1};throw new EnsAvatarUriResolutionError({uri:Fn})}function getJsonImage(Fn){if(typeof Fn!="object"||!("image"in Fn)&&!("image_url"in Fn)&&!("image_data"in Fn))throw new EnsAvatarInvalidMetadataError({data:Fn});return Fn.image||Fn.image_url||Fn.image_data}async function getMetadataAvatarUri({gatewayUrls:Fn,uri:Mn}){try{const rs=await fetch(Mn).then(os=>os.json());return await parseAvatarUri({gatewayUrls:Fn,uri:getJsonImage(rs)})}catch{throw new EnsAvatarUriResolutionError({uri:Mn})}}async function parseAvatarUri({gatewayUrls:Fn,uri:Mn}){const{uri:rs,isOnChain:is}=resolveAvatarUri({uri:Mn,gatewayUrls:Fn});if(is||await isImageUri(rs))return rs;throw new EnsAvatarUriResolutionError({uri:Mn})}function parseNftUri(Fn){let Mn=Fn;Mn.startsWith("did:nft:")&&(Mn=Mn.replace("did:nft:","").replace(/_/g,"/"));const[rs,is,os]=Mn.split("/"),[as,us]=rs.split(":"),[ds,hs]=is.split(":");if(!as||as.toLowerCase()!=="eip155")throw new EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!us)throw new EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!hs)throw new EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!os)throw new EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!ds)throw new EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(us),namespace:ds.toLowerCase(),contractAddress:hs,tokenID:os}}async function getNftTokenUri(Fn,{nft:Mn}){if(Mn.namespace==="erc721")return readContract$1(Fn,{address:Mn.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(Mn.tokenID)]});if(Mn.namespace==="erc1155")return readContract$1(Fn,{address:Mn.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(Mn.tokenID)]});throw new EnsAvatarUnsupportedNamespaceError({namespace:Mn.namespace})}async function parseAvatarRecord(Fn,{gatewayUrls:Mn,record:rs}){return/eip155:/i.test(rs)?parseNftAvatarUri(Fn,{gatewayUrls:Mn,record:rs}):parseAvatarUri({uri:rs,gatewayUrls:Mn})}async function parseNftAvatarUri(Fn,{gatewayUrls:Mn,record:rs}){const is=parseNftUri(rs),os=await getNftTokenUri(Fn,{nft:is}),{uri:as,isOnChain:us,isEncoded:ds}=resolveAvatarUri({uri:os,gatewayUrls:Mn});if(us&&(as.includes("data:application/json;base64,")||as.startsWith("{"))){const ps=ds?atob(as.replace("data:application/json;base64,","")):as,io=JSON.parse(ps);return parseAvatarUri({uri:getJsonImage(io),gatewayUrls:Mn})}let hs=is.tokenID;return is.namespace==="erc1155"&&(hs=hs.replace("0x","").padStart(64,"0")),getMetadataAvatarUri({gatewayUrls:Mn,uri:as.replace(/(?:0x)?{id}/,hs)})}async function getEnsText(Fn,{blockNumber:Mn,blockTag:rs,name:is,key:os,gatewayUrls:as,strict:us,universalResolverAddress:ds}){let hs=ds;if(!hs){if(!Fn.chain)throw new Error("client chain not configured. universalResolverAddress is required.");hs=getChainContractAddress({blockNumber:Mn,chain:Fn.chain,contract:"ensUniversalResolver"})}try{const ps={address:hs,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex$3(packetToBytes(is)),encodeFunctionData({abi:textResolverAbi,functionName:"text",args:[namehash$1(is),os]})],blockNumber:Mn,blockTag:rs},io=getAction$1(Fn,readContract$1,"readContract"),fo=as?await io({...ps,args:[...ps.args,as]}):await io(ps);if(fo[0]==="0x")return null;const mo=decodeFunctionResult({abi:textResolverAbi,functionName:"text",data:fo[0]});return mo===""?null:mo}catch(ps){if(us)throw ps;if(isNullUniversalResolverError(ps,"resolve"))return null;throw ps}}async function getEnsAvatar$1(Fn,{blockNumber:Mn,blockTag:rs,assetGatewayUrls:is,name:os,gatewayUrls:as,strict:us,universalResolverAddress:ds}){const hs=await getAction$1(Fn,getEnsText,"getEnsText")({blockNumber:Mn,blockTag:rs,key:"avatar",name:os,universalResolverAddress:ds,gatewayUrls:as,strict:us});if(!hs)return null;try{return await parseAvatarRecord(Fn,{record:hs,gatewayUrls:is})}catch{return null}}async function getEnsName$1(Fn,{address:Mn,blockNumber:rs,blockTag:is,gatewayUrls:os,strict:as,universalResolverAddress:us}){let ds=us;if(!ds){if(!Fn.chain)throw new Error("client chain not configured. universalResolverAddress is required.");ds=getChainContractAddress({blockNumber:rs,chain:Fn.chain,contract:"ensUniversalResolver"})}const hs=`${Mn.toLowerCase().substring(2)}.addr.reverse`;try{const ps={address:ds,abi:universalResolverReverseAbi,functionName:"reverse",args:[toHex$3(packetToBytes(hs))],blockNumber:rs,blockTag:is},io=getAction$1(Fn,readContract$1,"readContract"),[fo,mo]=os?await io({...ps,args:[...ps.args,os]}):await io(ps);return Mn.toLowerCase()!==mo.toLowerCase()?null:fo}catch(ps){if(as)throw ps;if(isNullUniversalResolverError(ps,"reverse"))return null;throw ps}}const promiseCache$1=new Map,responseCache=new Map;function getCache(Fn){const Mn=(os,as)=>({clear:()=>as.delete(os),get:()=>as.get(os),set:us=>as.set(os,us)}),rs=Mn(Fn,promiseCache$1),is=Mn(Fn,responseCache);return{clear:()=>{rs.clear(),is.clear()},promise:rs,response:is}}async function withCache(Fn,{cacheKey:Mn,cacheTime:rs=Number.POSITIVE_INFINITY}){const is=getCache(Mn),os=is.response.get();if(os&&rs>0&&new Date().getTime()-os.created.getTime()<rs)return os.data;let as=is.promise.get();as||(as=Fn(),is.promise.set(as));try{const us=await as;return is.response.set({created:new Date,data:us}),us}finally{is.promise.clear()}}const cacheKey=Fn=>`blockNumber.${Fn}`;async function getBlockNumber(Fn,{cacheTime:Mn=Fn.cacheTime}={}){const rs=await withCache(()=>Fn.request({method:"eth_blockNumber"}),{cacheKey:cacheKey(Fn.uid),cacheTime:Mn});return BigInt(rs)}function formatLog(Fn,{args:Mn,eventName:rs}={}){return{...Fn,blockHash:Fn.blockHash?Fn.blockHash:null,blockNumber:Fn.blockNumber?BigInt(Fn.blockNumber):null,logIndex:Fn.logIndex?Number(Fn.logIndex):null,transactionHash:Fn.transactionHash?Fn.transactionHash:null,transactionIndex:Fn.transactionIndex?Number(Fn.transactionIndex):null,...rs?{args:Mn,eventName:rs}:{}}}async function getTransaction(Fn,{blockHash:Mn,blockNumber:rs,blockTag:is,hash:os,index:as}){var io,fo,mo;const us=is||"latest",ds=rs!==void 0?numberToHex(rs):void 0;let hs=null;if(os?hs=await Fn.request({method:"eth_getTransactionByHash",params:[os]},{dedupe:!0}):Mn?hs=await Fn.request({method:"eth_getTransactionByBlockHashAndIndex",params:[Mn,numberToHex(as)]},{dedupe:!0}):(ds||us)&&(hs=await Fn.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[ds||us,numberToHex(as)]},{dedupe:!!ds})),!hs)throw new TransactionNotFoundError({blockHash:Mn,blockNumber:rs,blockTag:us,hash:os,index:as});return(((mo=(fo=(io=Fn.chain)==null?void 0:io.formatters)==null?void 0:fo.transaction)==null?void 0:mo.format)||formatTransaction)(hs)}const receiptStatuses={"0x0":"reverted","0x1":"success"};function formatTransactionReceipt(Fn){const Mn={...Fn,blockNumber:Fn.blockNumber?BigInt(Fn.blockNumber):null,contractAddress:Fn.contractAddress?Fn.contractAddress:null,cumulativeGasUsed:Fn.cumulativeGasUsed?BigInt(Fn.cumulativeGasUsed):null,effectiveGasPrice:Fn.effectiveGasPrice?BigInt(Fn.effectiveGasPrice):null,gasUsed:Fn.gasUsed?BigInt(Fn.gasUsed):null,logs:Fn.logs?Fn.logs.map(rs=>formatLog(rs)):null,to:Fn.to?Fn.to:null,transactionIndex:Fn.transactionIndex?hexToNumber(Fn.transactionIndex):null,status:Fn.status?receiptStatuses[Fn.status]:null,type:Fn.type?transactionType[Fn.type]||Fn.type:null};return Fn.blobGasPrice&&(Mn.blobGasPrice=BigInt(Fn.blobGasPrice)),Fn.blobGasUsed&&(Mn.blobGasUsed=BigInt(Fn.blobGasUsed)),Mn}async function getTransactionReceipt(Fn,{hash:Mn}){var os,as,us;const rs=await Fn.request({method:"eth_getTransactionReceipt",params:[Mn]},{dedupe:!0});if(!rs)throw new TransactionReceiptNotFoundError({hash:Mn});return(((us=(as=(os=Fn.chain)==null?void 0:os.formatters)==null?void 0:as.transactionReceipt)==null?void 0:us.format)||formatTransactionReceipt)(rs)}async function multicall$1(Fn,Mn){var Go;const{allowFailure:rs=!0,batchSize:is,blockNumber:os,blockTag:as,multicallAddress:us,stateOverride:ds}=Mn,hs=Mn.contracts,ps=is??(typeof((Go=Fn.batch)==null?void 0:Go.multicall)=="object"&&Fn.batch.multicall.batchSize||1024);let io=us;if(!io){if(!Fn.chain)throw new Error("client chain not configured. multicallAddress is required.");io=getChainContractAddress({blockNumber:os,chain:Fn.chain,contract:"multicall3"})}const fo=[[]];let mo=0,Ao=0;for(let Yo=0;Yo<hs.length;Yo++){const{abi:Wo,address:Jo,args:xl,functionName:_l}=hs[Yo];try{const Tl=encodeFunctionData({abi:Wo,args:xl,functionName:_l});Ao+=(Tl.length-2)/2,ps>0&&Ao>ps&&fo[mo].length>0&&(mo++,Ao=(Tl.length-2)/2,fo[mo]=[]),fo[mo]=[...fo[mo],{allowFailure:!0,callData:Tl,target:Jo}]}catch(Tl){const Sl=getContractError(Tl,{abi:Wo,address:Jo,args:xl,docsPath:"/docs/contract/multicall",functionName:_l});if(!rs)throw Sl;fo[mo]=[...fo[mo],{allowFailure:!0,callData:"0x",target:Jo}]}}const $o=await Promise.allSettled(fo.map(Yo=>getAction$1(Fn,readContract$1,"readContract")({abi:multicall3Abi,address:io,args:[Yo],blockNumber:os,blockTag:as,functionName:"aggregate3",stateOverride:ds}))),Lo=[];for(let Yo=0;Yo<$o.length;Yo++){const Wo=$o[Yo];if(Wo.status==="rejected"){if(!rs)throw Wo.reason;for(let xl=0;xl<fo[Yo].length;xl++)Lo.push({status:"failure",error:Wo.reason,result:void 0});continue}const Jo=Wo.value;for(let xl=0;xl<Jo.length;xl++){const{returnData:_l,success:Tl}=Jo[xl],{callData:Sl}=fo[Yo][xl],{abi:$l,address:Pl,functionName:Dl,args:Ol}=hs[Lo.length];try{if(Sl==="0x")throw new AbiDecodingZeroDataError;if(!Tl)throw new RawContractError({data:_l});const Rl=decodeFunctionResult({abi:$l,args:Ol,data:_l,functionName:Dl});Lo.push(rs?{result:Rl,status:"success"}:Rl)}catch(Rl){const Vo=getContractError(Rl,{abi:$l,address:Pl,args:Ol,docsPath:"/docs/contract/multicall",functionName:Dl});if(!rs)throw Vo;Lo.push({error:Vo,result:void 0,status:"failure"})}}}if(Lo.length!==hs.length)throw new BaseError$3("multicall results mismatch");return Lo}const listenersCache=new Map,cleanupCache=new Map;let callbackCount=0;function observe(Fn,Mn,rs){const is=++callbackCount,os=()=>listenersCache.get(Fn)||[],as=()=>{const io=os();listenersCache.set(Fn,io.filter(fo=>fo.id!==is))},us=()=>{const io=cleanupCache.get(Fn);os().length===1&&io&&io(),as()},ds=os();if(listenersCache.set(Fn,[...ds,{id:is,fns:Mn}]),ds&&ds.length>0)return us;const hs={};for(const io in Mn)hs[io]=(...fo)=>{var Ao,$o;const mo=os();if(mo.length!==0)for(const Lo of mo)($o=(Ao=Lo.fns)[io])==null||$o.call(Ao,...fo)};const ps=rs(hs);return typeof ps=="function"&&cleanupCache.set(Fn,ps),us}async function wait(Fn){return new Promise(Mn=>setTimeout(Mn,Fn))}function poll$1(Fn,{emitOnBegin:Mn,initialWaitTime:rs,interval:is}){let os=!0;const as=()=>os=!1;return(async()=>{let ds;Mn&&(ds=await Fn({unpoll:as}));const hs=await(rs==null?void 0:rs(ds))??is;await wait(hs);const ps=async()=>{os&&(await Fn({unpoll:as}),await wait(is),ps())};ps()})(),as}function watchBlockNumber(Fn,{emitOnBegin:Mn=!1,emitMissed:rs=!1,onBlockNumber:is,onError:os,poll:as,pollingInterval:us=Fn.pollingInterval}){const ds=typeof as<"u"?as:!(Fn.transport.type==="webSocket"||Fn.transport.type==="fallback"&&Fn.transport.transports[0].config.type==="webSocket");let hs;return ds?(()=>{const fo=stringify$1(["watchBlockNumber",Fn.uid,Mn,rs,us]);return observe(fo,{onBlockNumber:is,onError:os},mo=>poll$1(async()=>{var Ao;try{const $o=await getAction$1(Fn,getBlockNumber,"getBlockNumber")({cacheTime:0});if(hs){if($o===hs)return;if($o-hs>1&&rs)for(let Lo=hs+1n;Lo<$o;Lo++)mo.onBlockNumber(Lo,hs),hs=Lo}(!hs||$o>hs)&&(mo.onBlockNumber($o,hs),hs=$o)}catch($o){(Ao=mo.onError)==null||Ao.call(mo,$o)}},{emitOnBegin:Mn,interval:us}))})():(()=>{const fo=stringify$1(["watchBlockNumber",Fn.uid,Mn,rs]);return observe(fo,{onBlockNumber:is,onError:os},mo=>{let Ao=!0,$o=()=>Ao=!1;return(async()=>{try{const Lo=(()=>{if(Fn.transport.type==="fallback"){const Yo=Fn.transport.transports.find(Wo=>Wo.config.type==="webSocket");return Yo?Yo.value:Fn.transport}return Fn.transport})(),{unsubscribe:Go}=await Lo.subscribe({params:["newHeads"],onData(Yo){var Jo;if(!Ao)return;const Wo=hexToBigInt((Jo=Yo.result)==null?void 0:Jo.number);mo.onBlockNumber(Wo,hs),hs=Wo},onError(Yo){var Wo;(Wo=mo.onError)==null||Wo.call(mo,Yo)}});$o=Go,Ao||$o()}catch(Lo){os==null||os(Lo)}})(),()=>$o()})})()}const promiseCache=new LruMap(8192);function withDedupe(Fn,{enabled:Mn=!0,id:rs}){if(!Mn||!rs)return Fn();if(promiseCache.get(rs))return promiseCache.get(rs);const is=Fn().finally(()=>promiseCache.delete(rs));return promiseCache.set(rs,is),is}function withRetry(Fn,{delay:Mn=100,retryCount:rs=2,shouldRetry:is=()=>!0}={}){return new Promise((os,as)=>{const us=async({count:ds=0}={})=>{const hs=async({error:ps})=>{const io=typeof Mn=="function"?Mn({count:ds,error:ps}):Mn;io&&await wait(io),us({count:ds+1})};try{const ps=await Fn();os(ps)}catch(ps){if(ds<rs&&await is({count:ds,error:ps}))return hs({error:ps});as(ps)}};us()})}function buildRequest(Fn,Mn={}){return async(rs,is={})=>{const{dedupe:os=!1,retryDelay:as=150,retryCount:us=3,uid:ds}={...Mn,...is},hs=os?keccak256$1(stringToHex(`${ds}.${stringify$1(rs)}`)):void 0;return withDedupe(()=>withRetry(async()=>{try{return await Fn(rs)}catch(ps){const io=ps;switch(io.code){case ParseRpcError.code:throw new ParseRpcError(io);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(io);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(io,{method:rs.method});case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(io);case InternalRpcError.code:throw new InternalRpcError(io);case InvalidInputRpcError.code:throw new InvalidInputRpcError(io);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(io);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(io);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(io);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(io,{method:rs.method});case LimitExceededRpcError.code:throw new LimitExceededRpcError(io);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(io);case UserRejectedRequestError.code:throw new UserRejectedRequestError(io);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(io);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(io);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(io);case ChainDisconnectedError.code:throw new ChainDisconnectedError(io);case SwitchChainError.code:throw new SwitchChainError(io);case 5e3:throw new UserRejectedRequestError(io);default:throw ps instanceof BaseError$3?ps:new UnknownRpcError(io)}}},{delay:({count:ps,error:io})=>{var fo;if(io&&io instanceof HttpRequestError){const mo=(fo=io==null?void 0:io.headers)==null?void 0:fo.get("Retry-After");if(mo!=null&&mo.match(/\d/))return Number.parseInt(mo)*1e3}return~~(1<<ps)*as},retryCount:us,shouldRetry:({error:ps})=>shouldRetry(ps)}),{enabled:os,id:hs})}}function shouldRetry(Fn){return"code"in Fn&&typeof Fn.code=="number"?Fn.code===-1||Fn.code===LimitExceededRpcError.code||Fn.code===InternalRpcError.code:Fn instanceof HttpRequestError&&Fn.status?Fn.status===403||Fn.status===408||Fn.status===413||Fn.status===429||Fn.status===500||Fn.status===502||Fn.status===503||Fn.status===504:!0}function defineChain(Fn){return{formatters:void 0,fees:void 0,serializers:void 0,...Fn}}function withTimeout(Fn,{errorInstance:Mn=new Error("timed out"),timeout:rs,signal:is}){return new Promise((os,as)=>{(async()=>{let us;try{const ds=new AbortController;rs>0&&(us=setTimeout(()=>{is?ds.abort():as(Mn)},rs)),os(await Fn({signal:(ds==null?void 0:ds.signal)||null}))}catch(ds){(ds==null?void 0:ds.name)==="AbortError"&&as(Mn),as(ds)}finally{clearTimeout(us)}})()})}function createIdStore(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const idCache=createIdStore();function getHttpRpcClient(Fn,Mn={}){return{async request(rs){var fo;const{body:is,onRequest:os=Mn.onRequest,onResponse:as=Mn.onResponse,timeout:us=Mn.timeout??1e4}=rs,ds={...Mn.fetchOptions??{},...rs.fetchOptions??{}},{headers:hs,method:ps,signal:io}=ds;try{const mo=await withTimeout(async({signal:$o})=>{const Lo={...ds,body:Array.isArray(is)?stringify$1(is.map(Wo=>({jsonrpc:"2.0",id:Wo.id??idCache.take(),...Wo}))):stringify$1({jsonrpc:"2.0",id:is.id??idCache.take(),...is}),headers:{"Content-Type":"application/json",...hs},method:ps||"POST",signal:io||(us>0?$o:null)},Go=new Request(Fn,Lo);return os&&await os(Go),await fetch(Fn,Lo)},{errorInstance:new TimeoutError({body:is,url:Fn}),timeout:us,signal:!0});as&&await as(mo);let Ao;if((fo=mo.headers.get("Content-Type"))!=null&&fo.startsWith("application/json")?Ao=await mo.json():(Ao=await mo.text(),Ao=JSON.parse(Ao||"{}")),!mo.ok)throw new HttpRequestError({body:is,details:stringify$1(Ao.error)||mo.statusText,headers:mo.headers,status:mo.status,url:Fn});return Ao}catch(mo){throw mo instanceof HttpRequestError||mo instanceof TimeoutError?mo:new HttpRequestError({body:is,cause:mo,url:Fn})}}}}class InvalidDecimalNumberError extends BaseError$3{constructor({value:Mn}){super(`Number \`${Mn}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function parseUnits$1(Fn,Mn){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(Fn))throw new InvalidDecimalNumberError({value:Fn});let[rs,is="0"]=Fn.split(".");const os=rs.startsWith("-");if(os&&(rs=rs.slice(1)),is=is.replace(/(0+)$/,""),Mn===0)Math.round(+`.${is}`)===1&&(rs=`${BigInt(rs)+1n}`),is="";else if(is.length>Mn){const[as,us,ds]=[is.slice(0,Mn-1),is.slice(Mn-1,Mn),is.slice(Mn)],hs=Math.round(+`${us}.${ds}`);hs>9?is=`${BigInt(as)+BigInt(1)}0`.padStart(as.length+1,"0"):is=`${as}${hs}`,is.length>Mn&&(is=is.slice(1),rs=`${BigInt(rs)+1n}`),is=is.slice(0,Mn)}else is=is.padEnd(Mn,"0");return BigInt(`${os?"-":""}${rs}${is}`)}async function waitForTransactionReceipt$1(Fn,{confirmations:Mn=1,hash:rs,onReplaced:is,pollingInterval:os=Fn.pollingInterval,retryCount:as=6,retryDelay:us=({count:hs})=>~~(1<<hs)*200,timeout:ds}){const hs=stringify$1(["waitForTransactionReceipt",Fn.uid,rs]);let ps=0,io,fo,mo,Ao=!1;return new Promise(($o,Lo)=>{ds&&setTimeout(()=>Lo(new WaitForTransactionReceiptTimeoutError({hash:rs})),ds);const Go=observe(hs,{onReplaced:is,resolve:$o,reject:Lo},Yo=>{const Wo=getAction$1(Fn,watchBlockNumber,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:os,async onBlockNumber(Jo){const xl=Tl=>{Wo(),Tl(),Go()};let _l=Jo;if(!Ao){ps>as&&xl(()=>Yo.reject(new WaitForTransactionReceiptTimeoutError({hash:rs})));try{if(mo){if(Mn>1&&(!mo.blockNumber||_l-mo.blockNumber+1n<Mn))return;xl(()=>Yo.resolve(mo));return}if(io||(Ao=!0,await withRetry(async()=>{io=await getAction$1(Fn,getTransaction,"getTransaction")({hash:rs}),io.blockNumber&&(_l=io.blockNumber)},{delay:us,retryCount:as}),Ao=!1),mo=await getAction$1(Fn,getTransactionReceipt,"getTransactionReceipt")({hash:rs}),Mn>1&&(!mo.blockNumber||_l-mo.blockNumber+1n<Mn))return;xl(()=>Yo.resolve(mo))}catch(Tl){if(Tl instanceof TransactionNotFoundError||Tl instanceof TransactionReceiptNotFoundError){if(!io){Ao=!1;return}try{fo=io,Ao=!0;const Sl=await withRetry(()=>getAction$1(Fn,getBlock,"getBlock")({blockNumber:_l,includeTransactions:!0}),{delay:us,retryCount:as,shouldRetry:({error:Dl})=>Dl instanceof BlockNotFoundError});Ao=!1;const $l=Sl.transactions.find(({from:Dl,nonce:Ol})=>Dl===fo.from&&Ol===fo.nonce);if(!$l||(mo=await getAction$1(Fn,getTransactionReceipt,"getTransactionReceipt")({hash:$l.hash}),Mn>1&&(!mo.blockNumber||_l-mo.blockNumber+1n<Mn)))return;let Pl="replaced";$l.to===fo.to&&$l.value===fo.value?Pl="repriced":$l.from===$l.to&&$l.value===0n&&(Pl="cancelled"),xl(()=>{var Dl;(Dl=Yo.onReplaced)==null||Dl.call(Yo,{reason:Pl,replacedTransaction:fo,transaction:$l,transactionReceipt:mo}),Yo.resolve(mo)})}catch(Sl){xl(()=>Yo.reject(Sl))}}else xl(()=>Yo.reject(Tl))}finally{ps++}}}})})})}async function signMessage$1(Fn,{account:Mn=Fn.account,message:rs}){if(!Mn)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const is=parseAccount(Mn);if(is.signMessage)return is.signMessage({message:rs});const os=typeof rs=="string"?stringToHex(rs):rs.raw instanceof Uint8Array?toHex$3(rs.raw):rs.raw;return Fn.request({method:"personal_sign",params:[os,is.address]},{retryCount:0})}async function simulateContract$1(Fn,Mn){const{abi:rs,address:is,args:os,dataSuffix:as,functionName:us,...ds}=Mn,hs=ds.account?parseAccount(ds.account):Fn.account,ps=encodeFunctionData({abi:rs,args:os,functionName:us});try{const{data:io}=await getAction$1(Fn,call,"call")({batch:!1,data:`${ps}${as?as.replace("0x",""):""}`,to:is,...ds,account:hs}),fo=decodeFunctionResult({abi:rs,args:os,functionName:us,data:io||"0x"}),mo=rs.filter(Ao=>"name"in Ao&&Ao.name===Mn.functionName);return{result:fo,request:{abi:mo,address:is,args:os,dataSuffix:as,functionName:us,...ds,account:hs}}}catch(io){throw getContractError(io,{abi:rs,address:is,args:os,docsPath:"/docs/contract/simulateContract",functionName:us,sender:hs==null?void 0:hs.address})}}async function watchAsset$1(Fn,Mn){return await Fn.request({method:"wallet_watchAsset",params:Mn},{retryCount:0})}async function writeContract$1(Fn,Mn){const{abi:rs,account:is=Fn.account,address:os,args:as,dataSuffix:us,functionName:ds,...hs}=Mn;if(!is)throw new AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const ps=parseAccount(is),io=encodeFunctionData({abi:rs,args:as,functionName:ds});try{return await getAction$1(Fn,sendTransaction$1,"sendTransaction")({data:`${io}${us?us.replace("0x",""):""}`,to:os,account:ps,...hs})}catch(fo){throw getContractError(fo,{abi:rs,address:os,args:as,docsPath:"/docs/contract/writeContract",functionName:ds,sender:ps.address})}}function getAction(Fn,Mn,rs){const is=Fn[Mn.name];if(typeof is=="function")return is;const os=Fn[rs];return typeof os=="function"?os:as=>Mn(Fn,as)}const version$o="2.13.9",getVersion$1=()=>`@wagmi/core@${version$o}`;var __classPrivateFieldGet$1=function(Fn,Mn,rs,is){if(rs==="a"&&!is)throw new TypeError("Private accessor was defined without a getter");if(typeof Mn=="function"?Fn!==Mn||!is:!Mn.has(Fn))throw new TypeError("Cannot read private member from an object whose class did not declare it");return rs==="m"?is:rs==="a"?is.call(Fn):is?is.value:Mn.get(Fn)},_BaseError_instances,_BaseError_walk;let BaseError$1=class Ww extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return getVersion$1()}constructor(Mn,rs={}){var as;super(),_BaseError_instances.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 is=rs.cause instanceof Ww?rs.cause.details:(as=rs.cause)!=null&&as.message?rs.cause.message:rs.details,os=rs.cause instanceof Ww&&rs.cause.docsPath||rs.docsPath;this.message=[Mn||"An error occurred.","",...rs.metaMessages?[...rs.metaMessages,""]:[],...os?[`Docs: ${this.docsBaseUrl}${os}.html${rs.docsSlug?`#${rs.docsSlug}`:""}`]:[],...is?[`Details: ${is}`]:[],`Version: ${this.version}`].join(`
`),rs.cause&&(this.cause=rs.cause),this.details=is,this.docsPath=os,this.metaMessages=rs.metaMessages,this.shortMessage=Mn}walk(Mn){return __classPrivateFieldGet$1(this,_BaseError_instances,"m",_BaseError_walk).call(this,this,Mn)}};_BaseError_instances=new WeakSet,_BaseError_walk=function Fn(Mn,rs){return rs!=null&&rs(Mn)?Mn:Mn.cause?__classPrivateFieldGet$1(this,_BaseError_instances,"m",Fn).call(this,Mn.cause,rs):Mn};class ChainNotConfiguredError extends BaseError$1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ConnectorAlreadyConnectedError extends BaseError$1{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ConnectorNotConnectedError extends BaseError$1{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class ConnectorAccountNotFoundError extends BaseError$1{constructor({address:Mn,connector:rs}){super(`Account "${Mn}" not found for connector "${rs.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class ConnectorChainMismatchError extends BaseError$1{constructor({connectionChainId:Mn,connectorChainId:rs}){super(`The current chain of the connector (id: ${rs}) does not match the connection's chain (id: ${Mn}).`,{metaMessages:[`Current Chain ID:  ${rs}`,`Expected Chain ID: ${Mn}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class ConnectorUnavailableReconnectingError extends BaseError$1{constructor({connector:Mn}){super(`Connector "${Mn.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","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 connect(Fn,Mn){var is;let rs;if(typeof Mn.connector=="function"?rs=Fn._internal.connectors.setup(Mn.connector):rs=Mn.connector,rs.uid===Fn.state.current)throw new ConnectorAlreadyConnectedError;try{Fn.setState(us=>({...us,status:"connecting"})),rs.emitter.emit("message",{type:"connecting"});const os=await rs.connect({chainId:Mn.chainId}),as=os.accounts;return rs.emitter.off("connect",Fn._internal.events.connect),rs.emitter.on("change",Fn._internal.events.change),rs.emitter.on("disconnect",Fn._internal.events.disconnect),await((is=Fn.storage)==null?void 0:is.setItem("recentConnectorId",rs.id)),Fn.setState(us=>({...us,connections:new Map(us.connections).set(rs.uid,{accounts:as,chainId:os.chainId,connector:rs}),current:rs.uid,status:"connected"})),{accounts:as,chainId:os.chainId}}catch(os){throw Fn.setState(as=>({...as,status:as.current?"connected":"disconnected"})),os}}const size$1=256;let index$1=size$1,buffer$2;function uid$2(Fn=11){if(!buffer$2||index$1+Fn>size$1*2){buffer$2="",index$1=0;for(let Mn=0;Mn<size$1;Mn++)buffer$2+=(256+Math.random()*256|0).toString(16).substring(1)}return buffer$2.substring(index$1,index$1+++Fn)}function createClient(Fn){const{batch:Mn,cacheTime:rs=Fn.pollingInterval??4e3,ccipRead:is,key:os="base",name:as="Base Client",pollingInterval:us=4e3,type:ds="base"}=Fn,hs=Fn.chain,ps=Fn.account?parseAccount(Fn.account):void 0,{config:io,request:fo,value:mo}=Fn.transport({chain:hs,pollingInterval:us}),Ao={...io,...mo},$o={account:ps,batch:Mn,cacheTime:rs,ccipRead:is,chain:hs,key:os,name:as,pollingInterval:us,request:fo,transport:Ao,type:ds,uid:uid$2()};function Lo(Go){return Yo=>{const Wo=Yo(Go);for(const xl in $o)delete Wo[xl];const Jo={...Go,...Wo};return Object.assign(Jo,{extend:Lo(Jo)})}}return Object.assign($o,{extend:Lo($o)})}function createTransport({key:Fn,name:Mn,request:rs,retryCount:is=3,retryDelay:os=150,timeout:as,type:us},ds){const hs=uid$2();return{config:{key:Fn,name:Mn,request:rs,retryCount:is,retryDelay:os,timeout:as,type:us},request:buildRequest(rs,{retryCount:is,retryDelay:os,uid:hs}),value:ds}}function custom$1(Fn,Mn={}){const{key:rs="custom",name:is="Custom Provider",retryDelay:os}=Mn;return({retryCount:as})=>createTransport({key:rs,name:is,request:Fn.request.bind(Fn),retryCount:Mn.retryCount??as,retryDelay:os,type:"custom"})}function fallback$1(Fn,Mn={}){const{key:rs="fallback",name:is="Fallback",rank:os=!1,retryCount:as,retryDelay:us}=Mn;return({chain:ds,pollingInterval:hs=4e3,timeout:ps,...io})=>{let fo=Fn,mo=()=>{};const Ao=createTransport({key:rs,name:is,async request({method:$o,params:Lo}){const Go=async(Yo=0)=>{const Wo=fo[Yo]({...io,chain:ds,retryCount:0,timeout:ps});try{const Jo=await Wo.request({method:$o,params:Lo});return mo({method:$o,params:Lo,response:Jo,transport:Wo,status:"success"}),Jo}catch(Jo){if(mo({error:Jo,method:$o,params:Lo,transport:Wo,status:"error"}),shouldThrow(Jo)||Yo===fo.length-1)throw Jo;return Go(Yo+1)}};return Go()},retryCount:as,retryDelay:us,type:"fallback"},{onResponse:$o=>mo=$o,transports:fo.map($o=>$o({chain:ds,retryCount:0}))});if(os){const $o=typeof os=="object"?os:{};rankTransports({chain:ds,interval:$o.interval??hs,onTransports:Lo=>fo=Lo,sampleCount:$o.sampleCount,timeout:$o.timeout,transports:fo,weights:$o.weights})}return Ao}}function shouldThrow(Fn){return"code"in Fn&&typeof Fn.code=="number"&&(Fn.code===TransactionRejectedRpcError.code||Fn.code===UserRejectedRequestError.code||Fn.code===5e3)}function rankTransports({chain:Fn,interval:Mn=4e3,onTransports:rs,sampleCount:is=10,timeout:os=1e3,transports:as,weights:us={}}){const{stability:ds=.7,latency:hs=.3}=us,ps=[],io=async()=>{const fo=await Promise.all(as.map(async $o=>{const Lo=$o({chain:Fn,retryCount:0,timeout:os}),Go=Date.now();let Yo,Wo;try{await Lo.request({method:"net_listening"}),Wo=1}catch{Wo=0}finally{Yo=Date.now()}return{latency:Yo-Go,success:Wo}}));ps.push(fo),ps.length>is&&ps.shift();const mo=Math.max(...ps.map($o=>Math.max(...$o.map(({latency:Lo})=>Lo)))),Ao=as.map(($o,Lo)=>{const Go=ps.map(_l=>_l[Lo].latency),Wo=1-Go.reduce((_l,Tl)=>_l+Tl,0)/Go.length/mo,Jo=ps.map(_l=>_l[Lo].success),xl=Jo.reduce((_l,Tl)=>_l+Tl,0)/Jo.length;return xl===0?[0,Lo]:[hs*Wo+ds*xl,Lo]}).sort(($o,Lo)=>Lo[0]-$o[0]);rs(Ao.map(([,$o])=>as[$o])),await wait(Mn),io()};io()}class UrlRequiredError extends BaseError$3{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 http(Fn,Mn={}){const{batch:rs,fetchOptions:is,key:os="http",name:as="HTTP JSON-RPC",onFetchRequest:us,onFetchResponse:ds,retryDelay:hs}=Mn;return({chain:ps,retryCount:io,timeout:fo})=>{const{batchSize:mo=1e3,wait:Ao=0}=typeof rs=="object"?rs:{},$o=Mn.retryCount??io,Lo=fo??Mn.timeout??1e4,Go=Fn||(ps==null?void 0:ps.rpcUrls.default.http[0]);if(!Go)throw new UrlRequiredError;const Yo=getHttpRpcClient(Go,{fetchOptions:is,onRequest:us,onResponse:ds,timeout:Lo});return createTransport({key:os,name:as,async request({method:Wo,params:Jo}){const xl={method:Wo,params:Jo},{schedule:_l}=createBatchScheduler({id:Go,wait:Ao,shouldSplitBatch(Pl){return Pl.length>mo},fn:Pl=>Yo.request({body:Pl}),sort:(Pl,Dl)=>Pl.id-Dl.id}),Tl=async Pl=>rs?_l(Pl):[await Yo.request({body:Pl})],[{error:Sl,result:$l}]=await Tl(xl);if(Sl)throw new RpcRequestError({body:xl,error:Sl,url:Go});return $l},retryCount:$o,retryDelay:hs,timeout:Lo,type:"http"},{fetchOptions:is,url:Go})}}async function getConnectorClient(Fn,Mn={}){let rs;if(Mn.connector){const{connector:ps}=Mn;if(Fn.state.status==="reconnecting"&&!ps.getAccounts&&!ps.getChainId)throw new ConnectorUnavailableReconnectingError({connector:ps});const[io,fo]=await Promise.all([ps.getAccounts(),ps.getChainId()]);rs={accounts:io,chainId:fo,connector:ps}}else rs=Fn.state.connections.get(Fn.state.current);if(!rs)throw new ConnectorNotConnectedError;const is=Mn.chainId??rs.chainId,os=await rs.connector.getChainId();if(os!==rs.chainId)throw new ConnectorChainMismatchError({connectionChainId:rs.chainId,connectorChainId:os});const as=rs.connector;if(as.getClient)return as.getClient({chainId:is});const us=parseAccount(Mn.account??rs.accounts[0]);if(us.address=getAddress$1(us.address),Mn.account&&!rs.accounts.some(ps=>ps.toLowerCase()===us.address.toLowerCase()))throw new ConnectorAccountNotFoundError({address:us.address,connector:as});const ds=Fn.chains.find(ps=>ps.id===is),hs=await rs.connector.getProvider({chainId:is});return createClient({account:us,chain:ds,name:"Connector Client",transport:ps=>custom$1(hs)({...ps,retryCount:0})})}async function disconnect$1(Fn,Mn={}){var os,as;let rs;if(Mn.connector)rs=Mn.connector;else{const{connections:us,current:ds}=Fn.state,hs=us.get(ds);rs=hs==null?void 0:hs.connector}const is=Fn.state.connections;rs&&(await rs.disconnect(),rs.emitter.off("change",Fn._internal.events.change),rs.emitter.off("disconnect",Fn._internal.events.disconnect),rs.emitter.on("connect",Fn._internal.events.connect),is.delete(rs.uid)),Fn.setState(us=>{if(is.size===0)return{...us,connections:new Map,current:null,status:"disconnected"};const ds=is.values().next().value;return{...us,connections:new Map(is),current:ds.connector.uid}});{const us=Fn.state.current;if(!us)return;const ds=(os=Fn.state.connections.get(us))==null?void 0:os.connector;if(!ds)return;await((as=Fn.storage)==null?void 0:as.setItem("recentConnectorId",ds.id))}}async function estimateGas(Fn,Mn){const{chainId:rs,connector:is,...os}=Mn;let as;Mn.account?as=Mn.account:as=(await getConnectorClient(Fn,{account:Mn.account,chainId:rs,connector:is})).account;const us=Fn.getClient({chainId:rs});return getAction(us,estimateGas$1,"estimateGas")({...os,account:as})}function getUnit(Fn){return typeof Fn=="number"?Fn:Fn==="wei"?0:Math.abs(weiUnits[Fn])}function getAccount(Fn){const Mn=Fn.state.current,rs=Fn.state.connections.get(Mn),is=rs==null?void 0:rs.accounts,os=is==null?void 0:is[0],as=Fn.chains.find(ds=>ds.id===(rs==null?void 0:rs.chainId)),us=Fn.state.status;switch(us){case"connected":return{address:os,addresses:is,chain:as,chainId:rs==null?void 0:rs.chainId,connector:rs==null?void 0:rs.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:us};case"reconnecting":return{address:os,addresses:is,chain:as,chainId:rs==null?void 0:rs.chainId,connector:rs==null?void 0:rs.connector,isConnected:!!os,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:us};case"connecting":return{address:os,addresses:is,chain:as,chainId:rs==null?void 0:rs.chainId,connector:rs==null?void 0:rs.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:us};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:us}}}async function multicall(Fn,Mn){const{allowFailure:rs=!0,chainId:is,contracts:os,...as}=Mn,us=Fn.getClient({chainId:is});return getAction(us,multicall$1,"multicall")({allowFailure:rs,contracts:os,...as})}function readContract(Fn,Mn){const{chainId:rs,...is}=Mn,os=Fn.getClient({chainId:rs});return getAction(os,readContract$1,"readContract")(is)}async function readContracts(Fn,Mn){var ds;const{allowFailure:rs=!0,blockNumber:is,blockTag:os,...as}=Mn,us=Mn.contracts;try{const hs={};for(const[mo,Ao]of us.entries()){const $o=Ao.chainId??Fn.state.chainId;hs[$o]||(hs[$o]=[]),(ds=hs[$o])==null||ds.push({contract:Ao,index:mo})}const ps=()=>Object.entries(hs).map(([mo,Ao])=>multicall(Fn,{...as,allowFailure:rs,blockNumber:is,blockTag:os,chainId:Number.parseInt(mo),contracts:Ao.map(({contract:$o})=>$o)})),io=(await Promise.all(ps())).flat(),fo=Object.values(hs).flatMap(mo=>mo.map(({index:Ao})=>Ao));return io.reduce((mo,Ao,$o)=>(mo&&(mo[fo[$o]]=Ao),mo),[])}catch(hs){if(hs instanceof ContractFunctionExecutionError)throw hs;const ps=()=>us.map(io=>readContract(Fn,{...io,blockNumber:is,blockTag:os}));return rs?(await Promise.allSettled(ps())).map(io=>io.status==="fulfilled"?{result:io.value,status:"success"}:{error:io.reason,result:void 0,status:"failure"}):await Promise.all(ps())}}async function getBalance(Fn,Mn){const{address:rs,blockNumber:is,blockTag:os,chainId:as,token:us,unit:ds="ether"}=Mn;if(us)try{return getTokenBalance(Fn,{balanceAddress:rs,chainId:as,symbolType:"string",tokenAddress:us})}catch(mo){if(mo instanceof ContractFunctionExecutionError){const Ao=await getTokenBalance(Fn,{balanceAddress:rs,chainId:as,symbolType:"bytes32",tokenAddress:us}),$o=hexToString(trim$1(Ao.symbol,{dir:"right"}));return{...Ao,symbol:$o}}throw mo}const hs=Fn.getClient({chainId:as}),io=await getAction(hs,getBalance$1,"getBalance")(is?{address:rs,blockNumber:is}:{address:rs,blockTag:os}),fo=Fn.chains.find(mo=>mo.id===as)??hs.chain;return{decimals:fo.nativeCurrency.decimals,formatted:formatUnits$1(io,getUnit(ds)),symbol:fo.nativeCurrency.symbol,value:io}}async function getTokenBalance(Fn,Mn){const{balanceAddress:rs,chainId:is,symbolType:os,tokenAddress:as,unit:us}=Mn,ds={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:os}]}],address:as},[hs,ps,io]=await readContracts(Fn,{allowFailure:!1,contracts:[{...ds,functionName:"balanceOf",args:[rs],chainId:is},{...ds,functionName:"decimals",chainId:is},{...ds,functionName:"symbol",chainId:is}]}),fo=formatUnits$1(hs??"0",getUnit(us??ps));return{decimals:ps,formatted:fo,symbol:io,value:hs}}function deepEqual(Fn,Mn){if(Fn===Mn)return!0;if(Fn&&Mn&&typeof Fn=="object"&&typeof Mn=="object"){if(Fn.constructor!==Mn.constructor)return!1;let rs,is;if(Array.isArray(Fn)&&Array.isArray(Mn)){if(rs=Fn.length,rs!==Mn.length)return!1;for(is=rs;is--!==0;)if(!deepEqual(Fn[is],Mn[is]))return!1;return!0}if(Fn.valueOf!==Object.prototype.valueOf)return Fn.valueOf()===Mn.valueOf();if(Fn.toString!==Object.prototype.toString)return Fn.toString()===Mn.toString();const os=Object.keys(Fn);if(rs=os.length,rs!==Object.keys(Mn).length)return!1;for(is=rs;is--!==0;)if(!Object.prototype.hasOwnProperty.call(Mn,os[is]))return!1;for(is=rs;is--!==0;){const as=os[is];if(as&&!deepEqual(Fn[as],Mn[as]))return!1}return!0}return Fn!==Fn&&Mn!==Mn}let previousChains=[];function getChains(Fn){const Mn=Fn.chains;return deepEqual(previousChains,Mn)?previousChains:(previousChains=Mn,Mn)}let previousConnections=[];function getConnections(Fn){const Mn=[...Fn.state.connections.values()];return Fn.state.status==="reconnecting"||deepEqual(previousConnections,Mn)?previousConnections:(previousConnections=Mn,Mn)}let previousConnectors=[];function getConnectors(Fn){const Mn=Fn.connectors;return deepEqual(previousConnectors,Mn)?previousConnectors:(previousConnectors=Mn,Mn)}function getEnsAddress(Fn,Mn){const{chainId:rs,...is}=Mn,os=Fn.getClient({chainId:rs});return getAction(os,getEnsAddress$1,"getEnsAddress")(is)}function getEnsAvatar(Fn,Mn){const{chainId:rs,...is}=Mn,os=Fn.getClient({chainId:rs});return getAction(os,getEnsAvatar$1,"getEnsAvatar")(is)}function getEnsName(Fn,Mn){const{chainId:rs,...is}=Mn,os=Fn.getClient({chainId:rs});return getAction(os,getEnsName$1,"getEnsName")(is)}async function prepareTransactionRequest(Fn,Mn){const{account:rs,chainId:is,...os}=Mn,as=rs??getAccount(Fn).address,us=Fn.getClient({chainId:is});return getAction(us,prepareTransactionRequest$1,"prepareTransactionRequest")({...os,...as?{account:as}:{}})}let isReconnecting=!1;async function reconnect(Fn,Mn={}){var ps,io;if(isReconnecting)return[];isReconnecting=!0,Fn.setState(fo=>({...fo,status:fo.current?"reconnecting":"connecting"}));const rs=[];if((ps=Mn.connectors)!=null&&ps.length)for(const fo of Mn.connectors){let mo;typeof fo=="function"?mo=Fn._internal.connectors.setup(fo):mo=fo,rs.push(mo)}else rs.push(...Fn.connectors);let is;try{is=await((io=Fn.storage)==null?void 0:io.getItem("recentConnectorId"))}catch{}const os={};for(const[,fo]of Fn.state.connections)os[fo.connector.id]=1;is&&(os[is]=0);const as=Object.keys(os).length>0?[...rs].sort((fo,mo)=>(os[fo.id]??10)-(os[mo.id]??10)):rs;let us=!1;const ds=[],hs=[];for(const fo of as){const mo=await fo.getProvider().catch(()=>{});if(!mo||hs.some(Lo=>Lo===mo)||!await fo.isAuthorized())continue;const $o=await fo.connect({isReconnecting:!0}).catch(()=>null);$o&&(fo.emitter.off("connect",Fn._internal.events.connect),fo.emitter.on("change",Fn._internal.events.change),fo.emitter.on("disconnect",Fn._internal.events.disconnect),Fn.setState(Lo=>{const Go=new Map(us?Lo.connections:new Map).set(fo.uid,{accounts:$o.accounts,chainId:$o.chainId,connector:fo});return{...Lo,current:us?Lo.current:fo.uid,connections:Go}}),ds.push({accounts:$o.accounts,chainId:$o.chainId,connector:fo}),hs.push(mo),us=!0)}return(Fn.state.status==="reconnecting"||Fn.state.status==="connecting")&&(us?Fn.setState(fo=>({...fo,status:"connected"})):Fn.setState(fo=>({...fo,connections:new Map,current:null,status:"disconnected"}))),isReconnecting=!1,ds}async function sendTransaction(Fn,Mn){const{account:rs,chainId:is,connector:os,gas:as,...us}=Mn;let ds;typeof rs=="object"&&(rs==null?void 0:rs.type)==="local"?ds=Fn.getClient({chainId:is}):ds=await getConnectorClient(Fn,{account:rs??void 0,chainId:is,connector:os});const{connector:hs}=getAccount(Fn),ps=await(async()=>{var mo;if(!(!("data"in Mn)||!Mn.data)&&!((mo=os??hs)!=null&&mo.supportsSimulation)&&as!==null)return as===void 0?getAction(ds,estimateGas$1,"estimateGas")({...us,account:rs,chain:is?{id:is}:null}):as})();return await getAction(ds,sendTransaction$1,"sendTransaction")({...us,...rs?{account:rs}:{},gas:ps,chain:is?{id:is}:null})}async function signMessage(Fn,Mn){const{account:rs,connector:is,...os}=Mn;let as;return typeof rs=="object"&&rs.type==="local"?as=Fn.getClient():as=await getConnectorClient(Fn,{account:rs,connector:is}),getAction(as,signMessage$1,"signMessage")({...os,...rs?{account:rs}:{}})}async function simulateContract(Fn,Mn){const{abi:rs,chainId:is,connector:os,...as}=Mn;let us;Mn.account?us=Mn.account:us=(await getConnectorClient(Fn,{chainId:is,connector:os})).account;const ds=Fn.getClient({chainId:is}),hs=getAction(ds,simulateContract$1,"simulateContract"),{result:ps,request:io}=await hs({...as,abi:rs,account:us});return{chainId:ds.chain.id,result:ps,request:{__mode:"prepared",...io,chainId:is}}}async function switchAccount(Fn,Mn){var os;const{connector:rs}=Mn,is=Fn.state.connections.get(rs.uid);if(!is)throw new ConnectorNotConnectedError;return await((os=Fn.storage)==null?void 0:os.setItem("recentConnectorId",rs.id)),Fn.setState(as=>({...as,current:rs.uid})),{accounts:is.accounts,chainId:is.chainId}}class ProviderNotFoundError extends BaseError$1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class SwitchChainNotSupportedError extends BaseError$1{constructor({connector:Mn}){super(`"${Mn.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function switchChain(Fn,Mn){var us;const{addEthereumChainParameter:rs,chainId:is}=Mn,os=Fn.state.connections.get(((us=Mn.connector)==null?void 0:us.uid)??Fn.state.current);if(os){const ds=os.connector;if(!ds.switchChain)throw new SwitchChainNotSupportedError({connector:ds});return await ds.switchChain({addEthereumChainParameter:rs,chainId:is})}const as=Fn.chains.find(ds=>ds.id===is);if(!as)throw new ChainNotConfiguredError;return Fn.setState(ds=>({...ds,chainId:is})),as}function watchAccount(Fn,Mn){const{onChange:rs}=Mn;return Fn.subscribe(()=>getAccount(Fn),rs,{equalityFn(is,os){const{connector:as,...us}=is,{connector:ds,...hs}=os;return deepEqual(us,hs)&&(as==null?void 0:as.id)===(ds==null?void 0:ds.id)&&(as==null?void 0:as.uid)===(ds==null?void 0:ds.uid)}})}async function watchAsset(Fn,Mn){const{connector:rs,...is}=Mn,os=await getConnectorClient(Fn,{connector:rs});return getAction(os,watchAsset$1,"watchAsset")(is)}function watchConnections(Fn,Mn){const{onChange:rs}=Mn;return Fn.subscribe(()=>getConnections(Fn),rs,{equalityFn:deepEqual})}function watchConnectors(Fn,Mn){const{onChange:rs}=Mn;return Fn._internal.connectors.subscribe((is,os)=>{rs(Object.values(is),os)})}async function waitForTransactionReceipt(Fn,Mn){const{chainId:rs,timeout:is=0,...os}=Mn,as=Fn.getClient({chainId:rs}),ds=await getAction(as,waitForTransactionReceipt$1,"waitForTransactionReceipt")({...os,timeout:is});if(ds.status==="reverted"){const ps=await getAction(as,getTransaction,"getTransaction")({hash:ds.transactionHash}),fo=await getAction(as,call,"call")({...ps,gasPrice:ps.type!=="eip1559"?ps.gasPrice:void 0,maxFeePerGas:ps.type==="eip1559"?ps.maxFeePerGas:void 0,maxPriorityFeePerGas:ps.type==="eip1559"?ps.maxPriorityFeePerGas:void 0}),mo=fo!=null&&fo.data?hexToString(`0x${fo.data.substring(138)}`):"unknown reason";throw new Error(mo)}return{...ds,chainId:as.chain.id}}async function writeContract(Fn,Mn){const{account:rs,chainId:is,connector:os,__mode:as,...us}=Mn;let ds;typeof rs=="object"&&(rs==null?void 0:rs.type)==="local"?ds=Fn.getClient({chainId:is}):ds=await getConnectorClient(Fn,{account:rs??void 0,chainId:is,connector:os});const{connector:hs}=getAccount(Fn);let ps;if(as==="prepared"||hs!=null&&hs.supportsSimulation)ps=us;else{const{request:mo}=await simulateContract(Fn,{...us,account:rs,chainId:is});ps=mo}return await getAction(ds,writeContract$1,"writeContract")({...ps,...rs?{account:rs}:{},chain:is?{id:is}:null})}function createConnector(Fn){return Fn}const supportsSimulationIdRegex=/(rabby|trustwallet)/;injected.type="injected";function injected(Fn={}){const{shimDisconnect:Mn=!0,unstable_shimAsyncInject:rs}=Fn;function is(){const hs=Fn.target;if(typeof hs=="function"){const ps=hs();if(ps)return ps}return typeof hs=="object"?hs:typeof hs=="string"?{...targetMap[hs]??{id:hs,name:`${hs[0].toUpperCase()}${hs.slice(1)}`,provider:`is${hs[0].toUpperCase()}${hs.slice(1)}`}}:{id:"injected",name:"Injected",provider(ps){return ps==null?void 0:ps.ethereum}}}let os,as,us,ds;return hs=>({get icon(){return is().icon},get id(){return is().id},get name(){return is().name},get supportsSimulation(){return supportsSimulationIdRegex.test(this.id.toLowerCase())},type:injected.type,async setup(){const ps=await this.getProvider();ps!=null&&ps.on&&Fn.target&&(us||(us=this.onConnect.bind(this),ps.on("connect",us)),os||(os=this.onAccountsChanged.bind(this),ps.on("accountsChanged",os)))},async connect({chainId:ps,isReconnecting:io}={}){var Ao,$o,Lo,Go,Yo,Wo;const fo=await this.getProvider();if(!fo)throw new ProviderNotFoundError;let mo=[];if(io)mo=await this.getAccounts().catch(()=>[]);else if(Mn)try{mo=(Go=(Lo=($o=(Ao=(await fo.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:Ao.caveats)==null?void 0:$o[0])==null?void 0:Lo.value)==null?void 0:Go.map(xl=>getAddress$1(xl)),mo.length>0&&(mo=await this.getAccounts())}catch(Jo){const xl=Jo;if(xl.code===UserRejectedRequestError.code)throw new UserRejectedRequestError(xl);if(xl.code===ResourceUnavailableRpcError.code)throw xl}try{!(mo!=null&&mo.length)&&!io&&(mo=(await fo.request({method:"eth_requestAccounts"})).map(_l=>getAddress$1(_l))),us&&(fo.removeListener("connect",us),us=void 0),os||(os=this.onAccountsChanged.bind(this),fo.on("accountsChanged",os)),as||(as=this.onChainChanged.bind(this),fo.on("chainChanged",as)),ds||(ds=this.onDisconnect.bind(this),fo.on("disconnect",ds));let Jo=await this.getChainId();if(ps&&Jo!==ps){const xl=await this.switchChain({chainId:ps}).catch(_l=>{if(_l.code===UserRejectedRequestError.code)throw _l;return{id:Jo}});Jo=(xl==null?void 0:xl.id)??Jo}return Mn&&await((Yo=hs.storage)==null?void 0:Yo.removeItem(`${this.id}.disconnected`)),Fn.target||await((Wo=hs.storage)==null?void 0:Wo.setItem("injected.connected",!0)),{accounts:mo,chainId:Jo}}catch(Jo){const xl=Jo;throw xl.code===UserRejectedRequestError.code?new UserRejectedRequestError(xl):xl.code===ResourceUnavailableRpcError.code?new ResourceUnavailableRpcError(xl):xl}},async disconnect(){var io,fo;const ps=await this.getProvider();if(!ps)throw new ProviderNotFoundError;as&&(ps.removeListener("chainChanged",as),as=void 0),ds&&(ps.removeListener("disconnect",ds),ds=void 0),us||(us=this.onConnect.bind(this),ps.on("connect",us));try{await withTimeout(()=>ps.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}Mn&&await((io=hs.storage)==null?void 0:io.setItem(`${this.id}.disconnected`,!0)),Fn.target||await((fo=hs.storage)==null?void 0:fo.removeItem("injected.connected"))},async getAccounts(){const ps=await this.getProvider();if(!ps)throw new ProviderNotFoundError;return(await ps.request({method:"eth_accounts"})).map(fo=>getAddress$1(fo))},async getChainId(){const ps=await this.getProvider();if(!ps)throw new ProviderNotFoundError;const io=await ps.request({method:"eth_chainId"});return Number(io)},async getProvider(){if(typeof window>"u")return;let ps;const io=is();return typeof io.provider=="function"?ps=io.provider(window):typeof io.provider=="string"?ps=findProvider(window,io.provider):ps=io.provider,ps&&!ps.removeListener&&("off"in ps&&typeof ps.off=="function"?ps.removeListener=ps.off:ps.removeListener=()=>{}),ps},async isAuthorized(){var ps,io;try{if(Mn&&await((ps=hs.storage)==null?void 0:ps.getItem(`${this.id}.disconnected`))||!Fn.target&&!await((io=hs.storage)==null?void 0:io.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(rs!==void 0&&rs!==!1){const $o=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",$o),!!await this.getProvider()),Lo=typeof rs=="number"?rs:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(Yo=>window.addEventListener("ethereum#initialized",()=>Yo($o()),{once:!0}))]:[],new Promise(Yo=>setTimeout(()=>Yo($o()),Lo))]))return!0}throw new ProviderNotFoundError}return!!(await withRetry(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:ps,chainId:io}){var Ao,$o,Lo,Go;const fo=await this.getProvider();if(!fo)throw new ProviderNotFoundError;const mo=hs.chains.find(Yo=>Yo.id===io);if(!mo)throw new SwitchChainError(new ChainNotConfiguredError);try{return await Promise.all([fo.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(io)}]}).then(async()=>{await this.getChainId()===io&&hs.emitter.emit("change",{chainId:io})}),new Promise(Yo=>{const Wo=Jo=>{"chainId"in Jo&&Jo.chainId===io&&(hs.emitter.off("change",Wo),Yo())};hs.emitter.on("change",Wo)})]),mo}catch(Yo){const Wo=Yo;if(Wo.code===4902||(($o=(Ao=Wo==null?void 0:Wo.data)==null?void 0:Ao.originalError)==null?void 0:$o.code)===4902)try{const{default:Jo,...xl}=mo.blockExplorers??{};let _l;ps!=null&&ps.blockExplorerUrls?_l=ps.blockExplorerUrls:Jo&&(_l=[Jo.url,...Object.values(xl).map(Pl=>Pl.url)]);let Tl;(Lo=ps==null?void 0:ps.rpcUrls)!=null&&Lo.length?Tl=ps.rpcUrls:Tl=[((Go=mo.rpcUrls.default)==null?void 0:Go.http[0])??""];const Sl={blockExplorerUrls:_l,chainId:numberToHex(io),chainName:(ps==null?void 0:ps.chainName)??mo.name,iconUrls:ps==null?void 0:ps.iconUrls,nativeCurrency:(ps==null?void 0:ps.nativeCurrency)??mo.nativeCurrency,rpcUrls:Tl};if(await fo.request({method:"wallet_addEthereumChain",params:[Sl]}),await this.getChainId()!==io)throw new UserRejectedRequestError(new Error("User rejected switch after adding network."));return mo}catch(Jo){throw new UserRejectedRequestError(Jo)}throw Wo.code===UserRejectedRequestError.code?new UserRejectedRequestError(Wo):new SwitchChainError(Wo)}},async onAccountsChanged(ps){var io;if(ps.length===0)this.onDisconnect();else if(hs.emitter.listenerCount("connect")){const fo=(await this.getChainId()).toString();this.onConnect({chainId:fo}),Mn&&await((io=hs.storage)==null?void 0:io.removeItem(`${this.id}.disconnected`))}else hs.emitter.emit("change",{accounts:ps.map(fo=>getAddress$1(fo))})},onChainChanged(ps){const io=Number(ps);hs.emitter.emit("change",{chainId:io})},async onConnect(ps){const io=await this.getAccounts();if(io.length===0)return;const fo=Number(ps.chainId);hs.emitter.emit("connect",{accounts:io,chainId:fo});const mo=await this.getProvider();mo&&(us&&(mo.removeListener("connect",us),us=void 0),os||(os=this.onAccountsChanged.bind(this),mo.on("accountsChanged",os)),as||(as=this.onChainChanged.bind(this),mo.on("chainChanged",as)),ds||(ds=this.onDisconnect.bind(this),mo.on("disconnect",ds)))},async onDisconnect(ps){const io=await this.getProvider();ps&&ps.code===1013&&io&&(await this.getAccounts()).length||(hs.emitter.emit("disconnect"),io&&(as&&(io.removeListener("chainChanged",as),as=void 0),ds&&(io.removeListener("disconnect",ds),ds=void 0),us||(us=this.onConnect.bind(this),io.on("connect",us))))}})}const targetMap={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(Fn){return Fn!=null&&Fn.coinbaseWalletExtension?Fn.coinbaseWalletExtension:findProvider(Fn,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(Fn){return findProvider(Fn,Mn=>{if(!Mn.isMetaMask||Mn.isBraveWallet&&!Mn._events&&!Mn._state)return!1;const rs=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const is of rs)if(Mn[is])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(Fn){var Mn,rs;return(Mn=Fn==null?void 0:Fn.phantom)!=null&&Mn.ethereum?(rs=Fn.phantom)==null?void 0:rs.ethereum:findProvider(Fn,"isPhantom")}}};function findProvider(Fn,Mn){function rs(os){return typeof Mn=="function"?Mn(os):typeof Mn=="string"?os[Mn]:!0}const is=Fn.ethereum;if(is!=null&&is.providers)return is.providers.find(os=>rs(os));if(is&&rs(is))return is}function requestProviders(Fn){if(typeof window>"u")return;const Mn=rs=>Fn(rs.detail);return window.addEventListener("eip6963:announceProvider",Mn),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",Mn)}function createStore$3(){const Fn=new Set;let Mn=[];const rs=()=>requestProviders(os=>{Mn.some(({info:as})=>as.uuid===os.info.uuid)||(Mn=[...Mn,os],Fn.forEach(as=>as(Mn,{added:[os]})))});let is=rs();return{_listeners(){return Fn},clear(){Fn.forEach(os=>os([],{removed:[...Mn]})),Mn=[]},destroy(){this.clear(),Fn.clear(),is==null||is()},findProvider({rdns:os}){return Mn.find(as=>as.info.rdns===os)},getProviders(){return Mn},reset(){this.clear(),is==null||is(),is=rs()},subscribe(os,{emitImmediately:as}={}){return Fn.add(os),as&&os(Mn,{added:Mn}),()=>Fn.delete(os)}}}const __vite_import_meta_env__$6={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_ARBITRUM_BTC_CALL_CONTROLLER_ADDRESS:"0x88e7a3A04384B873121A3D4D8c7260C30a17f9b6",VITE_ARBITRUM_BTC_CALL_LONGTOKEN_ADDRESS:"0x849A6746D6235087593789184215B16a09353b58",VITE_ARBITRUM_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0x0f4f76a9DC0C9e5920928D443BD56a9910B9d440",VITE_ARBITRUM_BTC_CALL_SHORTTOKEN_ADDRESS:"0x7204F3591EfA344D7Db30A93B53f7ee896407A46",VITE_ARBITRUM_BTC_CALL_VAULT_ADDRESS:"0x1EF72E09cdcc719994Df01ef420413c387afF523",VITE_ARBITRUM_BTC_PUT_CONTROLLER_ADDRESS:"0x023b95F123d9F1f7c501cBC0Ff119C1148ae244d",VITE_ARBITRUM_BTC_PUT_LONGTOKEN_ADDRESS:"0x2A1be4b228e486d33988549b72fc0EDE7c67DfeC",VITE_ARBITRUM_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x6d635c3059C42e661D4f4D1aB3Ad7ad8Cb21a0ea",VITE_ARBITRUM_BTC_PUT_SHORTTOKEN_ADDRESS:"0x1ca634Fc2ba18EF9e23a1a4f50C204Fccee5b959",VITE_ARBITRUM_BTC_PUT_VAULT_ADDRESS:"0xCF4cb0D6058f6a0a2599997CB66EaC0AeBdB4be4",VITE_ARBITRUM_CANDLE_INTERVAL:"1",VITE_ARBITRUM_CHAIN_ID:"421614",VITE_ARBITRUM_CHAIN_ID_HEX:"0x66eee",VITE_ARBITRUM_CHAIN_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_CONNECT_NETWORK_NAME:"arbitrumSepolia",VITE_ARBITRUM_CYCLE_DURATION:"5",VITE_ARBITRUM_ETH_CALL_CONTROLLER_ADDRESS:"0xFf72B4fBCCeC5a01554BeE50595E999B84c4b5cd",VITE_ARBITRUM_ETH_CALL_LONGTOKEN_ADDRESS:"0x331D8e8e0ad743F3A1908734106051a21A79a809",VITE_ARBITRUM_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5f9A93b04De5fCFd4FA552Bab87927B4F7811283",VITE_ARBITRUM_ETH_CALL_SHORTTOKEN_ADDRESS:"0xe5a3222720347c3ABAD046D69C16f97B3f69D6e6",VITE_ARBITRUM_ETH_CALL_VAULT_ADDRESS:"0x3d2D17Dd22AAF2b5E78aC8287e91D94c6f293264",VITE_ARBITRUM_ETH_PUT_CONTROLLER_ADDRESS:"0x7113e58c3E35E4adcF49f8C94915541BF3c0b54b",VITE_ARBITRUM_ETH_PUT_LONGTOKEN_ADDRESS:"0x623AC047de297c98B0a300299D66334Fb6653334",VITE_ARBITRUM_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x8BD2f0d7713AF3Fbd1bCd4837D6B0dEE2424BF62",VITE_ARBITRUM_ETH_PUT_SHORTTOKEN_ADDRESS:"0x555FaB7E6909d62812a57a22A4e4782fB227943a",VITE_ARBITRUM_ETH_PUT_VAULT_ADDRESS:"0xD5a2e5eC7B7E12E4D13fF0CD86510e5d0ED9f22F",VITE_ARBITRUM_EXPLORER_LINK:"https://sepolia.arbiscan.io",VITE_ARBITRUM_FAUCET_URL:"https://www.alchemy.com/faucets/arbitrum-sepolia",VITE_ARBITRUM_GAS_MULTIPLIER:"200",VITE_ARBITRUM_INFO_AGGREGATOR_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_ARBITRUM_NATIVE_TOKEN:"Arbitrum ETH",VITE_ARBITRUM_NATIVE_TOKEN_DECIMALS:"18",VITE_ARBITRUM_NATIVE_TOKEN_NAME:"ETH",VITE_ARBITRUM_NATIVE_TOKEN_SYMBOL:"ETH",VITE_ARBITRUM_NETWORK_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_PEPE_CALL_CONTROLLER_ADDRESS:"0x9e4c0853D182280dDb07700E754f5164870b19b8",VITE_ARBITRUM_PEPE_CALL_LONGTOKEN_ADDRESS:"0x59c5c8cAf2f35711D6AeB3aB10d9C0941332c8C1",VITE_ARBITRUM_PEPE_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5b7B8058f9E42f5E1a1c8a5777e4fc7337ea388e",VITE_ARBITRUM_PEPE_CALL_SHORTTOKEN_ADDRESS:"0x2A92e73FB8E70245d8e5a02796Fbd337f218a2b3",VITE_ARBITRUM_PEPE_CALL_VAULT_ADDRESS:"0x47D92807f3DD509ca9263ad89869eedc2c929d8D",VITE_ARBITRUM_PEPE_PUT_CONTROLLER_ADDRESS:"0x335Aa597E78Ce41df4BFC5d8Fb239CE788549Fbf",VITE_ARBITRUM_PEPE_PUT_LONGTOKEN_ADDRESS:"0x0833370393c95F6248B0993f72115049a17C7e2B",VITE_ARBITRUM_PEPE_PUT_SETTLEMENTMANAGER_ADDRESS:"0xcF237Eaf46ec94003CF6BAfcB2d7ec1bdD9760aa",VITE_ARBITRUM_PEPE_PUT_SHORTTOKEN_ADDRESS:"0xDf148c772598A24eA94A96FA6556D53EBED5E248",VITE_ARBITRUM_PEPE_PUT_VAULT_ADDRESS:"0x6A1Fd2267bC482C8D5833F6cE54e34951b6554cf",VITE_ARBITRUM_PREMIUM_PER_CYCLE:"0.5",VITE_ARBITRUM_PUBLIC_RPC:"https://arbitrum-sepolia.blockpi.network/v1/rpc/public",VITE_ARBITRUM_RPC:"https://greatest-falling-patron.arbitrum-sepolia.quiknode.pro/933e64a18e212561d0a0fdab953df2fdc1c06080",VITE_ARBITRUM_SCRAPPING_TIME:"30",VITE_ARBITRUM_SETTLEMENT_TOKEN_ADDRESS:"0x30B74a8766563DbAbAf04e0FFE392817F2D02Da1",VITE_ARBITRUM_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_ARBITRUM_WIF_CALL_CONTROLLER_ADDRESS:"0x4871807209e54b608e5844107Cf06Bcf12129F80",VITE_ARBITRUM_WIF_CALL_LONGTOKEN_ADDRESS:"0xa8DdE51B13C7d81b4D9c2c8EAa2E79bB828d82C4",VITE_ARBITRUM_WIF_CALL_SETTLEMENTMANAGER_ADDRESS:"0x583855075C098F2Cd7b2dA5995a2B329f0aE0f3c",VITE_ARBITRUM_WIF_CALL_SHORTTOKEN_ADDRESS:"0x582071a082189236f41527339DBb56B0c111CD6E",VITE_ARBITRUM_WIF_CALL_VAULT_ADDRESS:"0xFbd0Df32C6f75374B4b4Cb03f405932b4eeAC199",VITE_ARBITRUM_WIF_PUT_CONTROLLER_ADDRESS:"0x463377730eCaa7310Dcb3A3d48aDE097A23Bdd42",VITE_ARBITRUM_WIF_PUT_LONGTOKEN_ADDRESS:"0x607324341E75a5a51959a7b541cC8Fd7576e3066",VITE_ARBITRUM_WIF_PUT_SETTLEMENTMANAGER_ADDRESS:"0xFaA4AbaF2890958B200A04AE4cB2880Ad929d8A9",VITE_ARBITRUM_WIF_PUT_SHORTTOKEN_ADDRESS:"0x3FD0b87A9b30738F8086f0c2fDDe469687250FEb",VITE_ARBITRUM_WIF_PUT_VAULT_ADDRESS:"0x4C585D80bDDa554278F909bA51F2E42A2d5f5b96",VITE_BACKEND_URL:"https://switch-testnet-backend.kanalabs.io",VITE_BINANCE_BTC_CALL_CONTROLLER_ADDRESS:"0xC0028f1E9493bdba1670E8C65284f43F897D16d4",VITE_BINANCE_BTC_CALL_LONGTOKEN_ADDRESS:"0xA3fD705798AF4FA090B4dC95E97Ffb353a576969",VITE_BINANCE_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0xd38fd86FCCBf8DE9102d7C3D82799432D0B8da32",VITE_BINANCE_BTC_CALL_SHORTTOKEN_ADDRESS:"0xCaEC56628DCe5709F6B17De68C3431f45D4aBc37",VITE_BINANCE_BTC_CALL_VAULT_ADDRESS:"0x2fdbb070D4767cb11fe176CE48986aF222830437",VITE_BINANCE_BTC_PUT_CONTROLLER_ADDRESS:"0xBd99Fdae11A55E41e9ce1Cb27F2A6182dB579af8",VITE_BINANCE_BTC_PUT_LONGTOKEN_ADDRESS:"0x5E7f282a9Cd7BF64fD4EccD13b34703D7F27333d",VITE_BINANCE_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x9f3D3a8D3f0215Fe2D7692096DBC4b097EF5D963",VITE_BINANCE_BTC_PUT_SHORTTOKEN_ADDRESS:"0x7961F22D5931a510b40f740a005339109243Ca30",VITE_BINANCE_BTC_PUT_VAULT_ADDRESS:"0xaaBbF2bC143F59ab731C48FD687a14a8c30F2383",VITE_BINANCE_CANDLE_INTERVAL:"15",VITE_BINANCE_CHAIN_ID:"97",VITE_BINANCE_CHAIN_ID_HEX:"0x61",VITE_BINANCE_CHAIN_NAME:"BNB Smart Chain Testnet",VITE_BINANCE_CONNECT_NETWORK_NAME:"bscTestnet",VITE_BINANCE_CYCLE_DURATION:"120",VITE_BINANCE_ETH_CALL_CONTROLLER_ADDRESS:"0x9e35EDB90CF67A455Dc54418363bd6EC8fd0750d",VITE_BINANCE_ETH_CALL_LONGTOKEN_ADDRESS:"0x264821A828df29D027AF824Fb8A3a9cCCfbfB4bE",VITE_BINANCE_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0xbfE633B7A33e75EfD4af4522666a1c8eac4b3b65",VITE_BINANCE_ETH_CALL_SHORTTOKEN_ADDRESS:"0xE649a5a93224F6dc9bD9d5934A93b28F0a153956",VITE_BINANCE_ETH_CALL_VAULT_ADDRESS:"0x1E88b5ffd67313aC35cb13b4574284a1856047a3",VITE_BINANCE_ETH_PUT_CONTROLLER_ADDRESS:"0x3a577c95f96990E7741F8c07568476bA84567356",VITE_BINANCE_ETH_PUT_LONGTOKEN_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_BINANCE_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x254FF4CFa3d7dd1829B408243266870266f841CA",VITE_BINANCE_ETH_PUT_SHORTTOKEN_ADDRESS:"0x7051898114C8347fea6a2dcd6E3606D3FB31508F",VITE_BINANCE_ETH_PUT_VAULT_ADDRESS:"0x1FEF214CAdc20AB09562ECa67408e2cda49518A2",VITE_BINANCE_EXPLORER_LINK:"https://testnet.bscscan.com",VITE_BINANCE_FAUCET_URL:"https://testnet.bnbchain.org/faucet-smart",VITE_BINANCE_GAS_MULTIPLIER:"110",VITE_BINANCE_INFO_AGGREGATOR_ADDRESS:"0x3DFc4c69bce8e9455EafE3f429590fa9De5f128d",VITE_BINANCE_NATIVE_TOKEN:"tBNB",VITE_BINANCE_NATIVE_TOKEN_DECIMALS:"18",VITE_BINANCE_NATIVE_TOKEN_NAME:"tBNB",VITE_BINANCE_NATIVE_TOKEN_SYMBOL:"tBNB",VITE_BINANCE_NETWORK_NAME:"Binance Testnet",VITE_BINANCE_PREMIUM_PER_CYCLE:"0.5",VITE_BINANCE_PUBLIC_RPC:"https://endpoints.omniatech.io/v1/bsc/testnet/public",VITE_BINANCE_RPC:"https://cold-burned-general.bsc-testnet.quiknode.pro/5dc69c2182e7f66da44461e6dde3d7d786575a30/",VITE_BINANCE_SCRAPPING_TIME:"300",VITE_BINANCE_SETTLEMENT_TOKEN_ADDRESS:"0xDD0020ffDD1B371189778954Cf556B2979b0D33d",VITE_BINANCE_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_CHAIN_TOKEN_ARRAY:"BINANCE_ETH,BINANCE_BTC,ARBITRUM_ETH,ARBITRUM_PEPE",VITE_CIPHERDATA:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjRlYjViZDZhOWNmNDE2YzJmNzc3ZjU2OTg3ODkzNWE4OTBlMTc5NDdjODUyZmRjMzNlYjU1NmZmNzNkZjE5OGUyODU1NTg4NGNkYzM1ZWMwZjQwNzZkMWE4M2RhNTFiM2ZjYTA1YmQ1YTBlNTIwZGViZGVkZTViNzQ5NjdlMGEwIn0.b7ECWqqAvXtC8fblJcVKLO0GKBxa7rfNDtUwsnAaUno",VITE_MORALIS_API_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjM1MGU5MDEyLTU1Y2MtNDZkMi1iZTRkLWU2YTNhNTFmYzIxYyIsIm9yZ0lkIjoiMzczNjA3IiwidXNlcklkIjoiMzgzOTUxIiwidHlwZUlkIjoiYTBlZWJlNWYtMjQ3Ny00NTRjLWFlMDEtYmIxMThjYzliNjZiIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MDU5MTM4MTMsImV4cCI6NDg2MTY3MzgxM30.6ChaPKm5D80_qsZMnlsCoSumD2z9gkBWSP7wwoCAido",VITE_NETWORK:"TESTNET",VITE_PAYMASTER_API_KEY:"6kz6vdwgdbzs3w55jbn45chhhkw7yq8yk",VITE_QUICKNODE_KEY:"f2d17d0c3e7ac54189a60dad8133a533c4b4e945",VITE_VERCEL_BRANCH_URL:"kana-operps-frontend-git-testnet-operps-projects.vercel.app",VITE_VERCEL_ENV:"preview",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"operps",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"operps",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Merge pull request #409 from operps/devnet

Devnet`,VITE_VERCEL_GIT_COMMIT_REF:"testnet",VITE_VERCEL_GIT_COMMIT_SHA:"226178a17dbaec9ac480571ddea005cdee23e6a9",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"800575360",VITE_VERCEL_GIT_REPO_OWNER:"operps",VITE_VERCEL_GIT_REPO_SLUG:"kana-operps-frontend",VITE_VERCEL_PROJECT_PRODUCTION_URL:"operps.kanalabs.io",VITE_VERCEL_URL:"kana-operps-frontend-1n78omxub-operps-projects.vercel.app",VITE_WALLETCONNECTPROJECTID:"b8d15d96157934a210eb13769a539caa"},subscribeWithSelectorImpl=Fn=>(Mn,rs,is)=>{const os=is.subscribe;return is.subscribe=(us,ds,hs)=>{let ps=us;if(ds){const io=(hs==null?void 0:hs.equalityFn)||Object.is;let fo=us(is.getState());ps=mo=>{const Ao=us(mo);if(!io(fo,Ao)){const $o=fo;ds(fo=Ao,$o)}},hs!=null&&hs.fireImmediately&&ds(fo,fo)}return os(ps)},Fn(Mn,rs,is)},subscribeWithSelector=subscribeWithSelectorImpl;function createJSONStorage(Fn,Mn){let rs;try{rs=Fn()}catch{return}return{getItem:os=>{var as;const us=hs=>hs===null?null:JSON.parse(hs,void 0),ds=(as=rs.getItem(os))!=null?as:null;return ds instanceof Promise?ds.then(us):us(ds)},setItem:(os,as)=>rs.setItem(os,JSON.stringify(as,void 0)),removeItem:os=>rs.removeItem(os)}}const toThenable=Fn=>Mn=>{try{const rs=Fn(Mn);return rs instanceof Promise?rs:{then(is){return toThenable(is)(rs)},catch(is){return this}}}catch(rs){return{then(is){return this},catch(is){return toThenable(is)(rs)}}}},oldImpl=(Fn,Mn)=>(rs,is,os)=>{let as={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:Go=>Go,version:0,merge:(Go,Yo)=>({...Yo,...Go}),...Mn},us=!1;const ds=new Set,hs=new Set;let ps;try{ps=as.getStorage()}catch{}if(!ps)return Fn((...Go)=>{console.warn(`[zustand persist middleware] Unable to update item '${as.name}', the given storage is currently unavailable.`),rs(...Go)},is,os);const io=toThenable(as.serialize),fo=()=>{const Go=as.partialize({...is()});let Yo;const Wo=io({state:Go,version:as.version}).then(Jo=>ps.setItem(as.name,Jo)).catch(Jo=>{Yo=Jo});if(Yo)throw Yo;return Wo},mo=os.setState;os.setState=(Go,Yo)=>{mo(Go,Yo),fo()};const Ao=Fn((...Go)=>{rs(...Go),fo()},is,os);let $o;const Lo=()=>{var Go;if(!ps)return;us=!1,ds.forEach(Wo=>Wo(is()));const Yo=((Go=as.onRehydrateStorage)==null?void 0:Go.call(as,is()))||void 0;return toThenable(ps.getItem.bind(ps))(as.name).then(Wo=>{if(Wo)return as.deserialize(Wo)}).then(Wo=>{if(Wo)if(typeof Wo.version=="number"&&Wo.version!==as.version){if(as.migrate)return as.migrate(Wo.state,Wo.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return Wo.state}).then(Wo=>{var Jo;return $o=as.merge(Wo,(Jo=is())!=null?Jo:Ao),rs($o,!0),fo()}).then(()=>{Yo==null||Yo($o,void 0),us=!0,hs.forEach(Wo=>Wo($o))}).catch(Wo=>{Yo==null||Yo(void 0,Wo)})};return os.persist={setOptions:Go=>{as={...as,...Go},Go.getStorage&&(ps=Go.getStorage())},clearStorage:()=>{ps==null||ps.removeItem(as.name)},getOptions:()=>as,rehydrate:()=>Lo(),hasHydrated:()=>us,onHydrate:Go=>(ds.add(Go),()=>{ds.delete(Go)}),onFinishHydration:Go=>(hs.add(Go),()=>{hs.delete(Go)})},Lo(),$o||Ao},newImpl=(Fn,Mn)=>(rs,is,os)=>{let as={storage:createJSONStorage(()=>localStorage),partialize:Lo=>Lo,version:0,merge:(Lo,Go)=>({...Go,...Lo}),...Mn},us=!1;const ds=new Set,hs=new Set;let ps=as.storage;if(!ps)return Fn((...Lo)=>{console.warn(`[zustand persist middleware] Unable to update item '${as.name}', the given storage is currently unavailable.`),rs(...Lo)},is,os);const io=()=>{const Lo=as.partialize({...is()});return ps.setItem(as.name,{state:Lo,version:as.version})},fo=os.setState;os.setState=(Lo,Go)=>{fo(Lo,Go),io()};const mo=Fn((...Lo)=>{rs(...Lo),io()},is,os);let Ao;const $o=()=>{var Lo,Go;if(!ps)return;us=!1,ds.forEach(Wo=>{var Jo;return Wo((Jo=is())!=null?Jo:mo)});const Yo=((Go=as.onRehydrateStorage)==null?void 0:Go.call(as,(Lo=is())!=null?Lo:mo))||void 0;return toThenable(ps.getItem.bind(ps))(as.name).then(Wo=>{if(Wo)if(typeof Wo.version=="number"&&Wo.version!==as.version){if(as.migrate)return as.migrate(Wo.state,Wo.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return Wo.state}).then(Wo=>{var Jo;return Ao=as.merge(Wo,(Jo=is())!=null?Jo:mo),rs(Ao,!0),io()}).then(()=>{Yo==null||Yo(Ao,void 0),Ao=is(),us=!0,hs.forEach(Wo=>Wo(Ao))}).catch(Wo=>{Yo==null||Yo(void 0,Wo)})};return os.persist={setOptions:Lo=>{as={...as,...Lo},Lo.storage&&(ps=Lo.storage)},clearStorage:()=>{ps==null||ps.removeItem(as.name)},getOptions:()=>as,rehydrate:()=>$o(),hasHydrated:()=>us,onHydrate:Lo=>(ds.add(Lo),()=>{ds.delete(Lo)}),onFinishHydration:Lo=>(hs.add(Lo),()=>{hs.delete(Lo)})},as.skipHydration||$o(),Ao||mo},persistImpl=(Fn,Mn)=>"getStorage"in Mn||"serialize"in Mn||"deserialize"in Mn?((__vite_import_meta_env__$6?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),oldImpl(Fn,Mn)):newImpl(Fn,Mn),persist=persistImpl,__vite_import_meta_env__$5={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_ARBITRUM_BTC_CALL_CONTROLLER_ADDRESS:"0x88e7a3A04384B873121A3D4D8c7260C30a17f9b6",VITE_ARBITRUM_BTC_CALL_LONGTOKEN_ADDRESS:"0x849A6746D6235087593789184215B16a09353b58",VITE_ARBITRUM_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0x0f4f76a9DC0C9e5920928D443BD56a9910B9d440",VITE_ARBITRUM_BTC_CALL_SHORTTOKEN_ADDRESS:"0x7204F3591EfA344D7Db30A93B53f7ee896407A46",VITE_ARBITRUM_BTC_CALL_VAULT_ADDRESS:"0x1EF72E09cdcc719994Df01ef420413c387afF523",VITE_ARBITRUM_BTC_PUT_CONTROLLER_ADDRESS:"0x023b95F123d9F1f7c501cBC0Ff119C1148ae244d",VITE_ARBITRUM_BTC_PUT_LONGTOKEN_ADDRESS:"0x2A1be4b228e486d33988549b72fc0EDE7c67DfeC",VITE_ARBITRUM_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x6d635c3059C42e661D4f4D1aB3Ad7ad8Cb21a0ea",VITE_ARBITRUM_BTC_PUT_SHORTTOKEN_ADDRESS:"0x1ca634Fc2ba18EF9e23a1a4f50C204Fccee5b959",VITE_ARBITRUM_BTC_PUT_VAULT_ADDRESS:"0xCF4cb0D6058f6a0a2599997CB66EaC0AeBdB4be4",VITE_ARBITRUM_CANDLE_INTERVAL:"1",VITE_ARBITRUM_CHAIN_ID:"421614",VITE_ARBITRUM_CHAIN_ID_HEX:"0x66eee",VITE_ARBITRUM_CHAIN_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_CONNECT_NETWORK_NAME:"arbitrumSepolia",VITE_ARBITRUM_CYCLE_DURATION:"5",VITE_ARBITRUM_ETH_CALL_CONTROLLER_ADDRESS:"0xFf72B4fBCCeC5a01554BeE50595E999B84c4b5cd",VITE_ARBITRUM_ETH_CALL_LONGTOKEN_ADDRESS:"0x331D8e8e0ad743F3A1908734106051a21A79a809",VITE_ARBITRUM_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5f9A93b04De5fCFd4FA552Bab87927B4F7811283",VITE_ARBITRUM_ETH_CALL_SHORTTOKEN_ADDRESS:"0xe5a3222720347c3ABAD046D69C16f97B3f69D6e6",VITE_ARBITRUM_ETH_CALL_VAULT_ADDRESS:"0x3d2D17Dd22AAF2b5E78aC8287e91D94c6f293264",VITE_ARBITRUM_ETH_PUT_CONTROLLER_ADDRESS:"0x7113e58c3E35E4adcF49f8C94915541BF3c0b54b",VITE_ARBITRUM_ETH_PUT_LONGTOKEN_ADDRESS:"0x623AC047de297c98B0a300299D66334Fb6653334",VITE_ARBITRUM_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x8BD2f0d7713AF3Fbd1bCd4837D6B0dEE2424BF62",VITE_ARBITRUM_ETH_PUT_SHORTTOKEN_ADDRESS:"0x555FaB7E6909d62812a57a22A4e4782fB227943a",VITE_ARBITRUM_ETH_PUT_VAULT_ADDRESS:"0xD5a2e5eC7B7E12E4D13fF0CD86510e5d0ED9f22F",VITE_ARBITRUM_EXPLORER_LINK:"https://sepolia.arbiscan.io",VITE_ARBITRUM_FAUCET_URL:"https://www.alchemy.com/faucets/arbitrum-sepolia",VITE_ARBITRUM_GAS_MULTIPLIER:"200",VITE_ARBITRUM_INFO_AGGREGATOR_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_ARBITRUM_NATIVE_TOKEN:"Arbitrum ETH",VITE_ARBITRUM_NATIVE_TOKEN_DECIMALS:"18",VITE_ARBITRUM_NATIVE_TOKEN_NAME:"ETH",VITE_ARBITRUM_NATIVE_TOKEN_SYMBOL:"ETH",VITE_ARBITRUM_NETWORK_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_PEPE_CALL_CONTROLLER_ADDRESS:"0x9e4c0853D182280dDb07700E754f5164870b19b8",VITE_ARBITRUM_PEPE_CALL_LONGTOKEN_ADDRESS:"0x59c5c8cAf2f35711D6AeB3aB10d9C0941332c8C1",VITE_ARBITRUM_PEPE_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5b7B8058f9E42f5E1a1c8a5777e4fc7337ea388e",VITE_ARBITRUM_PEPE_CALL_SHORTTOKEN_ADDRESS:"0x2A92e73FB8E70245d8e5a02796Fbd337f218a2b3",VITE_ARBITRUM_PEPE_CALL_VAULT_ADDRESS:"0x47D92807f3DD509ca9263ad89869eedc2c929d8D",VITE_ARBITRUM_PEPE_PUT_CONTROLLER_ADDRESS:"0x335Aa597E78Ce41df4BFC5d8Fb239CE788549Fbf",VITE_ARBITRUM_PEPE_PUT_LONGTOKEN_ADDRESS:"0x0833370393c95F6248B0993f72115049a17C7e2B",VITE_ARBITRUM_PEPE_PUT_SETTLEMENTMANAGER_ADDRESS:"0xcF237Eaf46ec94003CF6BAfcB2d7ec1bdD9760aa",VITE_ARBITRUM_PEPE_PUT_SHORTTOKEN_ADDRESS:"0xDf148c772598A24eA94A96FA6556D53EBED5E248",VITE_ARBITRUM_PEPE_PUT_VAULT_ADDRESS:"0x6A1Fd2267bC482C8D5833F6cE54e34951b6554cf",VITE_ARBITRUM_PREMIUM_PER_CYCLE:"0.5",VITE_ARBITRUM_PUBLIC_RPC:"https://arbitrum-sepolia.blockpi.network/v1/rpc/public",VITE_ARBITRUM_RPC:"https://greatest-falling-patron.arbitrum-sepolia.quiknode.pro/933e64a18e212561d0a0fdab953df2fdc1c06080",VITE_ARBITRUM_SCRAPPING_TIME:"30",VITE_ARBITRUM_SETTLEMENT_TOKEN_ADDRESS:"0x30B74a8766563DbAbAf04e0FFE392817F2D02Da1",VITE_ARBITRUM_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_ARBITRUM_WIF_CALL_CONTROLLER_ADDRESS:"0x4871807209e54b608e5844107Cf06Bcf12129F80",VITE_ARBITRUM_WIF_CALL_LONGTOKEN_ADDRESS:"0xa8DdE51B13C7d81b4D9c2c8EAa2E79bB828d82C4",VITE_ARBITRUM_WIF_CALL_SETTLEMENTMANAGER_ADDRESS:"0x583855075C098F2Cd7b2dA5995a2B329f0aE0f3c",VITE_ARBITRUM_WIF_CALL_SHORTTOKEN_ADDRESS:"0x582071a082189236f41527339DBb56B0c111CD6E",VITE_ARBITRUM_WIF_CALL_VAULT_ADDRESS:"0xFbd0Df32C6f75374B4b4Cb03f405932b4eeAC199",VITE_ARBITRUM_WIF_PUT_CONTROLLER_ADDRESS:"0x463377730eCaa7310Dcb3A3d48aDE097A23Bdd42",VITE_ARBITRUM_WIF_PUT_LONGTOKEN_ADDRESS:"0x607324341E75a5a51959a7b541cC8Fd7576e3066",VITE_ARBITRUM_WIF_PUT_SETTLEMENTMANAGER_ADDRESS:"0xFaA4AbaF2890958B200A04AE4cB2880Ad929d8A9",VITE_ARBITRUM_WIF_PUT_SHORTTOKEN_ADDRESS:"0x3FD0b87A9b30738F8086f0c2fDDe469687250FEb",VITE_ARBITRUM_WIF_PUT_VAULT_ADDRESS:"0x4C585D80bDDa554278F909bA51F2E42A2d5f5b96",VITE_BACKEND_URL:"https://switch-testnet-backend.kanalabs.io",VITE_BINANCE_BTC_CALL_CONTROLLER_ADDRESS:"0xC0028f1E9493bdba1670E8C65284f43F897D16d4",VITE_BINANCE_BTC_CALL_LONGTOKEN_ADDRESS:"0xA3fD705798AF4FA090B4dC95E97Ffb353a576969",VITE_BINANCE_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0xd38fd86FCCBf8DE9102d7C3D82799432D0B8da32",VITE_BINANCE_BTC_CALL_SHORTTOKEN_ADDRESS:"0xCaEC56628DCe5709F6B17De68C3431f45D4aBc37",VITE_BINANCE_BTC_CALL_VAULT_ADDRESS:"0x2fdbb070D4767cb11fe176CE48986aF222830437",VITE_BINANCE_BTC_PUT_CONTROLLER_ADDRESS:"0xBd99Fdae11A55E41e9ce1Cb27F2A6182dB579af8",VITE_BINANCE_BTC_PUT_LONGTOKEN_ADDRESS:"0x5E7f282a9Cd7BF64fD4EccD13b34703D7F27333d",VITE_BINANCE_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x9f3D3a8D3f0215Fe2D7692096DBC4b097EF5D963",VITE_BINANCE_BTC_PUT_SHORTTOKEN_ADDRESS:"0x7961F22D5931a510b40f740a005339109243Ca30",VITE_BINANCE_BTC_PUT_VAULT_ADDRESS:"0xaaBbF2bC143F59ab731C48FD687a14a8c30F2383",VITE_BINANCE_CANDLE_INTERVAL:"15",VITE_BINANCE_CHAIN_ID:"97",VITE_BINANCE_CHAIN_ID_HEX:"0x61",VITE_BINANCE_CHAIN_NAME:"BNB Smart Chain Testnet",VITE_BINANCE_CONNECT_NETWORK_NAME:"bscTestnet",VITE_BINANCE_CYCLE_DURATION:"120",VITE_BINANCE_ETH_CALL_CONTROLLER_ADDRESS:"0x9e35EDB90CF67A455Dc54418363bd6EC8fd0750d",VITE_BINANCE_ETH_CALL_LONGTOKEN_ADDRESS:"0x264821A828df29D027AF824Fb8A3a9cCCfbfB4bE",VITE_BINANCE_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0xbfE633B7A33e75EfD4af4522666a1c8eac4b3b65",VITE_BINANCE_ETH_CALL_SHORTTOKEN_ADDRESS:"0xE649a5a93224F6dc9bD9d5934A93b28F0a153956",VITE_BINANCE_ETH_CALL_VAULT_ADDRESS:"0x1E88b5ffd67313aC35cb13b4574284a1856047a3",VITE_BINANCE_ETH_PUT_CONTROLLER_ADDRESS:"0x3a577c95f96990E7741F8c07568476bA84567356",VITE_BINANCE_ETH_PUT_LONGTOKEN_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_BINANCE_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x254FF4CFa3d7dd1829B408243266870266f841CA",VITE_BINANCE_ETH_PUT_SHORTTOKEN_ADDRESS:"0x7051898114C8347fea6a2dcd6E3606D3FB31508F",VITE_BINANCE_ETH_PUT_VAULT_ADDRESS:"0x1FEF214CAdc20AB09562ECa67408e2cda49518A2",VITE_BINANCE_EXPLORER_LINK:"https://testnet.bscscan.com",VITE_BINANCE_FAUCET_URL:"https://testnet.bnbchain.org/faucet-smart",VITE_BINANCE_GAS_MULTIPLIER:"110",VITE_BINANCE_INFO_AGGREGATOR_ADDRESS:"0x3DFc4c69bce8e9455EafE3f429590fa9De5f128d",VITE_BINANCE_NATIVE_TOKEN:"tBNB",VITE_BINANCE_NATIVE_TOKEN_DECIMALS:"18",VITE_BINANCE_NATIVE_TOKEN_NAME:"tBNB",VITE_BINANCE_NATIVE_TOKEN_SYMBOL:"tBNB",VITE_BINANCE_NETWORK_NAME:"Binance Testnet",VITE_BINANCE_PREMIUM_PER_CYCLE:"0.5",VITE_BINANCE_PUBLIC_RPC:"https://endpoints.omniatech.io/v1/bsc/testnet/public",VITE_BINANCE_RPC:"https://cold-burned-general.bsc-testnet.quiknode.pro/5dc69c2182e7f66da44461e6dde3d7d786575a30/",VITE_BINANCE_SCRAPPING_TIME:"300",VITE_BINANCE_SETTLEMENT_TOKEN_ADDRESS:"0xDD0020ffDD1B371189778954Cf556B2979b0D33d",VITE_BINANCE_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_CHAIN_TOKEN_ARRAY:"BINANCE_ETH,BINANCE_BTC,ARBITRUM_ETH,ARBITRUM_PEPE",VITE_CIPHERDATA:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjRlYjViZDZhOWNmNDE2YzJmNzc3ZjU2OTg3ODkzNWE4OTBlMTc5NDdjODUyZmRjMzNlYjU1NmZmNzNkZjE5OGUyODU1NTg4NGNkYzM1ZWMwZjQwNzZkMWE4M2RhNTFiM2ZjYTA1YmQ1YTBlNTIwZGViZGVkZTViNzQ5NjdlMGEwIn0.b7ECWqqAvXtC8fblJcVKLO0GKBxa7rfNDtUwsnAaUno",VITE_MORALIS_API_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjM1MGU5MDEyLTU1Y2MtNDZkMi1iZTRkLWU2YTNhNTFmYzIxYyIsIm9yZ0lkIjoiMzczNjA3IiwidXNlcklkIjoiMzgzOTUxIiwidHlwZUlkIjoiYTBlZWJlNWYtMjQ3Ny00NTRjLWFlMDEtYmIxMThjYzliNjZiIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MDU5MTM4MTMsImV4cCI6NDg2MTY3MzgxM30.6ChaPKm5D80_qsZMnlsCoSumD2z9gkBWSP7wwoCAido",VITE_NETWORK:"TESTNET",VITE_PAYMASTER_API_KEY:"6kz6vdwgdbzs3w55jbn45chhhkw7yq8yk",VITE_QUICKNODE_KEY:"f2d17d0c3e7ac54189a60dad8133a533c4b4e945",VITE_VERCEL_BRANCH_URL:"kana-operps-frontend-git-testnet-operps-projects.vercel.app",VITE_VERCEL_ENV:"preview",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"operps",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"operps",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Merge pull request #409 from operps/devnet

Devnet`,VITE_VERCEL_GIT_COMMIT_REF:"testnet",VITE_VERCEL_GIT_COMMIT_SHA:"226178a17dbaec9ac480571ddea005cdee23e6a9",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"800575360",VITE_VERCEL_GIT_REPO_OWNER:"operps",VITE_VERCEL_GIT_REPO_SLUG:"kana-operps-frontend",VITE_VERCEL_PROJECT_PRODUCTION_URL:"operps.kanalabs.io",VITE_VERCEL_URL:"kana-operps-frontend-1n78omxub-operps-projects.vercel.app",VITE_WALLETCONNECTPROJECTID:"b8d15d96157934a210eb13769a539caa"},createStoreImpl$1=Fn=>{let Mn;const rs=new Set,is=(hs,ps)=>{const io=typeof hs=="function"?hs(Mn):hs;if(!Object.is(io,Mn)){const fo=Mn;Mn=ps??typeof io!="object"?io:Object.assign({},Mn,io),rs.forEach(mo=>mo(Mn,fo))}},os=()=>Mn,ds={setState:is,getState:os,subscribe:hs=>(rs.add(hs),()=>rs.delete(hs)),destroy:()=>{(__vite_import_meta_env__$5?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),rs.clear()}};return Mn=Fn(is,os,ds),ds},createStore$2=Fn=>Fn?createStoreImpl$1(Fn):createStoreImpl$1;var eventemitter3={exports:{}};(function(Fn){var Mn=Object.prototype.hasOwnProperty,rs="~";function is(){}Object.create&&(is.prototype=Object.create(null),new is().__proto__||(rs=!1));function os(hs,ps,io){this.fn=hs,this.context=ps,this.once=io||!1}function as(hs,ps,io,fo,mo){if(typeof io!="function")throw new TypeError("The listener must be a function");var Ao=new os(io,fo||hs,mo),$o=rs?rs+ps:ps;return hs._events[$o]?hs._events[$o].fn?hs._events[$o]=[hs._events[$o],Ao]:hs._events[$o].push(Ao):(hs._events[$o]=Ao,hs._eventsCount++),hs}function us(hs,ps){--hs._eventsCount===0?hs._events=new is:delete hs._events[ps]}function ds(){this._events=new is,this._eventsCount=0}ds.prototype.eventNames=function(){var ps=[],io,fo;if(this._eventsCount===0)return ps;for(fo in io=this._events)Mn.call(io,fo)&&ps.push(rs?fo.slice(1):fo);return Object.getOwnPropertySymbols?ps.concat(Object.getOwnPropertySymbols(io)):ps},ds.prototype.listeners=function(ps){var io=rs?rs+ps:ps,fo=this._events[io];if(!fo)return[];if(fo.fn)return[fo.fn];for(var mo=0,Ao=fo.length,$o=new Array(Ao);mo<Ao;mo++)$o[mo]=fo[mo].fn;return $o},ds.prototype.listenerCount=function(ps){var io=rs?rs+ps:ps,fo=this._events[io];return fo?fo.fn?1:fo.length:0},ds.prototype.emit=function(ps,io,fo,mo,Ao,$o){var Lo=rs?rs+ps:ps;if(!this._events[Lo])return!1;var Go=this._events[Lo],Yo=arguments.length,Wo,Jo;if(Go.fn){switch(Go.once&&this.removeListener(ps,Go.fn,void 0,!0),Yo){case 1:return Go.fn.call(Go.context),!0;case 2:return Go.fn.call(Go.context,io),!0;case 3:return Go.fn.call(Go.context,io,fo),!0;case 4:return Go.fn.call(Go.context,io,fo,mo),!0;case 5:return Go.fn.call(Go.context,io,fo,mo,Ao),!0;case 6:return Go.fn.call(Go.context,io,fo,mo,Ao,$o),!0}for(Jo=1,Wo=new Array(Yo-1);Jo<Yo;Jo++)Wo[Jo-1]=arguments[Jo];Go.fn.apply(Go.context,Wo)}else{var xl=Go.length,_l;for(Jo=0;Jo<xl;Jo++)switch(Go[Jo].once&&this.removeListener(ps,Go[Jo].fn,void 0,!0),Yo){case 1:Go[Jo].fn.call(Go[Jo].context);break;case 2:Go[Jo].fn.call(Go[Jo].context,io);break;case 3:Go[Jo].fn.call(Go[Jo].context,io,fo);break;case 4:Go[Jo].fn.call(Go[Jo].context,io,fo,mo);break;default:if(!Wo)for(_l=1,Wo=new Array(Yo-1);_l<Yo;_l++)Wo[_l-1]=arguments[_l];Go[Jo].fn.apply(Go[Jo].context,Wo)}}return!0},ds.prototype.on=function(ps,io,fo){return as(this,ps,io,fo,!1)},ds.prototype.once=function(ps,io,fo){return as(this,ps,io,fo,!0)},ds.prototype.removeListener=function(ps,io,fo,mo){var Ao=rs?rs+ps:ps;if(!this._events[Ao])return this;if(!io)return us(this,Ao),this;var $o=this._events[Ao];if($o.fn)$o.fn===io&&(!mo||$o.once)&&(!fo||$o.context===fo)&&us(this,Ao);else{for(var Lo=0,Go=[],Yo=$o.length;Lo<Yo;Lo++)($o[Lo].fn!==io||mo&&!$o[Lo].once||fo&&$o[Lo].context!==fo)&&Go.push($o[Lo]);Go.length?this._events[Ao]=Go.length===1?Go[0]:Go:us(this,Ao)}return this},ds.prototype.removeAllListeners=function(ps){var io;return ps?(io=rs?rs+ps:ps,this._events[io]&&us(this,io)):(this._events=new is,this._eventsCount=0),this},ds.prototype.off=ds.prototype.removeListener,ds.prototype.addListener=ds.prototype.on,ds.prefixed=rs,ds.EventEmitter=ds,Fn.exports=ds})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter$2=getDefaultExportFromCjs(eventemitter3Exports);class Emitter{constructor(Mn){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:Mn}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new EventEmitter$2})}on(Mn,rs){this._emitter.on(Mn,rs)}once(Mn,rs){this._emitter.once(Mn,rs)}off(Mn,rs){this._emitter.off(Mn,rs)}emit(Mn,...rs){const is=rs[0];this._emitter.emit(Mn,{uid:this.uid,...is})}listenerCount(Mn){return this._emitter.listenerCount(Mn)}}function createEmitter(Fn){return new Emitter(Fn)}function deserialize(Fn,Mn){return JSON.parse(Fn,(rs,is)=>{let os=is;return(os==null?void 0:os.__type)==="bigint"&&(os=BigInt(os.value)),(os==null?void 0:os.__type)==="Map"&&(os=new Map(os.value)),(Mn==null?void 0:Mn(rs,os))??os})}function getReferenceKey(Fn,Mn){return Fn.slice(0,Mn).join(".")||"."}function getCutoff(Fn,Mn){const{length:rs}=Fn;for(let is=0;is<rs;++is)if(Fn[is]===Mn)return is+1;return 0}function createReplacer(Fn,Mn){const rs=typeof Fn=="function",is=typeof Mn=="function",os=[],as=[];return function(ds,hs){if(typeof hs=="object")if(os.length){const ps=getCutoff(os,this);ps===0?os[os.length]=this:(os.splice(ps),as.splice(ps)),as[as.length]=ds;const io=getCutoff(os,hs);if(io!==0)return is?Mn.call(this,ds,hs,getReferenceKey(as,io)):`[ref=${getReferenceKey(as,io)}]`}else os[0]=hs,as[0]=ds;return rs?Fn.call(this,ds,hs):hs}}function serialize(Fn,Mn,rs,is){return JSON.stringify(Fn,createReplacer((os,as)=>{let us=as;return typeof us=="bigint"&&(us={__type:"bigint",value:as.toString()}),us instanceof Map&&(us={__type:"Map",value:Array.from(as.entries())}),(Mn==null?void 0:Mn(os,us))??us},is),rs??void 0)}function createStorage$1(Fn){const{deserialize:Mn=deserialize,key:rs="wagmi",serialize:is=serialize,storage:os=noopStorage}=Fn;function as(us){return us instanceof Promise?us.then(ds=>ds).catch(()=>null):us}return{...os,key:rs,async getItem(us,ds){const hs=os.getItem(`${rs}.${us}`),ps=await as(hs);return ps?Mn(ps)??null:ds??null},async setItem(us,ds){const hs=`${rs}.${us}`;ds===null?await as(os.removeItem(hs)):await as(os.setItem(hs,is(ds)))},async removeItem(us){await as(os.removeItem(`${rs}.${us}`))}}}const noopStorage={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},size=256;let index=size,buffer$1;function uid$1(Fn=11){if(!buffer$1||index+Fn>size*2){buffer$1="",index=0;for(let Mn=0;Mn<size;Mn++)buffer$1+=(256+Math.random()*256|0).toString(16).substring(1)}return buffer$1.substring(index,index+++Fn)}function createConfig(Fn){const{multiInjectedProviderDiscovery:Mn=!0,storage:rs=createStorage$1({storage:typeof window<"u"&&window.localStorage?window.localStorage:noopStorage}),syncConnectedChain:is=!0,ssr:os=!1,...as}=Fn,us=typeof window<"u"&&Mn?createStore$3():void 0,ds=createStore$2(()=>as.chains),hs=createStore$2(()=>[...as.connectors??[],...os?[]:(us==null?void 0:us.getProviders().map(io))??[]].map(ps));function ps(_l){var $l;const Tl=createEmitter(uid$1()),Sl={..._l({emitter:Tl,chains:ds.getState(),storage:rs,transports:as.transports}),emitter:Tl,uid:Tl.uid};return Tl.on("connect",Jo),($l=Sl.setup)==null||$l.call(Sl),Sl}function io(_l){const{info:Tl}=_l,Sl=_l.provider;return injected({target:{...Tl,id:Tl.rdns,provider:Sl}})}const fo=new Map;function mo(_l={}){const Tl=_l.chainId??Go.getState().chainId,Sl=ds.getState().find(Pl=>Pl.id===Tl);if(_l.chainId&&!Sl)throw new ChainNotConfiguredError;{const Pl=fo.get(Go.getState().chainId);if(Pl&&!Sl)return Pl;if(!Sl)throw new ChainNotConfiguredError}{const Pl=fo.get(Tl);if(Pl)return Pl}let $l;if(as.client)$l=as.client({chain:Sl});else{const Pl=Sl.id,Dl=ds.getState().map(Vo=>Vo.id),Ol={},Rl=Object.entries(as);for(const[Vo,jo]of Rl)if(!(Vo==="chains"||Vo==="client"||Vo==="connectors"||Vo==="transports"))if(typeof jo=="object")if(Pl in jo)Ol[Vo]=jo[Pl];else{if(Dl.some(Qo=>Qo in jo))continue;Ol[Vo]=jo}else Ol[Vo]=jo;$l=createClient({...Ol,chain:Sl,batch:Ol.batch??{multicall:!0},transport:Vo=>as.transports[Pl]({...Vo,connectors:hs})})}return fo.set(Tl,$l),$l}function Ao(){return{chainId:ds.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let $o;const Lo="0.0.0-canary-";version$o.startsWith(Lo)?$o=Number.parseInt(version$o.replace(Lo,"")):$o=Number.parseInt(version$o.split(".")[0]??"0");const Go=createStore$2(subscribeWithSelector(rs?persist(Ao,{migrate(_l,Tl){if(Tl===$o)return _l;const Sl=Ao(),$l=Yo(_l,Sl.chainId);return{...Sl,chainId:$l}},name:"store",partialize(_l){return{connections:{__type:"Map",value:Array.from(_l.connections.entries()).map(([Tl,Sl])=>{const{id:$l,name:Pl,type:Dl,uid:Ol}=Sl.connector;return[Tl,{...Sl,connector:{id:$l,name:Pl,type:Dl,uid:Ol}}]})},chainId:_l.chainId,current:_l.current}},merge(_l,Tl){typeof _l=="object"&&_l&&"status"in _l&&delete _l.status;const Sl=Yo(_l,Tl.chainId);return{...Tl,..._l,chainId:Sl}},skipHydration:os,storage:rs,version:$o}):Ao));function Yo(_l,Tl){return _l&&typeof _l=="object"&&"chainId"in _l&&typeof _l.chainId=="number"&&ds.getState().some(Sl=>Sl.id===_l.chainId)?_l.chainId:Tl}is&&Go.subscribe(({connections:_l,current:Tl})=>{var Sl;return Tl?(Sl=_l.get(Tl))==null?void 0:Sl.chainId:void 0},_l=>{if(ds.getState().some(Sl=>Sl.id===_l))return Go.setState(Sl=>({...Sl,chainId:_l??Sl.chainId}))}),us==null||us.subscribe(_l=>{const Tl=new Map;for(const $l of hs.getState())Tl.set($l.id,!0);const Sl=[];for(const $l of _l){const Pl=ps(io($l));Tl.has(Pl.id)||Sl.push(Pl)}rs&&!Go.persist.hasHydrated()||hs.setState($l=>[...$l,...Sl],!0)});function Wo(_l){Go.setState(Tl=>{const Sl=Tl.connections.get(_l.uid);return Sl?{...Tl,connections:new Map(Tl.connections).set(_l.uid,{accounts:_l.accounts??Sl.accounts,chainId:_l.chainId??Sl.chainId,connector:Sl.connector})}:Tl})}function Jo(_l){Go.getState().status==="connecting"||Go.getState().status==="reconnecting"||Go.setState(Tl=>{const Sl=hs.getState().find($l=>$l.uid===_l.uid);return Sl?(Sl.emitter.listenerCount("connect")&&Sl.emitter.off("connect",Wo),Sl.emitter.listenerCount("change")||Sl.emitter.on("change",Wo),Sl.emitter.listenerCount("disconnect")||Sl.emitter.on("disconnect",xl),{...Tl,connections:new Map(Tl.connections).set(_l.uid,{accounts:_l.accounts,chainId:_l.chainId,connector:Sl}),current:_l.uid,status:"connected"}):Tl})}function xl(_l){Go.setState(Tl=>{const Sl=Tl.connections.get(_l.uid);if(Sl){const Pl=Sl.connector;Pl.emitter.listenerCount("change")&&Sl.connector.emitter.off("change",Wo),Pl.emitter.listenerCount("disconnect")&&Sl.connector.emitter.off("disconnect",xl),Pl.emitter.listenerCount("connect")||Sl.connector.emitter.on("connect",Jo)}if(Tl.connections.delete(_l.uid),Tl.connections.size===0)return{...Tl,connections:new Map,current:null,status:"disconnected"};const $l=Tl.connections.values().next().value;return{...Tl,connections:new Map(Tl.connections),current:$l.connector.uid}})}return{get chains(){return ds.getState()},get connectors(){return hs.getState()},storage:rs,getClient:mo,get state(){return Go.getState()},setState(_l){let Tl;typeof _l=="function"?Tl=_l(Go.getState()):Tl=_l;const Sl=Ao();typeof Tl!="object"&&(Tl=Sl),Object.keys(Sl).some(Pl=>!(Pl in Tl))&&(Tl=Sl),Go.setState(Tl,!0)},subscribe(_l,Tl,Sl){return Go.subscribe(_l,Tl,Sl?{...Sl,fireImmediately:Sl.emitImmediately}:void 0)},_internal:{mipd:us,store:Go,ssr:!!os,syncConnectedChain:is,transports:as.transports,chains:{setState(_l){const Tl=typeof _l=="function"?_l(ds.getState()):_l;if(Tl.length!==0)return ds.setState(Tl,!0)},subscribe(_l){return ds.subscribe(_l)}},connectors:{providerDetailToConnector:io,setup:ps,setState(_l){return hs.setState(typeof _l=="function"?_l(hs.getState()):_l,!0)},subscribe(_l){return hs.subscribe(_l)}},events:{change:Wo,connect:Jo,disconnect:xl}}}}function hydrate(Fn,Mn){const{initialState:rs,reconnectOnMount:is}=Mn;return rs&&!Fn._internal.store.persist.hasHydrated()&&Fn.setState({...rs,chainId:Fn.chains.some(os=>os.id===rs.chainId)?rs.chainId:Fn.chains[0].id,connections:is?rs.connections:new Map,status:is?"reconnecting":"disconnected"}),{async onMount(){var os;if(Fn._internal.ssr){await Fn._internal.store.persist.rehydrate();const as=(os=Fn._internal.mipd)==null?void 0:os.getProviders().map(Fn._internal.connectors.providerDetailToConnector).map(Fn._internal.connectors.setup);Fn._internal.connectors.setState(us=>[...us,...as??[]])}is?reconnect(Fn):Fn.storage&&Fn.setState(as=>({...as,connections:new Map}))}}}function extractRpcUrls(Fn){var as,us,ds;const{chain:Mn}=Fn,rs=Mn.rpcUrls.default.http[0];if(!Fn.transports)return[rs];const is=(us=(as=Fn.transports)==null?void 0:as[Mn.id])==null?void 0:us.call(as,{chain:Mn});return(((ds=is==null?void 0:is.value)==null?void 0:ds.transports)||[is]).map(({value:hs})=>(hs==null?void 0:hs.url)||rs)}function Hydrate(Fn){const{children:Mn,config:rs,initialState:is,reconnectOnMount:os=!0}=Fn,{onMount:as}=hydrate(rs,{initialState:is,reconnectOnMount:os});rs._internal.ssr||as();const us=reactExports.useRef(!0);return reactExports.useEffect(()=>{if(us.current&&rs._internal.ssr)return as(),()=>{us.current=!1}},[]),Mn}const WagmiContext=reactExports.createContext(void 0);function WagmiProvider(Fn){const{children:Mn,config:rs}=Fn,is={value:rs};return reactExports.createElement(Hydrate,Fn,reactExports.createElement(WagmiContext.Provider,is,Mn))}const version$n="2.12.20",getVersion=()=>`wagmi@${version$n}`;class BaseError extends BaseError$1{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 getVersion()}}class WagmiProviderNotFoundError extends BaseError{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function useConfig(Fn={}){const Mn=Fn.config??reactExports.useContext(WagmiContext);if(!Mn)throw new WagmiProviderNotFoundError;return Mn}function watchChains(Fn,Mn){const{onChange:rs}=Mn;return Fn._internal.chains.subscribe((is,os)=>{rs(is,os)})}var withSelector={exports:{}},withSelector_production_min={},shim={exports:{}},useSyncExternalStoreShim_production_min={};/**
 * @license React
 * use-sync-external-store-shim.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 e$6=reactExports;function h$b(Fn,Mn){return Fn===Mn&&(Fn!==0||1/Fn===1/Mn)||Fn!==Fn&&Mn!==Mn}var k$5=typeof Object.is=="function"?Object.is:h$b,l$7=e$6.useState,m$3=e$6.useEffect,n$c=e$6.useLayoutEffect,p$7=e$6.useDebugValue;function q$5(Fn,Mn){var rs=Mn(),is=l$7({inst:{value:rs,getSnapshot:Mn}}),os=is[0].inst,as=is[1];return n$c(function(){os.value=rs,os.getSnapshot=Mn,r$e(os)&&as({inst:os})},[Fn,rs,Mn]),m$3(function(){return r$e(os)&&as({inst:os}),Fn(function(){r$e(os)&&as({inst:os})})},[Fn]),p$7(rs),rs}function r$e(Fn){var Mn=Fn.getSnapshot;Fn=Fn.value;try{var rs=Mn();return!k$5(Fn,rs)}catch{return!0}}function t$7(Fn,Mn){return Mn()}var u$5=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t$7:q$5;useSyncExternalStoreShim_production_min.useSyncExternalStore=e$6.useSyncExternalStore!==void 0?e$6.useSyncExternalStore:u$5;shim.exports=useSyncExternalStoreShim_production_min;var shimExports=shim.exports;/**
 * @license React
 * use-sync-external-store-shim/with-selector.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 h$a=reactExports,n$b=shimExports;function p$6(Fn,Mn){return Fn===Mn&&(Fn!==0||1/Fn===1/Mn)||Fn!==Fn&&Mn!==Mn}var q$4=typeof Object.is=="function"?Object.is:p$6,r$d=n$b.useSyncExternalStore,t$6=h$a.useRef,u$4=h$a.useEffect,v$8=h$a.useMemo,w$8=h$a.useDebugValue;withSelector_production_min.useSyncExternalStoreWithSelector=function(Fn,Mn,rs,is,os){var as=t$6(null);if(as.current===null){var us={hasValue:!1,value:null};as.current=us}else us=as.current;as=v$8(function(){function hs(Ao){if(!ps){if(ps=!0,io=Ao,Ao=is(Ao),os!==void 0&&us.hasValue){var $o=us.value;if(os($o,Ao))return fo=$o}return fo=Ao}if($o=fo,q$4(io,Ao))return $o;var Lo=is(Ao);return os!==void 0&&os($o,Lo)?$o:(io=Ao,fo=Lo)}var ps=!1,io,fo,mo=rs===void 0?null:rs;return[function(){return hs(Mn())},mo===null?void 0:function(){return hs(mo())}]},[Mn,rs,is,os]);var ds=r$d(Fn,as[0],as[1]);return u$4(function(){us.hasValue=!0,us.value=ds},[ds]),w$8(ds),ds};withSelector.exports=withSelector_production_min;var withSelectorExports=withSelector.exports;const useSyncExternalStoreExports=getDefaultExportFromCjs(withSelectorExports),isPlainObject$2=Fn=>typeof Fn=="object"&&!Array.isArray(Fn);function useSyncExternalStoreWithTracked(Fn,Mn,rs=Mn,is=deepEqual){const os=reactExports.useRef([]),as=withSelectorExports.useSyncExternalStoreWithSelector(Fn,Mn,rs,us=>us,(us,ds)=>{if(isPlainObject$2(us)&&isPlainObject$2(ds)&&os.current.length){for(const hs of os.current)if(!is(us[hs],ds[hs]))return!1;return!0}return is(us,ds)});return reactExports.useMemo(()=>{if(isPlainObject$2(as)){const us={...as};let ds={};for(const[hs,ps]of Object.entries(us))ds={...ds,[hs]:{configurable:!1,enumerable:!0,get:()=>(os.current.includes(hs)||os.current.push(hs),ps)}};return Object.defineProperties(us,ds),us}return as},[as])}function useAccount(Fn={}){const Mn=useConfig(Fn);return useSyncExternalStoreWithTracked(rs=>watchAccount(Mn,{onChange:rs}),()=>getAccount(Mn))}var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(Fn){return this.listeners.add(Fn),this.onSubscribe(),()=>{this.listeners.delete(Fn),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$6(){}function functionalUpdate(Fn,Mn){return typeof Fn=="function"?Fn(Mn):Fn}function isValidTimeout(Fn){return typeof Fn=="number"&&Fn>=0&&Fn!==1/0}function timeUntilStale(Fn,Mn){return Math.max(Fn+(Mn||0)-Date.now(),0)}function resolveStaleTime(Fn,Mn){return typeof Fn=="function"?Fn(Mn):Fn}function resolveEnabled(Fn,Mn){return typeof Fn=="function"?Fn(Mn):Fn}function matchQuery(Fn,Mn){const{type:rs="all",exact:is,fetchStatus:os,predicate:as,queryKey:us,stale:ds}=Fn;if(us){if(is){if(Mn.queryHash!==hashQueryKeyByOptions(us,Mn.options))return!1}else if(!partialMatchKey(Mn.queryKey,us))return!1}if(rs!=="all"){const hs=Mn.isActive();if(rs==="active"&&!hs||rs==="inactive"&&hs)return!1}return!(typeof ds=="boolean"&&Mn.isStale()!==ds||os&&os!==Mn.state.fetchStatus||as&&!as(Mn))}function matchMutation(Fn,Mn){const{exact:rs,status:is,predicate:os,mutationKey:as}=Fn;if(as){if(!Mn.options.mutationKey)return!1;if(rs){if(hashKey(Mn.options.mutationKey)!==hashKey(as))return!1}else if(!partialMatchKey(Mn.options.mutationKey,as))return!1}return!(is&&Mn.state.status!==is||os&&!os(Mn))}function hashQueryKeyByOptions(Fn,Mn){return((Mn==null?void 0:Mn.queryKeyHashFn)||hashKey)(Fn)}function hashKey(Fn){return JSON.stringify(Fn,(Mn,rs)=>isPlainObject$1(rs)?Object.keys(rs).sort().reduce((is,os)=>(is[os]=rs[os],is),{}):rs)}function partialMatchKey(Fn,Mn){return Fn===Mn?!0:typeof Fn!=typeof Mn?!1:Fn&&Mn&&typeof Fn=="object"&&typeof Mn=="object"?!Object.keys(Mn).some(rs=>!partialMatchKey(Fn[rs],Mn[rs])):!1}function replaceEqualDeep(Fn,Mn){if(Fn===Mn)return Fn;const rs=isPlainArray(Fn)&&isPlainArray(Mn);if(rs||isPlainObject$1(Fn)&&isPlainObject$1(Mn)){const is=rs?Fn:Object.keys(Fn),os=is.length,as=rs?Mn:Object.keys(Mn),us=as.length,ds=rs?[]:{};let hs=0;for(let ps=0;ps<us;ps++){const io=rs?ps:as[ps];(!rs&&is.includes(io)||rs)&&Fn[io]===void 0&&Mn[io]===void 0?(ds[io]=void 0,hs++):(ds[io]=replaceEqualDeep(Fn[io],Mn[io]),ds[io]===Fn[io]&&Fn[io]!==void 0&&hs++)}return os===us&&hs===os?Fn:ds}return Mn}function shallowEqualObjects(Fn,Mn){if(!Mn||Object.keys(Fn).length!==Object.keys(Mn).length)return!1;for(const rs in Fn)if(Fn[rs]!==Mn[rs])return!1;return!0}function isPlainArray(Fn){return Array.isArray(Fn)&&Fn.length===Object.keys(Fn).length}function isPlainObject$1(Fn){if(!hasObjectPrototype(Fn))return!1;const Mn=Fn.constructor;if(Mn===void 0)return!0;const rs=Mn.prototype;return!(!hasObjectPrototype(rs)||!rs.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(Fn)!==Object.prototype)}function hasObjectPrototype(Fn){return Object.prototype.toString.call(Fn)==="[object Object]"}function sleep(Fn){return new Promise(Mn=>{setTimeout(Mn,Fn)})}function replaceData(Fn,Mn,rs){return typeof rs.structuralSharing=="function"?rs.structuralSharing(Fn,Mn):rs.structuralSharing!==!1?replaceEqualDeep(Fn,Mn):Mn}function addToEnd(Fn,Mn,rs=0){const is=[...Fn,Mn];return rs&&is.length>rs?is.slice(1):is}function addToStart(Fn,Mn,rs=0){const is=[Mn,...Fn];return rs&&is.length>rs?is.slice(0,-1):is}var skipToken=Symbol();function ensureQueryFn(Fn,Mn){return!Fn.queryFn&&(Mn!=null&&Mn.initialPromise)?()=>Mn.initialPromise:!Fn.queryFn||Fn.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${Fn.queryHash}'`)):Fn.queryFn}var ny,Uv,wy,HE,FocusManager=(HE=class extends Subscribable{constructor(){super();Nm(this,ny);Nm(this,Uv);Nm(this,wy);gm(this,wy,Mn=>{if(!isServer&&window.addEventListener){const rs=()=>Mn();return window.addEventListener("visibilitychange",rs,!1),()=>{window.removeEventListener("visibilitychange",rs)}}})}onSubscribe(){Ep(this,Uv)||this.setEventListener(Ep(this,wy))}onUnsubscribe(){var Mn;this.hasListeners()||((Mn=Ep(this,Uv))==null||Mn.call(this),gm(this,Uv,void 0))}setEventListener(Mn){var rs;gm(this,wy,Mn),(rs=Ep(this,Uv))==null||rs.call(this),gm(this,Uv,Mn(is=>{typeof is=="boolean"?this.setFocused(is):this.onFocus()}))}setFocused(Mn){Ep(this,ny)!==Mn&&(gm(this,ny,Mn),this.onFocus())}onFocus(){const Mn=this.isFocused();this.listeners.forEach(rs=>{rs(Mn)})}isFocused(){var Mn;return typeof Ep(this,ny)=="boolean"?Ep(this,ny):((Mn=globalThis.document)==null?void 0:Mn.visibilityState)!=="hidden"}},ny=new WeakMap,Uv=new WeakMap,wy=new WeakMap,HE),focusManager=new FocusManager,Ey,Wv,_y,GE,OnlineManager=(GE=class extends Subscribable{constructor(){super();Nm(this,Ey,!0);Nm(this,Wv);Nm(this,_y);gm(this,_y,Mn=>{if(!isServer&&window.addEventListener){const rs=()=>Mn(!0),is=()=>Mn(!1);return window.addEventListener("online",rs,!1),window.addEventListener("offline",is,!1),()=>{window.removeEventListener("online",rs),window.removeEventListener("offline",is)}}})}onSubscribe(){Ep(this,Wv)||this.setEventListener(Ep(this,_y))}onUnsubscribe(){var Mn;this.hasListeners()||((Mn=Ep(this,Wv))==null||Mn.call(this),gm(this,Wv,void 0))}setEventListener(Mn){var rs;gm(this,_y,Mn),(rs=Ep(this,Wv))==null||rs.call(this),gm(this,Wv,Mn(this.setOnline.bind(this)))}setOnline(Mn){Ep(this,Ey)!==Mn&&(gm(this,Ey,Mn),this.listeners.forEach(is=>{is(Mn)}))}isOnline(){return Ep(this,Ey)}},Ey=new WeakMap,Wv=new WeakMap,_y=new WeakMap,GE),onlineManager=new OnlineManager;function pendingThenable(){let Fn,Mn;const rs=new Promise((os,as)=>{Fn=os,Mn=as});rs.status="pending",rs.catch(()=>{});function is(os){Object.assign(rs,os),delete rs.resolve,delete rs.reject}return rs.resolve=os=>{is({status:"fulfilled",value:os}),Fn(os)},rs.reject=os=>{is({status:"rejected",reason:os}),Mn(os)},rs}function defaultRetryDelay(Fn){return Math.min(1e3*2**Fn,3e4)}function canFetch(Fn){return(Fn??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(Fn){super("CancelledError"),this.revert=Fn==null?void 0:Fn.revert,this.silent=Fn==null?void 0:Fn.silent}};function isCancelledError(Fn){return Fn instanceof CancelledError}function createRetryer(Fn){let Mn=!1,rs=0,is=!1,os;const as=pendingThenable(),us=Lo=>{var Go;is||(mo(new CancelledError(Lo)),(Go=Fn.abort)==null||Go.call(Fn))},ds=()=>{Mn=!0},hs=()=>{Mn=!1},ps=()=>focusManager.isFocused()&&(Fn.networkMode==="always"||onlineManager.isOnline())&&Fn.canRun(),io=()=>canFetch(Fn.networkMode)&&Fn.canRun(),fo=Lo=>{var Go;is||(is=!0,(Go=Fn.onSuccess)==null||Go.call(Fn,Lo),os==null||os(),as.resolve(Lo))},mo=Lo=>{var Go;is||(is=!0,(Go=Fn.onError)==null||Go.call(Fn,Lo),os==null||os(),as.reject(Lo))},Ao=()=>new Promise(Lo=>{var Go;os=Yo=>{(is||ps())&&Lo(Yo)},(Go=Fn.onPause)==null||Go.call(Fn)}).then(()=>{var Lo;os=void 0,is||(Lo=Fn.onContinue)==null||Lo.call(Fn)}),$o=()=>{if(is)return;let Lo;const Go=rs===0?Fn.initialPromise:void 0;try{Lo=Go??Fn.fn()}catch(Yo){Lo=Promise.reject(Yo)}Promise.resolve(Lo).then(fo).catch(Yo=>{var Tl;if(is)return;const Wo=Fn.retry??(isServer?0:3),Jo=Fn.retryDelay??defaultRetryDelay,xl=typeof Jo=="function"?Jo(rs,Yo):Jo,_l=Wo===!0||typeof Wo=="number"&&rs<Wo||typeof Wo=="function"&&Wo(rs,Yo);if(Mn||!_l){mo(Yo);return}rs++,(Tl=Fn.onFail)==null||Tl.call(Fn,rs,Yo),sleep(xl).then(()=>ps()?void 0:Ao()).then(()=>{Mn?mo(Yo):$o()})})};return{promise:as,cancel:us,continue:()=>(os==null||os(),as),cancelRetry:ds,continueRetry:hs,canStart:io,start:()=>(io()?$o():Ao().then($o),as)}}function createNotifyManager(){let Fn=[],Mn=0,rs=ds=>{ds()},is=ds=>{ds()},os=ds=>setTimeout(ds,0);const as=ds=>{Mn?Fn.push(ds):os(()=>{rs(ds)})},us=()=>{const ds=Fn;Fn=[],ds.length&&os(()=>{is(()=>{ds.forEach(hs=>{rs(hs)})})})};return{batch:ds=>{let hs;Mn++;try{hs=ds()}finally{Mn--,Mn||us()}return hs},batchCalls:ds=>(...hs)=>{as(()=>{ds(...hs)})},schedule:as,setNotifyFunction:ds=>{rs=ds},setBatchNotifyFunction:ds=>{is=ds},setScheduler:ds=>{os=ds}}}var notifyManager=createNotifyManager(),iy,KE,Removable=(KE=class{constructor(){Nm(this,iy)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&gm(this,iy,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(Fn){this.gcTime=Math.max(this.gcTime||0,Fn??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Ep(this,iy)&&(clearTimeout(Ep(this,iy)),gm(this,iy,void 0))}},iy=new WeakMap,KE),Cy,Ay,A2,D1,Ky,sy,j2,bv,qE,Query=(qE=class extends Removable{constructor(Mn){super();Nm(this,j2);Nm(this,Cy);Nm(this,Ay);Nm(this,A2);Nm(this,D1);Nm(this,Ky);Nm(this,sy);gm(this,sy,!1),gm(this,Ky,Mn.defaultOptions),this.setOptions(Mn.options),this.observers=[],gm(this,A2,Mn.cache),this.queryKey=Mn.queryKey,this.queryHash=Mn.queryHash,gm(this,Cy,getDefaultState$1(this.options)),this.state=Mn.state??Ep(this,Cy),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var Mn;return(Mn=Ep(this,D1))==null?void 0:Mn.promise}setOptions(Mn){this.options={...Ep(this,Ky),...Mn},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Ep(this,A2).remove(this)}setData(Mn,rs){const is=replaceData(this.state.data,Mn,this.options);return m1(this,j2,bv).call(this,{data:is,type:"success",dataUpdatedAt:rs==null?void 0:rs.updatedAt,manual:rs==null?void 0:rs.manual}),is}setState(Mn,rs){m1(this,j2,bv).call(this,{type:"setState",state:Mn,setStateOptions:rs})}cancel(Mn){var is,os;const rs=(is=Ep(this,D1))==null?void 0:is.promise;return(os=Ep(this,D1))==null||os.cancel(Mn),rs?rs.then(noop$6).catch(noop$6):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Ep(this,Cy))}isActive(){return this.observers.some(Mn=>resolveEnabled(Mn.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(Mn=>Mn.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(Mn=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,Mn)}onFocus(){var rs;const Mn=this.observers.find(is=>is.shouldFetchOnWindowFocus());Mn==null||Mn.refetch({cancelRefetch:!1}),(rs=Ep(this,D1))==null||rs.continue()}onOnline(){var rs;const Mn=this.observers.find(is=>is.shouldFetchOnReconnect());Mn==null||Mn.refetch({cancelRefetch:!1}),(rs=Ep(this,D1))==null||rs.continue()}addObserver(Mn){this.observers.includes(Mn)||(this.observers.push(Mn),this.clearGcTimeout(),Ep(this,A2).notify({type:"observerAdded",query:this,observer:Mn}))}removeObserver(Mn){this.observers.includes(Mn)&&(this.observers=this.observers.filter(rs=>rs!==Mn),this.observers.length||(Ep(this,D1)&&(Ep(this,sy)?Ep(this,D1).cancel({revert:!0}):Ep(this,D1).cancelRetry()),this.scheduleGc()),Ep(this,A2).notify({type:"observerRemoved",query:this,observer:Mn}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||m1(this,j2,bv).call(this,{type:"invalidate"})}fetch(Mn,rs){var hs,ps,io;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(rs!=null&&rs.cancelRefetch))this.cancel({silent:!0});else if(Ep(this,D1))return Ep(this,D1).continueRetry(),Ep(this,D1).promise}if(Mn&&this.setOptions(Mn),!this.options.queryFn){const fo=this.observers.find(mo=>mo.options.queryFn);fo&&this.setOptions(fo.options)}const is=new AbortController,os=fo=>{Object.defineProperty(fo,"signal",{enumerable:!0,get:()=>(gm(this,sy,!0),is.signal)})},as=()=>{const fo=ensureQueryFn(this.options,rs),mo={queryKey:this.queryKey,meta:this.meta};return os(mo),gm(this,sy,!1),this.options.persister?this.options.persister(fo,mo,this):fo(mo)},us={fetchOptions:rs,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:as};os(us),(hs=this.options.behavior)==null||hs.onFetch(us,this),gm(this,Ay,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ps=us.fetchOptions)==null?void 0:ps.meta))&&m1(this,j2,bv).call(this,{type:"fetch",meta:(io=us.fetchOptions)==null?void 0:io.meta});const ds=fo=>{var mo,Ao,$o,Lo;isCancelledError(fo)&&fo.silent||m1(this,j2,bv).call(this,{type:"error",error:fo}),isCancelledError(fo)||((Ao=(mo=Ep(this,A2).config).onError)==null||Ao.call(mo,fo,this),(Lo=($o=Ep(this,A2).config).onSettled)==null||Lo.call($o,this.state.data,fo,this)),this.scheduleGc()};return gm(this,D1,createRetryer({initialPromise:rs==null?void 0:rs.initialPromise,fn:us.fetchFn,abort:is.abort.bind(is),onSuccess:fo=>{var mo,Ao,$o,Lo;if(fo===void 0){ds(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(fo)}catch(Go){ds(Go);return}(Ao=(mo=Ep(this,A2).config).onSuccess)==null||Ao.call(mo,fo,this),(Lo=($o=Ep(this,A2).config).onSettled)==null||Lo.call($o,fo,this.state.error,this),this.scheduleGc()},onError:ds,onFail:(fo,mo)=>{m1(this,j2,bv).call(this,{type:"failed",failureCount:fo,error:mo})},onPause:()=>{m1(this,j2,bv).call(this,{type:"pause"})},onContinue:()=>{m1(this,j2,bv).call(this,{type:"continue"})},retry:us.options.retry,retryDelay:us.options.retryDelay,networkMode:us.options.networkMode,canRun:()=>!0})),Ep(this,D1).start()}},Cy=new WeakMap,Ay=new WeakMap,A2=new WeakMap,D1=new WeakMap,Ky=new WeakMap,sy=new WeakMap,j2=new WeakSet,bv=function(Mn){const rs=is=>{switch(Mn.type){case"failed":return{...is,fetchFailureCount:Mn.failureCount,fetchFailureReason:Mn.error};case"pause":return{...is,fetchStatus:"paused"};case"continue":return{...is,fetchStatus:"fetching"};case"fetch":return{...is,...fetchState(is.data,this.options),fetchMeta:Mn.meta??null};case"success":return{...is,data:Mn.data,dataUpdateCount:is.dataUpdateCount+1,dataUpdatedAt:Mn.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!Mn.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const os=Mn.error;return isCancelledError(os)&&os.revert&&Ep(this,Ay)?{...Ep(this,Ay),fetchStatus:"idle"}:{...is,error:os,errorUpdateCount:is.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:is.fetchFailureCount+1,fetchFailureReason:os,fetchStatus:"idle",status:"error"};case"invalidate":return{...is,isInvalidated:!0};case"setState":return{...is,...Mn.state}}};this.state=rs(this.state),notifyManager.batch(()=>{this.observers.forEach(is=>{is.onQueryUpdate()}),Ep(this,A2).notify({query:this,type:"updated",action:Mn})})},qE);function fetchState(Fn,Mn){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(Mn.networkMode)?"fetching":"paused",...Fn===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(Fn){const Mn=typeof Fn.initialData=="function"?Fn.initialData():Fn.initialData,rs=Mn!==void 0,is=rs?typeof Fn.initialDataUpdatedAt=="function"?Fn.initialDataUpdatedAt():Fn.initialDataUpdatedAt:0;return{data:Mn,dataUpdateCount:0,dataUpdatedAt:rs?is??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rs?"success":"pending",fetchStatus:"idle"}}var V2,ZE,QueryCache=(ZE=class extends Subscribable{constructor(Mn={}){super();Nm(this,V2);this.config=Mn,gm(this,V2,new Map)}build(Mn,rs,is){const os=rs.queryKey,as=rs.queryHash??hashQueryKeyByOptions(os,rs);let us=this.get(as);return us||(us=new Query({cache:this,queryKey:os,queryHash:as,options:Mn.defaultQueryOptions(rs),state:is,defaultOptions:Mn.getQueryDefaults(os)}),this.add(us)),us}add(Mn){Ep(this,V2).has(Mn.queryHash)||(Ep(this,V2).set(Mn.queryHash,Mn),this.notify({type:"added",query:Mn}))}remove(Mn){const rs=Ep(this,V2).get(Mn.queryHash);rs&&(Mn.destroy(),rs===Mn&&Ep(this,V2).delete(Mn.queryHash),this.notify({type:"removed",query:Mn}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(Mn=>{this.remove(Mn)})})}get(Mn){return Ep(this,V2).get(Mn)}getAll(){return[...Ep(this,V2).values()]}find(Mn){const rs={exact:!0,...Mn};return this.getAll().find(is=>matchQuery(rs,is))}findAll(Mn={}){const rs=this.getAll();return Object.keys(Mn).length>0?rs.filter(is=>matchQuery(Mn,is)):rs}notify(Mn){notifyManager.batch(()=>{this.listeners.forEach(rs=>{rs(Mn)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(Mn=>{Mn.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(Mn=>{Mn.onOnline()})})}},V2=new WeakMap,ZE),z2,G1,oy,H2,Bv,YE,Mutation=(YE=class extends Removable{constructor(Mn){super();Nm(this,H2);Nm(this,z2);Nm(this,G1);Nm(this,oy);this.mutationId=Mn.mutationId,gm(this,G1,Mn.mutationCache),gm(this,z2,[]),this.state=Mn.state||getDefaultState(),this.setOptions(Mn.options),this.scheduleGc()}setOptions(Mn){this.options=Mn,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(Mn){Ep(this,z2).includes(Mn)||(Ep(this,z2).push(Mn),this.clearGcTimeout(),Ep(this,G1).notify({type:"observerAdded",mutation:this,observer:Mn}))}removeObserver(Mn){gm(this,z2,Ep(this,z2).filter(rs=>rs!==Mn)),this.scheduleGc(),Ep(this,G1).notify({type:"observerRemoved",mutation:this,observer:Mn})}optionalRemove(){Ep(this,z2).length||(this.state.status==="pending"?this.scheduleGc():Ep(this,G1).remove(this))}continue(){var Mn;return((Mn=Ep(this,oy))==null?void 0:Mn.continue())??this.execute(this.state.variables)}async execute(Mn){var os,as,us,ds,hs,ps,io,fo,mo,Ao,$o,Lo,Go,Yo,Wo,Jo,xl,_l,Tl,Sl;gm(this,oy,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(Mn):Promise.reject(new Error("No mutationFn found")),onFail:($l,Pl)=>{m1(this,H2,Bv).call(this,{type:"failed",failureCount:$l,error:Pl})},onPause:()=>{m1(this,H2,Bv).call(this,{type:"pause"})},onContinue:()=>{m1(this,H2,Bv).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Ep(this,G1).canRun(this)}));const rs=this.state.status==="pending",is=!Ep(this,oy).canStart();try{if(!rs){m1(this,H2,Bv).call(this,{type:"pending",variables:Mn,isPaused:is}),await((as=(os=Ep(this,G1).config).onMutate)==null?void 0:as.call(os,Mn,this));const Pl=await((ds=(us=this.options).onMutate)==null?void 0:ds.call(us,Mn));Pl!==this.state.context&&m1(this,H2,Bv).call(this,{type:"pending",context:Pl,variables:Mn,isPaused:is})}const $l=await Ep(this,oy).start();return await((ps=(hs=Ep(this,G1).config).onSuccess)==null?void 0:ps.call(hs,$l,Mn,this.state.context,this)),await((fo=(io=this.options).onSuccess)==null?void 0:fo.call(io,$l,Mn,this.state.context)),await((Ao=(mo=Ep(this,G1).config).onSettled)==null?void 0:Ao.call(mo,$l,null,this.state.variables,this.state.context,this)),await((Lo=($o=this.options).onSettled)==null?void 0:Lo.call($o,$l,null,Mn,this.state.context)),m1(this,H2,Bv).call(this,{type:"success",data:$l}),$l}catch($l){try{throw await((Yo=(Go=Ep(this,G1).config).onError)==null?void 0:Yo.call(Go,$l,Mn,this.state.context,this)),await((Jo=(Wo=this.options).onError)==null?void 0:Jo.call(Wo,$l,Mn,this.state.context)),await((_l=(xl=Ep(this,G1).config).onSettled)==null?void 0:_l.call(xl,void 0,$l,this.state.variables,this.state.context,this)),await((Sl=(Tl=this.options).onSettled)==null?void 0:Sl.call(Tl,void 0,$l,Mn,this.state.context)),$l}finally{m1(this,H2,Bv).call(this,{type:"error",error:$l})}}finally{Ep(this,G1).runNext(this)}}},z2=new WeakMap,G1=new WeakMap,oy=new WeakMap,H2=new WeakSet,Bv=function(Mn){const rs=is=>{switch(Mn.type){case"failed":return{...is,failureCount:Mn.failureCount,failureReason:Mn.error};case"pause":return{...is,isPaused:!0};case"continue":return{...is,isPaused:!1};case"pending":return{...is,context:Mn.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:Mn.isPaused,status:"pending",variables:Mn.variables,submittedAt:Date.now()};case"success":return{...is,data:Mn.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...is,data:void 0,error:Mn.error,failureCount:is.failureCount+1,failureReason:Mn.error,isPaused:!1,status:"error"}}};this.state=rs(this.state),notifyManager.batch(()=>{Ep(this,z2).forEach(is=>{is.onMutationUpdate(Mn)}),Ep(this,G1).notify({mutation:this,type:"updated",action:Mn})})},YE);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var f2,qy,QE,MutationCache=(QE=class extends Subscribable{constructor(Mn={}){super();Nm(this,f2);Nm(this,qy);this.config=Mn,gm(this,f2,new Map),gm(this,qy,Date.now())}build(Mn,rs,is){const os=new Mutation({mutationCache:this,mutationId:++jx(this,qy)._,options:Mn.defaultMutationOptions(rs),state:is});return this.add(os),os}add(Mn){const rs=scopeFor(Mn),is=Ep(this,f2).get(rs)??[];is.push(Mn),Ep(this,f2).set(rs,is),this.notify({type:"added",mutation:Mn})}remove(Mn){var is;const rs=scopeFor(Mn);if(Ep(this,f2).has(rs)){const os=(is=Ep(this,f2).get(rs))==null?void 0:is.filter(as=>as!==Mn);os&&(os.length===0?Ep(this,f2).delete(rs):Ep(this,f2).set(rs,os))}this.notify({type:"removed",mutation:Mn})}canRun(Mn){var is;const rs=(is=Ep(this,f2).get(scopeFor(Mn)))==null?void 0:is.find(os=>os.state.status==="pending");return!rs||rs===Mn}runNext(Mn){var is;const rs=(is=Ep(this,f2).get(scopeFor(Mn)))==null?void 0:is.find(os=>os!==Mn&&os.state.isPaused);return(rs==null?void 0:rs.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(Mn=>{this.remove(Mn)})})}getAll(){return[...Ep(this,f2).values()].flat()}find(Mn){const rs={exact:!0,...Mn};return this.getAll().find(is=>matchMutation(rs,is))}findAll(Mn={}){return this.getAll().filter(rs=>matchMutation(Mn,rs))}notify(Mn){notifyManager.batch(()=>{this.listeners.forEach(rs=>{rs(Mn)})})}resumePausedMutations(){const Mn=this.getAll().filter(rs=>rs.state.isPaused);return notifyManager.batch(()=>Promise.all(Mn.map(rs=>rs.continue().catch(noop$6))))}},f2=new WeakMap,qy=new WeakMap,QE);function scopeFor(Fn){var Mn;return((Mn=Fn.options.scope)==null?void 0:Mn.id)??String(Fn.mutationId)}function infiniteQueryBehavior(Fn){return{onFetch:(Mn,rs)=>{var io,fo,mo,Ao,$o;const is=Mn.options,os=(mo=(fo=(io=Mn.fetchOptions)==null?void 0:io.meta)==null?void 0:fo.fetchMore)==null?void 0:mo.direction,as=((Ao=Mn.state.data)==null?void 0:Ao.pages)||[],us=(($o=Mn.state.data)==null?void 0:$o.pageParams)||[];let ds={pages:[],pageParams:[]},hs=0;const ps=async()=>{let Lo=!1;const Go=Jo=>{Object.defineProperty(Jo,"signal",{enumerable:!0,get:()=>(Mn.signal.aborted?Lo=!0:Mn.signal.addEventListener("abort",()=>{Lo=!0}),Mn.signal)})},Yo=ensureQueryFn(Mn.options,Mn.fetchOptions),Wo=async(Jo,xl,_l)=>{if(Lo)return Promise.reject();if(xl==null&&Jo.pages.length)return Promise.resolve(Jo);const Tl={queryKey:Mn.queryKey,pageParam:xl,direction:_l?"backward":"forward",meta:Mn.options.meta};Go(Tl);const Sl=await Yo(Tl),{maxPages:$l}=Mn.options,Pl=_l?addToStart:addToEnd;return{pages:Pl(Jo.pages,Sl,$l),pageParams:Pl(Jo.pageParams,xl,$l)}};if(os&&as.length){const Jo=os==="backward",xl=Jo?getPreviousPageParam:getNextPageParam,_l={pages:as,pageParams:us},Tl=xl(is,_l);ds=await Wo(_l,Tl,Jo)}else{const Jo=Fn??as.length;do{const xl=hs===0?us[0]??is.initialPageParam:getNextPageParam(is,ds);if(hs>0&&xl==null)break;ds=await Wo(ds,xl),hs++}while(hs<Jo)}return ds};Mn.options.persister?Mn.fetchFn=()=>{var Lo,Go;return(Go=(Lo=Mn.options).persister)==null?void 0:Go.call(Lo,ps,{queryKey:Mn.queryKey,meta:Mn.options.meta,signal:Mn.signal},rs)}:Mn.fetchFn=ps}}}function getNextPageParam(Fn,{pages:Mn,pageParams:rs}){const is=Mn.length-1;return Mn.length>0?Fn.getNextPageParam(Mn[is],Mn,rs[is],rs):void 0}function getPreviousPageParam(Fn,{pages:Mn,pageParams:rs}){var is;return Mn.length>0?(is=Fn.getPreviousPageParam)==null?void 0:is.call(Fn,Mn[0],Mn,rs[0],rs):void 0}var c1,Vv,zv,Sy,$y,Hv,Ty,Ry,JE,QueryClient=(JE=class{constructor(Fn={}){Nm(this,c1);Nm(this,Vv);Nm(this,zv);Nm(this,Sy);Nm(this,$y);Nm(this,Hv);Nm(this,Ty);Nm(this,Ry);gm(this,c1,Fn.queryCache||new QueryCache),gm(this,Vv,Fn.mutationCache||new MutationCache),gm(this,zv,Fn.defaultOptions||{}),gm(this,Sy,new Map),gm(this,$y,new Map),gm(this,Hv,0)}mount(){jx(this,Hv)._++,Ep(this,Hv)===1&&(gm(this,Ty,focusManager.subscribe(async Fn=>{Fn&&(await this.resumePausedMutations(),Ep(this,c1).onFocus())})),gm(this,Ry,onlineManager.subscribe(async Fn=>{Fn&&(await this.resumePausedMutations(),Ep(this,c1).onOnline())})))}unmount(){var Fn,Mn;jx(this,Hv)._--,Ep(this,Hv)===0&&((Fn=Ep(this,Ty))==null||Fn.call(this),gm(this,Ty,void 0),(Mn=Ep(this,Ry))==null||Mn.call(this),gm(this,Ry,void 0))}isFetching(Fn){return Ep(this,c1).findAll({...Fn,fetchStatus:"fetching"}).length}isMutating(Fn){return Ep(this,Vv).findAll({...Fn,status:"pending"}).length}getQueryData(Fn){var rs;const Mn=this.defaultQueryOptions({queryKey:Fn});return(rs=Ep(this,c1).get(Mn.queryHash))==null?void 0:rs.state.data}ensureQueryData(Fn){const Mn=this.getQueryData(Fn.queryKey);if(Mn===void 0)return this.fetchQuery(Fn);{const rs=this.defaultQueryOptions(Fn),is=Ep(this,c1).build(this,rs);return Fn.revalidateIfStale&&is.isStaleByTime(resolveStaleTime(rs.staleTime,is))&&this.prefetchQuery(rs),Promise.resolve(Mn)}}getQueriesData(Fn){return Ep(this,c1).findAll(Fn).map(({queryKey:Mn,state:rs})=>{const is=rs.data;return[Mn,is]})}setQueryData(Fn,Mn,rs){const is=this.defaultQueryOptions({queryKey:Fn}),os=Ep(this,c1).get(is.queryHash),as=os==null?void 0:os.state.data,us=functionalUpdate(Mn,as);if(us!==void 0)return Ep(this,c1).build(this,is).setData(us,{...rs,manual:!0})}setQueriesData(Fn,Mn,rs){return notifyManager.batch(()=>Ep(this,c1).findAll(Fn).map(({queryKey:is})=>[is,this.setQueryData(is,Mn,rs)]))}getQueryState(Fn){var rs;const Mn=this.defaultQueryOptions({queryKey:Fn});return(rs=Ep(this,c1).get(Mn.queryHash))==null?void 0:rs.state}removeQueries(Fn){const Mn=Ep(this,c1);notifyManager.batch(()=>{Mn.findAll(Fn).forEach(rs=>{Mn.remove(rs)})})}resetQueries(Fn,Mn){const rs=Ep(this,c1),is={type:"active",...Fn};return notifyManager.batch(()=>(rs.findAll(Fn).forEach(os=>{os.reset()}),this.refetchQueries(is,Mn)))}cancelQueries(Fn={},Mn={}){const rs={revert:!0,...Mn},is=notifyManager.batch(()=>Ep(this,c1).findAll(Fn).map(os=>os.cancel(rs)));return Promise.all(is).then(noop$6).catch(noop$6)}invalidateQueries(Fn={},Mn={}){return notifyManager.batch(()=>{if(Ep(this,c1).findAll(Fn).forEach(is=>{is.invalidate()}),Fn.refetchType==="none")return Promise.resolve();const rs={...Fn,type:Fn.refetchType??Fn.type??"active"};return this.refetchQueries(rs,Mn)})}refetchQueries(Fn={},Mn){const rs={...Mn,cancelRefetch:(Mn==null?void 0:Mn.cancelRefetch)??!0},is=notifyManager.batch(()=>Ep(this,c1).findAll(Fn).filter(os=>!os.isDisabled()).map(os=>{let as=os.fetch(void 0,rs);return rs.throwOnError||(as=as.catch(noop$6)),os.state.fetchStatus==="paused"?Promise.resolve():as}));return Promise.all(is).then(noop$6)}fetchQuery(Fn){const Mn=this.defaultQueryOptions(Fn);Mn.retry===void 0&&(Mn.retry=!1);const rs=Ep(this,c1).build(this,Mn);return rs.isStaleByTime(resolveStaleTime(Mn.staleTime,rs))?rs.fetch(Mn):Promise.resolve(rs.state.data)}prefetchQuery(Fn){return this.fetchQuery(Fn).then(noop$6).catch(noop$6)}fetchInfiniteQuery(Fn){return Fn.behavior=infiniteQueryBehavior(Fn.pages),this.fetchQuery(Fn)}prefetchInfiniteQuery(Fn){return this.fetchInfiniteQuery(Fn).then(noop$6).catch(noop$6)}ensureInfiniteQueryData(Fn){return Fn.behavior=infiniteQueryBehavior(Fn.pages),this.ensureQueryData(Fn)}resumePausedMutations(){return onlineManager.isOnline()?Ep(this,Vv).resumePausedMutations():Promise.resolve()}getQueryCache(){return Ep(this,c1)}getMutationCache(){return Ep(this,Vv)}getDefaultOptions(){return Ep(this,zv)}setDefaultOptions(Fn){gm(this,zv,Fn)}setQueryDefaults(Fn,Mn){Ep(this,Sy).set(hashKey(Fn),{queryKey:Fn,defaultOptions:Mn})}getQueryDefaults(Fn){const Mn=[...Ep(this,Sy).values()];let rs={};return Mn.forEach(is=>{partialMatchKey(Fn,is.queryKey)&&(rs={...rs,...is.defaultOptions})}),rs}setMutationDefaults(Fn,Mn){Ep(this,$y).set(hashKey(Fn),{mutationKey:Fn,defaultOptions:Mn})}getMutationDefaults(Fn){const Mn=[...Ep(this,$y).values()];let rs={};return Mn.forEach(is=>{partialMatchKey(Fn,is.mutationKey)&&(rs={...rs,...is.defaultOptions})}),rs}defaultQueryOptions(Fn){if(Fn._defaulted)return Fn;const Mn={...Ep(this,zv).queries,...this.getQueryDefaults(Fn.queryKey),...Fn,_defaulted:!0};return Mn.queryHash||(Mn.queryHash=hashQueryKeyByOptions(Mn.queryKey,Mn)),Mn.refetchOnReconnect===void 0&&(Mn.refetchOnReconnect=Mn.networkMode!=="always"),Mn.throwOnError===void 0&&(Mn.throwOnError=!!Mn.suspense),!Mn.networkMode&&Mn.persister&&(Mn.networkMode="offlineFirst"),Mn.enabled!==!0&&Mn.queryFn===skipToken&&(Mn.enabled=!1),Mn}defaultMutationOptions(Fn){return Fn!=null&&Fn._defaulted?Fn:{...Ep(this,zv).mutations,...(Fn==null?void 0:Fn.mutationKey)&&this.getMutationDefaults(Fn.mutationKey),...Fn,_defaulted:!0}}clear(){Ep(this,c1).clear(),Ep(this,Vv).clear()}},c1=new WeakMap,Vv=new WeakMap,zv=new WeakMap,Sy=new WeakMap,$y=new WeakMap,Hv=new WeakMap,Ty=new WeakMap,Ry=new WeakMap,JE),Gv,Kv,r2,Ev,Sv,Mx,Vw,XE,MutationObserver$1=(XE=class extends Subscribable{constructor(rs,is){super();Nm(this,Sv);Nm(this,Gv);Nm(this,Kv);Nm(this,r2);Nm(this,Ev);gm(this,Gv,rs),this.setOptions(is),this.bindMethods(),m1(this,Sv,Mx).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rs){var os;const is=this.options;this.options=Ep(this,Gv).defaultMutationOptions(rs),shallowEqualObjects(this.options,is)||Ep(this,Gv).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Ep(this,r2),observer:this}),is!=null&&is.mutationKey&&this.options.mutationKey&&hashKey(is.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((os=Ep(this,r2))==null?void 0:os.state.status)==="pending"&&Ep(this,r2).setOptions(this.options)}onUnsubscribe(){var rs;this.hasListeners()||(rs=Ep(this,r2))==null||rs.removeObserver(this)}onMutationUpdate(rs){m1(this,Sv,Mx).call(this),m1(this,Sv,Vw).call(this,rs)}getCurrentResult(){return Ep(this,Kv)}reset(){var rs;(rs=Ep(this,r2))==null||rs.removeObserver(this),gm(this,r2,void 0),m1(this,Sv,Mx).call(this),m1(this,Sv,Vw).call(this)}mutate(rs,is){var os;return gm(this,Ev,is),(os=Ep(this,r2))==null||os.removeObserver(this),gm(this,r2,Ep(this,Gv).getMutationCache().build(Ep(this,Gv),this.options)),Ep(this,r2).addObserver(this),Ep(this,r2).execute(rs)}},Gv=new WeakMap,Kv=new WeakMap,r2=new WeakMap,Ev=new WeakMap,Sv=new WeakSet,Mx=function(){var is;const rs=((is=Ep(this,r2))==null?void 0:is.state)??getDefaultState();gm(this,Kv,{...rs,isPending:rs.status==="pending",isSuccess:rs.status==="success",isError:rs.status==="error",isIdle:rs.status==="idle",mutate:this.mutate,reset:this.reset})},Vw=function(rs){notifyManager.batch(()=>{var is,os,as,us,ds,hs,ps,io;if(Ep(this,Ev)&&this.hasListeners()){const fo=Ep(this,Kv).variables,mo=Ep(this,Kv).context;(rs==null?void 0:rs.type)==="success"?((os=(is=Ep(this,Ev)).onSuccess)==null||os.call(is,rs.data,fo,mo),(us=(as=Ep(this,Ev)).onSettled)==null||us.call(as,rs.data,null,fo,mo)):(rs==null?void 0:rs.type)==="error"&&((hs=(ds=Ep(this,Ev)).onError)==null||hs.call(ds,rs.error,fo,mo),(io=(ps=Ep(this,Ev)).onSettled)==null||io.call(ps,void 0,rs.error,fo,mo))}this.listeners.forEach(fo=>{fo(Ep(this,Kv))})})},XE);function connectMutationOptions(Fn){return{mutationFn(Mn){return connect(Fn,Mn)},mutationKey:["connect"]}}function disconnectMutationOptions(Fn){return{mutationFn(Mn){return disconnect$1(Fn,Mn)},mutationKey:["disconnect"]}}function switchChainMutationOptions(Fn){return{mutationFn(Mn){return switchChain(Fn,Mn)},mutationKey:["switchChain"]}}function watchAssetMutationOptions(Fn){return{mutationFn(Mn){return watchAsset(Fn,Mn)},mutationKey:["watchAsset"]}}var QueryClientContext=reactExports.createContext(void 0),useQueryClient=Fn=>{const Mn=reactExports.useContext(QueryClientContext);if(!Mn)throw new Error("No QueryClient set, use QueryClientProvider to set one");return Mn},QueryClientProvider=({client:Fn,children:Mn})=>(reactExports.useEffect(()=>(Fn.mount(),()=>{Fn.unmount()}),[Fn]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:Fn,children:Mn}));function shouldThrowError(Fn,Mn){return typeof Fn=="function"?Fn(...Mn):!!Fn}function noop$5(){}function useMutation(Fn,Mn){const rs=useQueryClient(),[is]=reactExports.useState(()=>new MutationObserver$1(rs,Fn));reactExports.useEffect(()=>{is.setOptions(Fn)},[is,Fn]);const os=reactExports.useSyncExternalStore(reactExports.useCallback(us=>is.subscribe(notifyManager.batchCalls(us)),[is]),()=>is.getCurrentResult(),()=>is.getCurrentResult()),as=reactExports.useCallback((us,ds)=>{is.mutate(us,ds).catch(noop$5)},[is]);if(os.error&&shouldThrowError(is.options.throwOnError,[os.error]))throw os.error;return{...os,mutate:as,mutateAsync:os.mutate}}function useChains(Fn={}){const Mn=useConfig(Fn);return reactExports.useSyncExternalStore(rs=>watchChains(Mn,{onChange:rs}),()=>getChains(Mn),()=>getChains(Mn))}function useConnectors(Fn={}){const Mn=useConfig(Fn);return reactExports.useSyncExternalStore(rs=>watchConnectors(Mn,{onChange:rs}),()=>getConnectors(Mn),()=>getConnectors(Mn))}function useConnect(Fn={}){const{mutation:Mn}=Fn,rs=useConfig(Fn),is=connectMutationOptions(rs),{mutate:os,mutateAsync:as,...us}=useMutation({...Mn,...is});return reactExports.useEffect(()=>rs.subscribe(({status:ds})=>ds,(ds,hs)=>{hs==="connected"&&ds==="disconnected"&&us.reset()}),[rs,us.reset]),{...us,connect:os,connectAsync:as,connectors:useConnectors({config:rs})}}function useConnections(Fn={}){const Mn=useConfig(Fn);return reactExports.useSyncExternalStore(rs=>watchConnections(Mn,{onChange:rs}),()=>getConnections(Mn),()=>getConnections(Mn))}function useDisconnect(Fn={}){const{mutation:Mn}=Fn,rs=useConfig(Fn),is=disconnectMutationOptions(rs),{mutate:os,mutateAsync:as,...us}=useMutation({...Mn,...is});return{...us,connectors:useConnections({config:rs}).map(ds=>ds.connector),disconnect:os,disconnectAsync:as}}function useSwitchChain(Fn={}){const{mutation:Mn}=Fn,rs=useConfig(Fn),is=switchChainMutationOptions(rs),{mutate:os,mutateAsync:as,...us}=useMutation({...Mn,...is});return{...us,chains:useChains({config:rs}),switchChain:os,switchChainAsync:as}}function useWatchAsset(Fn={}){const{mutation:Mn}=Fn,rs=useConfig(Fn),is=watchAssetMutationOptions(rs),{mutate:os,mutateAsync:as,...us}=useMutation({...Mn,...is});return{...us,watchAsset:os,watchAssetAsync:as}}const SettingDark="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%202V4M12%2020V22M4%2012H2M6.31412%206.31412L4.8999%204.8999M17.6859%206.31412L19.1001%204.8999M6.31412%2017.69L4.8999%2019.1042M17.6859%2017.69L19.1001%2019.1042M22%2012H20M17%2012C17%2014.7614%2014.7614%2017%2012%2017C9.23858%2017%207%2014.7614%207%2012C7%209.23858%209.23858%207%2012%207C14.7614%207%2017%209.23858%2017%2012Z'%20stroke='%23777879'%20stroke-opacity='1'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",SettingGreen="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%202V4M12%2020V22M4%2012H2M6.31412%206.31412L4.8999%204.8999M17.6859%206.31412L19.1001%204.8999M6.31412%2017.69L4.8999%2019.1042M17.6859%2017.69L19.1001%2019.1042M22%2012H20M17%2012C17%2014.7614%2014.7614%2017%2012%2017C9.23858%2017%207%2014.7614%207%2012C7%209.23858%209.23858%207%2012%207C14.7614%207%2017%209.23858%2017%2012Z'%20stroke='%23107569'%20stroke-opacity='1'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",BarMenuDark="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='M3%2012H21M3%206H21M3%2018H21'%20stroke='%234A4B4D'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",BarMenu="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='M3%2012H21M3%206H21M3%2018H21'%20stroke='white'%20stroke-opacity='0.8'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",WrongRed="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='M18%206L6%2018M6%206L18%2018'%20stroke='%23F04438'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function o$7(Fn,Mn,rs){return Mn in Fn?Object.defineProperty(Fn,Mn,{value:rs,enumerable:!0,configurable:!0,writable:!0}):Fn[Mn]=rs,Fn}var u$3={click:"onClick",focusin:"onFocus",focusout:"onFocus",mousedown:"onMouseDown",mouseup:"onMouseUp",touchstart:"onTouchStart",touchend:"onTouchEnd"},c$9=function(Fn){var Mn,rs=Fn.children,is=Fn.onClickAway,os=Fn.focusEvent,as=os===void 0?"focusin":os,us=Fn.mouseEvent,ds=us===void 0?"click":us,hs=Fn.touchEvent,ps=hs===void 0?"touchend":hs,io=reactExports.useRef(null),fo=reactExports.useRef(null),mo=reactExports.useRef(!1);reactExports.useEffect(function(){return setTimeout(function(){mo.current=!0},0),function(){mo.current=!1}},[]);var Ao=function(Yo){return function(Wo){fo.current=Wo.target;var Jo=rs==null?void 0:rs.props[Yo];Jo&&Jo(Wo)}};reactExports.useEffect(function(){var Yo,Wo,Jo=(Yo=(Wo=io.current)===null||Wo===void 0?void 0:Wo.ownerDocument)!==null&&Yo!==void 0?Yo:document,xl=function(_l){mo.current&&(io.current&&io.current.contains(_l.target)||fo.current===_l.target||!Jo.contains(_l.target)||is(_l))};return Jo.addEventListener(ds,xl),Jo.addEventListener(ps,xl),Jo.addEventListener(as,xl),function(){Jo.removeEventListener(ds,xl),Jo.removeEventListener(ps,xl),Jo.removeEventListener(as,xl)}},[as,ds,is,ps]);var $o=u$3[ds],Lo=u$3[ps],Go=u$3[as];return React.Children.only(reactExports.cloneElement(rs,(o$7(Mn={ref:function(Yo){io.current=Yo;var Wo=rs.ref;typeof Wo=="function"?Wo(Yo):Wo&&(Wo.current=Yo)}},Go,Ao(Go)),o$7(Mn,$o,Ao($o)),o$7(Mn,Lo,Ao(Lo)),Mn)))};c$9.displayName="ClickAwayListener";const __vite_import_meta_env__$4={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_ARBITRUM_BTC_CALL_CONTROLLER_ADDRESS:"0x88e7a3A04384B873121A3D4D8c7260C30a17f9b6",VITE_ARBITRUM_BTC_CALL_LONGTOKEN_ADDRESS:"0x849A6746D6235087593789184215B16a09353b58",VITE_ARBITRUM_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0x0f4f76a9DC0C9e5920928D443BD56a9910B9d440",VITE_ARBITRUM_BTC_CALL_SHORTTOKEN_ADDRESS:"0x7204F3591EfA344D7Db30A93B53f7ee896407A46",VITE_ARBITRUM_BTC_CALL_VAULT_ADDRESS:"0x1EF72E09cdcc719994Df01ef420413c387afF523",VITE_ARBITRUM_BTC_PUT_CONTROLLER_ADDRESS:"0x023b95F123d9F1f7c501cBC0Ff119C1148ae244d",VITE_ARBITRUM_BTC_PUT_LONGTOKEN_ADDRESS:"0x2A1be4b228e486d33988549b72fc0EDE7c67DfeC",VITE_ARBITRUM_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x6d635c3059C42e661D4f4D1aB3Ad7ad8Cb21a0ea",VITE_ARBITRUM_BTC_PUT_SHORTTOKEN_ADDRESS:"0x1ca634Fc2ba18EF9e23a1a4f50C204Fccee5b959",VITE_ARBITRUM_BTC_PUT_VAULT_ADDRESS:"0xCF4cb0D6058f6a0a2599997CB66EaC0AeBdB4be4",VITE_ARBITRUM_CANDLE_INTERVAL:"1",VITE_ARBITRUM_CHAIN_ID:"421614",VITE_ARBITRUM_CHAIN_ID_HEX:"0x66eee",VITE_ARBITRUM_CHAIN_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_CONNECT_NETWORK_NAME:"arbitrumSepolia",VITE_ARBITRUM_CYCLE_DURATION:"5",VITE_ARBITRUM_ETH_CALL_CONTROLLER_ADDRESS:"0xFf72B4fBCCeC5a01554BeE50595E999B84c4b5cd",VITE_ARBITRUM_ETH_CALL_LONGTOKEN_ADDRESS:"0x331D8e8e0ad743F3A1908734106051a21A79a809",VITE_ARBITRUM_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5f9A93b04De5fCFd4FA552Bab87927B4F7811283",VITE_ARBITRUM_ETH_CALL_SHORTTOKEN_ADDRESS:"0xe5a3222720347c3ABAD046D69C16f97B3f69D6e6",VITE_ARBITRUM_ETH_CALL_VAULT_ADDRESS:"0x3d2D17Dd22AAF2b5E78aC8287e91D94c6f293264",VITE_ARBITRUM_ETH_PUT_CONTROLLER_ADDRESS:"0x7113e58c3E35E4adcF49f8C94915541BF3c0b54b",VITE_ARBITRUM_ETH_PUT_LONGTOKEN_ADDRESS:"0x623AC047de297c98B0a300299D66334Fb6653334",VITE_ARBITRUM_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x8BD2f0d7713AF3Fbd1bCd4837D6B0dEE2424BF62",VITE_ARBITRUM_ETH_PUT_SHORTTOKEN_ADDRESS:"0x555FaB7E6909d62812a57a22A4e4782fB227943a",VITE_ARBITRUM_ETH_PUT_VAULT_ADDRESS:"0xD5a2e5eC7B7E12E4D13fF0CD86510e5d0ED9f22F",VITE_ARBITRUM_EXPLORER_LINK:"https://sepolia.arbiscan.io",VITE_ARBITRUM_FAUCET_URL:"https://www.alchemy.com/faucets/arbitrum-sepolia",VITE_ARBITRUM_GAS_MULTIPLIER:"200",VITE_ARBITRUM_INFO_AGGREGATOR_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_ARBITRUM_NATIVE_TOKEN:"Arbitrum ETH",VITE_ARBITRUM_NATIVE_TOKEN_DECIMALS:"18",VITE_ARBITRUM_NATIVE_TOKEN_NAME:"ETH",VITE_ARBITRUM_NATIVE_TOKEN_SYMBOL:"ETH",VITE_ARBITRUM_NETWORK_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_PEPE_CALL_CONTROLLER_ADDRESS:"0x9e4c0853D182280dDb07700E754f5164870b19b8",VITE_ARBITRUM_PEPE_CALL_LONGTOKEN_ADDRESS:"0x59c5c8cAf2f35711D6AeB3aB10d9C0941332c8C1",VITE_ARBITRUM_PEPE_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5b7B8058f9E42f5E1a1c8a5777e4fc7337ea388e",VITE_ARBITRUM_PEPE_CALL_SHORTTOKEN_ADDRESS:"0x2A92e73FB8E70245d8e5a02796Fbd337f218a2b3",VITE_ARBITRUM_PEPE_CALL_VAULT_ADDRESS:"0x47D92807f3DD509ca9263ad89869eedc2c929d8D",VITE_ARBITRUM_PEPE_PUT_CONTROLLER_ADDRESS:"0x335Aa597E78Ce41df4BFC5d8Fb239CE788549Fbf",VITE_ARBITRUM_PEPE_PUT_LONGTOKEN_ADDRESS:"0x0833370393c95F6248B0993f72115049a17C7e2B",VITE_ARBITRUM_PEPE_PUT_SETTLEMENTMANAGER_ADDRESS:"0xcF237Eaf46ec94003CF6BAfcB2d7ec1bdD9760aa",VITE_ARBITRUM_PEPE_PUT_SHORTTOKEN_ADDRESS:"0xDf148c772598A24eA94A96FA6556D53EBED5E248",VITE_ARBITRUM_PEPE_PUT_VAULT_ADDRESS:"0x6A1Fd2267bC482C8D5833F6cE54e34951b6554cf",VITE_ARBITRUM_PREMIUM_PER_CYCLE:"0.5",VITE_ARBITRUM_PUBLIC_RPC:"https://arbitrum-sepolia.blockpi.network/v1/rpc/public",VITE_ARBITRUM_RPC:"https://greatest-falling-patron.arbitrum-sepolia.quiknode.pro/933e64a18e212561d0a0fdab953df2fdc1c06080",VITE_ARBITRUM_SCRAPPING_TIME:"30",VITE_ARBITRUM_SETTLEMENT_TOKEN_ADDRESS:"0x30B74a8766563DbAbAf04e0FFE392817F2D02Da1",VITE_ARBITRUM_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_ARBITRUM_WIF_CALL_CONTROLLER_ADDRESS:"0x4871807209e54b608e5844107Cf06Bcf12129F80",VITE_ARBITRUM_WIF_CALL_LONGTOKEN_ADDRESS:"0xa8DdE51B13C7d81b4D9c2c8EAa2E79bB828d82C4",VITE_ARBITRUM_WIF_CALL_SETTLEMENTMANAGER_ADDRESS:"0x583855075C098F2Cd7b2dA5995a2B329f0aE0f3c",VITE_ARBITRUM_WIF_CALL_SHORTTOKEN_ADDRESS:"0x582071a082189236f41527339DBb56B0c111CD6E",VITE_ARBITRUM_WIF_CALL_VAULT_ADDRESS:"0xFbd0Df32C6f75374B4b4Cb03f405932b4eeAC199",VITE_ARBITRUM_WIF_PUT_CONTROLLER_ADDRESS:"0x463377730eCaa7310Dcb3A3d48aDE097A23Bdd42",VITE_ARBITRUM_WIF_PUT_LONGTOKEN_ADDRESS:"0x607324341E75a5a51959a7b541cC8Fd7576e3066",VITE_ARBITRUM_WIF_PUT_SETTLEMENTMANAGER_ADDRESS:"0xFaA4AbaF2890958B200A04AE4cB2880Ad929d8A9",VITE_ARBITRUM_WIF_PUT_SHORTTOKEN_ADDRESS:"0x3FD0b87A9b30738F8086f0c2fDDe469687250FEb",VITE_ARBITRUM_WIF_PUT_VAULT_ADDRESS:"0x4C585D80bDDa554278F909bA51F2E42A2d5f5b96",VITE_BACKEND_URL:"https://switch-testnet-backend.kanalabs.io",VITE_BINANCE_BTC_CALL_CONTROLLER_ADDRESS:"0xC0028f1E9493bdba1670E8C65284f43F897D16d4",VITE_BINANCE_BTC_CALL_LONGTOKEN_ADDRESS:"0xA3fD705798AF4FA090B4dC95E97Ffb353a576969",VITE_BINANCE_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0xd38fd86FCCBf8DE9102d7C3D82799432D0B8da32",VITE_BINANCE_BTC_CALL_SHORTTOKEN_ADDRESS:"0xCaEC56628DCe5709F6B17De68C3431f45D4aBc37",VITE_BINANCE_BTC_CALL_VAULT_ADDRESS:"0x2fdbb070D4767cb11fe176CE48986aF222830437",VITE_BINANCE_BTC_PUT_CONTROLLER_ADDRESS:"0xBd99Fdae11A55E41e9ce1Cb27F2A6182dB579af8",VITE_BINANCE_BTC_PUT_LONGTOKEN_ADDRESS:"0x5E7f282a9Cd7BF64fD4EccD13b34703D7F27333d",VITE_BINANCE_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x9f3D3a8D3f0215Fe2D7692096DBC4b097EF5D963",VITE_BINANCE_BTC_PUT_SHORTTOKEN_ADDRESS:"0x7961F22D5931a510b40f740a005339109243Ca30",VITE_BINANCE_BTC_PUT_VAULT_ADDRESS:"0xaaBbF2bC143F59ab731C48FD687a14a8c30F2383",VITE_BINANCE_CANDLE_INTERVAL:"15",VITE_BINANCE_CHAIN_ID:"97",VITE_BINANCE_CHAIN_ID_HEX:"0x61",VITE_BINANCE_CHAIN_NAME:"BNB Smart Chain Testnet",VITE_BINANCE_CONNECT_NETWORK_NAME:"bscTestnet",VITE_BINANCE_CYCLE_DURATION:"120",VITE_BINANCE_ETH_CALL_CONTROLLER_ADDRESS:"0x9e35EDB90CF67A455Dc54418363bd6EC8fd0750d",VITE_BINANCE_ETH_CALL_LONGTOKEN_ADDRESS:"0x264821A828df29D027AF824Fb8A3a9cCCfbfB4bE",VITE_BINANCE_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0xbfE633B7A33e75EfD4af4522666a1c8eac4b3b65",VITE_BINANCE_ETH_CALL_SHORTTOKEN_ADDRESS:"0xE649a5a93224F6dc9bD9d5934A93b28F0a153956",VITE_BINANCE_ETH_CALL_VAULT_ADDRESS:"0x1E88b5ffd67313aC35cb13b4574284a1856047a3",VITE_BINANCE_ETH_PUT_CONTROLLER_ADDRESS:"0x3a577c95f96990E7741F8c07568476bA84567356",VITE_BINANCE_ETH_PUT_LONGTOKEN_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_BINANCE_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x254FF4CFa3d7dd1829B408243266870266f841CA",VITE_BINANCE_ETH_PUT_SHORTTOKEN_ADDRESS:"0x7051898114C8347fea6a2dcd6E3606D3FB31508F",VITE_BINANCE_ETH_PUT_VAULT_ADDRESS:"0x1FEF214CAdc20AB09562ECa67408e2cda49518A2",VITE_BINANCE_EXPLORER_LINK:"https://testnet.bscscan.com",VITE_BINANCE_FAUCET_URL:"https://testnet.bnbchain.org/faucet-smart",VITE_BINANCE_GAS_MULTIPLIER:"110",VITE_BINANCE_INFO_AGGREGATOR_ADDRESS:"0x3DFc4c69bce8e9455EafE3f429590fa9De5f128d",VITE_BINANCE_NATIVE_TOKEN:"tBNB",VITE_BINANCE_NATIVE_TOKEN_DECIMALS:"18",VITE_BINANCE_NATIVE_TOKEN_NAME:"tBNB",VITE_BINANCE_NATIVE_TOKEN_SYMBOL:"tBNB",VITE_BINANCE_NETWORK_NAME:"Binance Testnet",VITE_BINANCE_PREMIUM_PER_CYCLE:"0.5",VITE_BINANCE_PUBLIC_RPC:"https://endpoints.omniatech.io/v1/bsc/testnet/public",VITE_BINANCE_RPC:"https://cold-burned-general.bsc-testnet.quiknode.pro/5dc69c2182e7f66da44461e6dde3d7d786575a30/",VITE_BINANCE_SCRAPPING_TIME:"300",VITE_BINANCE_SETTLEMENT_TOKEN_ADDRESS:"0xDD0020ffDD1B371189778954Cf556B2979b0D33d",VITE_BINANCE_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_CHAIN_TOKEN_ARRAY:"BINANCE_ETH,BINANCE_BTC,ARBITRUM_ETH,ARBITRUM_PEPE",VITE_CIPHERDATA:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjRlYjViZDZhOWNmNDE2YzJmNzc3ZjU2OTg3ODkzNWE4OTBlMTc5NDdjODUyZmRjMzNlYjU1NmZmNzNkZjE5OGUyODU1NTg4NGNkYzM1ZWMwZjQwNzZkMWE4M2RhNTFiM2ZjYTA1YmQ1YTBlNTIwZGViZGVkZTViNzQ5NjdlMGEwIn0.b7ECWqqAvXtC8fblJcVKLO0GKBxa7rfNDtUwsnAaUno",VITE_MORALIS_API_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjM1MGU5MDEyLTU1Y2MtNDZkMi1iZTRkLWU2YTNhNTFmYzIxYyIsIm9yZ0lkIjoiMzczNjA3IiwidXNlcklkIjoiMzgzOTUxIiwidHlwZUlkIjoiYTBlZWJlNWYtMjQ3Ny00NTRjLWFlMDEtYmIxMThjYzliNjZiIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MDU5MTM4MTMsImV4cCI6NDg2MTY3MzgxM30.6ChaPKm5D80_qsZMnlsCoSumD2z9gkBWSP7wwoCAido",VITE_NETWORK:"TESTNET",VITE_PAYMASTER_API_KEY:"6kz6vdwgdbzs3w55jbn45chhhkw7yq8yk",VITE_QUICKNODE_KEY:"f2d17d0c3e7ac54189a60dad8133a533c4b4e945",VITE_VERCEL_BRANCH_URL:"kana-operps-frontend-git-testnet-operps-projects.vercel.app",VITE_VERCEL_ENV:"preview",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"operps",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"operps",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Merge pull request #409 from operps/devnet

Devnet`,VITE_VERCEL_GIT_COMMIT_REF:"testnet",VITE_VERCEL_GIT_COMMIT_SHA:"226178a17dbaec9ac480571ddea005cdee23e6a9",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"800575360",VITE_VERCEL_GIT_REPO_OWNER:"operps",VITE_VERCEL_GIT_REPO_SLUG:"kana-operps-frontend",VITE_VERCEL_PROJECT_PRODUCTION_URL:"operps.kanalabs.io",VITE_VERCEL_URL:"kana-operps-frontend-1n78omxub-operps-projects.vercel.app",VITE_WALLETCONNECTPROJECTID:"b8d15d96157934a210eb13769a539caa"},createStoreImpl=Fn=>{let Mn;const rs=new Set,is=(io,fo)=>{const mo=typeof io=="function"?io(Mn):io;if(!Object.is(mo,Mn)){const Ao=Mn;Mn=fo??(typeof mo!="object"||mo===null)?mo:Object.assign({},Mn,mo),rs.forEach($o=>$o(Mn,Ao))}},os=()=>Mn,hs={setState:is,getState:os,getInitialState:()=>ps,subscribe:io=>(rs.add(io),()=>rs.delete(io)),destroy:()=>{(__vite_import_meta_env__$4?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),rs.clear()}},ps=Mn=Fn(is,os,hs);return hs},createStore$1=Fn=>Fn?createStoreImpl(Fn):createStoreImpl,__vite_import_meta_env__$3={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_ARBITRUM_BTC_CALL_CONTROLLER_ADDRESS:"0x88e7a3A04384B873121A3D4D8c7260C30a17f9b6",VITE_ARBITRUM_BTC_CALL_LONGTOKEN_ADDRESS:"0x849A6746D6235087593789184215B16a09353b58",VITE_ARBITRUM_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0x0f4f76a9DC0C9e5920928D443BD56a9910B9d440",VITE_ARBITRUM_BTC_CALL_SHORTTOKEN_ADDRESS:"0x7204F3591EfA344D7Db30A93B53f7ee896407A46",VITE_ARBITRUM_BTC_CALL_VAULT_ADDRESS:"0x1EF72E09cdcc719994Df01ef420413c387afF523",VITE_ARBITRUM_BTC_PUT_CONTROLLER_ADDRESS:"0x023b95F123d9F1f7c501cBC0Ff119C1148ae244d",VITE_ARBITRUM_BTC_PUT_LONGTOKEN_ADDRESS:"0x2A1be4b228e486d33988549b72fc0EDE7c67DfeC",VITE_ARBITRUM_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x6d635c3059C42e661D4f4D1aB3Ad7ad8Cb21a0ea",VITE_ARBITRUM_BTC_PUT_SHORTTOKEN_ADDRESS:"0x1ca634Fc2ba18EF9e23a1a4f50C204Fccee5b959",VITE_ARBITRUM_BTC_PUT_VAULT_ADDRESS:"0xCF4cb0D6058f6a0a2599997CB66EaC0AeBdB4be4",VITE_ARBITRUM_CANDLE_INTERVAL:"1",VITE_ARBITRUM_CHAIN_ID:"421614",VITE_ARBITRUM_CHAIN_ID_HEX:"0x66eee",VITE_ARBITRUM_CHAIN_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_CONNECT_NETWORK_NAME:"arbitrumSepolia",VITE_ARBITRUM_CYCLE_DURATION:"5",VITE_ARBITRUM_ETH_CALL_CONTROLLER_ADDRESS:"0xFf72B4fBCCeC5a01554BeE50595E999B84c4b5cd",VITE_ARBITRUM_ETH_CALL_LONGTOKEN_ADDRESS:"0x331D8e8e0ad743F3A1908734106051a21A79a809",VITE_ARBITRUM_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5f9A93b04De5fCFd4FA552Bab87927B4F7811283",VITE_ARBITRUM_ETH_CALL_SHORTTOKEN_ADDRESS:"0xe5a3222720347c3ABAD046D69C16f97B3f69D6e6",VITE_ARBITRUM_ETH_CALL_VAULT_ADDRESS:"0x3d2D17Dd22AAF2b5E78aC8287e91D94c6f293264",VITE_ARBITRUM_ETH_PUT_CONTROLLER_ADDRESS:"0x7113e58c3E35E4adcF49f8C94915541BF3c0b54b",VITE_ARBITRUM_ETH_PUT_LONGTOKEN_ADDRESS:"0x623AC047de297c98B0a300299D66334Fb6653334",VITE_ARBITRUM_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x8BD2f0d7713AF3Fbd1bCd4837D6B0dEE2424BF62",VITE_ARBITRUM_ETH_PUT_SHORTTOKEN_ADDRESS:"0x555FaB7E6909d62812a57a22A4e4782fB227943a",VITE_ARBITRUM_ETH_PUT_VAULT_ADDRESS:"0xD5a2e5eC7B7E12E4D13fF0CD86510e5d0ED9f22F",VITE_ARBITRUM_EXPLORER_LINK:"https://sepolia.arbiscan.io",VITE_ARBITRUM_FAUCET_URL:"https://www.alchemy.com/faucets/arbitrum-sepolia",VITE_ARBITRUM_GAS_MULTIPLIER:"200",VITE_ARBITRUM_INFO_AGGREGATOR_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_ARBITRUM_NATIVE_TOKEN:"Arbitrum ETH",VITE_ARBITRUM_NATIVE_TOKEN_DECIMALS:"18",VITE_ARBITRUM_NATIVE_TOKEN_NAME:"ETH",VITE_ARBITRUM_NATIVE_TOKEN_SYMBOL:"ETH",VITE_ARBITRUM_NETWORK_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_PEPE_CALL_CONTROLLER_ADDRESS:"0x9e4c0853D182280dDb07700E754f5164870b19b8",VITE_ARBITRUM_PEPE_CALL_LONGTOKEN_ADDRESS:"0x59c5c8cAf2f35711D6AeB3aB10d9C0941332c8C1",VITE_ARBITRUM_PEPE_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5b7B8058f9E42f5E1a1c8a5777e4fc7337ea388e",VITE_ARBITRUM_PEPE_CALL_SHORTTOKEN_ADDRESS:"0x2A92e73FB8E70245d8e5a02796Fbd337f218a2b3",VITE_ARBITRUM_PEPE_CALL_VAULT_ADDRESS:"0x47D92807f3DD509ca9263ad89869eedc2c929d8D",VITE_ARBITRUM_PEPE_PUT_CONTROLLER_ADDRESS:"0x335Aa597E78Ce41df4BFC5d8Fb239CE788549Fbf",VITE_ARBITRUM_PEPE_PUT_LONGTOKEN_ADDRESS:"0x0833370393c95F6248B0993f72115049a17C7e2B",VITE_ARBITRUM_PEPE_PUT_SETTLEMENTMANAGER_ADDRESS:"0xcF237Eaf46ec94003CF6BAfcB2d7ec1bdD9760aa",VITE_ARBITRUM_PEPE_PUT_SHORTTOKEN_ADDRESS:"0xDf148c772598A24eA94A96FA6556D53EBED5E248",VITE_ARBITRUM_PEPE_PUT_VAULT_ADDRESS:"0x6A1Fd2267bC482C8D5833F6cE54e34951b6554cf",VITE_ARBITRUM_PREMIUM_PER_CYCLE:"0.5",VITE_ARBITRUM_PUBLIC_RPC:"https://arbitrum-sepolia.blockpi.network/v1/rpc/public",VITE_ARBITRUM_RPC:"https://greatest-falling-patron.arbitrum-sepolia.quiknode.pro/933e64a18e212561d0a0fdab953df2fdc1c06080",VITE_ARBITRUM_SCRAPPING_TIME:"30",VITE_ARBITRUM_SETTLEMENT_TOKEN_ADDRESS:"0x30B74a8766563DbAbAf04e0FFE392817F2D02Da1",VITE_ARBITRUM_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_ARBITRUM_WIF_CALL_CONTROLLER_ADDRESS:"0x4871807209e54b608e5844107Cf06Bcf12129F80",VITE_ARBITRUM_WIF_CALL_LONGTOKEN_ADDRESS:"0xa8DdE51B13C7d81b4D9c2c8EAa2E79bB828d82C4",VITE_ARBITRUM_WIF_CALL_SETTLEMENTMANAGER_ADDRESS:"0x583855075C098F2Cd7b2dA5995a2B329f0aE0f3c",VITE_ARBITRUM_WIF_CALL_SHORTTOKEN_ADDRESS:"0x582071a082189236f41527339DBb56B0c111CD6E",VITE_ARBITRUM_WIF_CALL_VAULT_ADDRESS:"0xFbd0Df32C6f75374B4b4Cb03f405932b4eeAC199",VITE_ARBITRUM_WIF_PUT_CONTROLLER_ADDRESS:"0x463377730eCaa7310Dcb3A3d48aDE097A23Bdd42",VITE_ARBITRUM_WIF_PUT_LONGTOKEN_ADDRESS:"0x607324341E75a5a51959a7b541cC8Fd7576e3066",VITE_ARBITRUM_WIF_PUT_SETTLEMENTMANAGER_ADDRESS:"0xFaA4AbaF2890958B200A04AE4cB2880Ad929d8A9",VITE_ARBITRUM_WIF_PUT_SHORTTOKEN_ADDRESS:"0x3FD0b87A9b30738F8086f0c2fDDe469687250FEb",VITE_ARBITRUM_WIF_PUT_VAULT_ADDRESS:"0x4C585D80bDDa554278F909bA51F2E42A2d5f5b96",VITE_BACKEND_URL:"https://switch-testnet-backend.kanalabs.io",VITE_BINANCE_BTC_CALL_CONTROLLER_ADDRESS:"0xC0028f1E9493bdba1670E8C65284f43F897D16d4",VITE_BINANCE_BTC_CALL_LONGTOKEN_ADDRESS:"0xA3fD705798AF4FA090B4dC95E97Ffb353a576969",VITE_BINANCE_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0xd38fd86FCCBf8DE9102d7C3D82799432D0B8da32",VITE_BINANCE_BTC_CALL_SHORTTOKEN_ADDRESS:"0xCaEC56628DCe5709F6B17De68C3431f45D4aBc37",VITE_BINANCE_BTC_CALL_VAULT_ADDRESS:"0x2fdbb070D4767cb11fe176CE48986aF222830437",VITE_BINANCE_BTC_PUT_CONTROLLER_ADDRESS:"0xBd99Fdae11A55E41e9ce1Cb27F2A6182dB579af8",VITE_BINANCE_BTC_PUT_LONGTOKEN_ADDRESS:"0x5E7f282a9Cd7BF64fD4EccD13b34703D7F27333d",VITE_BINANCE_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x9f3D3a8D3f0215Fe2D7692096DBC4b097EF5D963",VITE_BINANCE_BTC_PUT_SHORTTOKEN_ADDRESS:"0x7961F22D5931a510b40f740a005339109243Ca30",VITE_BINANCE_BTC_PUT_VAULT_ADDRESS:"0xaaBbF2bC143F59ab731C48FD687a14a8c30F2383",VITE_BINANCE_CANDLE_INTERVAL:"15",VITE_BINANCE_CHAIN_ID:"97",VITE_BINANCE_CHAIN_ID_HEX:"0x61",VITE_BINANCE_CHAIN_NAME:"BNB Smart Chain Testnet",VITE_BINANCE_CONNECT_NETWORK_NAME:"bscTestnet",VITE_BINANCE_CYCLE_DURATION:"120",VITE_BINANCE_ETH_CALL_CONTROLLER_ADDRESS:"0x9e35EDB90CF67A455Dc54418363bd6EC8fd0750d",VITE_BINANCE_ETH_CALL_LONGTOKEN_ADDRESS:"0x264821A828df29D027AF824Fb8A3a9cCCfbfB4bE",VITE_BINANCE_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0xbfE633B7A33e75EfD4af4522666a1c8eac4b3b65",VITE_BINANCE_ETH_CALL_SHORTTOKEN_ADDRESS:"0xE649a5a93224F6dc9bD9d5934A93b28F0a153956",VITE_BINANCE_ETH_CALL_VAULT_ADDRESS:"0x1E88b5ffd67313aC35cb13b4574284a1856047a3",VITE_BINANCE_ETH_PUT_CONTROLLER_ADDRESS:"0x3a577c95f96990E7741F8c07568476bA84567356",VITE_BINANCE_ETH_PUT_LONGTOKEN_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_BINANCE_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x254FF4CFa3d7dd1829B408243266870266f841CA",VITE_BINANCE_ETH_PUT_SHORTTOKEN_ADDRESS:"0x7051898114C8347fea6a2dcd6E3606D3FB31508F",VITE_BINANCE_ETH_PUT_VAULT_ADDRESS:"0x1FEF214CAdc20AB09562ECa67408e2cda49518A2",VITE_BINANCE_EXPLORER_LINK:"https://testnet.bscscan.com",VITE_BINANCE_FAUCET_URL:"https://testnet.bnbchain.org/faucet-smart",VITE_BINANCE_GAS_MULTIPLIER:"110",VITE_BINANCE_INFO_AGGREGATOR_ADDRESS:"0x3DFc4c69bce8e9455EafE3f429590fa9De5f128d",VITE_BINANCE_NATIVE_TOKEN:"tBNB",VITE_BINANCE_NATIVE_TOKEN_DECIMALS:"18",VITE_BINANCE_NATIVE_TOKEN_NAME:"tBNB",VITE_BINANCE_NATIVE_TOKEN_SYMBOL:"tBNB",VITE_BINANCE_NETWORK_NAME:"Binance Testnet",VITE_BINANCE_PREMIUM_PER_CYCLE:"0.5",VITE_BINANCE_PUBLIC_RPC:"https://endpoints.omniatech.io/v1/bsc/testnet/public",VITE_BINANCE_RPC:"https://cold-burned-general.bsc-testnet.quiknode.pro/5dc69c2182e7f66da44461e6dde3d7d786575a30/",VITE_BINANCE_SCRAPPING_TIME:"300",VITE_BINANCE_SETTLEMENT_TOKEN_ADDRESS:"0xDD0020ffDD1B371189778954Cf556B2979b0D33d",VITE_BINANCE_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_CHAIN_TOKEN_ARRAY:"BINANCE_ETH,BINANCE_BTC,ARBITRUM_ETH,ARBITRUM_PEPE",VITE_CIPHERDATA:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjRlYjViZDZhOWNmNDE2YzJmNzc3ZjU2OTg3ODkzNWE4OTBlMTc5NDdjODUyZmRjMzNlYjU1NmZmNzNkZjE5OGUyODU1NTg4NGNkYzM1ZWMwZjQwNzZkMWE4M2RhNTFiM2ZjYTA1YmQ1YTBlNTIwZGViZGVkZTViNzQ5NjdlMGEwIn0.b7ECWqqAvXtC8fblJcVKLO0GKBxa7rfNDtUwsnAaUno",VITE_MORALIS_API_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjM1MGU5MDEyLTU1Y2MtNDZkMi1iZTRkLWU2YTNhNTFmYzIxYyIsIm9yZ0lkIjoiMzczNjA3IiwidXNlcklkIjoiMzgzOTUxIiwidHlwZUlkIjoiYTBlZWJlNWYtMjQ3Ny00NTRjLWFlMDEtYmIxMThjYzliNjZiIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MDU5MTM4MTMsImV4cCI6NDg2MTY3MzgxM30.6ChaPKm5D80_qsZMnlsCoSumD2z9gkBWSP7wwoCAido",VITE_NETWORK:"TESTNET",VITE_PAYMASTER_API_KEY:"6kz6vdwgdbzs3w55jbn45chhhkw7yq8yk",VITE_QUICKNODE_KEY:"f2d17d0c3e7ac54189a60dad8133a533c4b4e945",VITE_VERCEL_BRANCH_URL:"kana-operps-frontend-git-testnet-operps-projects.vercel.app",VITE_VERCEL_ENV:"preview",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"operps",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"operps",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Merge pull request #409 from operps/devnet

Devnet`,VITE_VERCEL_GIT_COMMIT_REF:"testnet",VITE_VERCEL_GIT_COMMIT_SHA:"226178a17dbaec9ac480571ddea005cdee23e6a9",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"800575360",VITE_VERCEL_GIT_REPO_OWNER:"operps",VITE_VERCEL_GIT_REPO_SLUG:"kana-operps-frontend",VITE_VERCEL_PROJECT_PRODUCTION_URL:"operps.kanalabs.io",VITE_VERCEL_URL:"kana-operps-frontend-1n78omxub-operps-projects.vercel.app",VITE_WALLETCONNECTPROJECTID:"b8d15d96157934a210eb13769a539caa"},{useDebugValue}=React,{useSyncExternalStoreWithSelector}=useSyncExternalStoreExports;let didWarnAboutEqualityFn=!1;const identity$1=Fn=>Fn;function useStore$1(Fn,Mn=identity$1,rs){(__vite_import_meta_env__$3?"production":void 0)!=="production"&&rs&&!didWarnAboutEqualityFn&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),didWarnAboutEqualityFn=!0);const is=useSyncExternalStoreWithSelector(Fn.subscribe,Fn.getState,Fn.getServerState||Fn.getInitialState,Mn,rs);return useDebugValue(is),is}const createImpl=Fn=>{(__vite_import_meta_env__$3?"production":void 0)!=="production"&&typeof Fn!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const Mn=typeof Fn=="function"?createStore$1(Fn):Fn,rs=(is,os)=>useStore$1(Mn,is,os);return Object.assign(rs,Mn),rs},create=Fn=>Fn?createImpl(Fn):createImpl;var react$1=Fn=>((__vite_import_meta_env__$3?"production":void 0)!=="production"&&console.warn("[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`."),create(Fn)),bn$2={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$3=getAugmentedNamespace(__viteBrowserExternal$1);bn$2.exports;(function(Fn){(function(Mn,rs){function is(Vo,jo){if(!Vo)throw new Error(jo||"Assertion failed")}function os(Vo,jo){Vo.super_=jo;var Ho=function(){};Ho.prototype=jo.prototype,Vo.prototype=new Ho,Vo.prototype.constructor=Vo}function as(Vo,jo,Ho){if(as.isBN(Vo))return Vo;this.negative=0,this.words=null,this.length=0,this.red=null,Vo!==null&&((jo==="le"||jo==="be")&&(Ho=jo,jo=10),this._init(Vo||0,jo||10,Ho||"be"))}typeof Mn=="object"?Mn.exports=as:rs.BN=as,as.BN=as,as.wordSize=26;var us;try{typeof window<"u"&&typeof window.Buffer<"u"?us=window.Buffer:us=require$$3.Buffer}catch{}as.isBN=function(jo){return jo instanceof as?!0:jo!==null&&typeof jo=="object"&&jo.constructor.wordSize===as.wordSize&&Array.isArray(jo.words)},as.max=function(jo,Ho){return jo.cmp(Ho)>0?jo:Ho},as.min=function(jo,Ho){return jo.cmp(Ho)<0?jo:Ho},as.prototype._init=function(jo,Ho,Qo){if(typeof jo=="number")return this._initNumber(jo,Ho,Qo);if(typeof jo=="object")return this._initArray(jo,Ho,Qo);Ho==="hex"&&(Ho=16),is(Ho===(Ho|0)&&Ho>=2&&Ho<=36),jo=jo.toString().replace(/\s+/g,"");var El=0;jo[0]==="-"&&(El++,this.negative=1),El<jo.length&&(Ho===16?this._parseHex(jo,El,Qo):(this._parseBase(jo,Ho,El),Qo==="le"&&this._initArray(this.toArray(),Ho,Qo)))},as.prototype._initNumber=function(jo,Ho,Qo){jo<0&&(this.negative=1,jo=-jo),jo<67108864?(this.words=[jo&67108863],this.length=1):jo<4503599627370496?(this.words=[jo&67108863,jo/67108864&67108863],this.length=2):(is(jo<9007199254740992),this.words=[jo&67108863,jo/67108864&67108863,1],this.length=3),Qo==="le"&&this._initArray(this.toArray(),Ho,Qo)},as.prototype._initArray=function(jo,Ho,Qo){if(is(typeof jo.length=="number"),jo.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(jo.length/3),this.words=new Array(this.length);for(var El=0;El<this.length;El++)this.words[El]=0;var Xo,Al,wl=0;if(Qo==="be")for(El=jo.length-1,Xo=0;El>=0;El-=3)Al=jo[El]|jo[El-1]<<8|jo[El-2]<<16,this.words[Xo]|=Al<<wl&67108863,this.words[Xo+1]=Al>>>26-wl&67108863,wl+=24,wl>=26&&(wl-=26,Xo++);else if(Qo==="le")for(El=0,Xo=0;El<jo.length;El+=3)Al=jo[El]|jo[El+1]<<8|jo[El+2]<<16,this.words[Xo]|=Al<<wl&67108863,this.words[Xo+1]=Al>>>26-wl&67108863,wl+=24,wl>=26&&(wl-=26,Xo++);return this._strip()};function ds(Vo,jo){var Ho=Vo.charCodeAt(jo);if(Ho>=48&&Ho<=57)return Ho-48;if(Ho>=65&&Ho<=70)return Ho-55;if(Ho>=97&&Ho<=102)return Ho-87;is(!1,"Invalid character in "+Vo)}function hs(Vo,jo,Ho){var Qo=ds(Vo,Ho);return Ho-1>=jo&&(Qo|=ds(Vo,Ho-1)<<4),Qo}as.prototype._parseHex=function(jo,Ho,Qo){this.length=Math.ceil((jo.length-Ho)/6),this.words=new Array(this.length);for(var El=0;El<this.length;El++)this.words[El]=0;var Xo=0,Al=0,wl;if(Qo==="be")for(El=jo.length-1;El>=Ho;El-=2)wl=hs(jo,Ho,El)<<Xo,this.words[Al]|=wl&67108863,Xo>=18?(Xo-=18,Al+=1,this.words[Al]|=wl>>>26):Xo+=8;else{var yl=jo.length-Ho;for(El=yl%2===0?Ho+1:Ho;El<jo.length;El+=2)wl=hs(jo,Ho,El)<<Xo,this.words[Al]|=wl&67108863,Xo>=18?(Xo-=18,Al+=1,this.words[Al]|=wl>>>26):Xo+=8}this._strip()};function ps(Vo,jo,Ho,Qo){for(var El=0,Xo=0,Al=Math.min(Vo.length,Ho),wl=jo;wl<Al;wl++){var yl=Vo.charCodeAt(wl)-48;El*=Qo,yl>=49?Xo=yl-49+10:yl>=17?Xo=yl-17+10:Xo=yl,is(yl>=0&&Xo<Qo,"Invalid character"),El+=Xo}return El}as.prototype._parseBase=function(jo,Ho,Qo){this.words=[0],this.length=1;for(var El=0,Xo=1;Xo<=67108863;Xo*=Ho)El++;El--,Xo=Xo/Ho|0;for(var Al=jo.length-Qo,wl=Al%El,yl=Math.min(Al,Al-wl)+Qo,Il=0,Bl=Qo;Bl<yl;Bl+=El)Il=ps(jo,Bl,Bl+El,Ho),this.imuln(Xo),this.words[0]+Il<67108864?this.words[0]+=Il:this._iaddn(Il);if(wl!==0){var Gl=1;for(Il=ps(jo,Bl,jo.length,Ho),Bl=0;Bl<wl;Bl++)Gl*=Ho;this.imuln(Gl),this.words[0]+Il<67108864?this.words[0]+=Il:this._iaddn(Il)}this._strip()},as.prototype.copy=function(jo){jo.words=new Array(this.length);for(var Ho=0;Ho<this.length;Ho++)jo.words[Ho]=this.words[Ho];jo.length=this.length,jo.negative=this.negative,jo.red=this.red};function io(Vo,jo){Vo.words=jo.words,Vo.length=jo.length,Vo.negative=jo.negative,Vo.red=jo.red}if(as.prototype._move=function(jo){io(jo,this)},as.prototype.clone=function(){var jo=new as(null);return this.copy(jo),jo},as.prototype._expand=function(jo){for(;this.length<jo;)this.words[this.length++]=0;return this},as.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},as.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{as.prototype[Symbol.for("nodejs.util.inspect.custom")]=fo}catch{as.prototype.inspect=fo}else as.prototype.inspect=fo;function fo(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var mo=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],Ao=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],$o=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];as.prototype.toString=function(jo,Ho){jo=jo||10,Ho=Ho|0||1;var Qo;if(jo===16||jo==="hex"){Qo="";for(var El=0,Xo=0,Al=0;Al<this.length;Al++){var wl=this.words[Al],yl=((wl<<El|Xo)&16777215).toString(16);Xo=wl>>>24-El&16777215,El+=2,El>=26&&(El-=26,Al--),Xo!==0||Al!==this.length-1?Qo=mo[6-yl.length]+yl+Qo:Qo=yl+Qo}for(Xo!==0&&(Qo=Xo.toString(16)+Qo);Qo.length%Ho!==0;)Qo="0"+Qo;return this.negative!==0&&(Qo="-"+Qo),Qo}if(jo===(jo|0)&&jo>=2&&jo<=36){var Il=Ao[jo],Bl=$o[jo];Qo="";var Gl=this.clone();for(Gl.negative=0;!Gl.isZero();){var Nl=Gl.modrn(Bl).toString(jo);Gl=Gl.idivn(Bl),Gl.isZero()?Qo=Nl+Qo:Qo=mo[Il-Nl.length]+Nl+Qo}for(this.isZero()&&(Qo="0"+Qo);Qo.length%Ho!==0;)Qo="0"+Qo;return this.negative!==0&&(Qo="-"+Qo),Qo}is(!1,"Base should be between 2 and 36")},as.prototype.toNumber=function(){var jo=this.words[0];return this.length===2?jo+=this.words[1]*67108864:this.length===3&&this.words[2]===1?jo+=4503599627370496+this.words[1]*67108864:this.length>2&&is(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-jo:jo},as.prototype.toJSON=function(){return this.toString(16,2)},us&&(as.prototype.toBuffer=function(jo,Ho){return this.toArrayLike(us,jo,Ho)}),as.prototype.toArray=function(jo,Ho){return this.toArrayLike(Array,jo,Ho)};var Lo=function(jo,Ho){return jo.allocUnsafe?jo.allocUnsafe(Ho):new jo(Ho)};as.prototype.toArrayLike=function(jo,Ho,Qo){this._strip();var El=this.byteLength(),Xo=Qo||Math.max(1,El);is(El<=Xo,"byte array longer than desired length"),is(Xo>0,"Requested array length <= 0");var Al=Lo(jo,Xo),wl=Ho==="le"?"LE":"BE";return this["_toArrayLike"+wl](Al,El),Al},as.prototype._toArrayLikeLE=function(jo,Ho){for(var Qo=0,El=0,Xo=0,Al=0;Xo<this.length;Xo++){var wl=this.words[Xo]<<Al|El;jo[Qo++]=wl&255,Qo<jo.length&&(jo[Qo++]=wl>>8&255),Qo<jo.length&&(jo[Qo++]=wl>>16&255),Al===6?(Qo<jo.length&&(jo[Qo++]=wl>>24&255),El=0,Al=0):(El=wl>>>24,Al+=2)}if(Qo<jo.length)for(jo[Qo++]=El;Qo<jo.length;)jo[Qo++]=0},as.prototype._toArrayLikeBE=function(jo,Ho){for(var Qo=jo.length-1,El=0,Xo=0,Al=0;Xo<this.length;Xo++){var wl=this.words[Xo]<<Al|El;jo[Qo--]=wl&255,Qo>=0&&(jo[Qo--]=wl>>8&255),Qo>=0&&(jo[Qo--]=wl>>16&255),Al===6?(Qo>=0&&(jo[Qo--]=wl>>24&255),El=0,Al=0):(El=wl>>>24,Al+=2)}if(Qo>=0)for(jo[Qo--]=El;Qo>=0;)jo[Qo--]=0},Math.clz32?as.prototype._countBits=function(jo){return 32-Math.clz32(jo)}:as.prototype._countBits=function(jo){var Ho=jo,Qo=0;return Ho>=4096&&(Qo+=13,Ho>>>=13),Ho>=64&&(Qo+=7,Ho>>>=7),Ho>=8&&(Qo+=4,Ho>>>=4),Ho>=2&&(Qo+=2,Ho>>>=2),Qo+Ho},as.prototype._zeroBits=function(jo){if(jo===0)return 26;var Ho=jo,Qo=0;return Ho&8191||(Qo+=13,Ho>>>=13),Ho&127||(Qo+=7,Ho>>>=7),Ho&15||(Qo+=4,Ho>>>=4),Ho&3||(Qo+=2,Ho>>>=2),Ho&1||Qo++,Qo},as.prototype.bitLength=function(){var jo=this.words[this.length-1],Ho=this._countBits(jo);return(this.length-1)*26+Ho};function Go(Vo){for(var jo=new Array(Vo.bitLength()),Ho=0;Ho<jo.length;Ho++){var Qo=Ho/26|0,El=Ho%26;jo[Ho]=Vo.words[Qo]>>>El&1}return jo}as.prototype.zeroBits=function(){if(this.isZero())return 0;for(var jo=0,Ho=0;Ho<this.length;Ho++){var Qo=this._zeroBits(this.words[Ho]);if(jo+=Qo,Qo!==26)break}return jo},as.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},as.prototype.toTwos=function(jo){return this.negative!==0?this.abs().inotn(jo).iaddn(1):this.clone()},as.prototype.fromTwos=function(jo){return this.testn(jo-1)?this.notn(jo).iaddn(1).ineg():this.clone()},as.prototype.isNeg=function(){return this.negative!==0},as.prototype.neg=function(){return this.clone().ineg()},as.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},as.prototype.iuor=function(jo){for(;this.length<jo.length;)this.words[this.length++]=0;for(var Ho=0;Ho<jo.length;Ho++)this.words[Ho]=this.words[Ho]|jo.words[Ho];return this._strip()},as.prototype.ior=function(jo){return is((this.negative|jo.negative)===0),this.iuor(jo)},as.prototype.or=function(jo){return this.length>jo.length?this.clone().ior(jo):jo.clone().ior(this)},as.prototype.uor=function(jo){return this.length>jo.length?this.clone().iuor(jo):jo.clone().iuor(this)},as.prototype.iuand=function(jo){var Ho;this.length>jo.length?Ho=jo:Ho=this;for(var Qo=0;Qo<Ho.length;Qo++)this.words[Qo]=this.words[Qo]&jo.words[Qo];return this.length=Ho.length,this._strip()},as.prototype.iand=function(jo){return is((this.negative|jo.negative)===0),this.iuand(jo)},as.prototype.and=function(jo){return this.length>jo.length?this.clone().iand(jo):jo.clone().iand(this)},as.prototype.uand=function(jo){return this.length>jo.length?this.clone().iuand(jo):jo.clone().iuand(this)},as.prototype.iuxor=function(jo){var Ho,Qo;this.length>jo.length?(Ho=this,Qo=jo):(Ho=jo,Qo=this);for(var El=0;El<Qo.length;El++)this.words[El]=Ho.words[El]^Qo.words[El];if(this!==Ho)for(;El<Ho.length;El++)this.words[El]=Ho.words[El];return this.length=Ho.length,this._strip()},as.prototype.ixor=function(jo){return is((this.negative|jo.negative)===0),this.iuxor(jo)},as.prototype.xor=function(jo){return this.length>jo.length?this.clone().ixor(jo):jo.clone().ixor(this)},as.prototype.uxor=function(jo){return this.length>jo.length?this.clone().iuxor(jo):jo.clone().iuxor(this)},as.prototype.inotn=function(jo){is(typeof jo=="number"&&jo>=0);var Ho=Math.ceil(jo/26)|0,Qo=jo%26;this._expand(Ho),Qo>0&&Ho--;for(var El=0;El<Ho;El++)this.words[El]=~this.words[El]&67108863;return Qo>0&&(this.words[El]=~this.words[El]&67108863>>26-Qo),this._strip()},as.prototype.notn=function(jo){return this.clone().inotn(jo)},as.prototype.setn=function(jo,Ho){is(typeof jo=="number"&&jo>=0);var Qo=jo/26|0,El=jo%26;return this._expand(Qo+1),Ho?this.words[Qo]=this.words[Qo]|1<<El:this.words[Qo]=this.words[Qo]&~(1<<El),this._strip()},as.prototype.iadd=function(jo){var Ho;if(this.negative!==0&&jo.negative===0)return this.negative=0,Ho=this.isub(jo),this.negative^=1,this._normSign();if(this.negative===0&&jo.negative!==0)return jo.negative=0,Ho=this.isub(jo),jo.negative=1,Ho._normSign();var Qo,El;this.length>jo.length?(Qo=this,El=jo):(Qo=jo,El=this);for(var Xo=0,Al=0;Al<El.length;Al++)Ho=(Qo.words[Al]|0)+(El.words[Al]|0)+Xo,this.words[Al]=Ho&67108863,Xo=Ho>>>26;for(;Xo!==0&&Al<Qo.length;Al++)Ho=(Qo.words[Al]|0)+Xo,this.words[Al]=Ho&67108863,Xo=Ho>>>26;if(this.length=Qo.length,Xo!==0)this.words[this.length]=Xo,this.length++;else if(Qo!==this)for(;Al<Qo.length;Al++)this.words[Al]=Qo.words[Al];return this},as.prototype.add=function(jo){var Ho;return jo.negative!==0&&this.negative===0?(jo.negative=0,Ho=this.sub(jo),jo.negative^=1,Ho):jo.negative===0&&this.negative!==0?(this.negative=0,Ho=jo.sub(this),this.negative=1,Ho):this.length>jo.length?this.clone().iadd(jo):jo.clone().iadd(this)},as.prototype.isub=function(jo){if(jo.negative!==0){jo.negative=0;var Ho=this.iadd(jo);return jo.negative=1,Ho._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(jo),this.negative=1,this._normSign();var Qo=this.cmp(jo);if(Qo===0)return this.negative=0,this.length=1,this.words[0]=0,this;var El,Xo;Qo>0?(El=this,Xo=jo):(El=jo,Xo=this);for(var Al=0,wl=0;wl<Xo.length;wl++)Ho=(El.words[wl]|0)-(Xo.words[wl]|0)+Al,Al=Ho>>26,this.words[wl]=Ho&67108863;for(;Al!==0&&wl<El.length;wl++)Ho=(El.words[wl]|0)+Al,Al=Ho>>26,this.words[wl]=Ho&67108863;if(Al===0&&wl<El.length&&El!==this)for(;wl<El.length;wl++)this.words[wl]=El.words[wl];return this.length=Math.max(this.length,wl),El!==this&&(this.negative=1),this._strip()},as.prototype.sub=function(jo){return this.clone().isub(jo)};function Yo(Vo,jo,Ho){Ho.negative=jo.negative^Vo.negative;var Qo=Vo.length+jo.length|0;Ho.length=Qo,Qo=Qo-1|0;var El=Vo.words[0]|0,Xo=jo.words[0]|0,Al=El*Xo,wl=Al&67108863,yl=Al/67108864|0;Ho.words[0]=wl;for(var Il=1;Il<Qo;Il++){for(var Bl=yl>>>26,Gl=yl&67108863,Nl=Math.min(Il,jo.length-1),zl=Math.max(0,Il-Vo.length+1);zl<=Nl;zl++){var Vl=Il-zl|0;El=Vo.words[Vl]|0,Xo=jo.words[zl]|0,Al=El*Xo+Gl,Bl+=Al/67108864|0,Gl=Al&67108863}Ho.words[Il]=Gl|0,yl=Bl|0}return yl!==0?Ho.words[Il]=yl|0:Ho.length--,Ho._strip()}var Wo=function(jo,Ho,Qo){var El=jo.words,Xo=Ho.words,Al=Qo.words,wl=0,yl,Il,Bl,Gl=El[0]|0,Nl=Gl&8191,zl=Gl>>>13,Vl=El[1]|0,Hl=Vl&8191,Yl=Vl>>>13,Ll=El[2]|0,Zl=Ll&8191,Xl=Ll>>>13,wu=El[3]|0,yu=wu&8191,rp=wu>>>13,dp=El[4]|0,up=dp&8191,wp=dp>>>13,vp=El[5]|0,pp=vp&8191,cp=vp>>>13,gp=El[6]|0,mp=gp&8191,fp=gp>>>13,hp=El[7]|0,xp=hp&8191,Kl=hp>>>13,Fl=El[8]|0,Ul=Fl&8191,Jl=Fl>>>13,fu=El[9]|0,_d=fu&8191,tp=fu>>>13,yp=Xo[0]|0,_p=yp&8191,Sp=yp>>>13,Ap=Xo[1]|0,Op=Ap&8191,Zp=Ap>>>13,Qp=Xo[2]|0,Xp=Qp&8191,h0=Qp>>>13,Wp=Xo[3]|0,Np=Wp&8191,Rp=Wp>>>13,Pp=Xo[4]|0,Hp=Pp&8191,kp=Pp>>>13,Gp=Xo[5]|0,Yp=Gp&8191,Mp=Gp>>>13,Ip=Xo[6]|0,Dp=Ip&8191,Lp=Ip>>>13,zp=Xo[7]|0,Bp=zp&8191,qp=zp>>>13,Vp=Xo[8]|0,tm=Vp&8191,g0=Vp>>>13,rm=Xo[9]|0,Jp=rm&8191,lm=rm>>>13;Qo.negative=jo.negative^Ho.negative,Qo.length=19,yl=Math.imul(Nl,_p),Il=Math.imul(Nl,Sp),Il=Il+Math.imul(zl,_p)|0,Bl=Math.imul(zl,Sp);var $m=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+($m>>>26)|0,$m&=67108863,yl=Math.imul(Hl,_p),Il=Math.imul(Hl,Sp),Il=Il+Math.imul(Yl,_p)|0,Bl=Math.imul(Yl,Sp),yl=yl+Math.imul(Nl,Op)|0,Il=Il+Math.imul(Nl,Zp)|0,Il=Il+Math.imul(zl,Op)|0,Bl=Bl+Math.imul(zl,Zp)|0;var km=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(km>>>26)|0,km&=67108863,yl=Math.imul(Zl,_p),Il=Math.imul(Zl,Sp),Il=Il+Math.imul(Xl,_p)|0,Bl=Math.imul(Xl,Sp),yl=yl+Math.imul(Hl,Op)|0,Il=Il+Math.imul(Hl,Zp)|0,Il=Il+Math.imul(Yl,Op)|0,Bl=Bl+Math.imul(Yl,Zp)|0,yl=yl+Math.imul(Nl,Xp)|0,Il=Il+Math.imul(Nl,h0)|0,Il=Il+Math.imul(zl,Xp)|0,Bl=Bl+Math.imul(zl,h0)|0;var Cm=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(Cm>>>26)|0,Cm&=67108863,yl=Math.imul(yu,_p),Il=Math.imul(yu,Sp),Il=Il+Math.imul(rp,_p)|0,Bl=Math.imul(rp,Sp),yl=yl+Math.imul(Zl,Op)|0,Il=Il+Math.imul(Zl,Zp)|0,Il=Il+Math.imul(Xl,Op)|0,Bl=Bl+Math.imul(Xl,Zp)|0,yl=yl+Math.imul(Hl,Xp)|0,Il=Il+Math.imul(Hl,h0)|0,Il=Il+Math.imul(Yl,Xp)|0,Bl=Bl+Math.imul(Yl,h0)|0,yl=yl+Math.imul(Nl,Np)|0,Il=Il+Math.imul(Nl,Rp)|0,Il=Il+Math.imul(zl,Np)|0,Bl=Bl+Math.imul(zl,Rp)|0;var Am=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(Am>>>26)|0,Am&=67108863,yl=Math.imul(up,_p),Il=Math.imul(up,Sp),Il=Il+Math.imul(wp,_p)|0,Bl=Math.imul(wp,Sp),yl=yl+Math.imul(yu,Op)|0,Il=Il+Math.imul(yu,Zp)|0,Il=Il+Math.imul(rp,Op)|0,Bl=Bl+Math.imul(rp,Zp)|0,yl=yl+Math.imul(Zl,Xp)|0,Il=Il+Math.imul(Zl,h0)|0,Il=Il+Math.imul(Xl,Xp)|0,Bl=Bl+Math.imul(Xl,h0)|0,yl=yl+Math.imul(Hl,Np)|0,Il=Il+Math.imul(Hl,Rp)|0,Il=Il+Math.imul(Yl,Np)|0,Bl=Bl+Math.imul(Yl,Rp)|0,yl=yl+Math.imul(Nl,Hp)|0,Il=Il+Math.imul(Nl,kp)|0,Il=Il+Math.imul(zl,Hp)|0,Bl=Bl+Math.imul(zl,kp)|0;var pm=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(pm>>>26)|0,pm&=67108863,yl=Math.imul(pp,_p),Il=Math.imul(pp,Sp),Il=Il+Math.imul(cp,_p)|0,Bl=Math.imul(cp,Sp),yl=yl+Math.imul(up,Op)|0,Il=Il+Math.imul(up,Zp)|0,Il=Il+Math.imul(wp,Op)|0,Bl=Bl+Math.imul(wp,Zp)|0,yl=yl+Math.imul(yu,Xp)|0,Il=Il+Math.imul(yu,h0)|0,Il=Il+Math.imul(rp,Xp)|0,Bl=Bl+Math.imul(rp,h0)|0,yl=yl+Math.imul(Zl,Np)|0,Il=Il+Math.imul(Zl,Rp)|0,Il=Il+Math.imul(Xl,Np)|0,Bl=Bl+Math.imul(Xl,Rp)|0,yl=yl+Math.imul(Hl,Hp)|0,Il=Il+Math.imul(Hl,kp)|0,Il=Il+Math.imul(Yl,Hp)|0,Bl=Bl+Math.imul(Yl,kp)|0,yl=yl+Math.imul(Nl,Yp)|0,Il=Il+Math.imul(Nl,Mp)|0,Il=Il+Math.imul(zl,Yp)|0,Bl=Bl+Math.imul(zl,Mp)|0;var Ym=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(Ym>>>26)|0,Ym&=67108863,yl=Math.imul(mp,_p),Il=Math.imul(mp,Sp),Il=Il+Math.imul(fp,_p)|0,Bl=Math.imul(fp,Sp),yl=yl+Math.imul(pp,Op)|0,Il=Il+Math.imul(pp,Zp)|0,Il=Il+Math.imul(cp,Op)|0,Bl=Bl+Math.imul(cp,Zp)|0,yl=yl+Math.imul(up,Xp)|0,Il=Il+Math.imul(up,h0)|0,Il=Il+Math.imul(wp,Xp)|0,Bl=Bl+Math.imul(wp,h0)|0,yl=yl+Math.imul(yu,Np)|0,Il=Il+Math.imul(yu,Rp)|0,Il=Il+Math.imul(rp,Np)|0,Bl=Bl+Math.imul(rp,Rp)|0,yl=yl+Math.imul(Zl,Hp)|0,Il=Il+Math.imul(Zl,kp)|0,Il=Il+Math.imul(Xl,Hp)|0,Bl=Bl+Math.imul(Xl,kp)|0,yl=yl+Math.imul(Hl,Yp)|0,Il=Il+Math.imul(Hl,Mp)|0,Il=Il+Math.imul(Yl,Yp)|0,Bl=Bl+Math.imul(Yl,Mp)|0,yl=yl+Math.imul(Nl,Dp)|0,Il=Il+Math.imul(Nl,Lp)|0,Il=Il+Math.imul(zl,Dp)|0,Bl=Bl+Math.imul(zl,Lp)|0;var u1=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(u1>>>26)|0,u1&=67108863,yl=Math.imul(xp,_p),Il=Math.imul(xp,Sp),Il=Il+Math.imul(Kl,_p)|0,Bl=Math.imul(Kl,Sp),yl=yl+Math.imul(mp,Op)|0,Il=Il+Math.imul(mp,Zp)|0,Il=Il+Math.imul(fp,Op)|0,Bl=Bl+Math.imul(fp,Zp)|0,yl=yl+Math.imul(pp,Xp)|0,Il=Il+Math.imul(pp,h0)|0,Il=Il+Math.imul(cp,Xp)|0,Bl=Bl+Math.imul(cp,h0)|0,yl=yl+Math.imul(up,Np)|0,Il=Il+Math.imul(up,Rp)|0,Il=Il+Math.imul(wp,Np)|0,Bl=Bl+Math.imul(wp,Rp)|0,yl=yl+Math.imul(yu,Hp)|0,Il=Il+Math.imul(yu,kp)|0,Il=Il+Math.imul(rp,Hp)|0,Bl=Bl+Math.imul(rp,kp)|0,yl=yl+Math.imul(Zl,Yp)|0,Il=Il+Math.imul(Zl,Mp)|0,Il=Il+Math.imul(Xl,Yp)|0,Bl=Bl+Math.imul(Xl,Mp)|0,yl=yl+Math.imul(Hl,Dp)|0,Il=Il+Math.imul(Hl,Lp)|0,Il=Il+Math.imul(Yl,Dp)|0,Bl=Bl+Math.imul(Yl,Lp)|0,yl=yl+Math.imul(Nl,Bp)|0,Il=Il+Math.imul(Nl,qp)|0,Il=Il+Math.imul(zl,Bp)|0,Bl=Bl+Math.imul(zl,qp)|0;var qm=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(qm>>>26)|0,qm&=67108863,yl=Math.imul(Ul,_p),Il=Math.imul(Ul,Sp),Il=Il+Math.imul(Jl,_p)|0,Bl=Math.imul(Jl,Sp),yl=yl+Math.imul(xp,Op)|0,Il=Il+Math.imul(xp,Zp)|0,Il=Il+Math.imul(Kl,Op)|0,Bl=Bl+Math.imul(Kl,Zp)|0,yl=yl+Math.imul(mp,Xp)|0,Il=Il+Math.imul(mp,h0)|0,Il=Il+Math.imul(fp,Xp)|0,Bl=Bl+Math.imul(fp,h0)|0,yl=yl+Math.imul(pp,Np)|0,Il=Il+Math.imul(pp,Rp)|0,Il=Il+Math.imul(cp,Np)|0,Bl=Bl+Math.imul(cp,Rp)|0,yl=yl+Math.imul(up,Hp)|0,Il=Il+Math.imul(up,kp)|0,Il=Il+Math.imul(wp,Hp)|0,Bl=Bl+Math.imul(wp,kp)|0,yl=yl+Math.imul(yu,Yp)|0,Il=Il+Math.imul(yu,Mp)|0,Il=Il+Math.imul(rp,Yp)|0,Bl=Bl+Math.imul(rp,Mp)|0,yl=yl+Math.imul(Zl,Dp)|0,Il=Il+Math.imul(Zl,Lp)|0,Il=Il+Math.imul(Xl,Dp)|0,Bl=Bl+Math.imul(Xl,Lp)|0,yl=yl+Math.imul(Hl,Bp)|0,Il=Il+Math.imul(Hl,qp)|0,Il=Il+Math.imul(Yl,Bp)|0,Bl=Bl+Math.imul(Yl,qp)|0,yl=yl+Math.imul(Nl,tm)|0,Il=Il+Math.imul(Nl,g0)|0,Il=Il+Math.imul(zl,tm)|0,Bl=Bl+Math.imul(zl,g0)|0;var Qm=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(Qm>>>26)|0,Qm&=67108863,yl=Math.imul(_d,_p),Il=Math.imul(_d,Sp),Il=Il+Math.imul(tp,_p)|0,Bl=Math.imul(tp,Sp),yl=yl+Math.imul(Ul,Op)|0,Il=Il+Math.imul(Ul,Zp)|0,Il=Il+Math.imul(Jl,Op)|0,Bl=Bl+Math.imul(Jl,Zp)|0,yl=yl+Math.imul(xp,Xp)|0,Il=Il+Math.imul(xp,h0)|0,Il=Il+Math.imul(Kl,Xp)|0,Bl=Bl+Math.imul(Kl,h0)|0,yl=yl+Math.imul(mp,Np)|0,Il=Il+Math.imul(mp,Rp)|0,Il=Il+Math.imul(fp,Np)|0,Bl=Bl+Math.imul(fp,Rp)|0,yl=yl+Math.imul(pp,Hp)|0,Il=Il+Math.imul(pp,kp)|0,Il=Il+Math.imul(cp,Hp)|0,Bl=Bl+Math.imul(cp,kp)|0,yl=yl+Math.imul(up,Yp)|0,Il=Il+Math.imul(up,Mp)|0,Il=Il+Math.imul(wp,Yp)|0,Bl=Bl+Math.imul(wp,Mp)|0,yl=yl+Math.imul(yu,Dp)|0,Il=Il+Math.imul(yu,Lp)|0,Il=Il+Math.imul(rp,Dp)|0,Bl=Bl+Math.imul(rp,Lp)|0,yl=yl+Math.imul(Zl,Bp)|0,Il=Il+Math.imul(Zl,qp)|0,Il=Il+Math.imul(Xl,Bp)|0,Bl=Bl+Math.imul(Xl,qp)|0,yl=yl+Math.imul(Hl,tm)|0,Il=Il+Math.imul(Hl,g0)|0,Il=Il+Math.imul(Yl,tm)|0,Bl=Bl+Math.imul(Yl,g0)|0,yl=yl+Math.imul(Nl,Jp)|0,Il=Il+Math.imul(Nl,lm)|0,Il=Il+Math.imul(zl,Jp)|0,Bl=Bl+Math.imul(zl,lm)|0;var o1=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(o1>>>26)|0,o1&=67108863,yl=Math.imul(_d,Op),Il=Math.imul(_d,Zp),Il=Il+Math.imul(tp,Op)|0,Bl=Math.imul(tp,Zp),yl=yl+Math.imul(Ul,Xp)|0,Il=Il+Math.imul(Ul,h0)|0,Il=Il+Math.imul(Jl,Xp)|0,Bl=Bl+Math.imul(Jl,h0)|0,yl=yl+Math.imul(xp,Np)|0,Il=Il+Math.imul(xp,Rp)|0,Il=Il+Math.imul(Kl,Np)|0,Bl=Bl+Math.imul(Kl,Rp)|0,yl=yl+Math.imul(mp,Hp)|0,Il=Il+Math.imul(mp,kp)|0,Il=Il+Math.imul(fp,Hp)|0,Bl=Bl+Math.imul(fp,kp)|0,yl=yl+Math.imul(pp,Yp)|0,Il=Il+Math.imul(pp,Mp)|0,Il=Il+Math.imul(cp,Yp)|0,Bl=Bl+Math.imul(cp,Mp)|0,yl=yl+Math.imul(up,Dp)|0,Il=Il+Math.imul(up,Lp)|0,Il=Il+Math.imul(wp,Dp)|0,Bl=Bl+Math.imul(wp,Lp)|0,yl=yl+Math.imul(yu,Bp)|0,Il=Il+Math.imul(yu,qp)|0,Il=Il+Math.imul(rp,Bp)|0,Bl=Bl+Math.imul(rp,qp)|0,yl=yl+Math.imul(Zl,tm)|0,Il=Il+Math.imul(Zl,g0)|0,Il=Il+Math.imul(Xl,tm)|0,Bl=Bl+Math.imul(Xl,g0)|0,yl=yl+Math.imul(Hl,Jp)|0,Il=Il+Math.imul(Hl,lm)|0,Il=Il+Math.imul(Yl,Jp)|0,Bl=Bl+Math.imul(Yl,lm)|0;var e1=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(e1>>>26)|0,e1&=67108863,yl=Math.imul(_d,Xp),Il=Math.imul(_d,h0),Il=Il+Math.imul(tp,Xp)|0,Bl=Math.imul(tp,h0),yl=yl+Math.imul(Ul,Np)|0,Il=Il+Math.imul(Ul,Rp)|0,Il=Il+Math.imul(Jl,Np)|0,Bl=Bl+Math.imul(Jl,Rp)|0,yl=yl+Math.imul(xp,Hp)|0,Il=Il+Math.imul(xp,kp)|0,Il=Il+Math.imul(Kl,Hp)|0,Bl=Bl+Math.imul(Kl,kp)|0,yl=yl+Math.imul(mp,Yp)|0,Il=Il+Math.imul(mp,Mp)|0,Il=Il+Math.imul(fp,Yp)|0,Bl=Bl+Math.imul(fp,Mp)|0,yl=yl+Math.imul(pp,Dp)|0,Il=Il+Math.imul(pp,Lp)|0,Il=Il+Math.imul(cp,Dp)|0,Bl=Bl+Math.imul(cp,Lp)|0,yl=yl+Math.imul(up,Bp)|0,Il=Il+Math.imul(up,qp)|0,Il=Il+Math.imul(wp,Bp)|0,Bl=Bl+Math.imul(wp,qp)|0,yl=yl+Math.imul(yu,tm)|0,Il=Il+Math.imul(yu,g0)|0,Il=Il+Math.imul(rp,tm)|0,Bl=Bl+Math.imul(rp,g0)|0,yl=yl+Math.imul(Zl,Jp)|0,Il=Il+Math.imul(Zl,lm)|0,Il=Il+Math.imul(Xl,Jp)|0,Bl=Bl+Math.imul(Xl,lm)|0;var Zm=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(Zm>>>26)|0,Zm&=67108863,yl=Math.imul(_d,Np),Il=Math.imul(_d,Rp),Il=Il+Math.imul(tp,Np)|0,Bl=Math.imul(tp,Rp),yl=yl+Math.imul(Ul,Hp)|0,Il=Il+Math.imul(Ul,kp)|0,Il=Il+Math.imul(Jl,Hp)|0,Bl=Bl+Math.imul(Jl,kp)|0,yl=yl+Math.imul(xp,Yp)|0,Il=Il+Math.imul(xp,Mp)|0,Il=Il+Math.imul(Kl,Yp)|0,Bl=Bl+Math.imul(Kl,Mp)|0,yl=yl+Math.imul(mp,Dp)|0,Il=Il+Math.imul(mp,Lp)|0,Il=Il+Math.imul(fp,Dp)|0,Bl=Bl+Math.imul(fp,Lp)|0,yl=yl+Math.imul(pp,Bp)|0,Il=Il+Math.imul(pp,qp)|0,Il=Il+Math.imul(cp,Bp)|0,Bl=Bl+Math.imul(cp,qp)|0,yl=yl+Math.imul(up,tm)|0,Il=Il+Math.imul(up,g0)|0,Il=Il+Math.imul(wp,tm)|0,Bl=Bl+Math.imul(wp,g0)|0,yl=yl+Math.imul(yu,Jp)|0,Il=Il+Math.imul(yu,lm)|0,Il=Il+Math.imul(rp,Jp)|0,Bl=Bl+Math.imul(rp,lm)|0;var t1=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(t1>>>26)|0,t1&=67108863,yl=Math.imul(_d,Hp),Il=Math.imul(_d,kp),Il=Il+Math.imul(tp,Hp)|0,Bl=Math.imul(tp,kp),yl=yl+Math.imul(Ul,Yp)|0,Il=Il+Math.imul(Ul,Mp)|0,Il=Il+Math.imul(Jl,Yp)|0,Bl=Bl+Math.imul(Jl,Mp)|0,yl=yl+Math.imul(xp,Dp)|0,Il=Il+Math.imul(xp,Lp)|0,Il=Il+Math.imul(Kl,Dp)|0,Bl=Bl+Math.imul(Kl,Lp)|0,yl=yl+Math.imul(mp,Bp)|0,Il=Il+Math.imul(mp,qp)|0,Il=Il+Math.imul(fp,Bp)|0,Bl=Bl+Math.imul(fp,qp)|0,yl=yl+Math.imul(pp,tm)|0,Il=Il+Math.imul(pp,g0)|0,Il=Il+Math.imul(cp,tm)|0,Bl=Bl+Math.imul(cp,g0)|0,yl=yl+Math.imul(up,Jp)|0,Il=Il+Math.imul(up,lm)|0,Il=Il+Math.imul(wp,Jp)|0,Bl=Bl+Math.imul(wp,lm)|0;var Bm=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(Bm>>>26)|0,Bm&=67108863,yl=Math.imul(_d,Yp),Il=Math.imul(_d,Mp),Il=Il+Math.imul(tp,Yp)|0,Bl=Math.imul(tp,Mp),yl=yl+Math.imul(Ul,Dp)|0,Il=Il+Math.imul(Ul,Lp)|0,Il=Il+Math.imul(Jl,Dp)|0,Bl=Bl+Math.imul(Jl,Lp)|0,yl=yl+Math.imul(xp,Bp)|0,Il=Il+Math.imul(xp,qp)|0,Il=Il+Math.imul(Kl,Bp)|0,Bl=Bl+Math.imul(Kl,qp)|0,yl=yl+Math.imul(mp,tm)|0,Il=Il+Math.imul(mp,g0)|0,Il=Il+Math.imul(fp,tm)|0,Bl=Bl+Math.imul(fp,g0)|0,yl=yl+Math.imul(pp,Jp)|0,Il=Il+Math.imul(pp,lm)|0,Il=Il+Math.imul(cp,Jp)|0,Bl=Bl+Math.imul(cp,lm)|0;var Dm=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(Dm>>>26)|0,Dm&=67108863,yl=Math.imul(_d,Dp),Il=Math.imul(_d,Lp),Il=Il+Math.imul(tp,Dp)|0,Bl=Math.imul(tp,Lp),yl=yl+Math.imul(Ul,Bp)|0,Il=Il+Math.imul(Ul,qp)|0,Il=Il+Math.imul(Jl,Bp)|0,Bl=Bl+Math.imul(Jl,qp)|0,yl=yl+Math.imul(xp,tm)|0,Il=Il+Math.imul(xp,g0)|0,Il=Il+Math.imul(Kl,tm)|0,Bl=Bl+Math.imul(Kl,g0)|0,yl=yl+Math.imul(mp,Jp)|0,Il=Il+Math.imul(mp,lm)|0,Il=Il+Math.imul(fp,Jp)|0,Bl=Bl+Math.imul(fp,lm)|0;var Om=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(Om>>>26)|0,Om&=67108863,yl=Math.imul(_d,Bp),Il=Math.imul(_d,qp),Il=Il+Math.imul(tp,Bp)|0,Bl=Math.imul(tp,qp),yl=yl+Math.imul(Ul,tm)|0,Il=Il+Math.imul(Ul,g0)|0,Il=Il+Math.imul(Jl,tm)|0,Bl=Bl+Math.imul(Jl,g0)|0,yl=yl+Math.imul(xp,Jp)|0,Il=Il+Math.imul(xp,lm)|0,Il=Il+Math.imul(Kl,Jp)|0,Bl=Bl+Math.imul(Kl,lm)|0;var r1=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(r1>>>26)|0,r1&=67108863,yl=Math.imul(_d,tm),Il=Math.imul(_d,g0),Il=Il+Math.imul(tp,tm)|0,Bl=Math.imul(tp,g0),yl=yl+Math.imul(Ul,Jp)|0,Il=Il+Math.imul(Ul,lm)|0,Il=Il+Math.imul(Jl,Jp)|0,Bl=Bl+Math.imul(Jl,lm)|0;var g1=(wl+yl|0)+((Il&8191)<<13)|0;wl=(Bl+(Il>>>13)|0)+(g1>>>26)|0,g1&=67108863,yl=Math.imul(_d,Jp),Il=Math.imul(_d,lm),Il=Il+Math.imul(tp,Jp)|0,Bl=Math.imul(tp,lm);var b1=(wl+yl|0)+((Il&8191)<<13)|0;return wl=(Bl+(Il>>>13)|0)+(b1>>>26)|0,b1&=67108863,Al[0]=$m,Al[1]=km,Al[2]=Cm,Al[3]=Am,Al[4]=pm,Al[5]=Ym,Al[6]=u1,Al[7]=qm,Al[8]=Qm,Al[9]=o1,Al[10]=e1,Al[11]=Zm,Al[12]=t1,Al[13]=Bm,Al[14]=Dm,Al[15]=Om,Al[16]=r1,Al[17]=g1,Al[18]=b1,wl!==0&&(Al[19]=wl,Qo.length++),Qo};Math.imul||(Wo=Yo);function Jo(Vo,jo,Ho){Ho.negative=jo.negative^Vo.negative,Ho.length=Vo.length+jo.length;for(var Qo=0,El=0,Xo=0;Xo<Ho.length-1;Xo++){var Al=El;El=0;for(var wl=Qo&67108863,yl=Math.min(Xo,jo.length-1),Il=Math.max(0,Xo-Vo.length+1);Il<=yl;Il++){var Bl=Xo-Il,Gl=Vo.words[Bl]|0,Nl=jo.words[Il]|0,zl=Gl*Nl,Vl=zl&67108863;Al=Al+(zl/67108864|0)|0,Vl=Vl+wl|0,wl=Vl&67108863,Al=Al+(Vl>>>26)|0,El+=Al>>>26,Al&=67108863}Ho.words[Xo]=wl,Qo=Al,Al=El}return Qo!==0?Ho.words[Xo]=Qo:Ho.length--,Ho._strip()}function xl(Vo,jo,Ho){return Jo(Vo,jo,Ho)}as.prototype.mulTo=function(jo,Ho){var Qo,El=this.length+jo.length;return this.length===10&&jo.length===10?Qo=Wo(this,jo,Ho):El<63?Qo=Yo(this,jo,Ho):El<1024?Qo=Jo(this,jo,Ho):Qo=xl(this,jo,Ho),Qo},as.prototype.mul=function(jo){var Ho=new as(null);return Ho.words=new Array(this.length+jo.length),this.mulTo(jo,Ho)},as.prototype.mulf=function(jo){var Ho=new as(null);return Ho.words=new Array(this.length+jo.length),xl(this,jo,Ho)},as.prototype.imul=function(jo){return this.clone().mulTo(jo,this)},as.prototype.imuln=function(jo){var Ho=jo<0;Ho&&(jo=-jo),is(typeof jo=="number"),is(jo<67108864);for(var Qo=0,El=0;El<this.length;El++){var Xo=(this.words[El]|0)*jo,Al=(Xo&67108863)+(Qo&67108863);Qo>>=26,Qo+=Xo/67108864|0,Qo+=Al>>>26,this.words[El]=Al&67108863}return Qo!==0&&(this.words[El]=Qo,this.length++),Ho?this.ineg():this},as.prototype.muln=function(jo){return this.clone().imuln(jo)},as.prototype.sqr=function(){return this.mul(this)},as.prototype.isqr=function(){return this.imul(this.clone())},as.prototype.pow=function(jo){var Ho=Go(jo);if(Ho.length===0)return new as(1);for(var Qo=this,El=0;El<Ho.length&&Ho[El]===0;El++,Qo=Qo.sqr());if(++El<Ho.length)for(var Xo=Qo.sqr();El<Ho.length;El++,Xo=Xo.sqr())Ho[El]!==0&&(Qo=Qo.mul(Xo));return Qo},as.prototype.iushln=function(jo){is(typeof jo=="number"&&jo>=0);var Ho=jo%26,Qo=(jo-Ho)/26,El=67108863>>>26-Ho<<26-Ho,Xo;if(Ho!==0){var Al=0;for(Xo=0;Xo<this.length;Xo++){var wl=this.words[Xo]&El,yl=(this.words[Xo]|0)-wl<<Ho;this.words[Xo]=yl|Al,Al=wl>>>26-Ho}Al&&(this.words[Xo]=Al,this.length++)}if(Qo!==0){for(Xo=this.length-1;Xo>=0;Xo--)this.words[Xo+Qo]=this.words[Xo];for(Xo=0;Xo<Qo;Xo++)this.words[Xo]=0;this.length+=Qo}return this._strip()},as.prototype.ishln=function(jo){return is(this.negative===0),this.iushln(jo)},as.prototype.iushrn=function(jo,Ho,Qo){is(typeof jo=="number"&&jo>=0);var El;Ho?El=(Ho-Ho%26)/26:El=0;var Xo=jo%26,Al=Math.min((jo-Xo)/26,this.length),wl=67108863^67108863>>>Xo<<Xo,yl=Qo;if(El-=Al,El=Math.max(0,El),yl){for(var Il=0;Il<Al;Il++)yl.words[Il]=this.words[Il];yl.length=Al}if(Al!==0)if(this.length>Al)for(this.length-=Al,Il=0;Il<this.length;Il++)this.words[Il]=this.words[Il+Al];else this.words[0]=0,this.length=1;var Bl=0;for(Il=this.length-1;Il>=0&&(Bl!==0||Il>=El);Il--){var Gl=this.words[Il]|0;this.words[Il]=Bl<<26-Xo|Gl>>>Xo,Bl=Gl&wl}return yl&&Bl!==0&&(yl.words[yl.length++]=Bl),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},as.prototype.ishrn=function(jo,Ho,Qo){return is(this.negative===0),this.iushrn(jo,Ho,Qo)},as.prototype.shln=function(jo){return this.clone().ishln(jo)},as.prototype.ushln=function(jo){return this.clone().iushln(jo)},as.prototype.shrn=function(jo){return this.clone().ishrn(jo)},as.prototype.ushrn=function(jo){return this.clone().iushrn(jo)},as.prototype.testn=function(jo){is(typeof jo=="number"&&jo>=0);var Ho=jo%26,Qo=(jo-Ho)/26,El=1<<Ho;if(this.length<=Qo)return!1;var Xo=this.words[Qo];return!!(Xo&El)},as.prototype.imaskn=function(jo){is(typeof jo=="number"&&jo>=0);var Ho=jo%26,Qo=(jo-Ho)/26;if(is(this.negative===0,"imaskn works only with positive numbers"),this.length<=Qo)return this;if(Ho!==0&&Qo++,this.length=Math.min(Qo,this.length),Ho!==0){var El=67108863^67108863>>>Ho<<Ho;this.words[this.length-1]&=El}return this._strip()},as.prototype.maskn=function(jo){return this.clone().imaskn(jo)},as.prototype.iaddn=function(jo){return is(typeof jo=="number"),is(jo<67108864),jo<0?this.isubn(-jo):this.negative!==0?this.length===1&&(this.words[0]|0)<=jo?(this.words[0]=jo-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(jo),this.negative=1,this):this._iaddn(jo)},as.prototype._iaddn=function(jo){this.words[0]+=jo;for(var Ho=0;Ho<this.length&&this.words[Ho]>=67108864;Ho++)this.words[Ho]-=67108864,Ho===this.length-1?this.words[Ho+1]=1:this.words[Ho+1]++;return this.length=Math.max(this.length,Ho+1),this},as.prototype.isubn=function(jo){if(is(typeof jo=="number"),is(jo<67108864),jo<0)return this.iaddn(-jo);if(this.negative!==0)return this.negative=0,this.iaddn(jo),this.negative=1,this;if(this.words[0]-=jo,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Ho=0;Ho<this.length&&this.words[Ho]<0;Ho++)this.words[Ho]+=67108864,this.words[Ho+1]-=1;return this._strip()},as.prototype.addn=function(jo){return this.clone().iaddn(jo)},as.prototype.subn=function(jo){return this.clone().isubn(jo)},as.prototype.iabs=function(){return this.negative=0,this},as.prototype.abs=function(){return this.clone().iabs()},as.prototype._ishlnsubmul=function(jo,Ho,Qo){var El=jo.length+Qo,Xo;this._expand(El);var Al,wl=0;for(Xo=0;Xo<jo.length;Xo++){Al=(this.words[Xo+Qo]|0)+wl;var yl=(jo.words[Xo]|0)*Ho;Al-=yl&67108863,wl=(Al>>26)-(yl/67108864|0),this.words[Xo+Qo]=Al&67108863}for(;Xo<this.length-Qo;Xo++)Al=(this.words[Xo+Qo]|0)+wl,wl=Al>>26,this.words[Xo+Qo]=Al&67108863;if(wl===0)return this._strip();for(is(wl===-1),wl=0,Xo=0;Xo<this.length;Xo++)Al=-(this.words[Xo]|0)+wl,wl=Al>>26,this.words[Xo]=Al&67108863;return this.negative=1,this._strip()},as.prototype._wordDiv=function(jo,Ho){var Qo=this.length-jo.length,El=this.clone(),Xo=jo,Al=Xo.words[Xo.length-1]|0,wl=this._countBits(Al);Qo=26-wl,Qo!==0&&(Xo=Xo.ushln(Qo),El.iushln(Qo),Al=Xo.words[Xo.length-1]|0);var yl=El.length-Xo.length,Il;if(Ho!=="mod"){Il=new as(null),Il.length=yl+1,Il.words=new Array(Il.length);for(var Bl=0;Bl<Il.length;Bl++)Il.words[Bl]=0}var Gl=El.clone()._ishlnsubmul(Xo,1,yl);Gl.negative===0&&(El=Gl,Il&&(Il.words[yl]=1));for(var Nl=yl-1;Nl>=0;Nl--){var zl=(El.words[Xo.length+Nl]|0)*67108864+(El.words[Xo.length+Nl-1]|0);for(zl=Math.min(zl/Al|0,67108863),El._ishlnsubmul(Xo,zl,Nl);El.negative!==0;)zl--,El.negative=0,El._ishlnsubmul(Xo,1,Nl),El.isZero()||(El.negative^=1);Il&&(Il.words[Nl]=zl)}return Il&&Il._strip(),El._strip(),Ho!=="div"&&Qo!==0&&El.iushrn(Qo),{div:Il||null,mod:El}},as.prototype.divmod=function(jo,Ho,Qo){if(is(!jo.isZero()),this.isZero())return{div:new as(0),mod:new as(0)};var El,Xo,Al;return this.negative!==0&&jo.negative===0?(Al=this.neg().divmod(jo,Ho),Ho!=="mod"&&(El=Al.div.neg()),Ho!=="div"&&(Xo=Al.mod.neg(),Qo&&Xo.negative!==0&&Xo.iadd(jo)),{div:El,mod:Xo}):this.negative===0&&jo.negative!==0?(Al=this.divmod(jo.neg(),Ho),Ho!=="mod"&&(El=Al.div.neg()),{div:El,mod:Al.mod}):this.negative&jo.negative?(Al=this.neg().divmod(jo.neg(),Ho),Ho!=="div"&&(Xo=Al.mod.neg(),Qo&&Xo.negative!==0&&Xo.isub(jo)),{div:Al.div,mod:Xo}):jo.length>this.length||this.cmp(jo)<0?{div:new as(0),mod:this}:jo.length===1?Ho==="div"?{div:this.divn(jo.words[0]),mod:null}:Ho==="mod"?{div:null,mod:new as(this.modrn(jo.words[0]))}:{div:this.divn(jo.words[0]),mod:new as(this.modrn(jo.words[0]))}:this._wordDiv(jo,Ho)},as.prototype.div=function(jo){return this.divmod(jo,"div",!1).div},as.prototype.mod=function(jo){return this.divmod(jo,"mod",!1).mod},as.prototype.umod=function(jo){return this.divmod(jo,"mod",!0).mod},as.prototype.divRound=function(jo){var Ho=this.divmod(jo);if(Ho.mod.isZero())return Ho.div;var Qo=Ho.div.negative!==0?Ho.mod.isub(jo):Ho.mod,El=jo.ushrn(1),Xo=jo.andln(1),Al=Qo.cmp(El);return Al<0||Xo===1&&Al===0?Ho.div:Ho.div.negative!==0?Ho.div.isubn(1):Ho.div.iaddn(1)},as.prototype.modrn=function(jo){var Ho=jo<0;Ho&&(jo=-jo),is(jo<=67108863);for(var Qo=(1<<26)%jo,El=0,Xo=this.length-1;Xo>=0;Xo--)El=(Qo*El+(this.words[Xo]|0))%jo;return Ho?-El:El},as.prototype.modn=function(jo){return this.modrn(jo)},as.prototype.idivn=function(jo){var Ho=jo<0;Ho&&(jo=-jo),is(jo<=67108863);for(var Qo=0,El=this.length-1;El>=0;El--){var Xo=(this.words[El]|0)+Qo*67108864;this.words[El]=Xo/jo|0,Qo=Xo%jo}return this._strip(),Ho?this.ineg():this},as.prototype.divn=function(jo){return this.clone().idivn(jo)},as.prototype.egcd=function(jo){is(jo.negative===0),is(!jo.isZero());var Ho=this,Qo=jo.clone();Ho.negative!==0?Ho=Ho.umod(jo):Ho=Ho.clone();for(var El=new as(1),Xo=new as(0),Al=new as(0),wl=new as(1),yl=0;Ho.isEven()&&Qo.isEven();)Ho.iushrn(1),Qo.iushrn(1),++yl;for(var Il=Qo.clone(),Bl=Ho.clone();!Ho.isZero();){for(var Gl=0,Nl=1;!(Ho.words[0]&Nl)&&Gl<26;++Gl,Nl<<=1);if(Gl>0)for(Ho.iushrn(Gl);Gl-- >0;)(El.isOdd()||Xo.isOdd())&&(El.iadd(Il),Xo.isub(Bl)),El.iushrn(1),Xo.iushrn(1);for(var zl=0,Vl=1;!(Qo.words[0]&Vl)&&zl<26;++zl,Vl<<=1);if(zl>0)for(Qo.iushrn(zl);zl-- >0;)(Al.isOdd()||wl.isOdd())&&(Al.iadd(Il),wl.isub(Bl)),Al.iushrn(1),wl.iushrn(1);Ho.cmp(Qo)>=0?(Ho.isub(Qo),El.isub(Al),Xo.isub(wl)):(Qo.isub(Ho),Al.isub(El),wl.isub(Xo))}return{a:Al,b:wl,gcd:Qo.iushln(yl)}},as.prototype._invmp=function(jo){is(jo.negative===0),is(!jo.isZero());var Ho=this,Qo=jo.clone();Ho.negative!==0?Ho=Ho.umod(jo):Ho=Ho.clone();for(var El=new as(1),Xo=new as(0),Al=Qo.clone();Ho.cmpn(1)>0&&Qo.cmpn(1)>0;){for(var wl=0,yl=1;!(Ho.words[0]&yl)&&wl<26;++wl,yl<<=1);if(wl>0)for(Ho.iushrn(wl);wl-- >0;)El.isOdd()&&El.iadd(Al),El.iushrn(1);for(var Il=0,Bl=1;!(Qo.words[0]&Bl)&&Il<26;++Il,Bl<<=1);if(Il>0)for(Qo.iushrn(Il);Il-- >0;)Xo.isOdd()&&Xo.iadd(Al),Xo.iushrn(1);Ho.cmp(Qo)>=0?(Ho.isub(Qo),El.isub(Xo)):(Qo.isub(Ho),Xo.isub(El))}var Gl;return Ho.cmpn(1)===0?Gl=El:Gl=Xo,Gl.cmpn(0)<0&&Gl.iadd(jo),Gl},as.prototype.gcd=function(jo){if(this.isZero())return jo.abs();if(jo.isZero())return this.abs();var Ho=this.clone(),Qo=jo.clone();Ho.negative=0,Qo.negative=0;for(var El=0;Ho.isEven()&&Qo.isEven();El++)Ho.iushrn(1),Qo.iushrn(1);do{for(;Ho.isEven();)Ho.iushrn(1);for(;Qo.isEven();)Qo.iushrn(1);var Xo=Ho.cmp(Qo);if(Xo<0){var Al=Ho;Ho=Qo,Qo=Al}else if(Xo===0||Qo.cmpn(1)===0)break;Ho.isub(Qo)}while(!0);return Qo.iushln(El)},as.prototype.invm=function(jo){return this.egcd(jo).a.umod(jo)},as.prototype.isEven=function(){return(this.words[0]&1)===0},as.prototype.isOdd=function(){return(this.words[0]&1)===1},as.prototype.andln=function(jo){return this.words[0]&jo},as.prototype.bincn=function(jo){is(typeof jo=="number");var Ho=jo%26,Qo=(jo-Ho)/26,El=1<<Ho;if(this.length<=Qo)return this._expand(Qo+1),this.words[Qo]|=El,this;for(var Xo=El,Al=Qo;Xo!==0&&Al<this.length;Al++){var wl=this.words[Al]|0;wl+=Xo,Xo=wl>>>26,wl&=67108863,this.words[Al]=wl}return Xo!==0&&(this.words[Al]=Xo,this.length++),this},as.prototype.isZero=function(){return this.length===1&&this.words[0]===0},as.prototype.cmpn=function(jo){var Ho=jo<0;if(this.negative!==0&&!Ho)return-1;if(this.negative===0&&Ho)return 1;this._strip();var Qo;if(this.length>1)Qo=1;else{Ho&&(jo=-jo),is(jo<=67108863,"Number is too big");var El=this.words[0]|0;Qo=El===jo?0:El<jo?-1:1}return this.negative!==0?-Qo|0:Qo},as.prototype.cmp=function(jo){if(this.negative!==0&&jo.negative===0)return-1;if(this.negative===0&&jo.negative!==0)return 1;var Ho=this.ucmp(jo);return this.negative!==0?-Ho|0:Ho},as.prototype.ucmp=function(jo){if(this.length>jo.length)return 1;if(this.length<jo.length)return-1;for(var Ho=0,Qo=this.length-1;Qo>=0;Qo--){var El=this.words[Qo]|0,Xo=jo.words[Qo]|0;if(El!==Xo){El<Xo?Ho=-1:El>Xo&&(Ho=1);break}}return Ho},as.prototype.gtn=function(jo){return this.cmpn(jo)===1},as.prototype.gt=function(jo){return this.cmp(jo)===1},as.prototype.gten=function(jo){return this.cmpn(jo)>=0},as.prototype.gte=function(jo){return this.cmp(jo)>=0},as.prototype.ltn=function(jo){return this.cmpn(jo)===-1},as.prototype.lt=function(jo){return this.cmp(jo)===-1},as.prototype.lten=function(jo){return this.cmpn(jo)<=0},as.prototype.lte=function(jo){return this.cmp(jo)<=0},as.prototype.eqn=function(jo){return this.cmpn(jo)===0},as.prototype.eq=function(jo){return this.cmp(jo)===0},as.red=function(jo){return new Ol(jo)},as.prototype.toRed=function(jo){return is(!this.red,"Already a number in reduction context"),is(this.negative===0,"red works only with positives"),jo.convertTo(this)._forceRed(jo)},as.prototype.fromRed=function(){return is(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},as.prototype._forceRed=function(jo){return this.red=jo,this},as.prototype.forceRed=function(jo){return is(!this.red,"Already a number in reduction context"),this._forceRed(jo)},as.prototype.redAdd=function(jo){return is(this.red,"redAdd works only with red numbers"),this.red.add(this,jo)},as.prototype.redIAdd=function(jo){return is(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,jo)},as.prototype.redSub=function(jo){return is(this.red,"redSub works only with red numbers"),this.red.sub(this,jo)},as.prototype.redISub=function(jo){return is(this.red,"redISub works only with red numbers"),this.red.isub(this,jo)},as.prototype.redShl=function(jo){return is(this.red,"redShl works only with red numbers"),this.red.shl(this,jo)},as.prototype.redMul=function(jo){return is(this.red,"redMul works only with red numbers"),this.red._verify2(this,jo),this.red.mul(this,jo)},as.prototype.redIMul=function(jo){return is(this.red,"redMul works only with red numbers"),this.red._verify2(this,jo),this.red.imul(this,jo)},as.prototype.redSqr=function(){return is(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},as.prototype.redISqr=function(){return is(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},as.prototype.redSqrt=function(){return is(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},as.prototype.redInvm=function(){return is(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},as.prototype.redNeg=function(){return is(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},as.prototype.redPow=function(jo){return is(this.red&&!jo.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,jo)};var _l={k256:null,p224:null,p192:null,p25519:null};function Tl(Vo,jo){this.name=Vo,this.p=new as(jo,16),this.n=this.p.bitLength(),this.k=new as(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Tl.prototype._tmp=function(){var jo=new as(null);return jo.words=new Array(Math.ceil(this.n/13)),jo},Tl.prototype.ireduce=function(jo){var Ho=jo,Qo;do this.split(Ho,this.tmp),Ho=this.imulK(Ho),Ho=Ho.iadd(this.tmp),Qo=Ho.bitLength();while(Qo>this.n);var El=Qo<this.n?-1:Ho.ucmp(this.p);return El===0?(Ho.words[0]=0,Ho.length=1):El>0?Ho.isub(this.p):Ho.strip!==void 0?Ho.strip():Ho._strip(),Ho},Tl.prototype.split=function(jo,Ho){jo.iushrn(this.n,0,Ho)},Tl.prototype.imulK=function(jo){return jo.imul(this.k)};function Sl(){Tl.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}os(Sl,Tl),Sl.prototype.split=function(jo,Ho){for(var Qo=4194303,El=Math.min(jo.length,9),Xo=0;Xo<El;Xo++)Ho.words[Xo]=jo.words[Xo];if(Ho.length=El,jo.length<=9){jo.words[0]=0,jo.length=1;return}var Al=jo.words[9];for(Ho.words[Ho.length++]=Al&Qo,Xo=10;Xo<jo.length;Xo++){var wl=jo.words[Xo]|0;jo.words[Xo-10]=(wl&Qo)<<4|Al>>>22,Al=wl}Al>>>=22,jo.words[Xo-10]=Al,Al===0&&jo.length>10?jo.length-=10:jo.length-=9},Sl.prototype.imulK=function(jo){jo.words[jo.length]=0,jo.words[jo.length+1]=0,jo.length+=2;for(var Ho=0,Qo=0;Qo<jo.length;Qo++){var El=jo.words[Qo]|0;Ho+=El*977,jo.words[Qo]=Ho&67108863,Ho=El*64+(Ho/67108864|0)}return jo.words[jo.length-1]===0&&(jo.length--,jo.words[jo.length-1]===0&&jo.length--),jo};function $l(){Tl.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}os($l,Tl);function Pl(){Tl.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}os(Pl,Tl);function Dl(){Tl.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}os(Dl,Tl),Dl.prototype.imulK=function(jo){for(var Ho=0,Qo=0;Qo<jo.length;Qo++){var El=(jo.words[Qo]|0)*19+Ho,Xo=El&67108863;El>>>=26,jo.words[Qo]=Xo,Ho=El}return Ho!==0&&(jo.words[jo.length++]=Ho),jo},as._prime=function(jo){if(_l[jo])return _l[jo];var Ho;if(jo==="k256")Ho=new Sl;else if(jo==="p224")Ho=new $l;else if(jo==="p192")Ho=new Pl;else if(jo==="p25519")Ho=new Dl;else throw new Error("Unknown prime "+jo);return _l[jo]=Ho,Ho};function Ol(Vo){if(typeof Vo=="string"){var jo=as._prime(Vo);this.m=jo.p,this.prime=jo}else is(Vo.gtn(1),"modulus must be greater than 1"),this.m=Vo,this.prime=null}Ol.prototype._verify1=function(jo){is(jo.negative===0,"red works only with positives"),is(jo.red,"red works only with red numbers")},Ol.prototype._verify2=function(jo,Ho){is((jo.negative|Ho.negative)===0,"red works only with positives"),is(jo.red&&jo.red===Ho.red,"red works only with red numbers")},Ol.prototype.imod=function(jo){return this.prime?this.prime.ireduce(jo)._forceRed(this):(io(jo,jo.umod(this.m)._forceRed(this)),jo)},Ol.prototype.neg=function(jo){return jo.isZero()?jo.clone():this.m.sub(jo)._forceRed(this)},Ol.prototype.add=function(jo,Ho){this._verify2(jo,Ho);var Qo=jo.add(Ho);return Qo.cmp(this.m)>=0&&Qo.isub(this.m),Qo._forceRed(this)},Ol.prototype.iadd=function(jo,Ho){this._verify2(jo,Ho);var Qo=jo.iadd(Ho);return Qo.cmp(this.m)>=0&&Qo.isub(this.m),Qo},Ol.prototype.sub=function(jo,Ho){this._verify2(jo,Ho);var Qo=jo.sub(Ho);return Qo.cmpn(0)<0&&Qo.iadd(this.m),Qo._forceRed(this)},Ol.prototype.isub=function(jo,Ho){this._verify2(jo,Ho);var Qo=jo.isub(Ho);return Qo.cmpn(0)<0&&Qo.iadd(this.m),Qo},Ol.prototype.shl=function(jo,Ho){return this._verify1(jo),this.imod(jo.ushln(Ho))},Ol.prototype.imul=function(jo,Ho){return this._verify2(jo,Ho),this.imod(jo.imul(Ho))},Ol.prototype.mul=function(jo,Ho){return this._verify2(jo,Ho),this.imod(jo.mul(Ho))},Ol.prototype.isqr=function(jo){return this.imul(jo,jo.clone())},Ol.prototype.sqr=function(jo){return this.mul(jo,jo)},Ol.prototype.sqrt=function(jo){if(jo.isZero())return jo.clone();var Ho=this.m.andln(3);if(is(Ho%2===1),Ho===3){var Qo=this.m.add(new as(1)).iushrn(2);return this.pow(jo,Qo)}for(var El=this.m.subn(1),Xo=0;!El.isZero()&&El.andln(1)===0;)Xo++,El.iushrn(1);is(!El.isZero());var Al=new as(1).toRed(this),wl=Al.redNeg(),yl=this.m.subn(1).iushrn(1),Il=this.m.bitLength();for(Il=new as(2*Il*Il).toRed(this);this.pow(Il,yl).cmp(wl)!==0;)Il.redIAdd(wl);for(var Bl=this.pow(Il,El),Gl=this.pow(jo,El.addn(1).iushrn(1)),Nl=this.pow(jo,El),zl=Xo;Nl.cmp(Al)!==0;){for(var Vl=Nl,Hl=0;Vl.cmp(Al)!==0;Hl++)Vl=Vl.redSqr();is(Hl<zl);var Yl=this.pow(Bl,new as(1).iushln(zl-Hl-1));Gl=Gl.redMul(Yl),Bl=Yl.redSqr(),Nl=Nl.redMul(Bl),zl=Hl}return Gl},Ol.prototype.invm=function(jo){var Ho=jo._invmp(this.m);return Ho.negative!==0?(Ho.negative=0,this.imod(Ho).redNeg()):this.imod(Ho)},Ol.prototype.pow=function(jo,Ho){if(Ho.isZero())return new as(1).toRed(this);if(Ho.cmpn(1)===0)return jo.clone();var Qo=4,El=new Array(1<<Qo);El[0]=new as(1).toRed(this),El[1]=jo;for(var Xo=2;Xo<El.length;Xo++)El[Xo]=this.mul(El[Xo-1],jo);var Al=El[0],wl=0,yl=0,Il=Ho.bitLength()%26;for(Il===0&&(Il=26),Xo=Ho.length-1;Xo>=0;Xo--){for(var Bl=Ho.words[Xo],Gl=Il-1;Gl>=0;Gl--){var Nl=Bl>>Gl&1;if(Al!==El[0]&&(Al=this.sqr(Al)),Nl===0&&wl===0){yl=0;continue}wl<<=1,wl|=Nl,yl++,!(yl!==Qo&&(Xo!==0||Gl!==0))&&(Al=this.mul(Al,El[wl]),yl=0,wl=0)}Il=26}return Al},Ol.prototype.convertTo=function(jo){var Ho=jo.umod(this.m);return Ho===jo?Ho.clone():Ho},Ol.prototype.convertFrom=function(jo){var Ho=jo.clone();return Ho.red=null,Ho},as.mont=function(jo){return new Rl(jo)};function Rl(Vo){Ol.call(this,Vo),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new as(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}os(Rl,Ol),Rl.prototype.convertTo=function(jo){return this.imod(jo.ushln(this.shift))},Rl.prototype.convertFrom=function(jo){var Ho=this.imod(jo.mul(this.rinv));return Ho.red=null,Ho},Rl.prototype.imul=function(jo,Ho){if(jo.isZero()||Ho.isZero())return jo.words[0]=0,jo.length=1,jo;var Qo=jo.imul(Ho),El=Qo.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Xo=Qo.isub(El).iushrn(this.shift),Al=Xo;return Xo.cmp(this.m)>=0?Al=Xo.isub(this.m):Xo.cmpn(0)<0&&(Al=Xo.iadd(this.m)),Al._forceRed(this)},Rl.prototype.mul=function(jo,Ho){if(jo.isZero()||Ho.isZero())return new as(0)._forceRed(this);var Qo=jo.mul(Ho),El=Qo.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Xo=Qo.isub(El).iushrn(this.shift),Al=Xo;return Xo.cmp(this.m)>=0?Al=Xo.isub(this.m):Xo.cmpn(0)<0&&(Al=Xo.iadd(this.m)),Al._forceRed(this)},Rl.prototype.invm=function(jo){var Ho=this.imod(jo._invmp(this.m).mul(this.r2));return Ho._forceRed(this)}})(Fn,commonjsGlobal)})(bn$2);var bnExports$1=bn$2.exports;const BN$9=getDefaultExportFromCjs(bnExports$1),version$m="logger/5.7.0";let _permanentCensorErrors=!1,_censorErrors=!1;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels.default,_globalLogger=null;function _checkNormalize(){try{const Fn=[];if(["NFD","NFC","NFKD","NFKC"].forEach(Mn=>{try{if("test".normalize(Mn)!=="test")throw new Error("bad normalize")}catch{Fn.push(Mn)}}),Fn.length)throw new Error("missing "+Fn.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(Fn){return Fn.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(Fn){Fn.DEBUG="DEBUG",Fn.INFO="INFO",Fn.WARNING="WARNING",Fn.ERROR="ERROR",Fn.OFF="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(Fn){Fn.UNKNOWN_ERROR="UNKNOWN_ERROR",Fn.NOT_IMPLEMENTED="NOT_IMPLEMENTED",Fn.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",Fn.NETWORK_ERROR="NETWORK_ERROR",Fn.SERVER_ERROR="SERVER_ERROR",Fn.TIMEOUT="TIMEOUT",Fn.BUFFER_OVERRUN="BUFFER_OVERRUN",Fn.NUMERIC_FAULT="NUMERIC_FAULT",Fn.MISSING_NEW="MISSING_NEW",Fn.INVALID_ARGUMENT="INVALID_ARGUMENT",Fn.MISSING_ARGUMENT="MISSING_ARGUMENT",Fn.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",Fn.CALL_EXCEPTION="CALL_EXCEPTION",Fn.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",Fn.NONCE_EXPIRED="NONCE_EXPIRED",Fn.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",Fn.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",Fn.TRANSACTION_REPLACED="TRANSACTION_REPLACED",Fn.ACTION_REJECTED="ACTION_REJECTED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";let Logger$1=class $1{constructor(Mn){Object.defineProperty(this,"version",{enumerable:!0,value:Mn,writable:!1})}_log(Mn,rs){const is=Mn.toLowerCase();LogLevels[is]==null&&this.throwArgumentError("invalid log level name","logLevel",Mn),!(_logLevel>LogLevels[is])&&console.log.apply(console,rs)}debug(...Mn){this._log($1.levels.DEBUG,Mn)}info(...Mn){this._log($1.levels.INFO,Mn)}warn(...Mn){this._log($1.levels.WARNING,Mn)}makeError(Mn,rs,is){if(_censorErrors)return this.makeError("censored error",rs,{});rs||(rs=$1.errors.UNKNOWN_ERROR),is||(is={});const os=[];Object.keys(is).forEach(hs=>{const ps=is[hs];try{if(ps instanceof Uint8Array){let io="";for(let fo=0;fo<ps.length;fo++)io+=HEX[ps[fo]>>4],io+=HEX[ps[fo]&15];os.push(hs+"=Uint8Array(0x"+io+")")}else os.push(hs+"="+JSON.stringify(ps))}catch{os.push(hs+"="+JSON.stringify(is[hs].toString()))}}),os.push(`code=${rs}`),os.push(`version=${this.version}`);const as=Mn;let us="";switch(rs){case ErrorCode.NUMERIC_FAULT:{us="NUMERIC_FAULT";const hs=Mn;switch(hs){case"overflow":case"underflow":case"division-by-zero":us+="-"+hs;break;case"negative-power":case"negative-width":us+="-unsupported";break;case"unbound-bitwise-result":us+="-unbound-result";break}break}case ErrorCode.CALL_EXCEPTION:case ErrorCode.INSUFFICIENT_FUNDS:case ErrorCode.MISSING_NEW:case ErrorCode.NONCE_EXPIRED:case ErrorCode.REPLACEMENT_UNDERPRICED:case ErrorCode.TRANSACTION_REPLACED:case ErrorCode.UNPREDICTABLE_GAS_LIMIT:us=rs;break}us&&(Mn+=" [ See: https://links.ethers.org/v5-errors-"+us+" ]"),os.length&&(Mn+=" ("+os.join(", ")+")");const ds=new Error(Mn);return ds.reason=as,ds.code=rs,Object.keys(is).forEach(function(hs){ds[hs]=is[hs]}),ds}throwError(Mn,rs,is){throw this.makeError(Mn,rs,is)}throwArgumentError(Mn,rs,is){return this.throwError(Mn,$1.errors.INVALID_ARGUMENT,{argument:rs,value:is})}assert(Mn,rs,is,os){Mn||this.throwError(rs,is,os)}assertArgument(Mn,rs,is,os){Mn||this.throwArgumentError(rs,is,os)}checkNormalize(Mn){_normalizeError&&this.throwError("platform missing String.prototype.normalize",$1.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}checkSafeUint53(Mn,rs){typeof Mn=="number"&&(rs==null&&(rs="value not safe"),(Mn<0||Mn>=9007199254740991)&&this.throwError(rs,$1.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:Mn}),Mn%1&&this.throwError(rs,$1.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:Mn}))}checkArgumentCount(Mn,rs,is){is?is=": "+is:is="",Mn<rs&&this.throwError("missing argument"+is,$1.errors.MISSING_ARGUMENT,{count:Mn,expectedCount:rs}),Mn>rs&&this.throwError("too many arguments"+is,$1.errors.UNEXPECTED_ARGUMENT,{count:Mn,expectedCount:rs})}checkNew(Mn,rs){(Mn===Object||Mn==null)&&this.throwError("missing new",$1.errors.MISSING_NEW,{name:rs.name})}checkAbstract(Mn,rs){Mn===rs?this.throwError("cannot instantiate abstract class "+JSON.stringify(rs.name)+" directly; use a sub-class",$1.errors.UNSUPPORTED_OPERATION,{name:Mn.name,operation:"new"}):(Mn===Object||Mn==null)&&this.throwError("missing new",$1.errors.MISSING_NEW,{name:rs.name})}static globalLogger(){return _globalLogger||(_globalLogger=new $1(version$m)),_globalLogger}static setCensorship(Mn,rs){if(!Mn&&rs&&this.globalLogger().throwError("cannot permanently disable censorship",$1.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_permanentCensorErrors){if(!Mn)return;this.globalLogger().throwError("error censorship permanent",$1.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!Mn,_permanentCensorErrors=!!rs}static setLogLevel(Mn){const rs=LogLevels[Mn.toLowerCase()];if(rs==null){$1.globalLogger().warn("invalid log level - "+Mn);return}_logLevel=rs}static from(Mn){return new $1(Mn)}};Logger$1.errors=ErrorCode;Logger$1.levels=LogLevel;const version$l="bytes/5.7.0",logger$q=new Logger$1(version$l);function isHexable(Fn){return!!Fn.toHexString}function addSlice(Fn){return Fn.slice||(Fn.slice=function(){const Mn=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(Fn,Mn)))}),Fn}function isBytesLike(Fn){return isHexString(Fn)&&!(Fn.length%2)||isBytes(Fn)}function isInteger(Fn){return typeof Fn=="number"&&Fn==Fn&&Fn%1===0}function isBytes(Fn){if(Fn==null)return!1;if(Fn.constructor===Uint8Array)return!0;if(typeof Fn=="string"||!isInteger(Fn.length)||Fn.length<0)return!1;for(let Mn=0;Mn<Fn.length;Mn++){const rs=Fn[Mn];if(!isInteger(rs)||rs<0||rs>=256)return!1}return!0}function arrayify(Fn,Mn){if(Mn||(Mn={}),typeof Fn=="number"){logger$q.checkSafeUint53(Fn,"invalid arrayify value");const rs=[];for(;Fn;)rs.unshift(Fn&255),Fn=parseInt(String(Fn/256));return rs.length===0&&rs.push(0),addSlice(new Uint8Array(rs))}if(Mn.allowMissingPrefix&&typeof Fn=="string"&&Fn.substring(0,2)!=="0x"&&(Fn="0x"+Fn),isHexable(Fn)&&(Fn=Fn.toHexString()),isHexString(Fn)){let rs=Fn.substring(2);rs.length%2&&(Mn.hexPad==="left"?rs="0"+rs:Mn.hexPad==="right"?rs+="0":logger$q.throwArgumentError("hex data is odd-length","value",Fn));const is=[];for(let os=0;os<rs.length;os+=2)is.push(parseInt(rs.substring(os,os+2),16));return addSlice(new Uint8Array(is))}return isBytes(Fn)?addSlice(new Uint8Array(Fn)):logger$q.throwArgumentError("invalid arrayify value","value",Fn)}function concat$2(Fn){const Mn=Fn.map(os=>arrayify(os)),rs=Mn.reduce((os,as)=>os+as.length,0),is=new Uint8Array(rs);return Mn.reduce((os,as)=>(is.set(as,os),os+as.length),0),addSlice(is)}function stripZeros(Fn){let Mn=arrayify(Fn);if(Mn.length===0)return Mn;let rs=0;for(;rs<Mn.length&&Mn[rs]===0;)rs++;return rs&&(Mn=Mn.slice(rs)),Mn}function zeroPad(Fn,Mn){Fn=arrayify(Fn),Fn.length>Mn&&logger$q.throwArgumentError("value out of range","value",arguments[0]);const rs=new Uint8Array(Mn);return rs.set(Fn,Mn-Fn.length),addSlice(rs)}function isHexString(Fn,Mn){return!(typeof Fn!="string"||!Fn.match(/^0x[0-9A-Fa-f]*$/)||Mn&&Fn.length!==2+2*Mn)}const HexCharacters="0123456789abcdef";function hexlify(Fn,Mn){if(Mn||(Mn={}),typeof Fn=="number"){logger$q.checkSafeUint53(Fn,"invalid hexlify value");let rs="";for(;Fn;)rs=HexCharacters[Fn&15]+rs,Fn=Math.floor(Fn/16);return rs.length?(rs.length%2&&(rs="0"+rs),"0x"+rs):"0x00"}if(typeof Fn=="bigint")return Fn=Fn.toString(16),Fn.length%2?"0x0"+Fn:"0x"+Fn;if(Mn.allowMissingPrefix&&typeof Fn=="string"&&Fn.substring(0,2)!=="0x"&&(Fn="0x"+Fn),isHexable(Fn))return Fn.toHexString();if(isHexString(Fn))return Fn.length%2&&(Mn.hexPad==="left"?Fn="0x0"+Fn.substring(2):Mn.hexPad==="right"?Fn+="0":logger$q.throwArgumentError("hex data is odd-length","value",Fn)),Fn.toLowerCase();if(isBytes(Fn)){let rs="0x";for(let is=0;is<Fn.length;is++){let os=Fn[is];rs+=HexCharacters[(os&240)>>4]+HexCharacters[os&15]}return rs}return logger$q.throwArgumentError("invalid hexlify value","value",Fn)}function hexDataLength(Fn){if(typeof Fn!="string")Fn=hexlify(Fn);else if(!isHexString(Fn)||Fn.length%2)return null;return(Fn.length-2)/2}function hexDataSlice(Fn,Mn,rs){return typeof Fn!="string"?Fn=hexlify(Fn):(!isHexString(Fn)||Fn.length%2)&&logger$q.throwArgumentError("invalid hexData","value",Fn),Mn=2+2*Mn,rs!=null?"0x"+Fn.substring(Mn,2+2*rs):"0x"+Fn.substring(Mn)}function hexConcat(Fn){let Mn="0x";return Fn.forEach(rs=>{Mn+=hexlify(rs).substring(2)}),Mn}function hexValue(Fn){const Mn=hexStripZeros(hexlify(Fn,{hexPad:"left"}));return Mn==="0x"?"0x0":Mn}function hexStripZeros(Fn){typeof Fn!="string"&&(Fn=hexlify(Fn)),isHexString(Fn)||logger$q.throwArgumentError("invalid hex string","value",Fn),Fn=Fn.substring(2);let Mn=0;for(;Mn<Fn.length&&Fn[Mn]==="0";)Mn++;return"0x"+Fn.substring(Mn)}function hexZeroPad(Fn,Mn){for(typeof Fn!="string"?Fn=hexlify(Fn):isHexString(Fn)||logger$q.throwArgumentError("invalid hex string","value",Fn),Fn.length>2*Mn+2&&logger$q.throwArgumentError("value out of range","value",arguments[1]);Fn.length<2*Mn+2;)Fn="0x0"+Fn.substring(2);return Fn}function splitSignature(Fn){const Mn={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(isBytesLike(Fn)){let rs=arrayify(Fn);rs.length===64?(Mn.v=27+(rs[32]>>7),rs[32]&=127,Mn.r=hexlify(rs.slice(0,32)),Mn.s=hexlify(rs.slice(32,64))):rs.length===65?(Mn.r=hexlify(rs.slice(0,32)),Mn.s=hexlify(rs.slice(32,64)),Mn.v=rs[64]):logger$q.throwArgumentError("invalid signature string","signature",Fn),Mn.v<27&&(Mn.v===0||Mn.v===1?Mn.v+=27:logger$q.throwArgumentError("signature invalid v byte","signature",Fn)),Mn.recoveryParam=1-Mn.v%2,Mn.recoveryParam&&(rs[32]|=128),Mn._vs=hexlify(rs.slice(32,64))}else{if(Mn.r=Fn.r,Mn.s=Fn.s,Mn.v=Fn.v,Mn.recoveryParam=Fn.recoveryParam,Mn._vs=Fn._vs,Mn._vs!=null){const os=zeroPad(arrayify(Mn._vs),32);Mn._vs=hexlify(os);const as=os[0]>=128?1:0;Mn.recoveryParam==null?Mn.recoveryParam=as:Mn.recoveryParam!==as&&logger$q.throwArgumentError("signature recoveryParam mismatch _vs","signature",Fn),os[0]&=127;const us=hexlify(os);Mn.s==null?Mn.s=us:Mn.s!==us&&logger$q.throwArgumentError("signature v mismatch _vs","signature",Fn)}if(Mn.recoveryParam==null)Mn.v==null?logger$q.throwArgumentError("signature missing v and recoveryParam","signature",Fn):Mn.v===0||Mn.v===1?Mn.recoveryParam=Mn.v:Mn.recoveryParam=1-Mn.v%2;else if(Mn.v==null)Mn.v=27+Mn.recoveryParam;else{const os=Mn.v===0||Mn.v===1?Mn.v:1-Mn.v%2;Mn.recoveryParam!==os&&logger$q.throwArgumentError("signature recoveryParam mismatch v","signature",Fn)}Mn.r==null||!isHexString(Mn.r)?logger$q.throwArgumentError("signature missing or invalid r","signature",Fn):Mn.r=hexZeroPad(Mn.r,32),Mn.s==null||!isHexString(Mn.s)?logger$q.throwArgumentError("signature missing or invalid s","signature",Fn):Mn.s=hexZeroPad(Mn.s,32);const rs=arrayify(Mn.s);rs[0]>=128&&logger$q.throwArgumentError("signature s out of range","signature",Fn),Mn.recoveryParam&&(rs[0]|=128);const is=hexlify(rs);Mn._vs&&(isHexString(Mn._vs)||logger$q.throwArgumentError("signature invalid _vs","signature",Fn),Mn._vs=hexZeroPad(Mn._vs,32)),Mn._vs==null?Mn._vs=is:Mn._vs!==is&&logger$q.throwArgumentError("signature _vs mismatch v and s","signature",Fn)}return Mn.yParityAndS=Mn._vs,Mn.compact=Mn.r+Mn.yParityAndS.substring(2),Mn}const version$k="bignumber/5.7.0";var BN$8=BN$9.BN;const logger$p=new Logger$1(version$k),_constructorGuard$3={},MAX_SAFE=9007199254740991;function isBigNumberish(Fn){return Fn!=null&&(BigNumber$1.isBigNumber(Fn)||typeof Fn=="number"&&Fn%1===0||typeof Fn=="string"&&!!Fn.match(/^-?[0-9]+$/)||isHexString(Fn)||typeof Fn=="bigint"||isBytes(Fn))}let _warnedToStringRadix=!1,BigNumber$1=class k2{constructor(Mn,rs){Mn!==_constructorGuard$3&&logger$p.throwError("cannot call constructor directly; use BigNumber.from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=rs,this._isBigNumber=!0,Object.freeze(this)}fromTwos(Mn){return toBigNumber(toBN(this).fromTwos(Mn))}toTwos(Mn){return toBigNumber(toBN(this).toTwos(Mn))}abs(){return this._hex[0]==="-"?k2.from(this._hex.substring(1)):this}add(Mn){return toBigNumber(toBN(this).add(toBN(Mn)))}sub(Mn){return toBigNumber(toBN(this).sub(toBN(Mn)))}div(Mn){return k2.from(Mn).isZero()&&throwFault$1("division-by-zero","div"),toBigNumber(toBN(this).div(toBN(Mn)))}mul(Mn){return toBigNumber(toBN(this).mul(toBN(Mn)))}mod(Mn){const rs=toBN(Mn);return rs.isNeg()&&throwFault$1("division-by-zero","mod"),toBigNumber(toBN(this).umod(rs))}pow(Mn){const rs=toBN(Mn);return rs.isNeg()&&throwFault$1("negative-power","pow"),toBigNumber(toBN(this).pow(rs))}and(Mn){const rs=toBN(Mn);return(this.isNegative()||rs.isNeg())&&throwFault$1("unbound-bitwise-result","and"),toBigNumber(toBN(this).and(rs))}or(Mn){const rs=toBN(Mn);return(this.isNegative()||rs.isNeg())&&throwFault$1("unbound-bitwise-result","or"),toBigNumber(toBN(this).or(rs))}xor(Mn){const rs=toBN(Mn);return(this.isNegative()||rs.isNeg())&&throwFault$1("unbound-bitwise-result","xor"),toBigNumber(toBN(this).xor(rs))}mask(Mn){return(this.isNegative()||Mn<0)&&throwFault$1("negative-width","mask"),toBigNumber(toBN(this).maskn(Mn))}shl(Mn){return(this.isNegative()||Mn<0)&&throwFault$1("negative-width","shl"),toBigNumber(toBN(this).shln(Mn))}shr(Mn){return(this.isNegative()||Mn<0)&&throwFault$1("negative-width","shr"),toBigNumber(toBN(this).shrn(Mn))}eq(Mn){return toBN(this).eq(toBN(Mn))}lt(Mn){return toBN(this).lt(toBN(Mn))}lte(Mn){return toBN(this).lte(toBN(Mn))}gt(Mn){return toBN(this).gt(toBN(Mn))}gte(Mn){return toBN(this).gte(toBN(Mn))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch{throwFault$1("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return logger$p.throwError("this platform does not support BigInt",Logger$1.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?_warnedToStringRadix||(_warnedToStringRadix=!0,logger$p.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?logger$p.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger$1.errors.UNEXPECTED_ARGUMENT,{}):logger$p.throwError("BigNumber.toString does not accept parameters",Logger$1.errors.UNEXPECTED_ARGUMENT,{})),toBN(this).toString(10)}toHexString(){return this._hex}toJSON(Mn){return{type:"BigNumber",hex:this.toHexString()}}static from(Mn){if(Mn instanceof k2)return Mn;if(typeof Mn=="string")return Mn.match(/^-?0x[0-9a-f]+$/i)?new k2(_constructorGuard$3,toHex$2(Mn)):Mn.match(/^-?[0-9]+$/)?new k2(_constructorGuard$3,toHex$2(new BN$8(Mn))):logger$p.throwArgumentError("invalid BigNumber string","value",Mn);if(typeof Mn=="number")return Mn%1&&throwFault$1("underflow","BigNumber.from",Mn),(Mn>=MAX_SAFE||Mn<=-MAX_SAFE)&&throwFault$1("overflow","BigNumber.from",Mn),k2.from(String(Mn));const rs=Mn;if(typeof rs=="bigint")return k2.from(rs.toString());if(isBytes(rs))return k2.from(hexlify(rs));if(rs)if(rs.toHexString){const is=rs.toHexString();if(typeof is=="string")return k2.from(is)}else{let is=rs._hex;if(is==null&&rs.type==="BigNumber"&&(is=rs.hex),typeof is=="string"&&(isHexString(is)||is[0]==="-"&&isHexString(is.substring(1))))return k2.from(is)}return logger$p.throwArgumentError("invalid BigNumber value","value",Mn)}static isBigNumber(Mn){return!!(Mn&&Mn._isBigNumber)}};function toHex$2(Fn){if(typeof Fn!="string")return toHex$2(Fn.toString(16));if(Fn[0]==="-")return Fn=Fn.substring(1),Fn[0]==="-"&&logger$p.throwArgumentError("invalid hex","value",Fn),Fn=toHex$2(Fn),Fn==="0x00"?Fn:"-"+Fn;if(Fn.substring(0,2)!=="0x"&&(Fn="0x"+Fn),Fn==="0x")return"0x00";for(Fn.length%2&&(Fn="0x0"+Fn.substring(2));Fn.length>4&&Fn.substring(0,4)==="0x00";)Fn="0x"+Fn.substring(4);return Fn}function toBigNumber(Fn){return BigNumber$1.from(toHex$2(Fn))}function toBN(Fn){const Mn=BigNumber$1.from(Fn).toHexString();return Mn[0]==="-"?new BN$8("-"+Mn.substring(3),16):new BN$8(Mn.substring(2),16)}function throwFault$1(Fn,Mn,rs){const is={fault:Fn,operation:Mn};return rs!=null&&(is.value=rs),logger$p.throwError(Fn,Logger$1.errors.NUMERIC_FAULT,is)}function _base36To16(Fn){return new BN$8(Fn,36).toString(16)}const logger$o=new Logger$1(version$k),_constructorGuard$2={},Zero$2=BigNumber$1.from(0),NegativeOne$2=BigNumber$1.from(-1);function throwFault(Fn,Mn,rs,is){const os={fault:Mn,operation:rs};return is!==void 0&&(os.value=is),logger$o.throwError(Fn,Logger$1.errors.NUMERIC_FAULT,os)}let zeros="0";for(;zeros.length<256;)zeros+=zeros;function getMultiplier(Fn){if(typeof Fn!="number")try{Fn=BigNumber$1.from(Fn).toNumber()}catch{}return typeof Fn=="number"&&Fn>=0&&Fn<=256&&!(Fn%1)?"1"+zeros.substring(0,Fn):logger$o.throwArgumentError("invalid decimal size","decimals",Fn)}function formatFixed(Fn,Mn){Mn==null&&(Mn=0);const rs=getMultiplier(Mn);Fn=BigNumber$1.from(Fn);const is=Fn.lt(Zero$2);is&&(Fn=Fn.mul(NegativeOne$2));let os=Fn.mod(rs).toString();for(;os.length<rs.length-1;)os="0"+os;os=os.match(/^([0-9]*[1-9]|0)(0*)/)[1];const as=Fn.div(rs).toString();return rs.length===1?Fn=as:Fn=as+"."+os,is&&(Fn="-"+Fn),Fn}function parseFixed(Fn,Mn){Mn==null&&(Mn=0);const rs=getMultiplier(Mn);(typeof Fn!="string"||!Fn.match(/^-?[0-9.]+$/))&&logger$o.throwArgumentError("invalid decimal value","value",Fn);const is=Fn.substring(0,1)==="-";is&&(Fn=Fn.substring(1)),Fn==="."&&logger$o.throwArgumentError("missing value","value",Fn);const os=Fn.split(".");os.length>2&&logger$o.throwArgumentError("too many decimal points","value",Fn);let as=os[0],us=os[1];for(as||(as="0"),us||(us="0");us[us.length-1]==="0";)us=us.substring(0,us.length-1);for(us.length>rs.length-1&&throwFault("fractional component exceeds decimals","underflow","parseFixed"),us===""&&(us="0");us.length<rs.length-1;)us+="0";const ds=BigNumber$1.from(as),hs=BigNumber$1.from(us);let ps=ds.mul(rs).add(hs);return is&&(ps=ps.mul(NegativeOne$2)),ps}class FixedFormat{constructor(Mn,rs,is,os){Mn!==_constructorGuard$2&&logger$o.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=rs,this.width=is,this.decimals=os,this.name=(rs?"":"u")+"fixed"+String(is)+"x"+String(os),this._multiplier=getMultiplier(os),Object.freeze(this)}static from(Mn){if(Mn instanceof FixedFormat)return Mn;typeof Mn=="number"&&(Mn=`fixed128x${Mn}`);let rs=!0,is=128,os=18;if(typeof Mn=="string"){if(Mn!=="fixed")if(Mn==="ufixed")rs=!1;else{const as=Mn.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);as||logger$o.throwArgumentError("invalid fixed format","format",Mn),rs=as[1]!=="u",is=parseInt(as[2]),os=parseInt(as[3])}}else if(Mn){const as=(us,ds,hs)=>Mn[us]==null?hs:(typeof Mn[us]!==ds&&logger$o.throwArgumentError("invalid fixed format ("+us+" not "+ds+")","format."+us,Mn[us]),Mn[us]);rs=as("signed","boolean",rs),is=as("width","number",is),os=as("decimals","number",os)}return is%8&&logger$o.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",is),os>80&&logger$o.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",os),new FixedFormat(_constructorGuard$2,rs,is,os)}}class FixedNumber{constructor(Mn,rs,is,os){Mn!==_constructorGuard$2&&logger$o.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=os,this._hex=rs,this._value=is,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(Mn){this.format.name!==Mn.format.name&&logger$o.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",Mn)}addUnsafe(Mn){this._checkFormat(Mn);const rs=parseFixed(this._value,this.format.decimals),is=parseFixed(Mn._value,Mn.format.decimals);return FixedNumber.fromValue(rs.add(is),this.format.decimals,this.format)}subUnsafe(Mn){this._checkFormat(Mn);const rs=parseFixed(this._value,this.format.decimals),is=parseFixed(Mn._value,Mn.format.decimals);return FixedNumber.fromValue(rs.sub(is),this.format.decimals,this.format)}mulUnsafe(Mn){this._checkFormat(Mn);const rs=parseFixed(this._value,this.format.decimals),is=parseFixed(Mn._value,Mn.format.decimals);return FixedNumber.fromValue(rs.mul(is).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(Mn){this._checkFormat(Mn);const rs=parseFixed(this._value,this.format.decimals),is=parseFixed(Mn._value,Mn.format.decimals);return FixedNumber.fromValue(rs.mul(this.format._multiplier).div(is),this.format.decimals,this.format)}floor(){const Mn=this.toString().split(".");Mn.length===1&&Mn.push("0");let rs=FixedNumber.from(Mn[0],this.format);const is=!Mn[1].match(/^(0*)$/);return this.isNegative()&&is&&(rs=rs.subUnsafe(ONE.toFormat(rs.format))),rs}ceiling(){const Mn=this.toString().split(".");Mn.length===1&&Mn.push("0");let rs=FixedNumber.from(Mn[0],this.format);const is=!Mn[1].match(/^(0*)$/);return!this.isNegative()&&is&&(rs=rs.addUnsafe(ONE.toFormat(rs.format))),rs}round(Mn){Mn==null&&(Mn=0);const rs=this.toString().split(".");if(rs.length===1&&rs.push("0"),(Mn<0||Mn>80||Mn%1)&&logger$o.throwArgumentError("invalid decimal count","decimals",Mn),rs[1].length<=Mn)return this;const is=FixedNumber.from("1"+zeros.substring(0,Mn),this.format),os=BUMP.toFormat(this.format);return this.mulUnsafe(is).addUnsafe(os).floor().divUnsafe(is)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(Mn){if(Mn==null)return this._hex;Mn%8&&logger$o.throwArgumentError("invalid byte width","width",Mn);const rs=BigNumber$1.from(this._hex).fromTwos(this.format.width).toTwos(Mn).toHexString();return hexZeroPad(rs,Mn/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(Mn){return FixedNumber.fromString(this._value,Mn)}static fromValue(Mn,rs,is){return is==null&&rs!=null&&!isBigNumberish(rs)&&(is=rs,rs=null),rs==null&&(rs=0),is==null&&(is="fixed"),FixedNumber.fromString(formatFixed(Mn,rs),FixedFormat.from(is))}static fromString(Mn,rs){rs==null&&(rs="fixed");const is=FixedFormat.from(rs),os=parseFixed(Mn,is.decimals);!is.signed&&os.lt(Zero$2)&&throwFault("unsigned value cannot be negative","overflow","value",Mn);let as=null;is.signed?as=os.toTwos(is.width).toHexString():(as=os.toHexString(),as=hexZeroPad(as,is.width/8));const us=formatFixed(os,is.decimals);return new FixedNumber(_constructorGuard$2,as,us,is)}static fromBytes(Mn,rs){rs==null&&(rs="fixed");const is=FixedFormat.from(rs);if(arrayify(Mn).length>is.width/8)throw new Error("overflow");let os=BigNumber$1.from(Mn);is.signed&&(os=os.fromTwos(is.width));const as=os.toTwos((is.signed?0:1)+is.width).toHexString(),us=formatFixed(os,is.decimals);return new FixedNumber(_constructorGuard$2,as,us,is)}static from(Mn,rs){if(typeof Mn=="string")return FixedNumber.fromString(Mn,rs);if(isBytes(Mn))return FixedNumber.fromBytes(Mn,rs);try{return FixedNumber.fromValue(Mn,0,rs)}catch(is){if(is.code!==Logger$1.errors.INVALID_ARGUMENT)throw is}return logger$o.throwArgumentError("invalid FixedNumber value","value",Mn)}static isFixedNumber(Mn){return!!(Mn&&Mn._isFixedNumber)}}const ONE=FixedNumber.from(1),BUMP=FixedNumber.from("0.5"),version$j="properties/5.7.0";var __awaiter$9=function(Fn,Mn,rs,is){function os(as){return as instanceof rs?as:new rs(function(us){us(as)})}return new(rs||(rs=Promise))(function(as,us){function ds(io){try{ps(is.next(io))}catch(fo){us(fo)}}function hs(io){try{ps(is.throw(io))}catch(fo){us(fo)}}function ps(io){io.done?as(io.value):os(io.value).then(ds,hs)}ps((is=is.apply(Fn,Mn||[])).next())})};const logger$n=new Logger$1(version$j);function defineReadOnly(Fn,Mn,rs){Object.defineProperty(Fn,Mn,{enumerable:!0,value:rs,writable:!1})}function getStatic(Fn,Mn){for(let rs=0;rs<32;rs++){if(Fn[Mn])return Fn[Mn];if(!Fn.prototype||typeof Fn.prototype!="object")break;Fn=Object.getPrototypeOf(Fn.prototype).constructor}return null}function resolveProperties(Fn){return __awaiter$9(this,void 0,void 0,function*(){const Mn=Object.keys(Fn).map(is=>{const os=Fn[is];return Promise.resolve(os).then(as=>({key:is,value:as}))});return(yield Promise.all(Mn)).reduce((is,os)=>(is[os.key]=os.value,is),{})})}function checkProperties(Fn,Mn){(!Fn||typeof Fn!="object")&&logger$n.throwArgumentError("invalid object","object",Fn),Object.keys(Fn).forEach(rs=>{Mn[rs]||logger$n.throwArgumentError("invalid object key - "+rs,"transaction:"+rs,Fn)})}function shallowCopy(Fn){const Mn={};for(const rs in Fn)Mn[rs]=Fn[rs];return Mn}const opaque={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function _isFrozen(Fn){if(Fn==null||opaque[typeof Fn])return!0;if(Array.isArray(Fn)||typeof Fn=="object"){if(!Object.isFrozen(Fn))return!1;const Mn=Object.keys(Fn);for(let rs=0;rs<Mn.length;rs++){let is=null;try{is=Fn[Mn[rs]]}catch{continue}if(!_isFrozen(is))return!1}return!0}return logger$n.throwArgumentError(`Cannot deepCopy ${typeof Fn}`,"object",Fn)}function _deepCopy(Fn){if(_isFrozen(Fn))return Fn;if(Array.isArray(Fn))return Object.freeze(Fn.map(Mn=>deepCopy(Mn)));if(typeof Fn=="object"){const Mn={};for(const rs in Fn){const is=Fn[rs];is!==void 0&&defineReadOnly(Mn,rs,deepCopy(is))}return Mn}return logger$n.throwArgumentError(`Cannot deepCopy ${typeof Fn}`,"object",Fn)}function deepCopy(Fn){return _deepCopy(Fn)}class Description{constructor(Mn){for(const rs in Mn)this[rs]=deepCopy(Mn[rs])}}const version$i="abi/5.7.0",logger$m=new Logger$1(version$i),_constructorGuard$1={};let ModifiersBytes={calldata:!0,memory:!0,storage:!0},ModifiersNest={calldata:!0,memory:!0};function checkModifier(Fn,Mn){if(Fn==="bytes"||Fn==="string"){if(ModifiersBytes[Mn])return!0}else if(Fn==="address"){if(Mn==="payable")return!0}else if((Fn.indexOf("[")>=0||Fn==="tuple")&&ModifiersNest[Mn])return!0;return(ModifiersBytes[Mn]||Mn==="payable")&&logger$m.throwArgumentError("invalid modifier","name",Mn),!1}function parseParamType(Fn,Mn){let rs=Fn;function is(ds){logger$m.throwArgumentError(`unexpected character at position ${ds}`,"param",Fn)}Fn=Fn.replace(/\s/g," ");function os(ds){let hs={type:"",name:"",parent:ds,state:{allowType:!0}};return Mn&&(hs.indexed=!1),hs}let as={type:"",name:"",state:{allowType:!0}},us=as;for(let ds=0;ds<Fn.length;ds++){let hs=Fn[ds];switch(hs){case"(":us.state.allowType&&us.type===""?us.type="tuple":us.state.allowParams||is(ds),us.state.allowType=!1,us.type=verifyType(us.type),us.components=[os(us)],us=us.components[0];break;case")":delete us.state,us.name==="indexed"&&(Mn||is(ds),us.indexed=!0,us.name=""),checkModifier(us.type,us.name)&&(us.name=""),us.type=verifyType(us.type);let ps=us;us=us.parent,us||is(ds),delete ps.parent,us.state.allowParams=!1,us.state.allowName=!0,us.state.allowArray=!0;break;case",":delete us.state,us.name==="indexed"&&(Mn||is(ds),us.indexed=!0,us.name=""),checkModifier(us.type,us.name)&&(us.name=""),us.type=verifyType(us.type);let io=os(us.parent);us.parent.components.push(io),delete us.parent,us=io;break;case" ":us.state.allowType&&us.type!==""&&(us.type=verifyType(us.type),delete us.state.allowType,us.state.allowName=!0,us.state.allowParams=!0),us.state.allowName&&us.name!==""&&(us.name==="indexed"?(Mn||is(ds),us.indexed&&is(ds),us.indexed=!0,us.name=""):checkModifier(us.type,us.name)?us.name="":us.state.allowName=!1);break;case"[":us.state.allowArray||is(ds),us.type+=hs,us.state.allowArray=!1,us.state.allowName=!1,us.state.readArray=!0;break;case"]":us.state.readArray||is(ds),us.type+=hs,us.state.readArray=!1,us.state.allowArray=!0,us.state.allowName=!0;break;default:us.state.allowType?(us.type+=hs,us.state.allowParams=!0,us.state.allowArray=!0):us.state.allowName?(us.name+=hs,delete us.state.allowArray):us.state.readArray?us.type+=hs:is(ds)}}return us.parent&&logger$m.throwArgumentError("unexpected eof","param",Fn),delete as.state,us.name==="indexed"?(Mn||is(rs.length-7),us.indexed&&is(rs.length-7),us.indexed=!0,us.name=""):checkModifier(us.type,us.name)&&(us.name=""),as.type=verifyType(as.type),as}function populate(Fn,Mn){for(let rs in Mn)defineReadOnly(Fn,rs,Mn[rs])}const FormatTypes=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),paramTypeArray=new RegExp(/^(.*)\[([0-9]*)\]$/);class ParamType{constructor(Mn,rs){Mn!==_constructorGuard$1&&logger$m.throwError("use fromString",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),populate(this,rs);let is=this.type.match(paramTypeArray);is?populate(this,{arrayLength:parseInt(is[2]||"-1"),arrayChildren:ParamType.fromObject({type:is[1],components:this.components}),baseType:"array"}):populate(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(Mn){if(Mn||(Mn=FormatTypes.sighash),FormatTypes[Mn]||logger$m.throwArgumentError("invalid format type","format",Mn),Mn===FormatTypes.json){let is={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(is.indexed=this.indexed),this.components&&(is.components=this.components.map(os=>JSON.parse(os.format(Mn)))),JSON.stringify(is)}let rs="";return this.baseType==="array"?(rs+=this.arrayChildren.format(Mn),rs+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(Mn!==FormatTypes.sighash&&(rs+=this.type),rs+="("+this.components.map(is=>is.format(Mn)).join(Mn===FormatTypes.full?", ":",")+")"):rs+=this.type,Mn!==FormatTypes.sighash&&(this.indexed===!0&&(rs+=" indexed"),Mn===FormatTypes.full&&this.name&&(rs+=" "+this.name)),rs}static from(Mn,rs){return typeof Mn=="string"?ParamType.fromString(Mn,rs):ParamType.fromObject(Mn)}static fromObject(Mn){return ParamType.isParamType(Mn)?Mn:new ParamType(_constructorGuard$1,{name:Mn.name||null,type:verifyType(Mn.type),indexed:Mn.indexed==null?null:!!Mn.indexed,components:Mn.components?Mn.components.map(ParamType.fromObject):null})}static fromString(Mn,rs){function is(os){return ParamType.fromObject({name:os.name,type:os.type,indexed:os.indexed,components:os.components})}return is(parseParamType(Mn,!!rs))}static isParamType(Mn){return!!(Mn!=null&&Mn._isParamType)}}function parseParams(Fn,Mn){return splitNesting(Fn).map(rs=>ParamType.fromString(rs,Mn))}let Fragment$1=class Gy{constructor(Mn,rs){Mn!==_constructorGuard$1&&logger$m.throwError("use a static from method",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),populate(this,rs),this._isFragment=!0,Object.freeze(this)}static from(Mn){return Gy.isFragment(Mn)?Mn:typeof Mn=="string"?Gy.fromString(Mn):Gy.fromObject(Mn)}static fromObject(Mn){if(Gy.isFragment(Mn))return Mn;switch(Mn.type){case"function":return FunctionFragment.fromObject(Mn);case"event":return EventFragment.fromObject(Mn);case"constructor":return ConstructorFragment.fromObject(Mn);case"error":return ErrorFragment.fromObject(Mn);case"fallback":case"receive":return null}return logger$m.throwArgumentError("invalid fragment object","value",Mn)}static fromString(Mn){return Mn=Mn.replace(/\s/g," "),Mn=Mn.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),Mn=Mn.trim(),Mn.split(" ")[0]==="event"?EventFragment.fromString(Mn.substring(5).trim()):Mn.split(" ")[0]==="function"?FunctionFragment.fromString(Mn.substring(8).trim()):Mn.split("(")[0].trim()==="constructor"?ConstructorFragment.fromString(Mn.trim()):Mn.split(" ")[0]==="error"?ErrorFragment.fromString(Mn.substring(5).trim()):logger$m.throwArgumentError("unsupported fragment","value",Mn)}static isFragment(Mn){return!!(Mn&&Mn._isFragment)}};class EventFragment extends Fragment$1{format(Mn){if(Mn||(Mn=FormatTypes.sighash),FormatTypes[Mn]||logger$m.throwArgumentError("invalid format type","format",Mn),Mn===FormatTypes.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(is=>JSON.parse(is.format(Mn)))});let rs="";return Mn!==FormatTypes.sighash&&(rs+="event "),rs+=this.name+"("+this.inputs.map(is=>is.format(Mn)).join(Mn===FormatTypes.full?", ":",")+") ",Mn!==FormatTypes.sighash&&this.anonymous&&(rs+="anonymous "),rs.trim()}static from(Mn){return typeof Mn=="string"?EventFragment.fromString(Mn):EventFragment.fromObject(Mn)}static fromObject(Mn){if(EventFragment.isEventFragment(Mn))return Mn;Mn.type!=="event"&&logger$m.throwArgumentError("invalid event object","value",Mn);const rs={name:verifyIdentifier(Mn.name),anonymous:Mn.anonymous,inputs:Mn.inputs?Mn.inputs.map(ParamType.fromObject):[],type:"event"};return new EventFragment(_constructorGuard$1,rs)}static fromString(Mn){let rs=Mn.match(regexParen);rs||logger$m.throwArgumentError("invalid event string","value",Mn);let is=!1;return rs[3].split(" ").forEach(os=>{switch(os.trim()){case"anonymous":is=!0;break;case"":break;default:logger$m.warn("unknown modifier: "+os)}}),EventFragment.fromObject({name:rs[1].trim(),anonymous:is,inputs:parseParams(rs[2],!0),type:"event"})}static isEventFragment(Mn){return Mn&&Mn._isFragment&&Mn.type==="event"}}function parseGas(Fn,Mn){Mn.gas=null;let rs=Fn.split("@");return rs.length!==1?(rs.length>2&&logger$m.throwArgumentError("invalid human-readable ABI signature","value",Fn),rs[1].match(/^[0-9]+$/)||logger$m.throwArgumentError("invalid human-readable ABI signature gas","value",Fn),Mn.gas=BigNumber$1.from(rs[1]),rs[0]):Fn}function parseModifiers(Fn,Mn){Mn.constant=!1,Mn.payable=!1,Mn.stateMutability="nonpayable",Fn.split(" ").forEach(rs=>{switch(rs.trim()){case"constant":Mn.constant=!0;break;case"payable":Mn.payable=!0,Mn.stateMutability="payable";break;case"nonpayable":Mn.payable=!1,Mn.stateMutability="nonpayable";break;case"pure":Mn.constant=!0,Mn.stateMutability="pure";break;case"view":Mn.constant=!0,Mn.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+rs)}})}function verifyState(Fn){let Mn={constant:!1,payable:!0,stateMutability:"payable"};return Fn.stateMutability!=null?(Mn.stateMutability=Fn.stateMutability,Mn.constant=Mn.stateMutability==="view"||Mn.stateMutability==="pure",Fn.constant!=null&&!!Fn.constant!==Mn.constant&&logger$m.throwArgumentError("cannot have constant function with mutability "+Mn.stateMutability,"value",Fn),Mn.payable=Mn.stateMutability==="payable",Fn.payable!=null&&!!Fn.payable!==Mn.payable&&logger$m.throwArgumentError("cannot have payable function with mutability "+Mn.stateMutability,"value",Fn)):Fn.payable!=null?(Mn.payable=!!Fn.payable,Fn.constant==null&&!Mn.payable&&Fn.type!=="constructor"&&logger$m.throwArgumentError("unable to determine stateMutability","value",Fn),Mn.constant=!!Fn.constant,Mn.constant?Mn.stateMutability="view":Mn.stateMutability=Mn.payable?"payable":"nonpayable",Mn.payable&&Mn.constant&&logger$m.throwArgumentError("cannot have constant payable function","value",Fn)):Fn.constant!=null?(Mn.constant=!!Fn.constant,Mn.payable=!Mn.constant,Mn.stateMutability=Mn.constant?"view":"payable"):Fn.type!=="constructor"&&logger$m.throwArgumentError("unable to determine stateMutability","value",Fn),Mn}class ConstructorFragment extends Fragment$1{format(Mn){if(Mn||(Mn=FormatTypes.sighash),FormatTypes[Mn]||logger$m.throwArgumentError("invalid format type","format",Mn),Mn===FormatTypes.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(is=>JSON.parse(is.format(Mn)))});Mn===FormatTypes.sighash&&logger$m.throwError("cannot format a constructor for sighash",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let rs="constructor("+this.inputs.map(is=>is.format(Mn)).join(Mn===FormatTypes.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(rs+=this.stateMutability+" "),rs.trim()}static from(Mn){return typeof Mn=="string"?ConstructorFragment.fromString(Mn):ConstructorFragment.fromObject(Mn)}static fromObject(Mn){if(ConstructorFragment.isConstructorFragment(Mn))return Mn;Mn.type!=="constructor"&&logger$m.throwArgumentError("invalid constructor object","value",Mn);let rs=verifyState(Mn);rs.constant&&logger$m.throwArgumentError("constructor cannot be constant","value",Mn);const is={name:null,type:Mn.type,inputs:Mn.inputs?Mn.inputs.map(ParamType.fromObject):[],payable:rs.payable,stateMutability:rs.stateMutability,gas:Mn.gas?BigNumber$1.from(Mn.gas):null};return new ConstructorFragment(_constructorGuard$1,is)}static fromString(Mn){let rs={type:"constructor"};Mn=parseGas(Mn,rs);let is=Mn.match(regexParen);return(!is||is[1].trim()!=="constructor")&&logger$m.throwArgumentError("invalid constructor string","value",Mn),rs.inputs=parseParams(is[2].trim(),!1),parseModifiers(is[3].trim(),rs),ConstructorFragment.fromObject(rs)}static isConstructorFragment(Mn){return Mn&&Mn._isFragment&&Mn.type==="constructor"}}class FunctionFragment extends ConstructorFragment{format(Mn){if(Mn||(Mn=FormatTypes.sighash),FormatTypes[Mn]||logger$m.throwArgumentError("invalid format type","format",Mn),Mn===FormatTypes.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?this.gas.toNumber():void 0,inputs:this.inputs.map(is=>JSON.parse(is.format(Mn))),outputs:this.outputs.map(is=>JSON.parse(is.format(Mn)))});let rs="";return Mn!==FormatTypes.sighash&&(rs+="function "),rs+=this.name+"("+this.inputs.map(is=>is.format(Mn)).join(Mn===FormatTypes.full?", ":",")+") ",Mn!==FormatTypes.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(rs+=this.stateMutability+" "):this.constant&&(rs+="view "),this.outputs&&this.outputs.length&&(rs+="returns ("+this.outputs.map(is=>is.format(Mn)).join(", ")+") "),this.gas!=null&&(rs+="@"+this.gas.toString()+" ")),rs.trim()}static from(Mn){return typeof Mn=="string"?FunctionFragment.fromString(Mn):FunctionFragment.fromObject(Mn)}static fromObject(Mn){if(FunctionFragment.isFunctionFragment(Mn))return Mn;Mn.type!=="function"&&logger$m.throwArgumentError("invalid function object","value",Mn);let rs=verifyState(Mn);const is={type:Mn.type,name:verifyIdentifier(Mn.name),constant:rs.constant,inputs:Mn.inputs?Mn.inputs.map(ParamType.fromObject):[],outputs:Mn.outputs?Mn.outputs.map(ParamType.fromObject):[],payable:rs.payable,stateMutability:rs.stateMutability,gas:Mn.gas?BigNumber$1.from(Mn.gas):null};return new FunctionFragment(_constructorGuard$1,is)}static fromString(Mn){let rs={type:"function"};Mn=parseGas(Mn,rs);let is=Mn.split(" returns ");is.length>2&&logger$m.throwArgumentError("invalid function string","value",Mn);let os=is[0].match(regexParen);if(os||logger$m.throwArgumentError("invalid function signature","value",Mn),rs.name=os[1].trim(),rs.name&&verifyIdentifier(rs.name),rs.inputs=parseParams(os[2],!1),parseModifiers(os[3].trim(),rs),is.length>1){let as=is[1].match(regexParen);(as[1].trim()!=""||as[3].trim()!="")&&logger$m.throwArgumentError("unexpected tokens","value",Mn),rs.outputs=parseParams(as[2],!1)}else rs.outputs=[];return FunctionFragment.fromObject(rs)}static isFunctionFragment(Mn){return Mn&&Mn._isFragment&&Mn.type==="function"}}function checkForbidden(Fn){const Mn=Fn.format();return(Mn==="Error(string)"||Mn==="Panic(uint256)")&&logger$m.throwArgumentError(`cannot specify user defined ${Mn} error`,"fragment",Fn),Fn}class ErrorFragment extends Fragment$1{format(Mn){if(Mn||(Mn=FormatTypes.sighash),FormatTypes[Mn]||logger$m.throwArgumentError("invalid format type","format",Mn),Mn===FormatTypes.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(is=>JSON.parse(is.format(Mn)))});let rs="";return Mn!==FormatTypes.sighash&&(rs+="error "),rs+=this.name+"("+this.inputs.map(is=>is.format(Mn)).join(Mn===FormatTypes.full?", ":",")+") ",rs.trim()}static from(Mn){return typeof Mn=="string"?ErrorFragment.fromString(Mn):ErrorFragment.fromObject(Mn)}static fromObject(Mn){if(ErrorFragment.isErrorFragment(Mn))return Mn;Mn.type!=="error"&&logger$m.throwArgumentError("invalid error object","value",Mn);const rs={type:Mn.type,name:verifyIdentifier(Mn.name),inputs:Mn.inputs?Mn.inputs.map(ParamType.fromObject):[]};return checkForbidden(new ErrorFragment(_constructorGuard$1,rs))}static fromString(Mn){let rs={type:"error"},is=Mn.match(regexParen);return is||logger$m.throwArgumentError("invalid error signature","value",Mn),rs.name=is[1].trim(),rs.name&&verifyIdentifier(rs.name),rs.inputs=parseParams(is[2],!1),checkForbidden(ErrorFragment.fromObject(rs))}static isErrorFragment(Mn){return Mn&&Mn._isFragment&&Mn.type==="error"}}function verifyType(Fn){return Fn.match(/^uint($|[^1-9])/)?Fn="uint256"+Fn.substring(4):Fn.match(/^int($|[^1-9])/)&&(Fn="int256"+Fn.substring(3)),Fn}const regexIdentifier=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function verifyIdentifier(Fn){return(!Fn||!Fn.match(regexIdentifier))&&logger$m.throwArgumentError(`invalid identifier "${Fn}"`,"value",Fn),Fn}const regexParen=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function splitNesting(Fn){Fn=Fn.trim();let Mn=[],rs="",is=0;for(let os=0;os<Fn.length;os++){let as=Fn[os];as===","&&is===0?(Mn.push(rs),rs=""):(rs+=as,as==="("?is++:as===")"&&(is--,is===-1&&logger$m.throwArgumentError("unbalanced parenthesis","value",Fn)))}return rs&&Mn.push(rs),Mn}const logger$l=new Logger$1(version$i);function checkResultErrors(Fn){const Mn=[],rs=function(is,os){if(Array.isArray(os))for(let as in os){const us=is.slice();us.push(as);try{rs(us,os[as])}catch(ds){Mn.push({path:us,error:ds})}}};return rs([],Fn),Mn}class Coder{constructor(Mn,rs,is,os){this.name=Mn,this.type=rs,this.localName=is,this.dynamic=os}_throwError(Mn,rs){logger$l.throwArgumentError(Mn,this.localName,rs)}}class Writer{constructor(Mn){defineReadOnly(this,"wordSize",Mn||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(Mn)}get data(){return hexConcat(this._data)}get length(){return this._dataLength}_writeData(Mn){return this._data.push(Mn),this._dataLength+=Mn.length,Mn.length}appendWriter(Mn){return this._writeData(concat$2(Mn._data))}writeBytes(Mn){let rs=arrayify(Mn);const is=rs.length%this.wordSize;return is&&(rs=concat$2([rs,this._padding.slice(is)])),this._writeData(rs)}_getValue(Mn){let rs=arrayify(BigNumber$1.from(Mn));return rs.length>this.wordSize&&logger$l.throwError("value out-of-bounds",Logger$1.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:rs.length}),rs.length%this.wordSize&&(rs=concat$2([this._padding.slice(rs.length%this.wordSize),rs])),rs}writeValue(Mn){return this._writeData(this._getValue(Mn))}writeUpdatableValue(){const Mn=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,rs=>{this._data[Mn]=this._getValue(rs)}}}class Reader{constructor(Mn,rs,is,os){defineReadOnly(this,"_data",arrayify(Mn)),defineReadOnly(this,"wordSize",rs||32),defineReadOnly(this,"_coerceFunc",is),defineReadOnly(this,"allowLoose",os),this._offset=0}get data(){return hexlify(this._data)}get consumed(){return this._offset}static coerce(Mn,rs){let is=Mn.match("^u?int([0-9]+)$");return is&&parseInt(is[1])<=48&&(rs=rs.toNumber()),rs}coerce(Mn,rs){return this._coerceFunc?this._coerceFunc(Mn,rs):Reader.coerce(Mn,rs)}_peekBytes(Mn,rs,is){let os=Math.ceil(rs/this.wordSize)*this.wordSize;return this._offset+os>this._data.length&&(this.allowLoose&&is&&this._offset+rs<=this._data.length?os=rs:logger$l.throwError("data out-of-bounds",Logger$1.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+os})),this._data.slice(this._offset,this._offset+os)}subReader(Mn){return new Reader(this._data.slice(this._offset+Mn),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(Mn,rs){let is=this._peekBytes(0,Mn,!!rs);return this._offset+=is.length,is.slice(0,Mn)}readValue(){return BigNumber$1.from(this.readBytes(this.wordSize))}}var sha3$1={exports:{}};(function(Fn){(function(){var Mn="input is invalid type",rs="finalize already called",is=typeof window=="object",os=is?window:{};os.JS_SHA3_NO_WINDOW&&(is=!1);var as=!is&&typeof self=="object",us=!os.JS_SHA3_NO_NODE_JS&&typeof browser$1$1=="object"&&browser$1$1.versions&&browser$1$1.versions.node;us?os=commonjsGlobal:as&&(os=self);var ds=!os.JS_SHA3_NO_COMMON_JS&&!0&&Fn.exports,hs=!os.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",ps="0123456789abcdef".split(""),io=[31,7936,2031616,520093696],fo=[4,1024,262144,67108864],mo=[1,256,65536,16777216],Ao=[6,1536,393216,100663296],$o=[0,8,16,24],Lo=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],Go=[224,256,384,512],Yo=[128,256],Wo=["hex","buffer","arrayBuffer","array","digest"],Jo={128:168,256:136};(os.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(Nl){return Object.prototype.toString.call(Nl)==="[object Array]"}),hs&&(os.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(Nl){return typeof Nl=="object"&&Nl.buffer&&Nl.buffer.constructor===ArrayBuffer});for(var xl=function(Nl,zl,Vl){return function(Hl){return new Il(Nl,zl,Nl).update(Hl)[Vl]()}},_l=function(Nl,zl,Vl){return function(Hl,Yl){return new Il(Nl,zl,Yl).update(Hl)[Vl]()}},Tl=function(Nl,zl,Vl){return function(Hl,Yl,Ll,Zl){return jo["cshake"+Nl].update(Hl,Yl,Ll,Zl)[Vl]()}},Sl=function(Nl,zl,Vl){return function(Hl,Yl,Ll,Zl){return jo["kmac"+Nl].update(Hl,Yl,Ll,Zl)[Vl]()}},$l=function(Nl,zl,Vl,Hl){for(var Yl=0;Yl<Wo.length;++Yl){var Ll=Wo[Yl];Nl[Ll]=zl(Vl,Hl,Ll)}return Nl},Pl=function(Nl,zl){var Vl=xl(Nl,zl,"hex");return Vl.create=function(){return new Il(Nl,zl,Nl)},Vl.update=function(Hl){return Vl.create().update(Hl)},$l(Vl,xl,Nl,zl)},Dl=function(Nl,zl){var Vl=_l(Nl,zl,"hex");return Vl.create=function(Hl){return new Il(Nl,zl,Hl)},Vl.update=function(Hl,Yl){return Vl.create(Yl).update(Hl)},$l(Vl,_l,Nl,zl)},Ol=function(Nl,zl){var Vl=Jo[Nl],Hl=Tl(Nl,zl,"hex");return Hl.create=function(Yl,Ll,Zl){return!Ll&&!Zl?jo["shake"+Nl].create(Yl):new Il(Nl,zl,Yl).bytepad([Ll,Zl],Vl)},Hl.update=function(Yl,Ll,Zl,Xl){return Hl.create(Ll,Zl,Xl).update(Yl)},$l(Hl,Tl,Nl,zl)},Rl=function(Nl,zl){var Vl=Jo[Nl],Hl=Sl(Nl,zl,"hex");return Hl.create=function(Yl,Ll,Zl){return new Bl(Nl,zl,Ll).bytepad(["KMAC",Zl],Vl).bytepad([Yl],Vl)},Hl.update=function(Yl,Ll,Zl,Xl){return Hl.create(Yl,Zl,Xl).update(Ll)},$l(Hl,Sl,Nl,zl)},Vo=[{name:"keccak",padding:mo,bits:Go,createMethod:Pl},{name:"sha3",padding:Ao,bits:Go,createMethod:Pl},{name:"shake",padding:io,bits:Yo,createMethod:Dl},{name:"cshake",padding:fo,bits:Yo,createMethod:Ol},{name:"kmac",padding:fo,bits:Yo,createMethod:Rl}],jo={},Ho=[],Qo=0;Qo<Vo.length;++Qo)for(var El=Vo[Qo],Xo=El.bits,Al=0;Al<Xo.length;++Al){var wl=El.name+"_"+Xo[Al];if(Ho.push(wl),jo[wl]=El.createMethod(Xo[Al],El.padding),El.name!=="sha3"){var yl=El.name+Xo[Al];Ho.push(yl),jo[yl]=jo[wl]}}function Il(Nl,zl,Vl){this.blocks=[],this.s=[],this.padding=zl,this.outputBits=Vl,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(Nl<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Vl>>5,this.extraBytes=(Vl&31)>>3;for(var Hl=0;Hl<50;++Hl)this.s[Hl]=0}Il.prototype.update=function(Nl){if(this.finalized)throw new Error(rs);var zl,Vl=typeof Nl;if(Vl!=="string"){if(Vl==="object"){if(Nl===null)throw new Error(Mn);if(hs&&Nl.constructor===ArrayBuffer)Nl=new Uint8Array(Nl);else if(!Array.isArray(Nl)&&(!hs||!ArrayBuffer.isView(Nl)))throw new Error(Mn)}else throw new Error(Mn);zl=!0}for(var Hl=this.blocks,Yl=this.byteCount,Ll=Nl.length,Zl=this.blockCount,Xl=0,wu=this.s,yu,rp;Xl<Ll;){if(this.reset)for(this.reset=!1,Hl[0]=this.block,yu=1;yu<Zl+1;++yu)Hl[yu]=0;if(zl)for(yu=this.start;Xl<Ll&&yu<Yl;++Xl)Hl[yu>>2]|=Nl[Xl]<<$o[yu++&3];else for(yu=this.start;Xl<Ll&&yu<Yl;++Xl)rp=Nl.charCodeAt(Xl),rp<128?Hl[yu>>2]|=rp<<$o[yu++&3]:rp<2048?(Hl[yu>>2]|=(192|rp>>6)<<$o[yu++&3],Hl[yu>>2]|=(128|rp&63)<<$o[yu++&3]):rp<55296||rp>=57344?(Hl[yu>>2]|=(224|rp>>12)<<$o[yu++&3],Hl[yu>>2]|=(128|rp>>6&63)<<$o[yu++&3],Hl[yu>>2]|=(128|rp&63)<<$o[yu++&3]):(rp=65536+((rp&1023)<<10|Nl.charCodeAt(++Xl)&1023),Hl[yu>>2]|=(240|rp>>18)<<$o[yu++&3],Hl[yu>>2]|=(128|rp>>12&63)<<$o[yu++&3],Hl[yu>>2]|=(128|rp>>6&63)<<$o[yu++&3],Hl[yu>>2]|=(128|rp&63)<<$o[yu++&3]);if(this.lastByteIndex=yu,yu>=Yl){for(this.start=yu-Yl,this.block=Hl[Zl],yu=0;yu<Zl;++yu)wu[yu]^=Hl[yu];Gl(wu),this.reset=!0}else this.start=yu}return this},Il.prototype.encode=function(Nl,zl){var Vl=Nl&255,Hl=1,Yl=[Vl];for(Nl=Nl>>8,Vl=Nl&255;Vl>0;)Yl.unshift(Vl),Nl=Nl>>8,Vl=Nl&255,++Hl;return zl?Yl.push(Hl):Yl.unshift(Hl),this.update(Yl),Yl.length},Il.prototype.encodeString=function(Nl){var zl,Vl=typeof Nl;if(Vl!=="string"){if(Vl==="object"){if(Nl===null)throw new Error(Mn);if(hs&&Nl.constructor===ArrayBuffer)Nl=new Uint8Array(Nl);else if(!Array.isArray(Nl)&&(!hs||!ArrayBuffer.isView(Nl)))throw new Error(Mn)}else throw new Error(Mn);zl=!0}var Hl=0,Yl=Nl.length;if(zl)Hl=Yl;else for(var Ll=0;Ll<Nl.length;++Ll){var Zl=Nl.charCodeAt(Ll);Zl<128?Hl+=1:Zl<2048?Hl+=2:Zl<55296||Zl>=57344?Hl+=3:(Zl=65536+((Zl&1023)<<10|Nl.charCodeAt(++Ll)&1023),Hl+=4)}return Hl+=this.encode(Hl*8),this.update(Nl),Hl},Il.prototype.bytepad=function(Nl,zl){for(var Vl=this.encode(zl),Hl=0;Hl<Nl.length;++Hl)Vl+=this.encodeString(Nl[Hl]);var Yl=zl-Vl%zl,Ll=[];return Ll.length=Yl,this.update(Ll),this},Il.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var Nl=this.blocks,zl=this.lastByteIndex,Vl=this.blockCount,Hl=this.s;if(Nl[zl>>2]|=this.padding[zl&3],this.lastByteIndex===this.byteCount)for(Nl[0]=Nl[Vl],zl=1;zl<Vl+1;++zl)Nl[zl]=0;for(Nl[Vl-1]|=2147483648,zl=0;zl<Vl;++zl)Hl[zl]^=Nl[zl];Gl(Hl)}},Il.prototype.toString=Il.prototype.hex=function(){this.finalize();for(var Nl=this.blockCount,zl=this.s,Vl=this.outputBlocks,Hl=this.extraBytes,Yl=0,Ll=0,Zl="",Xl;Ll<Vl;){for(Yl=0;Yl<Nl&&Ll<Vl;++Yl,++Ll)Xl=zl[Yl],Zl+=ps[Xl>>4&15]+ps[Xl&15]+ps[Xl>>12&15]+ps[Xl>>8&15]+ps[Xl>>20&15]+ps[Xl>>16&15]+ps[Xl>>28&15]+ps[Xl>>24&15];Ll%Nl===0&&(Gl(zl),Yl=0)}return Hl&&(Xl=zl[Yl],Zl+=ps[Xl>>4&15]+ps[Xl&15],Hl>1&&(Zl+=ps[Xl>>12&15]+ps[Xl>>8&15]),Hl>2&&(Zl+=ps[Xl>>20&15]+ps[Xl>>16&15])),Zl},Il.prototype.arrayBuffer=function(){this.finalize();var Nl=this.blockCount,zl=this.s,Vl=this.outputBlocks,Hl=this.extraBytes,Yl=0,Ll=0,Zl=this.outputBits>>3,Xl;Hl?Xl=new ArrayBuffer(Vl+1<<2):Xl=new ArrayBuffer(Zl);for(var wu=new Uint32Array(Xl);Ll<Vl;){for(Yl=0;Yl<Nl&&Ll<Vl;++Yl,++Ll)wu[Ll]=zl[Yl];Ll%Nl===0&&Gl(zl)}return Hl&&(wu[Yl]=zl[Yl],Xl=Xl.slice(0,Zl)),Xl},Il.prototype.buffer=Il.prototype.arrayBuffer,Il.prototype.digest=Il.prototype.array=function(){this.finalize();for(var Nl=this.blockCount,zl=this.s,Vl=this.outputBlocks,Hl=this.extraBytes,Yl=0,Ll=0,Zl=[],Xl,wu;Ll<Vl;){for(Yl=0;Yl<Nl&&Ll<Vl;++Yl,++Ll)Xl=Ll<<2,wu=zl[Yl],Zl[Xl]=wu&255,Zl[Xl+1]=wu>>8&255,Zl[Xl+2]=wu>>16&255,Zl[Xl+3]=wu>>24&255;Ll%Nl===0&&Gl(zl)}return Hl&&(Xl=Ll<<2,wu=zl[Yl],Zl[Xl]=wu&255,Hl>1&&(Zl[Xl+1]=wu>>8&255),Hl>2&&(Zl[Xl+2]=wu>>16&255)),Zl};function Bl(Nl,zl,Vl){Il.call(this,Nl,zl,Vl)}Bl.prototype=new Il,Bl.prototype.finalize=function(){return this.encode(this.outputBits,!0),Il.prototype.finalize.call(this)};var Gl=function(Nl){var zl,Vl,Hl,Yl,Ll,Zl,Xl,wu,yu,rp,dp,up,wp,vp,pp,cp,gp,mp,fp,hp,xp,Kl,Fl,Ul,Jl,fu,_d,tp,yp,_p,Sp,Ap,Op,Zp,Qp,Xp,h0,Wp,Np,Rp,Pp,Hp,kp,Gp,Yp,Mp,Ip,Dp,Lp,zp,Bp,qp,Vp,tm,g0,rm,Jp,lm,$m,km,Cm,Am,pm;for(Hl=0;Hl<48;Hl+=2)Yl=Nl[0]^Nl[10]^Nl[20]^Nl[30]^Nl[40],Ll=Nl[1]^Nl[11]^Nl[21]^Nl[31]^Nl[41],Zl=Nl[2]^Nl[12]^Nl[22]^Nl[32]^Nl[42],Xl=Nl[3]^Nl[13]^Nl[23]^Nl[33]^Nl[43],wu=Nl[4]^Nl[14]^Nl[24]^Nl[34]^Nl[44],yu=Nl[5]^Nl[15]^Nl[25]^Nl[35]^Nl[45],rp=Nl[6]^Nl[16]^Nl[26]^Nl[36]^Nl[46],dp=Nl[7]^Nl[17]^Nl[27]^Nl[37]^Nl[47],up=Nl[8]^Nl[18]^Nl[28]^Nl[38]^Nl[48],wp=Nl[9]^Nl[19]^Nl[29]^Nl[39]^Nl[49],zl=up^(Zl<<1|Xl>>>31),Vl=wp^(Xl<<1|Zl>>>31),Nl[0]^=zl,Nl[1]^=Vl,Nl[10]^=zl,Nl[11]^=Vl,Nl[20]^=zl,Nl[21]^=Vl,Nl[30]^=zl,Nl[31]^=Vl,Nl[40]^=zl,Nl[41]^=Vl,zl=Yl^(wu<<1|yu>>>31),Vl=Ll^(yu<<1|wu>>>31),Nl[2]^=zl,Nl[3]^=Vl,Nl[12]^=zl,Nl[13]^=Vl,Nl[22]^=zl,Nl[23]^=Vl,Nl[32]^=zl,Nl[33]^=Vl,Nl[42]^=zl,Nl[43]^=Vl,zl=Zl^(rp<<1|dp>>>31),Vl=Xl^(dp<<1|rp>>>31),Nl[4]^=zl,Nl[5]^=Vl,Nl[14]^=zl,Nl[15]^=Vl,Nl[24]^=zl,Nl[25]^=Vl,Nl[34]^=zl,Nl[35]^=Vl,Nl[44]^=zl,Nl[45]^=Vl,zl=wu^(up<<1|wp>>>31),Vl=yu^(wp<<1|up>>>31),Nl[6]^=zl,Nl[7]^=Vl,Nl[16]^=zl,Nl[17]^=Vl,Nl[26]^=zl,Nl[27]^=Vl,Nl[36]^=zl,Nl[37]^=Vl,Nl[46]^=zl,Nl[47]^=Vl,zl=rp^(Yl<<1|Ll>>>31),Vl=dp^(Ll<<1|Yl>>>31),Nl[8]^=zl,Nl[9]^=Vl,Nl[18]^=zl,Nl[19]^=Vl,Nl[28]^=zl,Nl[29]^=Vl,Nl[38]^=zl,Nl[39]^=Vl,Nl[48]^=zl,Nl[49]^=Vl,vp=Nl[0],pp=Nl[1],Mp=Nl[11]<<4|Nl[10]>>>28,Ip=Nl[10]<<4|Nl[11]>>>28,tp=Nl[20]<<3|Nl[21]>>>29,yp=Nl[21]<<3|Nl[20]>>>29,km=Nl[31]<<9|Nl[30]>>>23,Cm=Nl[30]<<9|Nl[31]>>>23,Hp=Nl[40]<<18|Nl[41]>>>14,kp=Nl[41]<<18|Nl[40]>>>14,Zp=Nl[2]<<1|Nl[3]>>>31,Qp=Nl[3]<<1|Nl[2]>>>31,cp=Nl[13]<<12|Nl[12]>>>20,gp=Nl[12]<<12|Nl[13]>>>20,Dp=Nl[22]<<10|Nl[23]>>>22,Lp=Nl[23]<<10|Nl[22]>>>22,_p=Nl[33]<<13|Nl[32]>>>19,Sp=Nl[32]<<13|Nl[33]>>>19,Am=Nl[42]<<2|Nl[43]>>>30,pm=Nl[43]<<2|Nl[42]>>>30,tm=Nl[5]<<30|Nl[4]>>>2,g0=Nl[4]<<30|Nl[5]>>>2,Xp=Nl[14]<<6|Nl[15]>>>26,h0=Nl[15]<<6|Nl[14]>>>26,mp=Nl[25]<<11|Nl[24]>>>21,fp=Nl[24]<<11|Nl[25]>>>21,zp=Nl[34]<<15|Nl[35]>>>17,Bp=Nl[35]<<15|Nl[34]>>>17,Ap=Nl[45]<<29|Nl[44]>>>3,Op=Nl[44]<<29|Nl[45]>>>3,Ul=Nl[6]<<28|Nl[7]>>>4,Jl=Nl[7]<<28|Nl[6]>>>4,rm=Nl[17]<<23|Nl[16]>>>9,Jp=Nl[16]<<23|Nl[17]>>>9,Wp=Nl[26]<<25|Nl[27]>>>7,Np=Nl[27]<<25|Nl[26]>>>7,hp=Nl[36]<<21|Nl[37]>>>11,xp=Nl[37]<<21|Nl[36]>>>11,qp=Nl[47]<<24|Nl[46]>>>8,Vp=Nl[46]<<24|Nl[47]>>>8,Gp=Nl[8]<<27|Nl[9]>>>5,Yp=Nl[9]<<27|Nl[8]>>>5,fu=Nl[18]<<20|Nl[19]>>>12,_d=Nl[19]<<20|Nl[18]>>>12,lm=Nl[29]<<7|Nl[28]>>>25,$m=Nl[28]<<7|Nl[29]>>>25,Rp=Nl[38]<<8|Nl[39]>>>24,Pp=Nl[39]<<8|Nl[38]>>>24,Kl=Nl[48]<<14|Nl[49]>>>18,Fl=Nl[49]<<14|Nl[48]>>>18,Nl[0]=vp^~cp&mp,Nl[1]=pp^~gp&fp,Nl[10]=Ul^~fu&tp,Nl[11]=Jl^~_d&yp,Nl[20]=Zp^~Xp&Wp,Nl[21]=Qp^~h0&Np,Nl[30]=Gp^~Mp&Dp,Nl[31]=Yp^~Ip&Lp,Nl[40]=tm^~rm&lm,Nl[41]=g0^~Jp&$m,Nl[2]=cp^~mp&hp,Nl[3]=gp^~fp&xp,Nl[12]=fu^~tp&_p,Nl[13]=_d^~yp&Sp,Nl[22]=Xp^~Wp&Rp,Nl[23]=h0^~Np&Pp,Nl[32]=Mp^~Dp&zp,Nl[33]=Ip^~Lp&Bp,Nl[42]=rm^~lm&km,Nl[43]=Jp^~$m&Cm,Nl[4]=mp^~hp&Kl,Nl[5]=fp^~xp&Fl,Nl[14]=tp^~_p&Ap,Nl[15]=yp^~Sp&Op,Nl[24]=Wp^~Rp&Hp,Nl[25]=Np^~Pp&kp,Nl[34]=Dp^~zp&qp,Nl[35]=Lp^~Bp&Vp,Nl[44]=lm^~km&Am,Nl[45]=$m^~Cm&pm,Nl[6]=hp^~Kl&vp,Nl[7]=xp^~Fl&pp,Nl[16]=_p^~Ap&Ul,Nl[17]=Sp^~Op&Jl,Nl[26]=Rp^~Hp&Zp,Nl[27]=Pp^~kp&Qp,Nl[36]=zp^~qp&Gp,Nl[37]=Bp^~Vp&Yp,Nl[46]=km^~Am&tm,Nl[47]=Cm^~pm&g0,Nl[8]=Kl^~vp&cp,Nl[9]=Fl^~pp&gp,Nl[18]=Ap^~Ul&fu,Nl[19]=Op^~Jl&_d,Nl[28]=Hp^~Zp&Xp,Nl[29]=kp^~Qp&h0,Nl[38]=qp^~Gp&Mp,Nl[39]=Vp^~Yp&Ip,Nl[48]=Am^~tm&rm,Nl[49]=pm^~g0&Jp,Nl[0]^=Lo[Hl],Nl[1]^=Lo[Hl+1]};if(ds)Fn.exports=jo;else for(Qo=0;Qo<Ho.length;++Qo)os[Ho[Qo]]=jo[Ho[Qo]]})()})(sha3$1);var sha3Exports=sha3$1.exports;const sha3=getDefaultExportFromCjs(sha3Exports);function keccak256(Fn){return"0x"+sha3.keccak_256(arrayify(Fn))}const version$h="rlp/5.7.0",logger$k=new Logger$1(version$h);function arrayifyInteger(Fn){const Mn=[];for(;Fn;)Mn.unshift(Fn&255),Fn>>=8;return Mn}function unarrayifyInteger(Fn,Mn,rs){let is=0;for(let os=0;os<rs;os++)is=is*256+Fn[Mn+os];return is}function _encode(Fn){if(Array.isArray(Fn)){let is=[];if(Fn.forEach(function(as){is=is.concat(_encode(as))}),is.length<=55)return is.unshift(192+is.length),is;const os=arrayifyInteger(is.length);return os.unshift(247+os.length),os.concat(is)}isBytesLike(Fn)||logger$k.throwArgumentError("RLP object must be BytesLike","object",Fn);const Mn=Array.prototype.slice.call(arrayify(Fn));if(Mn.length===1&&Mn[0]<=127)return Mn;if(Mn.length<=55)return Mn.unshift(128+Mn.length),Mn;const rs=arrayifyInteger(Mn.length);return rs.unshift(183+rs.length),rs.concat(Mn)}function encode$6(Fn){return hexlify(_encode(Fn))}function _decodeChildren(Fn,Mn,rs,is){const os=[];for(;rs<Mn+1+is;){const as=_decode(Fn,rs);os.push(as.result),rs+=as.consumed,rs>Mn+1+is&&logger$k.throwError("child data too short",Logger$1.errors.BUFFER_OVERRUN,{})}return{consumed:1+is,result:os}}function _decode(Fn,Mn){if(Fn.length===0&&logger$k.throwError("data too short",Logger$1.errors.BUFFER_OVERRUN,{}),Fn[Mn]>=248){const rs=Fn[Mn]-247;Mn+1+rs>Fn.length&&logger$k.throwError("data short segment too short",Logger$1.errors.BUFFER_OVERRUN,{});const is=unarrayifyInteger(Fn,Mn+1,rs);return Mn+1+rs+is>Fn.length&&logger$k.throwError("data long segment too short",Logger$1.errors.BUFFER_OVERRUN,{}),_decodeChildren(Fn,Mn,Mn+1+rs,rs+is)}else if(Fn[Mn]>=192){const rs=Fn[Mn]-192;return Mn+1+rs>Fn.length&&logger$k.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{}),_decodeChildren(Fn,Mn,Mn+1,rs)}else if(Fn[Mn]>=184){const rs=Fn[Mn]-183;Mn+1+rs>Fn.length&&logger$k.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{});const is=unarrayifyInteger(Fn,Mn+1,rs);Mn+1+rs+is>Fn.length&&logger$k.throwError("data array too short",Logger$1.errors.BUFFER_OVERRUN,{});const os=hexlify(Fn.slice(Mn+1+rs,Mn+1+rs+is));return{consumed:1+rs+is,result:os}}else if(Fn[Mn]>=128){const rs=Fn[Mn]-128;Mn+1+rs>Fn.length&&logger$k.throwError("data too short",Logger$1.errors.BUFFER_OVERRUN,{});const is=hexlify(Fn.slice(Mn+1,Mn+1+rs));return{consumed:1+rs,result:is}}return{consumed:1,result:hexlify(Fn[Mn])}}function decode$5(Fn){const Mn=arrayify(Fn),rs=_decode(Mn,0);return rs.consumed!==Mn.length&&logger$k.throwArgumentError("invalid rlp data","data",Fn),rs.result}const version$g="address/5.7.0",logger$j=new Logger$1(version$g);function getChecksumAddress(Fn){isHexString(Fn,20)||logger$j.throwArgumentError("invalid address","address",Fn),Fn=Fn.toLowerCase();const Mn=Fn.substring(2).split(""),rs=new Uint8Array(40);for(let os=0;os<40;os++)rs[os]=Mn[os].charCodeAt(0);const is=arrayify(keccak256(rs));for(let os=0;os<40;os+=2)is[os>>1]>>4>=8&&(Mn[os]=Mn[os].toUpperCase()),(is[os>>1]&15)>=8&&(Mn[os+1]=Mn[os+1].toUpperCase());return"0x"+Mn.join("")}const MAX_SAFE_INTEGER$1=9007199254740991;function log10$1(Fn){return Math.log10?Math.log10(Fn):Math.log(Fn)/Math.LN10}const ibanLookup={};for(let Fn=0;Fn<10;Fn++)ibanLookup[String(Fn)]=String(Fn);for(let Fn=0;Fn<26;Fn++)ibanLookup[String.fromCharCode(65+Fn)]=String(10+Fn);const safeDigits=Math.floor(log10$1(MAX_SAFE_INTEGER$1));function ibanChecksum(Fn){Fn=Fn.toUpperCase(),Fn=Fn.substring(4)+Fn.substring(0,2)+"00";let Mn=Fn.split("").map(is=>ibanLookup[is]).join("");for(;Mn.length>=safeDigits;){let is=Mn.substring(0,safeDigits);Mn=parseInt(is,10)%97+Mn.substring(is.length)}let rs=String(98-parseInt(Mn,10)%97);for(;rs.length<2;)rs="0"+rs;return rs}function getAddress(Fn){let Mn=null;if(typeof Fn!="string"&&logger$j.throwArgumentError("invalid address","address",Fn),Fn.match(/^(0x)?[0-9a-fA-F]{40}$/))Fn.substring(0,2)!=="0x"&&(Fn="0x"+Fn),Mn=getChecksumAddress(Fn),Fn.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&Mn!==Fn&&logger$j.throwArgumentError("bad address checksum","address",Fn);else if(Fn.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(Fn.substring(2,4)!==ibanChecksum(Fn)&&logger$j.throwArgumentError("bad icap checksum","address",Fn),Mn=_base36To16(Fn.substring(4));Mn.length<40;)Mn="0"+Mn;Mn=getChecksumAddress("0x"+Mn)}else logger$j.throwArgumentError("invalid address","address",Fn);return Mn}function getContractAddress(Fn){let Mn=null;try{Mn=getAddress(Fn.from)}catch{logger$j.throwArgumentError("missing from address","transaction",Fn)}const rs=stripZeros(arrayify(BigNumber$1.from(Fn.nonce).toHexString()));return getAddress(hexDataSlice(keccak256(encode$6([Mn,rs])),12))}class AddressCoder extends Coder{constructor(Mn){super("address","address",Mn,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(Mn,rs){try{rs=getAddress(rs)}catch(is){this._throwError(is.message,rs)}return Mn.writeValue(rs)}decode(Mn){return getAddress(hexZeroPad(Mn.readValue().toHexString(),20))}}class AnonymousCoder extends Coder{constructor(Mn){super(Mn.name,Mn.type,void 0,Mn.dynamic),this.coder=Mn}defaultValue(){return this.coder.defaultValue()}encode(Mn,rs){return this.coder.encode(Mn,rs)}decode(Mn){return this.coder.decode(Mn)}}const logger$i=new Logger$1(version$i);function pack$1(Fn,Mn,rs){let is=null;if(Array.isArray(rs))is=rs;else if(rs&&typeof rs=="object"){let hs={};is=Mn.map(ps=>{const io=ps.localName;return io||logger$i.throwError("cannot encode object for signature with missing names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:ps,value:rs}),hs[io]&&logger$i.throwError("cannot encode object for signature with duplicate names",Logger$1.errors.INVALID_ARGUMENT,{argument:"values",coder:ps,value:rs}),hs[io]=!0,rs[io]})}else logger$i.throwArgumentError("invalid tuple value","tuple",rs);Mn.length!==is.length&&logger$i.throwArgumentError("types/value length mismatch","tuple",rs);let os=new Writer(Fn.wordSize),as=new Writer(Fn.wordSize),us=[];Mn.forEach((hs,ps)=>{let io=is[ps];if(hs.dynamic){let fo=as.length;hs.encode(as,io);let mo=os.writeUpdatableValue();us.push(Ao=>{mo(Ao+fo)})}else hs.encode(os,io)}),us.forEach(hs=>{hs(os.length)});let ds=Fn.appendWriter(os);return ds+=Fn.appendWriter(as),ds}function unpack$1(Fn,Mn){let rs=[],is=Fn.subReader(0);Mn.forEach(as=>{let us=null;if(as.dynamic){let ds=Fn.readValue(),hs=is.subReader(ds.toNumber());try{us=as.decode(hs)}catch(ps){if(ps.code===Logger$1.errors.BUFFER_OVERRUN)throw ps;us=ps,us.baseType=as.name,us.name=as.localName,us.type=as.type}}else try{us=as.decode(Fn)}catch(ds){if(ds.code===Logger$1.errors.BUFFER_OVERRUN)throw ds;us=ds,us.baseType=as.name,us.name=as.localName,us.type=as.type}us!=null&&rs.push(us)});const os=Mn.reduce((as,us)=>{const ds=us.localName;return ds&&(as[ds]||(as[ds]=0),as[ds]++),as},{});Mn.forEach((as,us)=>{let ds=as.localName;if(!ds||os[ds]!==1||(ds==="length"&&(ds="_length"),rs[ds]!=null))return;const hs=rs[us];hs instanceof Error?Object.defineProperty(rs,ds,{enumerable:!0,get:()=>{throw hs}}):rs[ds]=hs});for(let as=0;as<rs.length;as++){const us=rs[as];us instanceof Error&&Object.defineProperty(rs,as,{enumerable:!0,get:()=>{throw us}})}return Object.freeze(rs)}class ArrayCoder extends Coder{constructor(Mn,rs,is){const os=Mn.type+"["+(rs>=0?rs:"")+"]",as=rs===-1||Mn.dynamic;super("array",os,is,as),this.coder=Mn,this.length=rs}defaultValue(){const Mn=this.coder.defaultValue(),rs=[];for(let is=0;is<this.length;is++)rs.push(Mn);return rs}encode(Mn,rs){Array.isArray(rs)||this._throwError("expected array value",rs);let is=this.length;is===-1&&(is=rs.length,Mn.writeValue(rs.length)),logger$i.checkArgumentCount(rs.length,is,"coder array"+(this.localName?" "+this.localName:""));let os=[];for(let as=0;as<rs.length;as++)os.push(this.coder);return pack$1(Mn,os,rs)}decode(Mn){let rs=this.length;rs===-1&&(rs=Mn.readValue().toNumber(),rs*32>Mn._data.length&&logger$i.throwError("insufficient data length",Logger$1.errors.BUFFER_OVERRUN,{length:Mn._data.length,count:rs}));let is=[];for(let os=0;os<rs;os++)is.push(new AnonymousCoder(this.coder));return Mn.coerce(this.name,unpack$1(Mn,is))}}class BooleanCoder extends Coder{constructor(Mn){super("bool","bool",Mn,!1)}defaultValue(){return!1}encode(Mn,rs){return Mn.writeValue(rs?1:0)}decode(Mn){return Mn.coerce(this.type,!Mn.readValue().isZero())}}class DynamicBytesCoder extends Coder{constructor(Mn,rs){super(Mn,Mn,rs,!0)}defaultValue(){return"0x"}encode(Mn,rs){rs=arrayify(rs);let is=Mn.writeValue(rs.length);return is+=Mn.writeBytes(rs),is}decode(Mn){return Mn.readBytes(Mn.readValue().toNumber(),!0)}}class BytesCoder extends DynamicBytesCoder{constructor(Mn){super("bytes",Mn)}decode(Mn){return Mn.coerce(this.name,hexlify(super.decode(Mn)))}}class FixedBytesCoder extends Coder{constructor(Mn,rs){let is="bytes"+String(Mn);super(is,is,rs,!1),this.size=Mn}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(Mn,rs){let is=arrayify(rs);return is.length!==this.size&&this._throwError("incorrect data length",rs),Mn.writeBytes(is)}decode(Mn){return Mn.coerce(this.name,hexlify(Mn.readBytes(this.size)))}}class NullCoder extends Coder{constructor(Mn){super("null","",Mn,!1)}defaultValue(){return null}encode(Mn,rs){return rs!=null&&this._throwError("not null",rs),Mn.writeBytes([])}decode(Mn){return Mn.readBytes(0),Mn.coerce(this.name,null)}}const AddressZero="0x0000000000000000000000000000000000000000",NegativeOne$1=BigNumber$1.from(-1),Zero$1=BigNumber$1.from(0),One$1=BigNumber$1.from(1),MaxUint256$1=BigNumber$1.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),HashZero="0x0000000000000000000000000000000000000000000000000000000000000000";class NumberCoder extends Coder{constructor(Mn,rs,is){const os=(rs?"int":"uint")+Mn*8;super(os,os,is,!1),this.size=Mn,this.signed=rs}defaultValue(){return 0}encode(Mn,rs){let is=BigNumber$1.from(rs),os=MaxUint256$1.mask(Mn.wordSize*8);if(this.signed){let as=os.mask(this.size*8-1);(is.gt(as)||is.lt(as.add(One$1).mul(NegativeOne$1)))&&this._throwError("value out-of-bounds",rs)}else(is.lt(Zero$1)||is.gt(os.mask(this.size*8)))&&this._throwError("value out-of-bounds",rs);return is=is.toTwos(this.size*8).mask(this.size*8),this.signed&&(is=is.fromTwos(this.size*8).toTwos(8*Mn.wordSize)),Mn.writeValue(is)}decode(Mn){let rs=Mn.readValue().mask(this.size*8);return this.signed&&(rs=rs.fromTwos(this.size*8)),Mn.coerce(this.name,rs)}}const version$f="strings/5.7.0",logger$h=new Logger$1(version$f);var UnicodeNormalizationForm;(function(Fn){Fn.current="",Fn.NFC="NFC",Fn.NFD="NFD",Fn.NFKC="NFKC",Fn.NFKD="NFKD"})(UnicodeNormalizationForm||(UnicodeNormalizationForm={}));var Utf8ErrorReason;(function(Fn){Fn.UNEXPECTED_CONTINUE="unexpected continuation byte",Fn.BAD_PREFIX="bad codepoint prefix",Fn.OVERRUN="string overrun",Fn.MISSING_CONTINUE="missing continuation byte",Fn.OUT_OF_RANGE="out of UTF-8 range",Fn.UTF16_SURROGATE="UTF-16 surrogate",Fn.OVERLONG="overlong representation"})(Utf8ErrorReason||(Utf8ErrorReason={}));function errorFunc(Fn,Mn,rs,is,os){return logger$h.throwArgumentError(`invalid codepoint at offset ${Mn}; ${Fn}`,"bytes",rs)}function ignoreFunc(Fn,Mn,rs,is,os){if(Fn===Utf8ErrorReason.BAD_PREFIX||Fn===Utf8ErrorReason.UNEXPECTED_CONTINUE){let as=0;for(let us=Mn+1;us<rs.length&&rs[us]>>6===2;us++)as++;return as}return Fn===Utf8ErrorReason.OVERRUN?rs.length-Mn-1:0}function replaceFunc(Fn,Mn,rs,is,os){return Fn===Utf8ErrorReason.OVERLONG?(is.push(os),0):(is.push(65533),ignoreFunc(Fn,Mn,rs))}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(Fn,Mn){Mn==null&&(Mn=Utf8ErrorFuncs.error),Fn=arrayify(Fn);const rs=[];let is=0;for(;is<Fn.length;){const os=Fn[is++];if(!(os>>7)){rs.push(os);continue}let as=null,us=null;if((os&224)===192)as=1,us=127;else if((os&240)===224)as=2,us=2047;else if((os&248)===240)as=3,us=65535;else{(os&192)===128?is+=Mn(Utf8ErrorReason.UNEXPECTED_CONTINUE,is-1,Fn,rs):is+=Mn(Utf8ErrorReason.BAD_PREFIX,is-1,Fn,rs);continue}if(is-1+as>=Fn.length){is+=Mn(Utf8ErrorReason.OVERRUN,is-1,Fn,rs);continue}let ds=os&(1<<8-as-1)-1;for(let hs=0;hs<as;hs++){let ps=Fn[is];if((ps&192)!=128){is+=Mn(Utf8ErrorReason.MISSING_CONTINUE,is,Fn,rs),ds=null;break}ds=ds<<6|ps&63,is++}if(ds!==null){if(ds>1114111){is+=Mn(Utf8ErrorReason.OUT_OF_RANGE,is-1-as,Fn,rs,ds);continue}if(ds>=55296&&ds<=57343){is+=Mn(Utf8ErrorReason.UTF16_SURROGATE,is-1-as,Fn,rs,ds);continue}if(ds<=us){is+=Mn(Utf8ErrorReason.OVERLONG,is-1-as,Fn,rs,ds);continue}rs.push(ds)}}return rs}function toUtf8Bytes(Fn,Mn=UnicodeNormalizationForm.current){Mn!=UnicodeNormalizationForm.current&&(logger$h.checkNormalize(),Fn=Fn.normalize(Mn));let rs=[];for(let is=0;is<Fn.length;is++){const os=Fn.charCodeAt(is);if(os<128)rs.push(os);else if(os<2048)rs.push(os>>6|192),rs.push(os&63|128);else if((os&64512)==55296){is++;const as=Fn.charCodeAt(is);if(is>=Fn.length||(as&64512)!==56320)throw new Error("invalid utf-8 string");const us=65536+((os&1023)<<10)+(as&1023);rs.push(us>>18|240),rs.push(us>>12&63|128),rs.push(us>>6&63|128),rs.push(us&63|128)}else rs.push(os>>12|224),rs.push(os>>6&63|128),rs.push(os&63|128)}return arrayify(rs)}function _toUtf8String(Fn){return Fn.map(Mn=>Mn<=65535?String.fromCharCode(Mn):(Mn-=65536,String.fromCharCode((Mn>>10&1023)+55296,(Mn&1023)+56320))).join("")}function toUtf8String(Fn,Mn){return _toUtf8String(getUtf8CodePoints(Fn,Mn))}function toUtf8CodePoints(Fn,Mn=UnicodeNormalizationForm.current){return getUtf8CodePoints(toUtf8Bytes(Fn,Mn))}class StringCoder extends DynamicBytesCoder{constructor(Mn){super("string",Mn)}defaultValue(){return""}encode(Mn,rs){return super.encode(Mn,toUtf8Bytes(rs))}decode(Mn){return toUtf8String(super.decode(Mn))}}class TupleCoder extends Coder{constructor(Mn,rs){let is=!1;const os=[];Mn.forEach(us=>{us.dynamic&&(is=!0),os.push(us.type)});const as="tuple("+os.join(",")+")";super("tuple",as,rs,is),this.coders=Mn}defaultValue(){const Mn=[];this.coders.forEach(is=>{Mn.push(is.defaultValue())});const rs=this.coders.reduce((is,os)=>{const as=os.localName;return as&&(is[as]||(is[as]=0),is[as]++),is},{});return this.coders.forEach((is,os)=>{let as=is.localName;!as||rs[as]!==1||(as==="length"&&(as="_length"),Mn[as]==null&&(Mn[as]=Mn[os]))}),Object.freeze(Mn)}encode(Mn,rs){return pack$1(Mn,this.coders,rs)}decode(Mn){return Mn.coerce(this.name,unpack$1(Mn,this.coders))}}const logger$g=new Logger$1(version$i),paramTypeBytes=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);class AbiCoder{constructor(Mn){defineReadOnly(this,"coerceFunc",Mn||null)}_getCoder(Mn){switch(Mn.baseType){case"address":return new AddressCoder(Mn.name);case"bool":return new BooleanCoder(Mn.name);case"string":return new StringCoder(Mn.name);case"bytes":return new BytesCoder(Mn.name);case"array":return new ArrayCoder(this._getCoder(Mn.arrayChildren),Mn.arrayLength,Mn.name);case"tuple":return new TupleCoder((Mn.components||[]).map(is=>this._getCoder(is)),Mn.name);case"":return new NullCoder(Mn.name)}let rs=Mn.type.match(paramTypeNumber);if(rs){let is=parseInt(rs[2]||"256");return(is===0||is>256||is%8!==0)&&logger$g.throwArgumentError("invalid "+rs[1]+" bit length","param",Mn),new NumberCoder(is/8,rs[1]==="int",Mn.name)}if(rs=Mn.type.match(paramTypeBytes),rs){let is=parseInt(rs[1]);return(is===0||is>32)&&logger$g.throwArgumentError("invalid bytes length","param",Mn),new FixedBytesCoder(is,Mn.name)}return logger$g.throwArgumentError("invalid type","type",Mn.type)}_getWordSize(){return 32}_getReader(Mn,rs){return new Reader(Mn,this._getWordSize(),this.coerceFunc,rs)}_getWriter(){return new Writer(this._getWordSize())}getDefaultValue(Mn){const rs=Mn.map(os=>this._getCoder(ParamType.from(os)));return new TupleCoder(rs,"_").defaultValue()}encode(Mn,rs){Mn.length!==rs.length&&logger$g.throwError("types/values length mismatch",Logger$1.errors.INVALID_ARGUMENT,{count:{types:Mn.length,values:rs.length},value:{types:Mn,values:rs}});const is=Mn.map(us=>this._getCoder(ParamType.from(us))),os=new TupleCoder(is,"_"),as=this._getWriter();return os.encode(as,rs),as.data}decode(Mn,rs,is){const os=Mn.map(us=>this._getCoder(ParamType.from(us)));return new TupleCoder(os,"_").decode(this._getReader(arrayify(rs),is))}}const defaultAbiCoder=new AbiCoder;function id(Fn){return keccak256(toUtf8Bytes(Fn))}const version$e="hash/5.7.0";function decode$4(Fn){Fn=atob(Fn);const Mn=[];for(let rs=0;rs<Fn.length;rs++)Mn.push(Fn.charCodeAt(rs));return arrayify(Mn)}function encode$5(Fn){Fn=arrayify(Fn);let Mn="";for(let rs=0;rs<Fn.length;rs++)Mn+=String.fromCharCode(Fn[rs]);return btoa(Mn)}function flat(Fn,Mn){Mn==null&&(Mn=1);const rs=[],is=rs.forEach,os=function(as,us){is.call(as,function(ds){us>0&&Array.isArray(ds)?os(ds,us-1):rs.push(ds)})};return os(Fn,Mn),rs}function fromEntries(Fn){const Mn={};for(let rs=0;rs<Fn.length;rs++){const is=Fn[rs];Mn[is[0]]=is[1]}return Mn}function decode_arithmetic$1(Fn){let Mn=0;function rs(){return Fn[Mn++]<<8|Fn[Mn++]}let is=rs(),os=1,as=[0,1];for(let _l=1;_l<is;_l++)as.push(os+=rs());let us=rs(),ds=Mn;Mn+=us;let hs=0,ps=0;function io(){return hs==0&&(ps=ps<<8|Fn[Mn++],hs=8),ps>>--hs&1}const fo=31,mo=Math.pow(2,fo),Ao=mo>>>1,$o=Ao>>1,Lo=mo-1;let Go=0;for(let _l=0;_l<fo;_l++)Go=Go<<1|io();let Yo=[],Wo=0,Jo=mo;for(;;){let _l=Math.floor(((Go-Wo+1)*os-1)/Jo),Tl=0,Sl=is;for(;Sl-Tl>1;){let Dl=Tl+Sl>>>1;_l<as[Dl]?Sl=Dl:Tl=Dl}if(Tl==0)break;Yo.push(Tl);let $l=Wo+Math.floor(Jo*as[Tl]/os),Pl=Wo+Math.floor(Jo*as[Tl+1]/os)-1;for(;!(($l^Pl)&Ao);)Go=Go<<1&Lo|io(),$l=$l<<1&Lo,Pl=Pl<<1&Lo|1;for(;$l&~Pl&$o;)Go=Go&Ao|Go<<1&Lo>>>1|io(),$l=$l<<1^Ao,Pl=(Pl^Ao)<<1|Ao|1;Wo=$l,Jo=1+Pl-$l}let xl=is-4;return Yo.map(_l=>{switch(_l-xl){case 3:return xl+65792+(Fn[ds++]<<16|Fn[ds++]<<8|Fn[ds++]);case 2:return xl+256+(Fn[ds++]<<8|Fn[ds++]);case 1:return xl+Fn[ds++];default:return _l-1}})}function read_payload$1(Fn){let Mn=0;return()=>Fn[Mn++]}function read_compressed_payload$1(Fn){return read_payload$1(decode_arithmetic$1(Fn))}function signed$1(Fn){return Fn&1?~Fn>>1:Fn>>1}function read_counts(Fn,Mn){let rs=Array(Fn);for(let is=0;is<Fn;is++)rs[is]=1+Mn();return rs}function read_ascending(Fn,Mn){let rs=Array(Fn);for(let is=0,os=-1;is<Fn;is++)rs[is]=os+=1+Mn();return rs}function read_deltas$1(Fn,Mn){let rs=Array(Fn);for(let is=0,os=0;is<Fn;is++)rs[is]=os+=signed$1(Mn());return rs}function read_member_array(Fn,Mn){let rs=read_ascending(Fn(),Fn),is=Fn(),os=read_ascending(is,Fn),as=read_counts(is,Fn);for(let us=0;us<is;us++)for(let ds=0;ds<as[us];ds++)rs.push(os[us]+ds);return Mn?rs.map(us=>Mn[us]):rs}function read_mapped_map(Fn){let Mn=[];for(;;){let rs=Fn();if(rs==0)break;Mn.push(read_linear_table$1(rs,Fn))}for(;;){let rs=Fn()-1;if(rs<0)break;Mn.push(read_replacement_table$1(rs,Fn))}return fromEntries(flat(Mn))}function read_zero_terminated_array(Fn){let Mn=[];for(;;){let rs=Fn();if(rs==0)break;Mn.push(rs)}return Mn}function read_transposed$1(Fn,Mn,rs){let is=Array(Fn).fill(void 0).map(()=>[]);for(let os=0;os<Mn;os++)read_deltas$1(Fn,rs).forEach((as,us)=>is[us].push(as));return is}function read_linear_table$1(Fn,Mn){let rs=1+Mn(),is=Mn(),os=read_zero_terminated_array(Mn),as=read_transposed$1(os.length,1+Fn,Mn);return flat(as.map((us,ds)=>{const hs=us[0],ps=us.slice(1);return Array(os[ds]).fill(void 0).map((io,fo)=>{let mo=fo*is;return[hs+fo*rs,ps.map(Ao=>Ao+mo)]})}))}function read_replacement_table$1(Fn,Mn){let rs=1+Mn();return read_transposed$1(rs,1+Fn,Mn).map(os=>[os[0],os.slice(1)])}function read_emoji_trie(Fn){let Mn=read_member_array(Fn).sort((is,os)=>is-os);return rs();function rs(){let is=[];for(;;){let ps=read_member_array(Fn,Mn);if(ps.length==0)break;is.push({set:new Set(ps),node:rs()})}is.sort((ps,io)=>io.set.size-ps.set.size);let os=Fn(),as=os%3;os=os/3|0;let us=!!(os&1);os>>=1;let ds=os==1,hs=os==2;return{branches:is,valid:as,fe0f:us,save:ds,check:hs}}}function getData(){return read_compressed_payload$1(decode$4("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const r$c=getData(),VALID$1=new Set(read_member_array(r$c)),IGNORED$1=new Set(read_member_array(r$c)),MAPPED$1=read_mapped_map(r$c),EMOJI_ROOT$1=read_emoji_trie(r$c),HYPHEN$1=45,UNDERSCORE=95;function explode_cp$1(Fn){return toUtf8CodePoints(Fn)}function filter_fe0f$1(Fn){return Fn.filter(Mn=>Mn!=65039)}function ens_normalize_post_check(Fn){for(let Mn of Fn.split(".")){let rs=explode_cp$1(Mn);try{for(let is=rs.lastIndexOf(UNDERSCORE)-1;is>=0;is--)if(rs[is]!==UNDERSCORE)throw new Error("underscore only allowed at start");if(rs.length>=4&&rs.every(is=>is<128)&&rs[2]===HYPHEN$1&&rs[3]===HYPHEN$1)throw new Error("invalid label extension")}catch(is){throw new Error(`Invalid label "${Mn}": ${is.message}`)}}return Fn}function ens_normalize$1(Fn){return ens_normalize_post_check(normalize$1(Fn,filter_fe0f$1))}function normalize$1(Fn,Mn){let rs=explode_cp$1(Fn).reverse(),is=[];for(;rs.length;){let os=consume_emoji_reversed$1(rs);if(os){is.push(...Mn(os));continue}let as=rs.pop();if(VALID$1.has(as)){is.push(as);continue}if(IGNORED$1.has(as))continue;let us=MAPPED$1[as];if(us){is.push(...us);continue}throw new Error(`Disallowed codepoint: 0x${as.toString(16).toUpperCase()}`)}return ens_normalize_post_check(nfc$1(String.fromCodePoint(...is)))}function nfc$1(Fn){return Fn.normalize("NFC")}function consume_emoji_reversed$1(Fn,Mn){var rs;let is=EMOJI_ROOT$1,os,as,us=[],ds=Fn.length;for(;ds;){let hs=Fn[--ds];if(is=(rs=is.branches.find(ps=>ps.set.has(hs)))===null||rs===void 0?void 0:rs.node,!is)break;if(is.save)as=hs;else if(is.check&&hs===as)break;us.push(hs),is.fe0f&&(us.push(65039),ds>0&&Fn[ds-1]==65039&&ds--),is.valid&&(os=us.slice(),is.valid==2&&os.splice(1,1),Fn.length=ds)}return os}const logger$f=new Logger$1(version$e),Zeros$1=new Uint8Array(32);Zeros$1.fill(0);function checkComponent(Fn){if(Fn.length===0)throw new Error("invalid ENS name; empty component");return Fn}function ensNameSplit(Fn){const Mn=toUtf8Bytes(ens_normalize$1(Fn)),rs=[];if(Fn.length===0)return rs;let is=0;for(let os=0;os<Mn.length;os++)Mn[os]===46&&(rs.push(checkComponent(Mn.slice(is,os))),is=os+1);if(is>=Mn.length)throw new Error("invalid ENS name; empty component");return rs.push(checkComponent(Mn.slice(is))),rs}function namehash(Fn){typeof Fn!="string"&&logger$f.throwArgumentError("invalid ENS name; not a string","name",Fn);let Mn=Zeros$1;const rs=ensNameSplit(Fn);for(;rs.length;)Mn=keccak256(concat$2([Mn,keccak256(rs.pop())]));return hexlify(Mn)}function dnsEncode(Fn){return hexlify(concat$2(ensNameSplit(Fn).map(Mn=>{if(Mn.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const rs=new Uint8Array(Mn.length+1);return rs.set(Mn,1),rs[0]=rs.length-1,rs})))+"00"}var __awaiter$8=function(Fn,Mn,rs,is){function os(as){return as instanceof rs?as:new rs(function(us){us(as)})}return new(rs||(rs=Promise))(function(as,us){function ds(io){try{ps(is.next(io))}catch(fo){us(fo)}}function hs(io){try{ps(is.throw(io))}catch(fo){us(fo)}}function ps(io){io.done?as(io.value):os(io.value).then(ds,hs)}ps((is=is.apply(Fn,Mn||[])).next())})};const logger$e=new Logger$1(version$e),padding=new Uint8Array(32);padding.fill(0);const NegativeOne=BigNumber$1.from(-1),Zero=BigNumber$1.from(0),One=BigNumber$1.from(1),MaxUint256=BigNumber$1.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(Fn){const Mn=arrayify(Fn),rs=Mn.length%32;return rs?hexConcat([Mn,padding.slice(rs)]):hexlify(Mn)}const hexTrue=hexZeroPad(One.toHexString(),32),hexFalse=hexZeroPad(Zero.toHexString(),32),domainFieldTypes={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},domainFieldNames=["name","version","chainId","verifyingContract","salt"];function checkString(Fn){return function(Mn){return typeof Mn!="string"&&logger$e.throwArgumentError(`invalid domain value for ${JSON.stringify(Fn)}`,`domain.${Fn}`,Mn),Mn}}const domainChecks={name:checkString("name"),version:checkString("version"),chainId:function(Fn){try{return BigNumber$1.from(Fn).toString()}catch{}return logger$e.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",Fn)},verifyingContract:function(Fn){try{return getAddress(Fn).toLowerCase()}catch{}return logger$e.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",Fn)},salt:function(Fn){try{const Mn=arrayify(Fn);if(Mn.length!==32)throw new Error("bad length");return hexlify(Mn)}catch{}return logger$e.throwArgumentError('invalid domain value "salt"',"domain.salt",Fn)}};function getBaseEncoder(Fn){{const Mn=Fn.match(/^(u?)int(\d*)$/);if(Mn){const rs=Mn[1]==="",is=parseInt(Mn[2]||"256");(is%8!==0||is>256||Mn[2]&&Mn[2]!==String(is))&&logger$e.throwArgumentError("invalid numeric width","type",Fn);const os=MaxUint256.mask(rs?is-1:is),as=rs?os.add(One).mul(NegativeOne):Zero;return function(us){const ds=BigNumber$1.from(us);return(ds.lt(as)||ds.gt(os))&&logger$e.throwArgumentError(`value out-of-bounds for ${Fn}`,"value",us),hexZeroPad(ds.toTwos(256).toHexString(),32)}}}{const Mn=Fn.match(/^bytes(\d+)$/);if(Mn){const rs=parseInt(Mn[1]);return(rs===0||rs>32||Mn[1]!==String(rs))&&logger$e.throwArgumentError("invalid bytes width","type",Fn),function(is){return arrayify(is).length!==rs&&logger$e.throwArgumentError(`invalid length for ${Fn}`,"value",is),hexPadRight(is)}}}switch(Fn){case"address":return function(Mn){return hexZeroPad(getAddress(Mn),32)};case"bool":return function(Mn){return Mn?hexTrue:hexFalse};case"bytes":return function(Mn){return keccak256(Mn)};case"string":return function(Mn){return id(Mn)}}return null}function encodeType(Fn,Mn){return`${Fn}(${Mn.map(({name:rs,type:is})=>is+" "+rs).join(",")})`}class TypedDataEncoder{constructor(Mn){defineReadOnly(this,"types",Object.freeze(deepCopy(Mn))),defineReadOnly(this,"_encoderCache",{}),defineReadOnly(this,"_types",{});const rs={},is={},os={};Object.keys(Mn).forEach(ds=>{rs[ds]={},is[ds]=[],os[ds]={}});for(const ds in Mn){const hs={};Mn[ds].forEach(ps=>{hs[ps.name]&&logger$e.throwArgumentError(`duplicate variable name ${JSON.stringify(ps.name)} in ${JSON.stringify(ds)}`,"types",Mn),hs[ps.name]=!0;const io=ps.type.match(/^([^\x5b]*)(\x5b|$)/)[1];io===ds&&logger$e.throwArgumentError(`circular type reference to ${JSON.stringify(io)}`,"types",Mn),!getBaseEncoder(io)&&(is[io]||logger$e.throwArgumentError(`unknown type ${JSON.stringify(io)}`,"types",Mn),is[io].push(ds),rs[ds][io]=!0)})}const as=Object.keys(is).filter(ds=>is[ds].length===0);as.length===0?logger$e.throwArgumentError("missing primary type","types",Mn):as.length>1&&logger$e.throwArgumentError(`ambiguous primary types or unused types: ${as.map(ds=>JSON.stringify(ds)).join(", ")}`,"types",Mn),defineReadOnly(this,"primaryType",as[0]);function us(ds,hs){hs[ds]&&logger$e.throwArgumentError(`circular type reference to ${JSON.stringify(ds)}`,"types",Mn),hs[ds]=!0,Object.keys(rs[ds]).forEach(ps=>{is[ps]&&(us(ps,hs),Object.keys(hs).forEach(io=>{os[io][ps]=!0}))}),delete hs[ds]}us(this.primaryType,{});for(const ds in os){const hs=Object.keys(os[ds]);hs.sort(),this._types[ds]=encodeType(ds,Mn[ds])+hs.map(ps=>encodeType(ps,Mn[ps])).join("")}}getEncoder(Mn){let rs=this._encoderCache[Mn];return rs||(rs=this._encoderCache[Mn]=this._getEncoder(Mn)),rs}_getEncoder(Mn){{const os=getBaseEncoder(Mn);if(os)return os}const rs=Mn.match(/^(.*)(\x5b(\d*)\x5d)$/);if(rs){const os=rs[1],as=this.getEncoder(os),us=parseInt(rs[3]);return ds=>{us>=0&&ds.length!==us&&logger$e.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",ds);let hs=ds.map(as);return this._types[os]&&(hs=hs.map(keccak256)),keccak256(hexConcat(hs))}}const is=this.types[Mn];if(is){const os=id(this._types[Mn]);return as=>{const us=is.map(({name:ds,type:hs})=>{const ps=this.getEncoder(hs)(as[ds]);return this._types[hs]?keccak256(ps):ps});return us.unshift(os),hexConcat(us)}}return logger$e.throwArgumentError(`unknown type: ${Mn}`,"type",Mn)}encodeType(Mn){const rs=this._types[Mn];return rs||logger$e.throwArgumentError(`unknown type: ${JSON.stringify(Mn)}`,"name",Mn),rs}encodeData(Mn,rs){return this.getEncoder(Mn)(rs)}hashStruct(Mn,rs){return keccak256(this.encodeData(Mn,rs))}encode(Mn){return this.encodeData(this.primaryType,Mn)}hash(Mn){return this.hashStruct(this.primaryType,Mn)}_visit(Mn,rs,is){if(getBaseEncoder(Mn))return is(Mn,rs);const os=Mn.match(/^(.*)(\x5b(\d*)\x5d)$/);if(os){const us=os[1],ds=parseInt(os[3]);return ds>=0&&rs.length!==ds&&logger$e.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",rs),rs.map(hs=>this._visit(us,hs,is))}const as=this.types[Mn];return as?as.reduce((us,{name:ds,type:hs})=>(us[ds]=this._visit(hs,rs[ds],is),us),{}):logger$e.throwArgumentError(`unknown type: ${Mn}`,"type",Mn)}visit(Mn,rs){return this._visit(this.primaryType,Mn,rs)}static from(Mn){return new TypedDataEncoder(Mn)}static getPrimaryType(Mn){return TypedDataEncoder.from(Mn).primaryType}static hashStruct(Mn,rs,is){return TypedDataEncoder.from(rs).hashStruct(Mn,is)}static hashDomain(Mn){const rs=[];for(const is in Mn){const os=domainFieldTypes[is];os||logger$e.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(is)}`,"domain",Mn),rs.push({name:is,type:os})}return rs.sort((is,os)=>domainFieldNames.indexOf(is.name)-domainFieldNames.indexOf(os.name)),TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:rs},Mn)}static encode(Mn,rs,is){return hexConcat(["0x1901",TypedDataEncoder.hashDomain(Mn),TypedDataEncoder.from(rs).hash(is)])}static hash(Mn,rs,is){return keccak256(TypedDataEncoder.encode(Mn,rs,is))}static resolveNames(Mn,rs,is,os){return __awaiter$8(this,void 0,void 0,function*(){Mn=shallowCopy(Mn);const as={};Mn.verifyingContract&&!isHexString(Mn.verifyingContract,20)&&(as[Mn.verifyingContract]="0x");const us=TypedDataEncoder.from(rs);us.visit(is,(ds,hs)=>(ds==="address"&&!isHexString(hs,20)&&(as[hs]="0x"),hs));for(const ds in as)as[ds]=yield os(ds);return Mn.verifyingContract&&as[Mn.verifyingContract]&&(Mn.verifyingContract=as[Mn.verifyingContract]),is=us.visit(is,(ds,hs)=>ds==="address"&&as[hs]?as[hs]:hs),{domain:Mn,value:is}})}static getPayload(Mn,rs,is){TypedDataEncoder.hashDomain(Mn);const os={},as=[];domainFieldNames.forEach(hs=>{const ps=Mn[hs];ps!=null&&(os[hs]=domainChecks[hs](ps),as.push({name:hs,type:domainFieldTypes[hs]}))});const us=TypedDataEncoder.from(rs),ds=shallowCopy(rs);return ds.EIP712Domain?logger$e.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",rs):ds.EIP712Domain=as,us.encode(is),{types:ds,domain:os,primaryType:us.primaryType,message:us.visit(is,(hs,ps)=>{if(hs.match(/^bytes(\d*)/))return hexlify(arrayify(ps));if(hs.match(/^u?int/))return BigNumber$1.from(ps).toString();switch(hs){case"address":return ps.toLowerCase();case"bool":return!!ps;case"string":return typeof ps!="string"&&logger$e.throwArgumentError("invalid string","value",ps),ps}return logger$e.throwArgumentError("unsupported type","type",hs)})}}}const logger$d=new Logger$1(version$i);class LogDescription extends Description{}class TransactionDescription extends Description{}class ErrorDescription extends Description{}class Indexed extends Description{static isIndexed(Mn){return!!(Mn&&Mn._isIndexed)}}const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function wrapAccessError(Fn,Mn){const rs=new Error(`deferred error during ABI decoding triggered accessing ${Fn}`);return rs.error=Mn,rs}class Interface{constructor(Mn){let rs=[];typeof Mn=="string"?rs=JSON.parse(Mn):rs=Mn,defineReadOnly(this,"fragments",rs.map(is=>Fragment$1.from(is)).filter(is=>is!=null)),defineReadOnly(this,"_abiCoder",getStatic(new.target,"getAbiCoder")()),defineReadOnly(this,"functions",{}),defineReadOnly(this,"errors",{}),defineReadOnly(this,"events",{}),defineReadOnly(this,"structs",{}),this.fragments.forEach(is=>{let os=null;switch(is.type){case"constructor":if(this.deploy){logger$d.warn("duplicate definition - constructor");return}defineReadOnly(this,"deploy",is);return;case"function":os=this.functions;break;case"event":os=this.events;break;case"error":os=this.errors;break;default:return}let as=is.format();if(os[as]){logger$d.warn("duplicate definition - "+as);return}os[as]=is}),this.deploy||defineReadOnly(this,"deploy",ConstructorFragment.from({payable:!1,type:"constructor"})),defineReadOnly(this,"_isInterface",!0)}format(Mn){Mn||(Mn=FormatTypes.full),Mn===FormatTypes.sighash&&logger$d.throwArgumentError("interface does not support formatting sighash","format",Mn);const rs=this.fragments.map(is=>is.format(Mn));return Mn===FormatTypes.json?JSON.stringify(rs.map(is=>JSON.parse(is))):rs}static getAbiCoder(){return defaultAbiCoder}static getAddress(Mn){return getAddress(Mn)}static getSighash(Mn){return hexDataSlice(id(Mn.format()),0,4)}static getEventTopic(Mn){return id(Mn.format())}getFunction(Mn){if(isHexString(Mn)){for(const is in this.functions)if(Mn===this.getSighash(is))return this.functions[is];logger$d.throwArgumentError("no matching function","sighash",Mn)}if(Mn.indexOf("(")===-1){const is=Mn.trim(),os=Object.keys(this.functions).filter(as=>as.split("(")[0]===is);return os.length===0?logger$d.throwArgumentError("no matching function","name",is):os.length>1&&logger$d.throwArgumentError("multiple matching functions","name",is),this.functions[os[0]]}const rs=this.functions[FunctionFragment.fromString(Mn).format()];return rs||logger$d.throwArgumentError("no matching function","signature",Mn),rs}getEvent(Mn){if(isHexString(Mn)){const is=Mn.toLowerCase();for(const os in this.events)if(is===this.getEventTopic(os))return this.events[os];logger$d.throwArgumentError("no matching event","topichash",is)}if(Mn.indexOf("(")===-1){const is=Mn.trim(),os=Object.keys(this.events).filter(as=>as.split("(")[0]===is);return os.length===0?logger$d.throwArgumentError("no matching event","name",is):os.length>1&&logger$d.throwArgumentError("multiple matching events","name",is),this.events[os[0]]}const rs=this.events[EventFragment.fromString(Mn).format()];return rs||logger$d.throwArgumentError("no matching event","signature",Mn),rs}getError(Mn){if(isHexString(Mn)){const is=getStatic(this.constructor,"getSighash");for(const os in this.errors){const as=this.errors[os];if(Mn===is(as))return this.errors[os]}logger$d.throwArgumentError("no matching error","sighash",Mn)}if(Mn.indexOf("(")===-1){const is=Mn.trim(),os=Object.keys(this.errors).filter(as=>as.split("(")[0]===is);return os.length===0?logger$d.throwArgumentError("no matching error","name",is):os.length>1&&logger$d.throwArgumentError("multiple matching errors","name",is),this.errors[os[0]]}const rs=this.errors[FunctionFragment.fromString(Mn).format()];return rs||logger$d.throwArgumentError("no matching error","signature",Mn),rs}getSighash(Mn){if(typeof Mn=="string")try{Mn=this.getFunction(Mn)}catch(rs){try{Mn=this.getError(Mn)}catch{throw rs}}return getStatic(this.constructor,"getSighash")(Mn)}getEventTopic(Mn){return typeof Mn=="string"&&(Mn=this.getEvent(Mn)),getStatic(this.constructor,"getEventTopic")(Mn)}_decodeParams(Mn,rs){return this._abiCoder.decode(Mn,rs)}_encodeParams(Mn,rs){return this._abiCoder.encode(Mn,rs)}encodeDeploy(Mn){return this._encodeParams(this.deploy.inputs,Mn||[])}decodeErrorResult(Mn,rs){typeof Mn=="string"&&(Mn=this.getError(Mn));const is=arrayify(rs);return hexlify(is.slice(0,4))!==this.getSighash(Mn)&&logger$d.throwArgumentError(`data signature does not match error ${Mn.name}.`,"data",hexlify(is)),this._decodeParams(Mn.inputs,is.slice(4))}encodeErrorResult(Mn,rs){return typeof Mn=="string"&&(Mn=this.getError(Mn)),hexlify(concat$2([this.getSighash(Mn),this._encodeParams(Mn.inputs,rs||[])]))}decodeFunctionData(Mn,rs){typeof Mn=="string"&&(Mn=this.getFunction(Mn));const is=arrayify(rs);return hexlify(is.slice(0,4))!==this.getSighash(Mn)&&logger$d.throwArgumentError(`data signature does not match function ${Mn.name}.`,"data",hexlify(is)),this._decodeParams(Mn.inputs,is.slice(4))}encodeFunctionData(Mn,rs){return typeof Mn=="string"&&(Mn=this.getFunction(Mn)),hexlify(concat$2([this.getSighash(Mn),this._encodeParams(Mn.inputs,rs||[])]))}decodeFunctionResult(Mn,rs){typeof Mn=="string"&&(Mn=this.getFunction(Mn));let is=arrayify(rs),os=null,as="",us=null,ds=null,hs=null;switch(is.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(Mn.outputs,is)}catch{}break;case 4:{const ps=hexlify(is.slice(0,4)),io=BuiltinErrors[ps];if(io)us=this._abiCoder.decode(io.inputs,is.slice(4)),ds=io.name,hs=io.signature,io.reason&&(os=us[0]),ds==="Error"?as=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(us[0])}`:ds==="Panic"&&(as=`; VM Exception while processing transaction: reverted with panic code ${us[0]}`);else try{const fo=this.getError(ps);us=this._abiCoder.decode(fo.inputs,is.slice(4)),ds=fo.name,hs=fo.format()}catch{}break}}return logger$d.throwError("call revert exception"+as,Logger$1.errors.CALL_EXCEPTION,{method:Mn.format(),data:hexlify(rs),errorArgs:us,errorName:ds,errorSignature:hs,reason:os})}encodeFunctionResult(Mn,rs){return typeof Mn=="string"&&(Mn=this.getFunction(Mn)),hexlify(this._abiCoder.encode(Mn.outputs,rs||[]))}encodeFilterTopics(Mn,rs){typeof Mn=="string"&&(Mn=this.getEvent(Mn)),rs.length>Mn.inputs.length&&logger$d.throwError("too many arguments for "+Mn.format(),Logger$1.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:rs});let is=[];Mn.anonymous||is.push(this.getEventTopic(Mn));const os=(as,us)=>as.type==="string"?id(us):as.type==="bytes"?keccak256(hexlify(us)):(as.type==="bool"&&typeof us=="boolean"&&(us=us?"0x01":"0x00"),as.type.match(/^u?int/)&&(us=BigNumber$1.from(us).toHexString()),as.type==="address"&&this._abiCoder.encode(["address"],[us]),hexZeroPad(hexlify(us),32));for(rs.forEach((as,us)=>{let ds=Mn.inputs[us];if(!ds.indexed){as!=null&&logger$d.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+ds.name,as);return}as==null?is.push(null):ds.baseType==="array"||ds.baseType==="tuple"?logger$d.throwArgumentError("filtering with tuples or arrays not supported","contract."+ds.name,as):Array.isArray(as)?is.push(as.map(hs=>os(ds,hs))):is.push(os(ds,as))});is.length&&is[is.length-1]===null;)is.pop();return is}encodeEventLog(Mn,rs){typeof Mn=="string"&&(Mn=this.getEvent(Mn));const is=[],os=[],as=[];return Mn.anonymous||is.push(this.getEventTopic(Mn)),rs.length!==Mn.inputs.length&&logger$d.throwArgumentError("event arguments/values mismatch","values",rs),Mn.inputs.forEach((us,ds)=>{const hs=rs[ds];if(us.indexed)if(us.type==="string")is.push(id(hs));else if(us.type==="bytes")is.push(keccak256(hs));else{if(us.baseType==="tuple"||us.baseType==="array")throw new Error("not implemented");is.push(this._abiCoder.encode([us.type],[hs]))}else os.push(us),as.push(hs)}),{data:this._abiCoder.encode(os,as),topics:is}}decodeEventLog(Mn,rs,is){if(typeof Mn=="string"&&(Mn=this.getEvent(Mn)),is!=null&&!Mn.anonymous){let mo=this.getEventTopic(Mn);(!isHexString(is[0],32)||is[0].toLowerCase()!==mo)&&logger$d.throwError("fragment/topic mismatch",Logger$1.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:mo,value:is[0]}),is=is.slice(1)}let os=[],as=[],us=[];Mn.inputs.forEach((mo,Ao)=>{mo.indexed?mo.type==="string"||mo.type==="bytes"||mo.baseType==="tuple"||mo.baseType==="array"?(os.push(ParamType.fromObject({type:"bytes32",name:mo.name})),us.push(!0)):(os.push(mo),us.push(!1)):(as.push(mo),us.push(!1))});let ds=is!=null?this._abiCoder.decode(os,concat$2(is)):null,hs=this._abiCoder.decode(as,rs,!0),ps=[],io=0,fo=0;Mn.inputs.forEach((mo,Ao)=>{if(mo.indexed)if(ds==null)ps[Ao]=new Indexed({_isIndexed:!0,hash:null});else if(us[Ao])ps[Ao]=new Indexed({_isIndexed:!0,hash:ds[fo++]});else try{ps[Ao]=ds[fo++]}catch($o){ps[Ao]=$o}else try{ps[Ao]=hs[io++]}catch($o){ps[Ao]=$o}if(mo.name&&ps[mo.name]==null){const $o=ps[Ao];$o instanceof Error?Object.defineProperty(ps,mo.name,{enumerable:!0,get:()=>{throw wrapAccessError(`property ${JSON.stringify(mo.name)}`,$o)}}):ps[mo.name]=$o}});for(let mo=0;mo<ps.length;mo++){const Ao=ps[mo];Ao instanceof Error&&Object.defineProperty(ps,mo,{enumerable:!0,get:()=>{throw wrapAccessError(`index ${mo}`,Ao)}})}return Object.freeze(ps)}parseTransaction(Mn){let rs=this.getFunction(Mn.data.substring(0,10).toLowerCase());return rs?new TransactionDescription({args:this._abiCoder.decode(rs.inputs,"0x"+Mn.data.substring(10)),functionFragment:rs,name:rs.name,signature:rs.format(),sighash:this.getSighash(rs),value:BigNumber$1.from(Mn.value||"0")}):null}parseLog(Mn){let rs=this.getEvent(Mn.topics[0]);return!rs||rs.anonymous?null:new LogDescription({eventFragment:rs,name:rs.name,signature:rs.format(),topic:this.getEventTopic(rs),args:this.decodeEventLog(rs,Mn.data,Mn.topics)})}parseError(Mn){const rs=hexlify(Mn);let is=this.getError(rs.substring(0,10).toLowerCase());return is?new ErrorDescription({args:this._abiCoder.decode(is.inputs,"0x"+rs.substring(10)),errorFragment:is,name:is.name,signature:is.format(),sighash:this.getSighash(is)}):null}static isInterface(Mn){return!!(Mn&&Mn._isInterface)}}const version$d="abstract-provider/5.7.0";var __awaiter$7=function(Fn,Mn,rs,is){function os(as){return as instanceof rs?as:new rs(function(us){us(as)})}return new(rs||(rs=Promise))(function(as,us){function ds(io){try{ps(is.next(io))}catch(fo){us(fo)}}function hs(io){try{ps(is.throw(io))}catch(fo){us(fo)}}function ps(io){io.done?as(io.value):os(io.value).then(ds,hs)}ps((is=is.apply(Fn,Mn||[])).next())})};const logger$c=new Logger$1(version$d);class ForkEvent extends Description{static isForkEvent(Mn){return!!(Mn&&Mn._isForkEvent)}}class Provider{constructor(){logger$c.checkAbstract(new.target,Provider),defineReadOnly(this,"_isProvider",!0)}getFeeData(){return __awaiter$7(this,void 0,void 0,function*(){const{block:Mn,gasPrice:rs}=yield resolveProperties({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(us=>null)});let is=null,os=null,as=null;return Mn&&Mn.baseFeePerGas&&(is=Mn.baseFeePerGas,as=BigNumber$1.from("1500000000"),os=Mn.baseFeePerGas.mul(2).add(as)),{lastBaseFeePerGas:is,maxFeePerGas:os,maxPriorityFeePerGas:as,gasPrice:rs}})}addListener(Mn,rs){return this.on(Mn,rs)}removeListener(Mn,rs){return this.off(Mn,rs)}static isProvider(Mn){return!!(Mn&&Mn._isProvider)}}const version$c="abstract-signer/5.7.0";var __awaiter$6=function(Fn,Mn,rs,is){function os(as){return as instanceof rs?as:new rs(function(us){us(as)})}return new(rs||(rs=Promise))(function(as,us){function ds(io){try{ps(is.next(io))}catch(fo){us(fo)}}function hs(io){try{ps(is.throw(io))}catch(fo){us(fo)}}function ps(io){io.done?as(io.value):os(io.value).then(ds,hs)}ps((is=is.apply(Fn,Mn||[])).next())})};const logger$b=new Logger$1(version$c),allowedTransactionKeys$1=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],forwardErrors=[Logger$1.errors.INSUFFICIENT_FUNDS,Logger$1.errors.NONCE_EXPIRED,Logger$1.errors.REPLACEMENT_UNDERPRICED];class Signer{constructor(){logger$b.checkAbstract(new.target,Signer),defineReadOnly(this,"_isSigner",!0)}getBalance(Mn){return __awaiter$6(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),Mn)})}getTransactionCount(Mn){return __awaiter$6(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),Mn)})}estimateGas(Mn){return __awaiter$6(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const rs=yield resolveProperties(this.checkTransaction(Mn));return yield this.provider.estimateGas(rs)})}call(Mn,rs){return __awaiter$6(this,void 0,void 0,function*(){this._checkProvider("call");const is=yield resolveProperties(this.checkTransaction(Mn));return yield this.provider.call(is,rs)})}sendTransaction(Mn){return __awaiter$6(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const rs=yield this.populateTransaction(Mn),is=yield this.signTransaction(rs);return yield this.provider.sendTransaction(is)})}getChainId(){return __awaiter$6(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return __awaiter$6(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return __awaiter$6(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(Mn){return __awaiter$6(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(Mn)})}checkTransaction(Mn){for(const is in Mn)allowedTransactionKeys$1.indexOf(is)===-1&&logger$b.throwArgumentError("invalid transaction key: "+is,"transaction",Mn);const rs=shallowCopy(Mn);return rs.from==null?rs.from=this.getAddress():rs.from=Promise.all([Promise.resolve(rs.from),this.getAddress()]).then(is=>(is[0].toLowerCase()!==is[1].toLowerCase()&&logger$b.throwArgumentError("from address mismatch","transaction",Mn),is[0])),rs}populateTransaction(Mn){return __awaiter$6(this,void 0,void 0,function*(){const rs=yield resolveProperties(this.checkTransaction(Mn));rs.to!=null&&(rs.to=Promise.resolve(rs.to).then(os=>__awaiter$6(this,void 0,void 0,function*(){if(os==null)return null;const as=yield this.resolveName(os);return as==null&&logger$b.throwArgumentError("provided ENS name resolves to null","tx.to",os),as})),rs.to.catch(os=>{}));const is=rs.maxFeePerGas!=null||rs.maxPriorityFeePerGas!=null;if(rs.gasPrice!=null&&(rs.type===2||is)?logger$b.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",Mn):(rs.type===0||rs.type===1)&&is&&logger$b.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",Mn),(rs.type===2||rs.type==null)&&rs.maxFeePerGas!=null&&rs.maxPriorityFeePerGas!=null)rs.type=2;else if(rs.type===0||rs.type===1)rs.gasPrice==null&&(rs.gasPrice=this.getGasPrice());else{const os=yield this.getFeeData();if(rs.type==null)if(os.maxFeePerGas!=null&&os.maxPriorityFeePerGas!=null)if(rs.type=2,rs.gasPrice!=null){const as=rs.gasPrice;delete rs.gasPrice,rs.maxFeePerGas=as,rs.maxPriorityFeePerGas=as}else rs.maxFeePerGas==null&&(rs.maxFeePerGas=os.maxFeePerGas),rs.maxPriorityFeePerGas==null&&(rs.maxPriorityFeePerGas=os.maxPriorityFeePerGas);else os.gasPrice!=null?(is&&logger$b.throwError("network does not support EIP-1559",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),rs.gasPrice==null&&(rs.gasPrice=os.gasPrice),rs.type=0):logger$b.throwError("failed to get consistent fee data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else rs.type===2&&(rs.maxFeePerGas==null&&(rs.maxFeePerGas=os.maxFeePerGas),rs.maxPriorityFeePerGas==null&&(rs.maxPriorityFeePerGas=os.maxPriorityFeePerGas))}return rs.nonce==null&&(rs.nonce=this.getTransactionCount("pending")),rs.gasLimit==null&&(rs.gasLimit=this.estimateGas(rs).catch(os=>{if(forwardErrors.indexOf(os.code)>=0)throw os;return logger$b.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{error:os,tx:rs})})),rs.chainId==null?rs.chainId=this.getChainId():rs.chainId=Promise.all([Promise.resolve(rs.chainId),this.getChainId()]).then(os=>(os[1]!==0&&os[0]!==os[1]&&logger$b.throwArgumentError("chainId address mismatch","transaction",Mn),os[0])),yield resolveProperties(rs)})}_checkProvider(Mn){this.provider||logger$b.throwError("missing provider",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:Mn||"_checkProvider"})}static isSigner(Mn){return!!(Mn&&Mn._isSigner)}}class VoidSigner extends Signer{constructor(Mn,rs){super(),defineReadOnly(this,"address",Mn),defineReadOnly(this,"provider",rs||null)}getAddress(){return Promise.resolve(this.address)}_fail(Mn,rs){return Promise.resolve().then(()=>{logger$b.throwError(Mn,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:rs})})}signMessage(Mn){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(Mn){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(Mn,rs,is){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(Mn){return new VoidSigner(this.address,Mn)}}var hash$5={},utils$s={},minimalisticAssert$1=assert$g;function assert$g(Fn,Mn){if(!Fn)throw new Error(Mn||"Assertion failed")}assert$g.equal=function(Mn,rs,is){if(Mn!=rs)throw new Error(is||"Assertion failed: "+Mn+" != "+rs)};var inherits_browser$1={exports:{}};typeof Object.create=="function"?inherits_browser$1.exports=function(Mn,rs){rs&&(Mn.super_=rs,Mn.prototype=Object.create(rs.prototype,{constructor:{value:Mn,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser$1.exports=function(Mn,rs){if(rs){Mn.super_=rs;var is=function(){};is.prototype=rs.prototype,Mn.prototype=new is,Mn.prototype.constructor=Mn}};var inherits_browserExports=inherits_browser$1.exports,assert$f=minimalisticAssert$1,inherits$4=inherits_browserExports;utils$s.inherits=inherits$4;function isSurrogatePair(Fn,Mn){return(Fn.charCodeAt(Mn)&64512)!==55296||Mn<0||Mn+1>=Fn.length?!1:(Fn.charCodeAt(Mn+1)&64512)===56320}function toArray$1(Fn,Mn){if(Array.isArray(Fn))return Fn.slice();if(!Fn)return[];var rs=[];if(typeof Fn=="string")if(Mn){if(Mn==="hex")for(Fn=Fn.replace(/[^a-z0-9]+/ig,""),Fn.length%2!==0&&(Fn="0"+Fn),os=0;os<Fn.length;os+=2)rs.push(parseInt(Fn[os]+Fn[os+1],16))}else for(var is=0,os=0;os<Fn.length;os++){var as=Fn.charCodeAt(os);as<128?rs[is++]=as:as<2048?(rs[is++]=as>>6|192,rs[is++]=as&63|128):isSurrogatePair(Fn,os)?(as=65536+((as&1023)<<10)+(Fn.charCodeAt(++os)&1023),rs[is++]=as>>18|240,rs[is++]=as>>12&63|128,rs[is++]=as>>6&63|128,rs[is++]=as&63|128):(rs[is++]=as>>12|224,rs[is++]=as>>6&63|128,rs[is++]=as&63|128)}else for(os=0;os<Fn.length;os++)rs[os]=Fn[os]|0;return rs}utils$s.toArray=toArray$1;function toHex$1(Fn){for(var Mn="",rs=0;rs<Fn.length;rs++)Mn+=zero2(Fn[rs].toString(16));return Mn}utils$s.toHex=toHex$1;function htonl(Fn){var Mn=Fn>>>24|Fn>>>8&65280|Fn<<8&16711680|(Fn&255)<<24;return Mn>>>0}utils$s.htonl=htonl;function toHex32(Fn,Mn){for(var rs="",is=0;is<Fn.length;is++){var os=Fn[is];Mn==="little"&&(os=htonl(os)),rs+=zero8(os.toString(16))}return rs}utils$s.toHex32=toHex32;function zero2(Fn){return Fn.length===1?"0"+Fn:Fn}utils$s.zero2=zero2;function zero8(Fn){return Fn.length===7?"0"+Fn:Fn.length===6?"00"+Fn:Fn.length===5?"000"+Fn:Fn.length===4?"0000"+Fn:Fn.length===3?"00000"+Fn:Fn.length===2?"000000"+Fn:Fn.length===1?"0000000"+Fn:Fn}utils$s.zero8=zero8;function join32(Fn,Mn,rs,is){var os=rs-Mn;assert$f(os%4===0);for(var as=new Array(os/4),us=0,ds=Mn;us<as.length;us++,ds+=4){var hs;is==="big"?hs=Fn[ds]<<24|Fn[ds+1]<<16|Fn[ds+2]<<8|Fn[ds+3]:hs=Fn[ds+3]<<24|Fn[ds+2]<<16|Fn[ds+1]<<8|Fn[ds],as[us]=hs>>>0}return as}utils$s.join32=join32;function split32(Fn,Mn){for(var rs=new Array(Fn.length*4),is=0,os=0;is<Fn.length;is++,os+=4){var as=Fn[is];Mn==="big"?(rs[os]=as>>>24,rs[os+1]=as>>>16&255,rs[os+2]=as>>>8&255,rs[os+3]=as&255):(rs[os+3]=as>>>24,rs[os+2]=as>>>16&255,rs[os+1]=as>>>8&255,rs[os]=as&255)}return rs}utils$s.split32=split32;function rotr32$1(Fn,Mn){return Fn>>>Mn|Fn<<32-Mn}utils$s.rotr32=rotr32$1;function rotl32$2(Fn,Mn){return Fn<<Mn|Fn>>>32-Mn}utils$s.rotl32=rotl32$2;function sum32$3(Fn,Mn){return Fn+Mn>>>0}utils$s.sum32=sum32$3;function sum32_3$1(Fn,Mn,rs){return Fn+Mn+rs>>>0}utils$s.sum32_3=sum32_3$1;function sum32_4$2(Fn,Mn,rs,is){return Fn+Mn+rs+is>>>0}utils$s.sum32_4=sum32_4$2;function sum32_5$2(Fn,Mn,rs,is,os){return Fn+Mn+rs+is+os>>>0}utils$s.sum32_5=sum32_5$2;function sum64$1(Fn,Mn,rs,is){var os=Fn[Mn],as=Fn[Mn+1],us=is+as>>>0,ds=(us<is?1:0)+rs+os;Fn[Mn]=ds>>>0,Fn[Mn+1]=us}utils$s.sum64=sum64$1;function sum64_hi$1(Fn,Mn,rs,is){var os=Mn+is>>>0,as=(os<Mn?1:0)+Fn+rs;return as>>>0}utils$s.sum64_hi=sum64_hi$1;function sum64_lo$1(Fn,Mn,rs,is){var os=Mn+is;return os>>>0}utils$s.sum64_lo=sum64_lo$1;function sum64_4_hi$1(Fn,Mn,rs,is,os,as,us,ds){var hs=0,ps=Mn;ps=ps+is>>>0,hs+=ps<Mn?1:0,ps=ps+as>>>0,hs+=ps<as?1:0,ps=ps+ds>>>0,hs+=ps<ds?1:0;var io=Fn+rs+os+us+hs;return io>>>0}utils$s.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(Fn,Mn,rs,is,os,as,us,ds){var hs=Mn+is+as+ds;return hs>>>0}utils$s.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(Fn,Mn,rs,is,os,as,us,ds,hs,ps){var io=0,fo=Mn;fo=fo+is>>>0,io+=fo<Mn?1:0,fo=fo+as>>>0,io+=fo<as?1:0,fo=fo+ds>>>0,io+=fo<ds?1:0,fo=fo+ps>>>0,io+=fo<ps?1:0;var mo=Fn+rs+os+us+hs+io;return mo>>>0}utils$s.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(Fn,Mn,rs,is,os,as,us,ds,hs,ps){var io=Mn+is+as+ds+ps;return io>>>0}utils$s.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(Fn,Mn,rs){var is=Mn<<32-rs|Fn>>>rs;return is>>>0}utils$s.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(Fn,Mn,rs){var is=Fn<<32-rs|Mn>>>rs;return is>>>0}utils$s.rotr64_lo=rotr64_lo$1;function shr64_hi$1(Fn,Mn,rs){return Fn>>>rs}utils$s.shr64_hi=shr64_hi$1;function shr64_lo$1(Fn,Mn,rs){var is=Fn<<32-rs|Mn>>>rs;return is>>>0}utils$s.shr64_lo=shr64_lo$1;var common$5={},utils$r=utils$s,assert$e=minimalisticAssert$1;function BlockHash$4(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}common$5.BlockHash=BlockHash$4;BlockHash$4.prototype.update=function(Mn,rs){if(Mn=utils$r.toArray(Mn,rs),this.pending?this.pending=this.pending.concat(Mn):this.pending=Mn,this.pendingTotal+=Mn.length,this.pending.length>=this._delta8){Mn=this.pending;var is=Mn.length%this._delta8;this.pending=Mn.slice(Mn.length-is,Mn.length),this.pending.length===0&&(this.pending=null),Mn=utils$r.join32(Mn,0,Mn.length-is,this.endian);for(var os=0;os<Mn.length;os+=this._delta32)this._update(Mn,os,os+this._delta32)}return this};BlockHash$4.prototype.digest=function(Mn){return this.update(this._pad()),assert$e(this.pending===null),this._digest(Mn)};BlockHash$4.prototype._pad=function(){var Mn=this.pendingTotal,rs=this._delta8,is=rs-(Mn+this.padLength)%rs,os=new Array(is+this.padLength);os[0]=128;for(var as=1;as<is;as++)os[as]=0;if(Mn<<=3,this.endian==="big"){for(var us=8;us<this.padLength;us++)os[as++]=0;os[as++]=0,os[as++]=0,os[as++]=0,os[as++]=0,os[as++]=Mn>>>24&255,os[as++]=Mn>>>16&255,os[as++]=Mn>>>8&255,os[as++]=Mn&255}else for(os[as++]=Mn&255,os[as++]=Mn>>>8&255,os[as++]=Mn>>>16&255,os[as++]=Mn>>>24&255,os[as++]=0,os[as++]=0,os[as++]=0,os[as++]=0,us=8;us<this.padLength;us++)os[as++]=0;return os};var sha={},common$4={},utils$q=utils$s,rotr32=utils$q.rotr32;function ft_1$1(Fn,Mn,rs,is){if(Fn===0)return ch32$1(Mn,rs,is);if(Fn===1||Fn===3)return p32(Mn,rs,is);if(Fn===2)return maj32$1(Mn,rs,is)}common$4.ft_1=ft_1$1;function ch32$1(Fn,Mn,rs){return Fn&Mn^~Fn&rs}common$4.ch32=ch32$1;function maj32$1(Fn,Mn,rs){return Fn&Mn^Fn&rs^Mn&rs}common$4.maj32=maj32$1;function p32(Fn,Mn,rs){return Fn^Mn^rs}common$4.p32=p32;function s0_256$1(Fn){return rotr32(Fn,2)^rotr32(Fn,13)^rotr32(Fn,22)}common$4.s0_256=s0_256$1;function s1_256$1(Fn){return rotr32(Fn,6)^rotr32(Fn,11)^rotr32(Fn,25)}common$4.s1_256=s1_256$1;function g0_256$1(Fn){return rotr32(Fn,7)^rotr32(Fn,18)^Fn>>>3}common$4.g0_256=g0_256$1;function g1_256$1(Fn){return rotr32(Fn,17)^rotr32(Fn,19)^Fn>>>10}common$4.g1_256=g1_256$1;var utils$p=utils$s,common$3=common$5,shaCommon$1=common$4,rotl32$1=utils$p.rotl32,sum32$2=utils$p.sum32,sum32_5$1=utils$p.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$3.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$p.inherits(SHA1,BlockHash$3);var _1=SHA1;SHA1.blockSize=512;SHA1.outSize=160;SHA1.hmacStrength=80;SHA1.padLength=64;SHA1.prototype._update=function(Mn,rs){for(var is=this.W,os=0;os<16;os++)is[os]=Mn[rs+os];for(;os<is.length;os++)is[os]=rotl32$1(is[os-3]^is[os-8]^is[os-14]^is[os-16],1);var as=this.h[0],us=this.h[1],ds=this.h[2],hs=this.h[3],ps=this.h[4];for(os=0;os<is.length;os++){var io=~~(os/20),fo=sum32_5$1(rotl32$1(as,5),ft_1(io,us,ds,hs),ps,is[os],sha1_K[io]);ps=hs,hs=ds,ds=rotl32$1(us,30),us=as,as=fo}this.h[0]=sum32$2(this.h[0],as),this.h[1]=sum32$2(this.h[1],us),this.h[2]=sum32$2(this.h[2],ds),this.h[3]=sum32$2(this.h[3],hs),this.h[4]=sum32$2(this.h[4],ps)};SHA1.prototype._digest=function(Mn){return Mn==="hex"?utils$p.toHex32(this.h,"big"):utils$p.split32(this.h,"big")};var utils$o=utils$s,common$2=common$5,shaCommon=common$4,assert$d=minimalisticAssert$1,sum32$1=utils$o.sum32,sum32_4$1=utils$o.sum32_4,sum32_5=utils$o.sum32_5,ch32=shaCommon.ch32,maj32=shaCommon.maj32,s0_256=shaCommon.s0_256,s1_256=shaCommon.s1_256,g0_256=shaCommon.g0_256,g1_256=shaCommon.g1_256,BlockHash$2=common$2.BlockHash,sha256_K=[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];function SHA256$1(){if(!(this instanceof SHA256$1))return new SHA256$1;BlockHash$2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=sha256_K,this.W=new Array(64)}utils$o.inherits(SHA256$1,BlockHash$2);var _256=SHA256$1;SHA256$1.blockSize=512;SHA256$1.outSize=256;SHA256$1.hmacStrength=192;SHA256$1.padLength=64;SHA256$1.prototype._update=function(Mn,rs){for(var is=this.W,os=0;os<16;os++)is[os]=Mn[rs+os];for(;os<is.length;os++)is[os]=sum32_4$1(g1_256(is[os-2]),is[os-7],g0_256(is[os-15]),is[os-16]);var as=this.h[0],us=this.h[1],ds=this.h[2],hs=this.h[3],ps=this.h[4],io=this.h[5],fo=this.h[6],mo=this.h[7];for(assert$d(this.k.length===is.length),os=0;os<is.length;os++){var Ao=sum32_5(mo,s1_256(ps),ch32(ps,io,fo),this.k[os],is[os]),$o=sum32$1(s0_256(as),maj32(as,us,ds));mo=fo,fo=io,io=ps,ps=sum32$1(hs,Ao),hs=ds,ds=us,us=as,as=sum32$1(Ao,$o)}this.h[0]=sum32$1(this.h[0],as),this.h[1]=sum32$1(this.h[1],us),this.h[2]=sum32$1(this.h[2],ds),this.h[3]=sum32$1(this.h[3],hs),this.h[4]=sum32$1(this.h[4],ps),this.h[5]=sum32$1(this.h[5],io),this.h[6]=sum32$1(this.h[6],fo),this.h[7]=sum32$1(this.h[7],mo)};SHA256$1.prototype._digest=function(Mn){return Mn==="hex"?utils$o.toHex32(this.h,"big"):utils$o.split32(this.h,"big")};var utils$n=utils$s,SHA256=_256;function SHA224(){if(!(this instanceof SHA224))return new SHA224;SHA256.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}utils$n.inherits(SHA224,SHA256);var _224=SHA224;SHA224.blockSize=512;SHA224.outSize=224;SHA224.hmacStrength=192;SHA224.padLength=64;SHA224.prototype._digest=function(Mn){return Mn==="hex"?utils$n.toHex32(this.h.slice(0,7),"big"):utils$n.split32(this.h.slice(0,7),"big")};var utils$m=utils$s,common$1=common$5,assert$c=minimalisticAssert$1,rotr64_hi=utils$m.rotr64_hi,rotr64_lo=utils$m.rotr64_lo,shr64_hi=utils$m.shr64_hi,shr64_lo=utils$m.shr64_lo,sum64=utils$m.sum64,sum64_hi=utils$m.sum64_hi,sum64_lo=utils$m.sum64_lo,sum64_4_hi=utils$m.sum64_4_hi,sum64_4_lo=utils$m.sum64_4_lo,sum64_5_hi=utils$m.sum64_5_hi,sum64_5_lo=utils$m.sum64_5_lo,BlockHash$1=common$1.BlockHash,sha512_K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function SHA512$1(){if(!(this instanceof SHA512$1))return new SHA512$1;BlockHash$1.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=sha512_K,this.W=new Array(160)}utils$m.inherits(SHA512$1,BlockHash$1);var _512=SHA512$1;SHA512$1.blockSize=1024;SHA512$1.outSize=512;SHA512$1.hmacStrength=192;SHA512$1.padLength=128;SHA512$1.prototype._prepareBlock=function(Mn,rs){for(var is=this.W,os=0;os<32;os++)is[os]=Mn[rs+os];for(;os<is.length;os+=2){var as=g1_512_hi(is[os-4],is[os-3]),us=g1_512_lo(is[os-4],is[os-3]),ds=is[os-14],hs=is[os-13],ps=g0_512_hi(is[os-30],is[os-29]),io=g0_512_lo(is[os-30],is[os-29]),fo=is[os-32],mo=is[os-31];is[os]=sum64_4_hi(as,us,ds,hs,ps,io,fo,mo),is[os+1]=sum64_4_lo(as,us,ds,hs,ps,io,fo,mo)}};SHA512$1.prototype._update=function(Mn,rs){this._prepareBlock(Mn,rs);var is=this.W,os=this.h[0],as=this.h[1],us=this.h[2],ds=this.h[3],hs=this.h[4],ps=this.h[5],io=this.h[6],fo=this.h[7],mo=this.h[8],Ao=this.h[9],$o=this.h[10],Lo=this.h[11],Go=this.h[12],Yo=this.h[13],Wo=this.h[14],Jo=this.h[15];assert$c(this.k.length===is.length);for(var xl=0;xl<is.length;xl+=2){var _l=Wo,Tl=Jo,Sl=s1_512_hi(mo,Ao),$l=s1_512_lo(mo,Ao),Pl=ch64_hi(mo,Ao,$o,Lo,Go),Dl=ch64_lo(mo,Ao,$o,Lo,Go,Yo),Ol=this.k[xl],Rl=this.k[xl+1],Vo=is[xl],jo=is[xl+1],Ho=sum64_5_hi(_l,Tl,Sl,$l,Pl,Dl,Ol,Rl,Vo,jo),Qo=sum64_5_lo(_l,Tl,Sl,$l,Pl,Dl,Ol,Rl,Vo,jo);_l=s0_512_hi(os,as),Tl=s0_512_lo(os,as),Sl=maj64_hi(os,as,us,ds,hs),$l=maj64_lo(os,as,us,ds,hs,ps);var El=sum64_hi(_l,Tl,Sl,$l),Xo=sum64_lo(_l,Tl,Sl,$l);Wo=Go,Jo=Yo,Go=$o,Yo=Lo,$o=mo,Lo=Ao,mo=sum64_hi(io,fo,Ho,Qo),Ao=sum64_lo(fo,fo,Ho,Qo),io=hs,fo=ps,hs=us,ps=ds,us=os,ds=as,os=sum64_hi(Ho,Qo,El,Xo),as=sum64_lo(Ho,Qo,El,Xo)}sum64(this.h,0,os,as),sum64(this.h,2,us,ds),sum64(this.h,4,hs,ps),sum64(this.h,6,io,fo),sum64(this.h,8,mo,Ao),sum64(this.h,10,$o,Lo),sum64(this.h,12,Go,Yo),sum64(this.h,14,Wo,Jo)};SHA512$1.prototype._digest=function(Mn){return Mn==="hex"?utils$m.toHex32(this.h,"big"):utils$m.split32(this.h,"big")};function ch64_hi(Fn,Mn,rs,is,os){var as=Fn&rs^~Fn&os;return as<0&&(as+=4294967296),as}function ch64_lo(Fn,Mn,rs,is,os,as){var us=Mn&is^~Mn&as;return us<0&&(us+=4294967296),us}function maj64_hi(Fn,Mn,rs,is,os){var as=Fn&rs^Fn&os^rs&os;return as<0&&(as+=4294967296),as}function maj64_lo(Fn,Mn,rs,is,os,as){var us=Mn&is^Mn&as^is&as;return us<0&&(us+=4294967296),us}function s0_512_hi(Fn,Mn){var rs=rotr64_hi(Fn,Mn,28),is=rotr64_hi(Mn,Fn,2),os=rotr64_hi(Mn,Fn,7),as=rs^is^os;return as<0&&(as+=4294967296),as}function s0_512_lo(Fn,Mn){var rs=rotr64_lo(Fn,Mn,28),is=rotr64_lo(Mn,Fn,2),os=rotr64_lo(Mn,Fn,7),as=rs^is^os;return as<0&&(as+=4294967296),as}function s1_512_hi(Fn,Mn){var rs=rotr64_hi(Fn,Mn,14),is=rotr64_hi(Fn,Mn,18),os=rotr64_hi(Mn,Fn,9),as=rs^is^os;return as<0&&(as+=4294967296),as}function s1_512_lo(Fn,Mn){var rs=rotr64_lo(Fn,Mn,14),is=rotr64_lo(Fn,Mn,18),os=rotr64_lo(Mn,Fn,9),as=rs^is^os;return as<0&&(as+=4294967296),as}function g0_512_hi(Fn,Mn){var rs=rotr64_hi(Fn,Mn,1),is=rotr64_hi(Fn,Mn,8),os=shr64_hi(Fn,Mn,7),as=rs^is^os;return as<0&&(as+=4294967296),as}function g0_512_lo(Fn,Mn){var rs=rotr64_lo(Fn,Mn,1),is=rotr64_lo(Fn,Mn,8),os=shr64_lo(Fn,Mn,7),as=rs^is^os;return as<0&&(as+=4294967296),as}function g1_512_hi(Fn,Mn){var rs=rotr64_hi(Fn,Mn,19),is=rotr64_hi(Mn,Fn,29),os=shr64_hi(Fn,Mn,6),as=rs^is^os;return as<0&&(as+=4294967296),as}function g1_512_lo(Fn,Mn){var rs=rotr64_lo(Fn,Mn,19),is=rotr64_lo(Mn,Fn,29),os=shr64_lo(Fn,Mn,6),as=rs^is^os;return as<0&&(as+=4294967296),as}var utils$l=utils$s,SHA512=_512;function SHA384(){if(!(this instanceof SHA384))return new SHA384;SHA512.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}utils$l.inherits(SHA384,SHA512);var _384=SHA384;SHA384.blockSize=1024;SHA384.outSize=384;SHA384.hmacStrength=192;SHA384.padLength=128;SHA384.prototype._digest=function(Mn){return Mn==="hex"?utils$l.toHex32(this.h.slice(0,12),"big"):utils$l.split32(this.h.slice(0,12),"big")};sha.sha1=_1;sha.sha224=_224;sha.sha256=_256;sha.sha384=_384;sha.sha512=_512;var ripemd={},utils$k=utils$s,common=common$5,rotl32=utils$k.rotl32,sum32=utils$k.sum32,sum32_3=utils$k.sum32_3,sum32_4=utils$k.sum32_4,BlockHash=common.BlockHash;function RIPEMD160(){if(!(this instanceof RIPEMD160))return new RIPEMD160;BlockHash.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}utils$k.inherits(RIPEMD160,BlockHash);ripemd.ripemd160=RIPEMD160;RIPEMD160.blockSize=512;RIPEMD160.outSize=160;RIPEMD160.hmacStrength=192;RIPEMD160.padLength=64;RIPEMD160.prototype._update=function(Mn,rs){for(var is=this.h[0],os=this.h[1],as=this.h[2],us=this.h[3],ds=this.h[4],hs=is,ps=os,io=as,fo=us,mo=ds,Ao=0;Ao<80;Ao++){var $o=sum32(rotl32(sum32_4(is,f$8(Ao,os,as,us),Mn[r$b[Ao]+rs],K$3(Ao)),s$5[Ao]),ds);is=ds,ds=us,us=rotl32(as,10),as=os,os=$o,$o=sum32(rotl32(sum32_4(hs,f$8(79-Ao,ps,io,fo),Mn[rh[Ao]+rs],Kh(Ao)),sh[Ao]),mo),hs=mo,mo=fo,fo=rotl32(io,10),io=ps,ps=$o}$o=sum32_3(this.h[1],as,fo),this.h[1]=sum32_3(this.h[2],us,mo),this.h[2]=sum32_3(this.h[3],ds,hs),this.h[3]=sum32_3(this.h[4],is,ps),this.h[4]=sum32_3(this.h[0],os,io),this.h[0]=$o};RIPEMD160.prototype._digest=function(Mn){return Mn==="hex"?utils$k.toHex32(this.h,"little"):utils$k.split32(this.h,"little")};function f$8(Fn,Mn,rs,is){return Fn<=15?Mn^rs^is:Fn<=31?Mn&rs|~Mn&is:Fn<=47?(Mn|~rs)^is:Fn<=63?Mn&is|rs&~is:Mn^(rs|~is)}function K$3(Fn){return Fn<=15?0:Fn<=31?1518500249:Fn<=47?1859775393:Fn<=63?2400959708:2840853838}function Kh(Fn){return Fn<=15?1352829926:Fn<=31?1548603684:Fn<=47?1836072691:Fn<=63?2053994217:0}var r$b=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rh=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],s$5=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sh=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],utils$j=utils$s,assert$b=minimalisticAssert$1;function Hmac(Fn,Mn,rs){if(!(this instanceof Hmac))return new Hmac(Fn,Mn,rs);this.Hash=Fn,this.blockSize=Fn.blockSize/8,this.outSize=Fn.outSize/8,this.inner=null,this.outer=null,this._init(utils$j.toArray(Mn,rs))}var hmac$2=Hmac;Hmac.prototype._init=function(Mn){Mn.length>this.blockSize&&(Mn=new this.Hash().update(Mn).digest()),assert$b(Mn.length<=this.blockSize);for(var rs=Mn.length;rs<this.blockSize;rs++)Mn.push(0);for(rs=0;rs<Mn.length;rs++)Mn[rs]^=54;for(this.inner=new this.Hash().update(Mn),rs=0;rs<Mn.length;rs++)Mn[rs]^=106;this.outer=new this.Hash().update(Mn)};Hmac.prototype.update=function(Mn,rs){return this.inner.update(Mn,rs),this};Hmac.prototype.digest=function(Mn){return this.outer.update(this.inner.digest()),this.outer.digest(Mn)};(function(Fn){var Mn=Fn;Mn.utils=utils$s,Mn.common=common$5,Mn.sha=sha,Mn.ripemd=ripemd,Mn.hmac=hmac$2,Mn.sha1=Mn.sha.sha1,Mn.sha256=Mn.sha.sha256,Mn.sha224=Mn.sha.sha224,Mn.sha384=Mn.sha.sha384,Mn.sha512=Mn.sha.sha512,Mn.ripemd160=Mn.ripemd.ripemd160})(hash$5);const hash$4=getDefaultExportFromCjs(hash$5);function createCommonjsModule$1(Fn,Mn,rs){return rs={path:Mn,exports:{},require:function(is,os){return commonjsRequire$1(is,os??rs.path)}},Fn(rs,rs.exports),rs.exports}function commonjsRequire$1(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var minimalisticAssert=assert$a;function assert$a(Fn,Mn){if(!Fn)throw new Error(Mn||"Assertion failed")}assert$a.equal=function(Mn,rs,is){if(Mn!=rs)throw new Error(is||"Assertion failed: "+Mn+" != "+rs)};var utils_1=createCommonjsModule$1(function(Fn,Mn){var rs=Mn;function is(us,ds){if(Array.isArray(us))return us.slice();if(!us)return[];var hs=[];if(typeof us!="string"){for(var ps=0;ps<us.length;ps++)hs[ps]=us[ps]|0;return hs}if(ds==="hex"){us=us.replace(/[^a-z0-9]+/ig,""),us.length%2!==0&&(us="0"+us);for(var ps=0;ps<us.length;ps+=2)hs.push(parseInt(us[ps]+us[ps+1],16))}else for(var ps=0;ps<us.length;ps++){var io=us.charCodeAt(ps),fo=io>>8,mo=io&255;fo?hs.push(fo,mo):hs.push(mo)}return hs}rs.toArray=is;function os(us){return us.length===1?"0"+us:us}rs.zero2=os;function as(us){for(var ds="",hs=0;hs<us.length;hs++)ds+=os(us[hs].toString(16));return ds}rs.toHex=as,rs.encode=function(ds,hs){return hs==="hex"?as(ds):ds}}),utils_1$1=createCommonjsModule$1(function(Fn,Mn){var rs=Mn;rs.assert=minimalisticAssert,rs.toArray=utils_1.toArray,rs.zero2=utils_1.zero2,rs.toHex=utils_1.toHex,rs.encode=utils_1.encode;function is(hs,ps,io){var fo=new Array(Math.max(hs.bitLength(),io)+1);fo.fill(0);for(var mo=1<<ps+1,Ao=hs.clone(),$o=0;$o<fo.length;$o++){var Lo,Go=Ao.andln(mo-1);Ao.isOdd()?(Go>(mo>>1)-1?Lo=(mo>>1)-Go:Lo=Go,Ao.isubn(Lo)):Lo=0,fo[$o]=Lo,Ao.iushrn(1)}return fo}rs.getNAF=is;function os(hs,ps){var io=[[],[]];hs=hs.clone(),ps=ps.clone();for(var fo=0,mo=0,Ao;hs.cmpn(-fo)>0||ps.cmpn(-mo)>0;){var $o=hs.andln(3)+fo&3,Lo=ps.andln(3)+mo&3;$o===3&&($o=-1),Lo===3&&(Lo=-1);var Go;$o&1?(Ao=hs.andln(7)+fo&7,(Ao===3||Ao===5)&&Lo===2?Go=-$o:Go=$o):Go=0,io[0].push(Go);var Yo;Lo&1?(Ao=ps.andln(7)+mo&7,(Ao===3||Ao===5)&&$o===2?Yo=-Lo:Yo=Lo):Yo=0,io[1].push(Yo),2*fo===Go+1&&(fo=1-fo),2*mo===Yo+1&&(mo=1-mo),hs.iushrn(1),ps.iushrn(1)}return io}rs.getJSF=os;function as(hs,ps,io){var fo="_"+ps;hs.prototype[ps]=function(){return this[fo]!==void 0?this[fo]:this[fo]=io.call(this)}}rs.cachedProperty=as;function us(hs){return typeof hs=="string"?rs.toArray(hs,"hex"):hs}rs.parseBytes=us;function ds(hs){return new BN$9(hs,"hex","le")}rs.intFromLE=ds}),getNAF$1=utils_1$1.getNAF,getJSF$1=utils_1$1.getJSF,assert$1$1=utils_1$1.assert;function BaseCurve$1(Fn,Mn){this.type=Fn,this.p=new BN$9(Mn.p,16),this.red=Mn.prime?BN$9.red(Mn.prime):BN$9.mont(this.p),this.zero=new BN$9(0).toRed(this.red),this.one=new BN$9(1).toRed(this.red),this.two=new BN$9(2).toRed(this.red),this.n=Mn.n&&new BN$9(Mn.n,16),this.g=Mn.g&&this.pointFromJSON(Mn.g,Mn.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var rs=this.n&&this.p.div(this.n);!rs||rs.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base$2=BaseCurve$1;BaseCurve$1.prototype.point=function(){throw new Error("Not implemented")};BaseCurve$1.prototype.validate=function(){throw new Error("Not implemented")};BaseCurve$1.prototype._fixedNafMul=function(Mn,rs){assert$1$1(Mn.precomputed);var is=Mn._getDoubles(),os=getNAF$1(rs,1,this._bitLength),as=(1<<is.step+1)-(is.step%2===0?2:1);as/=3;var us=[],ds,hs;for(ds=0;ds<os.length;ds+=is.step){hs=0;for(var ps=ds+is.step-1;ps>=ds;ps--)hs=(hs<<1)+os[ps];us.push(hs)}for(var io=this.jpoint(null,null,null),fo=this.jpoint(null,null,null),mo=as;mo>0;mo--){for(ds=0;ds<us.length;ds++)hs=us[ds],hs===mo?fo=fo.mixedAdd(is.points[ds]):hs===-mo&&(fo=fo.mixedAdd(is.points[ds].neg()));io=io.add(fo)}return io.toP()};BaseCurve$1.prototype._wnafMul=function(Mn,rs){var is=4,os=Mn._getNAFPoints(is);is=os.wnd;for(var as=os.points,us=getNAF$1(rs,is,this._bitLength),ds=this.jpoint(null,null,null),hs=us.length-1;hs>=0;hs--){for(var ps=0;hs>=0&&us[hs]===0;hs--)ps++;if(hs>=0&&ps++,ds=ds.dblp(ps),hs<0)break;var io=us[hs];assert$1$1(io!==0),Mn.type==="affine"?io>0?ds=ds.mixedAdd(as[io-1>>1]):ds=ds.mixedAdd(as[-io-1>>1].neg()):io>0?ds=ds.add(as[io-1>>1]):ds=ds.add(as[-io-1>>1].neg())}return Mn.type==="affine"?ds.toP():ds};BaseCurve$1.prototype._wnafMulAdd=function(Mn,rs,is,os,as){var us=this._wnafT1,ds=this._wnafT2,hs=this._wnafT3,ps=0,io,fo,mo;for(io=0;io<os;io++){mo=rs[io];var Ao=mo._getNAFPoints(Mn);us[io]=Ao.wnd,ds[io]=Ao.points}for(io=os-1;io>=1;io-=2){var $o=io-1,Lo=io;if(us[$o]!==1||us[Lo]!==1){hs[$o]=getNAF$1(is[$o],us[$o],this._bitLength),hs[Lo]=getNAF$1(is[Lo],us[Lo],this._bitLength),ps=Math.max(hs[$o].length,ps),ps=Math.max(hs[Lo].length,ps);continue}var Go=[rs[$o],null,null,rs[Lo]];rs[$o].y.cmp(rs[Lo].y)===0?(Go[1]=rs[$o].add(rs[Lo]),Go[2]=rs[$o].toJ().mixedAdd(rs[Lo].neg())):rs[$o].y.cmp(rs[Lo].y.redNeg())===0?(Go[1]=rs[$o].toJ().mixedAdd(rs[Lo]),Go[2]=rs[$o].add(rs[Lo].neg())):(Go[1]=rs[$o].toJ().mixedAdd(rs[Lo]),Go[2]=rs[$o].toJ().mixedAdd(rs[Lo].neg()));var Yo=[-3,-1,-5,-7,0,7,5,1,3],Wo=getJSF$1(is[$o],is[Lo]);for(ps=Math.max(Wo[0].length,ps),hs[$o]=new Array(ps),hs[Lo]=new Array(ps),fo=0;fo<ps;fo++){var Jo=Wo[0][fo]|0,xl=Wo[1][fo]|0;hs[$o][fo]=Yo[(Jo+1)*3+(xl+1)],hs[Lo][fo]=0,ds[$o]=Go}}var _l=this.jpoint(null,null,null),Tl=this._wnafT4;for(io=ps;io>=0;io--){for(var Sl=0;io>=0;){var $l=!0;for(fo=0;fo<os;fo++)Tl[fo]=hs[fo][io]|0,Tl[fo]!==0&&($l=!1);if(!$l)break;Sl++,io--}if(io>=0&&Sl++,_l=_l.dblp(Sl),io<0)break;for(fo=0;fo<os;fo++){var Pl=Tl[fo];Pl!==0&&(Pl>0?mo=ds[fo][Pl-1>>1]:Pl<0&&(mo=ds[fo][-Pl-1>>1].neg()),mo.type==="affine"?_l=_l.mixedAdd(mo):_l=_l.add(mo))}}for(io=0;io<os;io++)ds[io]=null;return as?_l:_l.toP()};function BasePoint$1(Fn,Mn){this.curve=Fn,this.type=Mn,this.precomputed=null}BaseCurve$1.BasePoint=BasePoint$1;BasePoint$1.prototype.eq=function(){throw new Error("Not implemented")};BasePoint$1.prototype.validate=function(){return this.curve.validate(this)};BaseCurve$1.prototype.decodePoint=function(Mn,rs){Mn=utils_1$1.toArray(Mn,rs);var is=this.p.byteLength();if((Mn[0]===4||Mn[0]===6||Mn[0]===7)&&Mn.length-1===2*is){Mn[0]===6?assert$1$1(Mn[Mn.length-1]%2===0):Mn[0]===7&&assert$1$1(Mn[Mn.length-1]%2===1);var os=this.point(Mn.slice(1,1+is),Mn.slice(1+is,1+2*is));return os}else if((Mn[0]===2||Mn[0]===3)&&Mn.length-1===is)return this.pointFromX(Mn.slice(1,1+is),Mn[0]===3);throw new Error("Unknown point format")};BasePoint$1.prototype.encodeCompressed=function(Mn){return this.encode(Mn,!0)};BasePoint$1.prototype._encode=function(Mn){var rs=this.curve.p.byteLength(),is=this.getX().toArray("be",rs);return Mn?[this.getY().isEven()?2:3].concat(is):[4].concat(is,this.getY().toArray("be",rs))};BasePoint$1.prototype.encode=function(Mn,rs){return utils_1$1.encode(this._encode(rs),Mn)};BasePoint$1.prototype.precompute=function(Mn){if(this.precomputed)return this;var rs={doubles:null,naf:null,beta:null};return rs.naf=this._getNAFPoints(8),rs.doubles=this._getDoubles(4,Mn),rs.beta=this._getBeta(),this.precomputed=rs,this};BasePoint$1.prototype._hasDoubles=function(Mn){if(!this.precomputed)return!1;var rs=this.precomputed.doubles;return rs?rs.points.length>=Math.ceil((Mn.bitLength()+1)/rs.step):!1};BasePoint$1.prototype._getDoubles=function(Mn,rs){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var is=[this],os=this,as=0;as<rs;as+=Mn){for(var us=0;us<Mn;us++)os=os.dbl();is.push(os)}return{step:Mn,points:is}};BasePoint$1.prototype._getNAFPoints=function(Mn){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var rs=[this],is=(1<<Mn)-1,os=is===1?null:this.dbl(),as=1;as<is;as++)rs[as]=rs[as-1].add(os);return{wnd:Mn,points:rs}};BasePoint$1.prototype._getBeta=function(){return null};BasePoint$1.prototype.dblp=function(Mn){for(var rs=this,is=0;is<Mn;is++)rs=rs.dbl();return rs};var inherits_browser=createCommonjsModule$1(function(Fn){typeof Object.create=="function"?Fn.exports=function(rs,is){is&&(rs.super_=is,rs.prototype=Object.create(is.prototype,{constructor:{value:rs,enumerable:!1,writable:!0,configurable:!0}}))}:Fn.exports=function(rs,is){if(is){rs.super_=is;var os=function(){};os.prototype=is.prototype,rs.prototype=new os,rs.prototype.constructor=rs}}}),assert$2$1=utils_1$1.assert;function ShortCurve$1(Fn){base$2.call(this,"short",Fn),this.a=new BN$9(Fn.a,16).toRed(this.red),this.b=new BN$9(Fn.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(Fn),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}inherits_browser(ShortCurve$1,base$2);var short_1=ShortCurve$1;ShortCurve$1.prototype._getEndomorphism=function(Mn){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var rs,is;if(Mn.beta)rs=new BN$9(Mn.beta,16).toRed(this.red);else{var os=this._getEndoRoots(this.p);rs=os[0].cmp(os[1])<0?os[0]:os[1],rs=rs.toRed(this.red)}if(Mn.lambda)is=new BN$9(Mn.lambda,16);else{var as=this._getEndoRoots(this.n);this.g.mul(as[0]).x.cmp(this.g.x.redMul(rs))===0?is=as[0]:(is=as[1],assert$2$1(this.g.mul(is).x.cmp(this.g.x.redMul(rs))===0))}var us;return Mn.basis?us=Mn.basis.map(function(ds){return{a:new BN$9(ds.a,16),b:new BN$9(ds.b,16)}}):us=this._getEndoBasis(is),{beta:rs,lambda:is,basis:us}}};ShortCurve$1.prototype._getEndoRoots=function(Mn){var rs=Mn===this.p?this.red:BN$9.mont(Mn),is=new BN$9(2).toRed(rs).redInvm(),os=is.redNeg(),as=new BN$9(3).toRed(rs).redNeg().redSqrt().redMul(is),us=os.redAdd(as).fromRed(),ds=os.redSub(as).fromRed();return[us,ds]};ShortCurve$1.prototype._getEndoBasis=function(Mn){for(var rs=this.n.ushrn(Math.floor(this.n.bitLength()/2)),is=Mn,os=this.n.clone(),as=new BN$9(1),us=new BN$9(0),ds=new BN$9(0),hs=new BN$9(1),ps,io,fo,mo,Ao,$o,Lo,Go=0,Yo,Wo;is.cmpn(0)!==0;){var Jo=os.div(is);Yo=os.sub(Jo.mul(is)),Wo=ds.sub(Jo.mul(as));var xl=hs.sub(Jo.mul(us));if(!fo&&Yo.cmp(rs)<0)ps=Lo.neg(),io=as,fo=Yo.neg(),mo=Wo;else if(fo&&++Go===2)break;Lo=Yo,os=is,is=Yo,ds=as,as=Wo,hs=us,us=xl}Ao=Yo.neg(),$o=Wo;var _l=fo.sqr().add(mo.sqr()),Tl=Ao.sqr().add($o.sqr());return Tl.cmp(_l)>=0&&(Ao=ps,$o=io),fo.negative&&(fo=fo.neg(),mo=mo.neg()),Ao.negative&&(Ao=Ao.neg(),$o=$o.neg()),[{a:fo,b:mo},{a:Ao,b:$o}]};ShortCurve$1.prototype._endoSplit=function(Mn){var rs=this.endo.basis,is=rs[0],os=rs[1],as=os.b.mul(Mn).divRound(this.n),us=is.b.neg().mul(Mn).divRound(this.n),ds=as.mul(is.a),hs=us.mul(os.a),ps=as.mul(is.b),io=us.mul(os.b),fo=Mn.sub(ds).sub(hs),mo=ps.add(io).neg();return{k1:fo,k2:mo}};ShortCurve$1.prototype.pointFromX=function(Mn,rs){Mn=new BN$9(Mn,16),Mn.red||(Mn=Mn.toRed(this.red));var is=Mn.redSqr().redMul(Mn).redIAdd(Mn.redMul(this.a)).redIAdd(this.b),os=is.redSqrt();if(os.redSqr().redSub(is).cmp(this.zero)!==0)throw new Error("invalid point");var as=os.fromRed().isOdd();return(rs&&!as||!rs&&as)&&(os=os.redNeg()),this.point(Mn,os)};ShortCurve$1.prototype.validate=function(Mn){if(Mn.inf)return!0;var rs=Mn.x,is=Mn.y,os=this.a.redMul(rs),as=rs.redSqr().redMul(rs).redIAdd(os).redIAdd(this.b);return is.redSqr().redISub(as).cmpn(0)===0};ShortCurve$1.prototype._endoWnafMulAdd=function(Mn,rs,is){for(var os=this._endoWnafT1,as=this._endoWnafT2,us=0;us<Mn.length;us++){var ds=this._endoSplit(rs[us]),hs=Mn[us],ps=hs._getBeta();ds.k1.negative&&(ds.k1.ineg(),hs=hs.neg(!0)),ds.k2.negative&&(ds.k2.ineg(),ps=ps.neg(!0)),os[us*2]=hs,os[us*2+1]=ps,as[us*2]=ds.k1,as[us*2+1]=ds.k2}for(var io=this._wnafMulAdd(1,os,as,us*2,is),fo=0;fo<us*2;fo++)os[fo]=null,as[fo]=null;return io};function Point$3(Fn,Mn,rs,is){base$2.BasePoint.call(this,Fn,"affine"),Mn===null&&rs===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN$9(Mn,16),this.y=new BN$9(rs,16),is&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}inherits_browser(Point$3,base$2.BasePoint);ShortCurve$1.prototype.point=function(Mn,rs,is){return new Point$3(this,Mn,rs,is)};ShortCurve$1.prototype.pointFromJSON=function(Mn,rs){return Point$3.fromJSON(this,Mn,rs)};Point$3.prototype._getBeta=function(){if(this.curve.endo){var Mn=this.precomputed;if(Mn&&Mn.beta)return Mn.beta;var rs=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(Mn){var is=this.curve,os=function(as){return is.point(as.x.redMul(is.endo.beta),as.y)};Mn.beta=rs,rs.precomputed={beta:null,naf:Mn.naf&&{wnd:Mn.naf.wnd,points:Mn.naf.points.map(os)},doubles:Mn.doubles&&{step:Mn.doubles.step,points:Mn.doubles.points.map(os)}}}return rs}};Point$3.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Point$3.fromJSON=function(Mn,rs,is){typeof rs=="string"&&(rs=JSON.parse(rs));var os=Mn.point(rs[0],rs[1],is);if(!rs[2])return os;function as(ds){return Mn.point(ds[0],ds[1],is)}var us=rs[2];return os.precomputed={beta:null,doubles:us.doubles&&{step:us.doubles.step,points:[os].concat(us.doubles.points.map(as))},naf:us.naf&&{wnd:us.naf.wnd,points:[os].concat(us.naf.points.map(as))}},os};Point$3.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Point$3.prototype.isInfinity=function(){return this.inf};Point$3.prototype.add=function(Mn){if(this.inf)return Mn;if(Mn.inf)return this;if(this.eq(Mn))return this.dbl();if(this.neg().eq(Mn))return this.curve.point(null,null);if(this.x.cmp(Mn.x)===0)return this.curve.point(null,null);var rs=this.y.redSub(Mn.y);rs.cmpn(0)!==0&&(rs=rs.redMul(this.x.redSub(Mn.x).redInvm()));var is=rs.redSqr().redISub(this.x).redISub(Mn.x),os=rs.redMul(this.x.redSub(is)).redISub(this.y);return this.curve.point(is,os)};Point$3.prototype.dbl=function(){if(this.inf)return this;var Mn=this.y.redAdd(this.y);if(Mn.cmpn(0)===0)return this.curve.point(null,null);var rs=this.curve.a,is=this.x.redSqr(),os=Mn.redInvm(),as=is.redAdd(is).redIAdd(is).redIAdd(rs).redMul(os),us=as.redSqr().redISub(this.x.redAdd(this.x)),ds=as.redMul(this.x.redSub(us)).redISub(this.y);return this.curve.point(us,ds)};Point$3.prototype.getX=function(){return this.x.fromRed()};Point$3.prototype.getY=function(){return this.y.fromRed()};Point$3.prototype.mul=function(Mn){return Mn=new BN$9(Mn,16),this.isInfinity()?this:this._hasDoubles(Mn)?this.curve._fixedNafMul(this,Mn):this.curve.endo?this.curve._endoWnafMulAdd([this],[Mn]):this.curve._wnafMul(this,Mn)};Point$3.prototype.mulAdd=function(Mn,rs,is){var os=[this,rs],as=[Mn,is];return this.curve.endo?this.curve._endoWnafMulAdd(os,as):this.curve._wnafMulAdd(1,os,as,2)};Point$3.prototype.jmulAdd=function(Mn,rs,is){var os=[this,rs],as=[Mn,is];return this.curve.endo?this.curve._endoWnafMulAdd(os,as,!0):this.curve._wnafMulAdd(1,os,as,2,!0)};Point$3.prototype.eq=function(Mn){return this===Mn||this.inf===Mn.inf&&(this.inf||this.x.cmp(Mn.x)===0&&this.y.cmp(Mn.y)===0)};Point$3.prototype.neg=function(Mn){if(this.inf)return this;var rs=this.curve.point(this.x,this.y.redNeg());if(Mn&&this.precomputed){var is=this.precomputed,os=function(as){return as.neg()};rs.precomputed={naf:is.naf&&{wnd:is.naf.wnd,points:is.naf.points.map(os)},doubles:is.doubles&&{step:is.doubles.step,points:is.doubles.points.map(os)}}}return rs};Point$3.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var Mn=this.curve.jpoint(this.x,this.y,this.curve.one);return Mn};function JPoint$1(Fn,Mn,rs,is){base$2.BasePoint.call(this,Fn,"jacobian"),Mn===null&&rs===null&&is===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$9(0)):(this.x=new BN$9(Mn,16),this.y=new BN$9(rs,16),this.z=new BN$9(is,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits_browser(JPoint$1,base$2.BasePoint);ShortCurve$1.prototype.jpoint=function(Mn,rs,is){return new JPoint$1(this,Mn,rs,is)};JPoint$1.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var Mn=this.z.redInvm(),rs=Mn.redSqr(),is=this.x.redMul(rs),os=this.y.redMul(rs).redMul(Mn);return this.curve.point(is,os)};JPoint$1.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint$1.prototype.add=function(Mn){if(this.isInfinity())return Mn;if(Mn.isInfinity())return this;var rs=Mn.z.redSqr(),is=this.z.redSqr(),os=this.x.redMul(rs),as=Mn.x.redMul(is),us=this.y.redMul(rs.redMul(Mn.z)),ds=Mn.y.redMul(is.redMul(this.z)),hs=os.redSub(as),ps=us.redSub(ds);if(hs.cmpn(0)===0)return ps.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var io=hs.redSqr(),fo=io.redMul(hs),mo=os.redMul(io),Ao=ps.redSqr().redIAdd(fo).redISub(mo).redISub(mo),$o=ps.redMul(mo.redISub(Ao)).redISub(us.redMul(fo)),Lo=this.z.redMul(Mn.z).redMul(hs);return this.curve.jpoint(Ao,$o,Lo)};JPoint$1.prototype.mixedAdd=function(Mn){if(this.isInfinity())return Mn.toJ();if(Mn.isInfinity())return this;var rs=this.z.redSqr(),is=this.x,os=Mn.x.redMul(rs),as=this.y,us=Mn.y.redMul(rs).redMul(this.z),ds=is.redSub(os),hs=as.redSub(us);if(ds.cmpn(0)===0)return hs.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ps=ds.redSqr(),io=ps.redMul(ds),fo=is.redMul(ps),mo=hs.redSqr().redIAdd(io).redISub(fo).redISub(fo),Ao=hs.redMul(fo.redISub(mo)).redISub(as.redMul(io)),$o=this.z.redMul(ds);return this.curve.jpoint(mo,Ao,$o)};JPoint$1.prototype.dblp=function(Mn){if(Mn===0)return this;if(this.isInfinity())return this;if(!Mn)return this.dbl();var rs;if(this.curve.zeroA||this.curve.threeA){var is=this;for(rs=0;rs<Mn;rs++)is=is.dbl();return is}var os=this.curve.a,as=this.curve.tinv,us=this.x,ds=this.y,hs=this.z,ps=hs.redSqr().redSqr(),io=ds.redAdd(ds);for(rs=0;rs<Mn;rs++){var fo=us.redSqr(),mo=io.redSqr(),Ao=mo.redSqr(),$o=fo.redAdd(fo).redIAdd(fo).redIAdd(os.redMul(ps)),Lo=us.redMul(mo),Go=$o.redSqr().redISub(Lo.redAdd(Lo)),Yo=Lo.redISub(Go),Wo=$o.redMul(Yo);Wo=Wo.redIAdd(Wo).redISub(Ao);var Jo=io.redMul(hs);rs+1<Mn&&(ps=ps.redMul(Ao)),us=Go,hs=Jo,io=Wo}return this.curve.jpoint(us,io.redMul(as),hs)};JPoint$1.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};JPoint$1.prototype._zeroDbl=function(){var Mn,rs,is;if(this.zOne){var os=this.x.redSqr(),as=this.y.redSqr(),us=as.redSqr(),ds=this.x.redAdd(as).redSqr().redISub(os).redISub(us);ds=ds.redIAdd(ds);var hs=os.redAdd(os).redIAdd(os),ps=hs.redSqr().redISub(ds).redISub(ds),io=us.redIAdd(us);io=io.redIAdd(io),io=io.redIAdd(io),Mn=ps,rs=hs.redMul(ds.redISub(ps)).redISub(io),is=this.y.redAdd(this.y)}else{var fo=this.x.redSqr(),mo=this.y.redSqr(),Ao=mo.redSqr(),$o=this.x.redAdd(mo).redSqr().redISub(fo).redISub(Ao);$o=$o.redIAdd($o);var Lo=fo.redAdd(fo).redIAdd(fo),Go=Lo.redSqr(),Yo=Ao.redIAdd(Ao);Yo=Yo.redIAdd(Yo),Yo=Yo.redIAdd(Yo),Mn=Go.redISub($o).redISub($o),rs=Lo.redMul($o.redISub(Mn)).redISub(Yo),is=this.y.redMul(this.z),is=is.redIAdd(is)}return this.curve.jpoint(Mn,rs,is)};JPoint$1.prototype._threeDbl=function(){var Mn,rs,is;if(this.zOne){var os=this.x.redSqr(),as=this.y.redSqr(),us=as.redSqr(),ds=this.x.redAdd(as).redSqr().redISub(os).redISub(us);ds=ds.redIAdd(ds);var hs=os.redAdd(os).redIAdd(os).redIAdd(this.curve.a),ps=hs.redSqr().redISub(ds).redISub(ds);Mn=ps;var io=us.redIAdd(us);io=io.redIAdd(io),io=io.redIAdd(io),rs=hs.redMul(ds.redISub(ps)).redISub(io),is=this.y.redAdd(this.y)}else{var fo=this.z.redSqr(),mo=this.y.redSqr(),Ao=this.x.redMul(mo),$o=this.x.redSub(fo).redMul(this.x.redAdd(fo));$o=$o.redAdd($o).redIAdd($o);var Lo=Ao.redIAdd(Ao);Lo=Lo.redIAdd(Lo);var Go=Lo.redAdd(Lo);Mn=$o.redSqr().redISub(Go),is=this.y.redAdd(this.z).redSqr().redISub(mo).redISub(fo);var Yo=mo.redSqr();Yo=Yo.redIAdd(Yo),Yo=Yo.redIAdd(Yo),Yo=Yo.redIAdd(Yo),rs=$o.redMul(Lo.redISub(Mn)).redISub(Yo)}return this.curve.jpoint(Mn,rs,is)};JPoint$1.prototype._dbl=function(){var Mn=this.curve.a,rs=this.x,is=this.y,os=this.z,as=os.redSqr().redSqr(),us=rs.redSqr(),ds=is.redSqr(),hs=us.redAdd(us).redIAdd(us).redIAdd(Mn.redMul(as)),ps=rs.redAdd(rs);ps=ps.redIAdd(ps);var io=ps.redMul(ds),fo=hs.redSqr().redISub(io.redAdd(io)),mo=io.redISub(fo),Ao=ds.redSqr();Ao=Ao.redIAdd(Ao),Ao=Ao.redIAdd(Ao),Ao=Ao.redIAdd(Ao);var $o=hs.redMul(mo).redISub(Ao),Lo=is.redAdd(is).redMul(os);return this.curve.jpoint(fo,$o,Lo)};JPoint$1.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var Mn=this.x.redSqr(),rs=this.y.redSqr(),is=this.z.redSqr(),os=rs.redSqr(),as=Mn.redAdd(Mn).redIAdd(Mn),us=as.redSqr(),ds=this.x.redAdd(rs).redSqr().redISub(Mn).redISub(os);ds=ds.redIAdd(ds),ds=ds.redAdd(ds).redIAdd(ds),ds=ds.redISub(us);var hs=ds.redSqr(),ps=os.redIAdd(os);ps=ps.redIAdd(ps),ps=ps.redIAdd(ps),ps=ps.redIAdd(ps);var io=as.redIAdd(ds).redSqr().redISub(us).redISub(hs).redISub(ps),fo=rs.redMul(io);fo=fo.redIAdd(fo),fo=fo.redIAdd(fo);var mo=this.x.redMul(hs).redISub(fo);mo=mo.redIAdd(mo),mo=mo.redIAdd(mo);var Ao=this.y.redMul(io.redMul(ps.redISub(io)).redISub(ds.redMul(hs)));Ao=Ao.redIAdd(Ao),Ao=Ao.redIAdd(Ao),Ao=Ao.redIAdd(Ao);var $o=this.z.redAdd(ds).redSqr().redISub(is).redISub(hs);return this.curve.jpoint(mo,Ao,$o)};JPoint$1.prototype.mul=function(Mn,rs){return Mn=new BN$9(Mn,rs),this.curve._wnafMul(this,Mn)};JPoint$1.prototype.eq=function(Mn){if(Mn.type==="affine")return this.eq(Mn.toJ());if(this===Mn)return!0;var rs=this.z.redSqr(),is=Mn.z.redSqr();if(this.x.redMul(is).redISub(Mn.x.redMul(rs)).cmpn(0)!==0)return!1;var os=rs.redMul(this.z),as=is.redMul(Mn.z);return this.y.redMul(as).redISub(Mn.y.redMul(os)).cmpn(0)===0};JPoint$1.prototype.eqXToP=function(Mn){var rs=this.z.redSqr(),is=Mn.toRed(this.curve.red).redMul(rs);if(this.x.cmp(is)===0)return!0;for(var os=Mn.clone(),as=this.curve.redN.redMul(rs);;){if(os.iadd(this.curve.n),os.cmp(this.curve.p)>=0)return!1;if(is.redIAdd(as),this.x.cmp(is)===0)return!0}};JPoint$1.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};JPoint$1.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var curve_1=createCommonjsModule$1(function(Fn,Mn){var rs=Mn;rs.base=base$2,rs.short=short_1,rs.mont=null,rs.edwards=null}),curves_1=createCommonjsModule$1(function(Fn,Mn){var rs=Mn,is=utils_1$1.assert;function os(ds){ds.type==="short"?this.curve=new curve_1.short(ds):ds.type==="edwards"?this.curve=new curve_1.edwards(ds):this.curve=new curve_1.mont(ds),this.g=this.curve.g,this.n=this.curve.n,this.hash=ds.hash,is(this.g.validate(),"Invalid curve"),is(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}rs.PresetCurve=os;function as(ds,hs){Object.defineProperty(rs,ds,{configurable:!0,enumerable:!0,get:function(){var ps=new os(hs);return Object.defineProperty(rs,ds,{configurable:!0,enumerable:!0,value:ps}),ps}})}as("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash$4.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),as("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash$4.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),as("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash$4.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),as("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash$4.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),as("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash$4.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),as("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash$4.sha256,gRed:!1,g:["9"]}),as("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash$4.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var us;try{us=null.crash()}catch{us=void 0}as("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash$4.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",us]})});function HmacDRBG$2(Fn){if(!(this instanceof HmacDRBG$2))return new HmacDRBG$2(Fn);this.hash=Fn.hash,this.predResist=!!Fn.predResist,this.outLen=this.hash.outSize,this.minEntropy=Fn.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var Mn=utils_1.toArray(Fn.entropy,Fn.entropyEnc||"hex"),rs=utils_1.toArray(Fn.nonce,Fn.nonceEnc||"hex"),is=utils_1.toArray(Fn.pers,Fn.persEnc||"hex");minimalisticAssert(Mn.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(Mn,rs,is)}var hmacDrbg$1=HmacDRBG$2;HmacDRBG$2.prototype._init=function(Mn,rs,is){var os=Mn.concat(rs).concat(is);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var as=0;as<this.V.length;as++)this.K[as]=0,this.V[as]=1;this._update(os),this._reseed=1,this.reseedInterval=281474976710656};HmacDRBG$2.prototype._hmac=function(){return new hash$4.hmac(this.hash,this.K)};HmacDRBG$2.prototype._update=function(Mn){var rs=this._hmac().update(this.V).update([0]);Mn&&(rs=rs.update(Mn)),this.K=rs.digest(),this.V=this._hmac().update(this.V).digest(),Mn&&(this.K=this._hmac().update(this.V).update([1]).update(Mn).digest(),this.V=this._hmac().update(this.V).digest())};HmacDRBG$2.prototype.reseed=function(Mn,rs,is,os){typeof rs!="string"&&(os=is,is=rs,rs=null),Mn=utils_1.toArray(Mn,rs),is=utils_1.toArray(is,os),minimalisticAssert(Mn.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Mn.concat(is||[])),this._reseed=1};HmacDRBG$2.prototype.generate=function(Mn,rs,is,os){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof rs!="string"&&(os=is,is=rs,rs=null),is&&(is=utils_1.toArray(is,os||"hex"),this._update(is));for(var as=[];as.length<Mn;)this.V=this._hmac().update(this.V).digest(),as=as.concat(this.V);var us=as.slice(0,Mn);return this._update(is),this._reseed++,utils_1.encode(us,rs)};var assert$3$1=utils_1$1.assert;function KeyPair$4(Fn,Mn){this.ec=Fn,this.priv=null,this.pub=null,Mn.priv&&this._importPrivate(Mn.priv,Mn.privEnc),Mn.pub&&this._importPublic(Mn.pub,Mn.pubEnc)}var key$2=KeyPair$4;KeyPair$4.fromPublic=function(Mn,rs,is){return rs instanceof KeyPair$4?rs:new KeyPair$4(Mn,{pub:rs,pubEnc:is})};KeyPair$4.fromPrivate=function(Mn,rs,is){return rs instanceof KeyPair$4?rs:new KeyPair$4(Mn,{priv:rs,privEnc:is})};KeyPair$4.prototype.validate=function(){var Mn=this.getPublic();return Mn.isInfinity()?{result:!1,reason:"Invalid public key"}:Mn.validate()?Mn.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};KeyPair$4.prototype.getPublic=function(Mn,rs){return typeof Mn=="string"&&(rs=Mn,Mn=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),rs?this.pub.encode(rs,Mn):this.pub};KeyPair$4.prototype.getPrivate=function(Mn){return Mn==="hex"?this.priv.toString(16,2):this.priv};KeyPair$4.prototype._importPrivate=function(Mn,rs){this.priv=new BN$9(Mn,rs||16),this.priv=this.priv.umod(this.ec.curve.n)};KeyPair$4.prototype._importPublic=function(Mn,rs){if(Mn.x||Mn.y){this.ec.curve.type==="mont"?assert$3$1(Mn.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$3$1(Mn.x&&Mn.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(Mn.x,Mn.y);return}this.pub=this.ec.curve.decodePoint(Mn,rs)};KeyPair$4.prototype.derive=function(Mn){return Mn.validate()||assert$3$1(Mn.validate(),"public point not validated"),Mn.mul(this.priv).getX()};KeyPair$4.prototype.sign=function(Mn,rs,is){return this.ec.sign(Mn,this,rs,is)};KeyPair$4.prototype.verify=function(Mn,rs){return this.ec.verify(Mn,rs,this)};KeyPair$4.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var assert$4$1=utils_1$1.assert;function Signature$4(Fn,Mn){if(Fn instanceof Signature$4)return Fn;this._importDER(Fn,Mn)||(assert$4$1(Fn.r&&Fn.s,"Signature without r or s"),this.r=new BN$9(Fn.r,16),this.s=new BN$9(Fn.s,16),Fn.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=Fn.recoveryParam)}var signature$2=Signature$4;function Position$1(){this.place=0}function getLength$1(Fn,Mn){var rs=Fn[Mn.place++];if(!(rs&128))return rs;var is=rs&15;if(is===0||is>4)return!1;for(var os=0,as=0,us=Mn.place;as<is;as++,us++)os<<=8,os|=Fn[us],os>>>=0;return os<=127?!1:(Mn.place=us,os)}function rmPadding$1(Fn){for(var Mn=0,rs=Fn.length-1;!Fn[Mn]&&!(Fn[Mn+1]&128)&&Mn<rs;)Mn++;return Mn===0?Fn:Fn.slice(Mn)}Signature$4.prototype._importDER=function(Mn,rs){Mn=utils_1$1.toArray(Mn,rs);var is=new Position$1;if(Mn[is.place++]!==48)return!1;var os=getLength$1(Mn,is);if(os===!1||os+is.place!==Mn.length||Mn[is.place++]!==2)return!1;var as=getLength$1(Mn,is);if(as===!1)return!1;var us=Mn.slice(is.place,as+is.place);if(is.place+=as,Mn[is.place++]!==2)return!1;var ds=getLength$1(Mn,is);if(ds===!1||Mn.length!==ds+is.place)return!1;var hs=Mn.slice(is.place,ds+is.place);if(us[0]===0)if(us[1]&128)us=us.slice(1);else return!1;if(hs[0]===0)if(hs[1]&128)hs=hs.slice(1);else return!1;return this.r=new BN$9(us),this.s=new BN$9(hs),this.recoveryParam=null,!0};function constructLength$1(Fn,Mn){if(Mn<128){Fn.push(Mn);return}var rs=1+(Math.log(Mn)/Math.LN2>>>3);for(Fn.push(rs|128);--rs;)Fn.push(Mn>>>(rs<<3)&255);Fn.push(Mn)}Signature$4.prototype.toDER=function(Mn){var rs=this.r.toArray(),is=this.s.toArray();for(rs[0]&128&&(rs=[0].concat(rs)),is[0]&128&&(is=[0].concat(is)),rs=rmPadding$1(rs),is=rmPadding$1(is);!is[0]&&!(is[1]&128);)is=is.slice(1);var os=[2];constructLength$1(os,rs.length),os=os.concat(rs),os.push(2),constructLength$1(os,is.length);var as=os.concat(is),us=[48];return constructLength$1(us,as.length),us=us.concat(as),utils_1$1.encode(us,Mn)};var rand$1=function(){throw new Error("unsupported")},assert$5$1=utils_1$1.assert;function EC$1(Fn){if(!(this instanceof EC$1))return new EC$1(Fn);typeof Fn=="string"&&(assert$5$1(Object.prototype.hasOwnProperty.call(curves_1,Fn),"Unknown curve "+Fn),Fn=curves_1[Fn]),Fn instanceof curves_1.PresetCurve&&(Fn={curve:Fn}),this.curve=Fn.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=Fn.curve.g,this.g.precompute(Fn.curve.n.bitLength()+1),this.hash=Fn.hash||Fn.curve.hash}var ec$1=EC$1;EC$1.prototype.keyPair=function(Mn){return new key$2(this,Mn)};EC$1.prototype.keyFromPrivate=function(Mn,rs){return key$2.fromPrivate(this,Mn,rs)};EC$1.prototype.keyFromPublic=function(Mn,rs){return key$2.fromPublic(this,Mn,rs)};EC$1.prototype.genKeyPair=function(Mn){Mn||(Mn={});for(var rs=new hmacDrbg$1({hash:this.hash,pers:Mn.pers,persEnc:Mn.persEnc||"utf8",entropy:Mn.entropy||rand$1(this.hash.hmacStrength),entropyEnc:Mn.entropy&&Mn.entropyEnc||"utf8",nonce:this.n.toArray()}),is=this.n.byteLength(),os=this.n.sub(new BN$9(2));;){var as=new BN$9(rs.generate(is));if(!(as.cmp(os)>0))return as.iaddn(1),this.keyFromPrivate(as)}};EC$1.prototype._truncateToN=function(Mn,rs){var is=Mn.byteLength()*8-this.n.bitLength();return is>0&&(Mn=Mn.ushrn(is)),!rs&&Mn.cmp(this.n)>=0?Mn.sub(this.n):Mn};EC$1.prototype.sign=function(Mn,rs,is,os){typeof is=="object"&&(os=is,is=null),os||(os={}),rs=this.keyFromPrivate(rs,is),Mn=this._truncateToN(new BN$9(Mn,16));for(var as=this.n.byteLength(),us=rs.getPrivate().toArray("be",as),ds=Mn.toArray("be",as),hs=new hmacDrbg$1({hash:this.hash,entropy:us,nonce:ds,pers:os.pers,persEnc:os.persEnc||"utf8"}),ps=this.n.sub(new BN$9(1)),io=0;;io++){var fo=os.k?os.k(io):new BN$9(hs.generate(this.n.byteLength()));if(fo=this._truncateToN(fo,!0),!(fo.cmpn(1)<=0||fo.cmp(ps)>=0)){var mo=this.g.mul(fo);if(!mo.isInfinity()){var Ao=mo.getX(),$o=Ao.umod(this.n);if($o.cmpn(0)!==0){var Lo=fo.invm(this.n).mul($o.mul(rs.getPrivate()).iadd(Mn));if(Lo=Lo.umod(this.n),Lo.cmpn(0)!==0){var Go=(mo.getY().isOdd()?1:0)|(Ao.cmp($o)!==0?2:0);return os.canonical&&Lo.cmp(this.nh)>0&&(Lo=this.n.sub(Lo),Go^=1),new signature$2({r:$o,s:Lo,recoveryParam:Go})}}}}}};EC$1.prototype.verify=function(Mn,rs,is,os){Mn=this._truncateToN(new BN$9(Mn,16)),is=this.keyFromPublic(is,os),rs=new signature$2(rs,"hex");var as=rs.r,us=rs.s;if(as.cmpn(1)<0||as.cmp(this.n)>=0||us.cmpn(1)<0||us.cmp(this.n)>=0)return!1;var ds=us.invm(this.n),hs=ds.mul(Mn).umod(this.n),ps=ds.mul(as).umod(this.n),io;return this.curve._maxwellTrick?(io=this.g.jmulAdd(hs,is.getPublic(),ps),io.isInfinity()?!1:io.eqXToP(as)):(io=this.g.mulAdd(hs,is.getPublic(),ps),io.isInfinity()?!1:io.getX().umod(this.n).cmp(as)===0)};EC$1.prototype.recoverPubKey=function(Fn,Mn,rs,is){assert$5$1((3&rs)===rs,"The recovery param is more than two bits"),Mn=new signature$2(Mn,is);var os=this.n,as=new BN$9(Fn),us=Mn.r,ds=Mn.s,hs=rs&1,ps=rs>>1;if(us.cmp(this.curve.p.umod(this.curve.n))>=0&&ps)throw new Error("Unable to find sencond key candinate");ps?us=this.curve.pointFromX(us.add(this.curve.n),hs):us=this.curve.pointFromX(us,hs);var io=Mn.r.invm(os),fo=os.sub(as).mul(io).umod(os),mo=ds.mul(io).umod(os);return this.g.mulAdd(fo,us,mo)};EC$1.prototype.getKeyRecoveryParam=function(Fn,Mn,rs,is){if(Mn=new signature$2(Mn,is),Mn.recoveryParam!==null)return Mn.recoveryParam;for(var os=0;os<4;os++){var as;try{as=this.recoverPubKey(Fn,Mn,os)}catch{continue}if(as.eq(rs))return os}throw new Error("Unable to find valid recovery factor")};var elliptic_1=createCommonjsModule$1(function(Fn,Mn){var rs=Mn;rs.version="6.5.4",rs.utils=utils_1$1,rs.rand=function(){throw new Error("unsupported")},rs.curve=curve_1,rs.curves=curves_1,rs.ec=ec$1,rs.eddsa=null}),EC$1$1=elliptic_1.ec;const version$b="signing-key/5.7.0",logger$a=new Logger$1(version$b);let _curve=null;function getCurve(){return _curve||(_curve=new EC$1$1("secp256k1")),_curve}class SigningKey{constructor(Mn){defineReadOnly(this,"curve","secp256k1"),defineReadOnly(this,"privateKey",hexlify(Mn)),hexDataLength(this.privateKey)!==32&&logger$a.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const rs=getCurve().keyFromPrivate(arrayify(this.privateKey));defineReadOnly(this,"publicKey","0x"+rs.getPublic(!1,"hex")),defineReadOnly(this,"compressedPublicKey","0x"+rs.getPublic(!0,"hex")),defineReadOnly(this,"_isSigningKey",!0)}_addPoint(Mn){const rs=getCurve().keyFromPublic(arrayify(this.publicKey)),is=getCurve().keyFromPublic(arrayify(Mn));return"0x"+rs.pub.add(is.pub).encodeCompressed("hex")}signDigest(Mn){const rs=getCurve().keyFromPrivate(arrayify(this.privateKey)),is=arrayify(Mn);is.length!==32&&logger$a.throwArgumentError("bad digest length","digest",Mn);const os=rs.sign(is,{canonical:!0});return splitSignature({recoveryParam:os.recoveryParam,r:hexZeroPad("0x"+os.r.toString(16),32),s:hexZeroPad("0x"+os.s.toString(16),32)})}computeSharedSecret(Mn){const rs=getCurve().keyFromPrivate(arrayify(this.privateKey)),is=getCurve().keyFromPublic(arrayify(computePublicKey(Mn)));return hexZeroPad("0x"+rs.derive(is.getPublic()).toString(16),32)}static isSigningKey(Mn){return!!(Mn&&Mn._isSigningKey)}}function recoverPublicKey(Fn,Mn){const rs=splitSignature(Mn),is={r:arrayify(rs.r),s:arrayify(rs.s)};return"0x"+getCurve().recoverPubKey(arrayify(Fn),is,rs.recoveryParam).encode("hex",!1)}function computePublicKey(Fn,Mn){const rs=arrayify(Fn);return rs.length===32?new SigningKey(rs).publicKey:rs.length===33?"0x"+getCurve().keyFromPublic(rs).getPublic(!1,"hex"):rs.length===65?hexlify(rs):logger$a.throwArgumentError("invalid public or private key","key","[REDACTED]")}const version$a="transactions/5.7.0",logger$9=new Logger$1(version$a);var TransactionTypes;(function(Fn){Fn[Fn.legacy=0]="legacy",Fn[Fn.eip2930=1]="eip2930",Fn[Fn.eip1559=2]="eip1559"})(TransactionTypes||(TransactionTypes={}));function handleAddress(Fn){return Fn==="0x"?null:getAddress(Fn)}function handleNumber(Fn){return Fn==="0x"?Zero$1:BigNumber$1.from(Fn)}function computeAddress(Fn){const Mn=computePublicKey(Fn);return getAddress(hexDataSlice(keccak256(hexDataSlice(Mn,1)),12))}function recoverAddress(Fn,Mn){return computeAddress(recoverPublicKey(arrayify(Fn),Mn))}function formatNumber$2(Fn,Mn){const rs=stripZeros(BigNumber$1.from(Fn).toHexString());return rs.length>32&&logger$9.throwArgumentError("invalid length for "+Mn,"transaction:"+Mn,Fn),rs}function accessSetify(Fn,Mn){return{address:getAddress(Fn),storageKeys:(Mn||[]).map((rs,is)=>(hexDataLength(rs)!==32&&logger$9.throwArgumentError("invalid access list storageKey",`accessList[${Fn}:${is}]`,rs),rs.toLowerCase()))}}function accessListify(Fn){if(Array.isArray(Fn))return Fn.map((rs,is)=>Array.isArray(rs)?(rs.length>2&&logger$9.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${is}]`,rs),accessSetify(rs[0],rs[1])):accessSetify(rs.address,rs.storageKeys));const Mn=Object.keys(Fn).map(rs=>{const is=Fn[rs].reduce((os,as)=>(os[as]=!0,os),{});return accessSetify(rs,Object.keys(is).sort())});return Mn.sort((rs,is)=>rs.address.localeCompare(is.address)),Mn}function formatAccessList(Fn){return accessListify(Fn).map(Mn=>[Mn.address,Mn.storageKeys])}function _serializeEip1559(Fn,Mn){if(Fn.gasPrice!=null){const is=BigNumber$1.from(Fn.gasPrice),os=BigNumber$1.from(Fn.maxFeePerGas||0);is.eq(os)||logger$9.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:is,maxFeePerGas:os})}const rs=[formatNumber$2(Fn.chainId||0,"chainId"),formatNumber$2(Fn.nonce||0,"nonce"),formatNumber$2(Fn.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber$2(Fn.maxFeePerGas||0,"maxFeePerGas"),formatNumber$2(Fn.gasLimit||0,"gasLimit"),Fn.to!=null?getAddress(Fn.to):"0x",formatNumber$2(Fn.value||0,"value"),Fn.data||"0x",formatAccessList(Fn.accessList||[])];if(Mn){const is=splitSignature(Mn);rs.push(formatNumber$2(is.recoveryParam,"recoveryParam")),rs.push(stripZeros(is.r)),rs.push(stripZeros(is.s))}return hexConcat(["0x02",encode$6(rs)])}function _serializeEip2930(Fn,Mn){const rs=[formatNumber$2(Fn.chainId||0,"chainId"),formatNumber$2(Fn.nonce||0,"nonce"),formatNumber$2(Fn.gasPrice||0,"gasPrice"),formatNumber$2(Fn.gasLimit||0,"gasLimit"),Fn.to!=null?getAddress(Fn.to):"0x",formatNumber$2(Fn.value||0,"value"),Fn.data||"0x",formatAccessList(Fn.accessList||[])];if(Mn){const is=splitSignature(Mn);rs.push(formatNumber$2(is.recoveryParam,"recoveryParam")),rs.push(stripZeros(is.r)),rs.push(stripZeros(is.s))}return hexConcat(["0x01",encode$6(rs)])}function _parseEipSignature(Fn,Mn,rs){try{const is=handleNumber(Mn[0]).toNumber();if(is!==0&&is!==1)throw new Error("bad recid");Fn.v=is}catch{logger$9.throwArgumentError("invalid v for transaction type: 1","v",Mn[0])}Fn.r=hexZeroPad(Mn[1],32),Fn.s=hexZeroPad(Mn[2],32);try{const is=keccak256(rs(Fn));Fn.from=recoverAddress(is,{r:Fn.r,s:Fn.s,recoveryParam:Fn.v})}catch{}}function _parseEip1559(Fn){const Mn=decode$5(Fn.slice(1));Mn.length!==9&&Mn.length!==12&&logger$9.throwArgumentError("invalid component count for transaction type: 2","payload",hexlify(Fn));const rs=handleNumber(Mn[2]),is=handleNumber(Mn[3]),os={type:2,chainId:handleNumber(Mn[0]).toNumber(),nonce:handleNumber(Mn[1]).toNumber(),maxPriorityFeePerGas:rs,maxFeePerGas:is,gasPrice:null,gasLimit:handleNumber(Mn[4]),to:handleAddress(Mn[5]),value:handleNumber(Mn[6]),data:Mn[7],accessList:accessListify(Mn[8])};return Mn.length===9||(os.hash=keccak256(Fn),_parseEipSignature(os,Mn.slice(9),_serializeEip1559)),os}function _parseEip2930(Fn){const Mn=decode$5(Fn.slice(1));Mn.length!==8&&Mn.length!==11&&logger$9.throwArgumentError("invalid component count for transaction type: 1","payload",hexlify(Fn));const rs={type:1,chainId:handleNumber(Mn[0]).toNumber(),nonce:handleNumber(Mn[1]).toNumber(),gasPrice:handleNumber(Mn[2]),gasLimit:handleNumber(Mn[3]),to:handleAddress(Mn[4]),value:handleNumber(Mn[5]),data:Mn[6],accessList:accessListify(Mn[7])};return Mn.length===8||(rs.hash=keccak256(Fn),_parseEipSignature(rs,Mn.slice(8),_serializeEip2930)),rs}function _parse(Fn){const Mn=decode$5(Fn);Mn.length!==9&&Mn.length!==6&&logger$9.throwArgumentError("invalid raw transaction","rawTransaction",Fn);const rs={nonce:handleNumber(Mn[0]).toNumber(),gasPrice:handleNumber(Mn[1]),gasLimit:handleNumber(Mn[2]),to:handleAddress(Mn[3]),value:handleNumber(Mn[4]),data:Mn[5],chainId:0};if(Mn.length===6)return rs;try{rs.v=BigNumber$1.from(Mn[6]).toNumber()}catch{return rs}if(rs.r=hexZeroPad(Mn[7],32),rs.s=hexZeroPad(Mn[8],32),BigNumber$1.from(rs.r).isZero()&&BigNumber$1.from(rs.s).isZero())rs.chainId=rs.v,rs.v=0;else{rs.chainId=Math.floor((rs.v-35)/2),rs.chainId<0&&(rs.chainId=0);let is=rs.v-27;const os=Mn.slice(0,6);rs.chainId!==0&&(os.push(hexlify(rs.chainId)),os.push("0x"),os.push("0x"),is-=rs.chainId*2+8);const as=keccak256(encode$6(os));try{rs.from=recoverAddress(as,{r:hexlify(rs.r),s:hexlify(rs.s),recoveryParam:is})}catch{}rs.hash=keccak256(Fn)}return rs.type=null,rs}function parse$1(Fn){const Mn=arrayify(Fn);if(Mn[0]>127)return _parse(Mn);switch(Mn[0]){case 1:return _parseEip2930(Mn);case 2:return _parseEip1559(Mn)}return logger$9.throwError(`unsupported transaction type: ${Mn[0]}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:Mn[0]})}const version$9="contracts/5.7.0";var __awaiter$5=function(Fn,Mn,rs,is){function os(as){return as instanceof rs?as:new rs(function(us){us(as)})}return new(rs||(rs=Promise))(function(as,us){function ds(io){try{ps(is.next(io))}catch(fo){us(fo)}}function hs(io){try{ps(is.throw(io))}catch(fo){us(fo)}}function ps(io){io.done?as(io.value):os(io.value).then(ds,hs)}ps((is=is.apply(Fn,Mn||[])).next())})};const logger$8=new Logger$1(version$9);function resolveName(Fn,Mn){return __awaiter$5(this,void 0,void 0,function*(){const rs=yield Mn;typeof rs!="string"&&logger$8.throwArgumentError("invalid address or ENS name","name",rs);try{return getAddress(rs)}catch{}Fn||logger$8.throwError("a provider or signer is needed to resolve ENS names",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const is=yield Fn.resolveName(rs);return is==null&&logger$8.throwArgumentError("resolver or addr is not configured for ENS name","name",rs),is})}function resolveAddresses(Fn,Mn,rs){return __awaiter$5(this,void 0,void 0,function*(){return Array.isArray(rs)?yield Promise.all(rs.map((is,os)=>resolveAddresses(Fn,Array.isArray(Mn)?Mn[os]:Mn[is.name],is))):rs.type==="address"?yield resolveName(Fn,Mn):rs.type==="tuple"?yield resolveAddresses(Fn,Mn,rs.components):rs.baseType==="array"?Array.isArray(Mn)?yield Promise.all(Mn.map(is=>resolveAddresses(Fn,is,rs.arrayChildren))):Promise.reject(logger$8.makeError("invalid value for array",Logger$1.errors.INVALID_ARGUMENT,{argument:"value",value:Mn})):Mn})}function populateTransaction(Fn,Mn,rs){return __awaiter$5(this,void 0,void 0,function*(){let is={};rs.length===Mn.inputs.length+1&&typeof rs[rs.length-1]=="object"&&(is=shallowCopy(rs.pop())),logger$8.checkArgumentCount(rs.length,Mn.inputs.length,"passed to contract"),Fn.signer?is.from?is.from=resolveProperties({override:resolveName(Fn.signer,is.from),signer:Fn.signer.getAddress()}).then(ps=>__awaiter$5(this,void 0,void 0,function*(){return getAddress(ps.signer)!==ps.override&&logger$8.throwError("Contract with a Signer cannot override from",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),ps.override})):is.from=Fn.signer.getAddress():is.from&&(is.from=resolveName(Fn.provider,is.from));const os=yield resolveProperties({args:resolveAddresses(Fn.signer||Fn.provider,rs,Mn.inputs),address:Fn.resolvedAddress,overrides:resolveProperties(is)||{}}),as=Fn.interface.encodeFunctionData(Mn,os.args),us={data:as,to:os.address},ds=os.overrides;if(ds.nonce!=null&&(us.nonce=BigNumber$1.from(ds.nonce).toNumber()),ds.gasLimit!=null&&(us.gasLimit=BigNumber$1.from(ds.gasLimit)),ds.gasPrice!=null&&(us.gasPrice=BigNumber$1.from(ds.gasPrice)),ds.maxFeePerGas!=null&&(us.maxFeePerGas=BigNumber$1.from(ds.maxFeePerGas)),ds.maxPriorityFeePerGas!=null&&(us.maxPriorityFeePerGas=BigNumber$1.from(ds.maxPriorityFeePerGas)),ds.from!=null&&(us.from=ds.from),ds.type!=null&&(us.type=ds.type),ds.accessList!=null&&(us.accessList=accessListify(ds.accessList)),us.gasLimit==null&&Mn.gas!=null){let ps=21e3;const io=arrayify(as);for(let fo=0;fo<io.length;fo++)ps+=4,io[fo]&&(ps+=64);us.gasLimit=BigNumber$1.from(Mn.gas).add(ps)}if(ds.value){const ps=BigNumber$1.from(ds.value);!ps.isZero()&&!Mn.payable&&logger$8.throwError("non-payable method cannot override value",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:is.value}),us.value=ps}ds.customData&&(us.customData=shallowCopy(ds.customData)),ds.ccipReadEnabled&&(us.ccipReadEnabled=!!ds.ccipReadEnabled),delete is.nonce,delete is.gasLimit,delete is.gasPrice,delete is.from,delete is.value,delete is.type,delete is.accessList,delete is.maxFeePerGas,delete is.maxPriorityFeePerGas,delete is.customData,delete is.ccipReadEnabled;const hs=Object.keys(is).filter(ps=>is[ps]!=null);return hs.length&&logger$8.throwError(`cannot override ${hs.map(ps=>JSON.stringify(ps)).join(",")}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:hs}),us})}function buildPopulate(Fn,Mn){return function(...rs){return populateTransaction(Fn,Mn,rs)}}function buildEstimate(Fn,Mn){const rs=Fn.signer||Fn.provider;return function(...is){return __awaiter$5(this,void 0,void 0,function*(){rs||logger$8.throwError("estimate require a provider or signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const os=yield populateTransaction(Fn,Mn,is);return yield rs.estimateGas(os)})}}function addContractWait(Fn,Mn){const rs=Mn.wait.bind(Mn);Mn.wait=is=>rs(is).then(os=>(os.events=os.logs.map(as=>{let us=deepCopy(as),ds=null;try{ds=Fn.interface.parseLog(as)}catch{}return ds&&(us.args=ds.args,us.decode=(hs,ps)=>Fn.interface.decodeEventLog(ds.eventFragment,hs,ps),us.event=ds.name,us.eventSignature=ds.signature),us.removeListener=()=>Fn.provider,us.getBlock=()=>Fn.provider.getBlock(os.blockHash),us.getTransaction=()=>Fn.provider.getTransaction(os.transactionHash),us.getTransactionReceipt=()=>Promise.resolve(os),us}),os))}function buildCall(Fn,Mn,rs){const is=Fn.signer||Fn.provider;return function(...os){return __awaiter$5(this,void 0,void 0,function*(){let as;if(os.length===Mn.inputs.length+1&&typeof os[os.length-1]=="object"){const hs=shallowCopy(os.pop());hs.blockTag!=null&&(as=yield hs.blockTag),delete hs.blockTag,os.push(hs)}Fn.deployTransaction!=null&&(yield Fn._deployed(as));const us=yield populateTransaction(Fn,Mn,os),ds=yield is.call(us,as);try{let hs=Fn.interface.decodeFunctionResult(Mn,ds);return rs&&Mn.outputs.length===1&&(hs=hs[0]),hs}catch(hs){throw hs.code===Logger$1.errors.CALL_EXCEPTION&&(hs.address=Fn.address,hs.args=os,hs.transaction=us),hs}})}}function buildSend(Fn,Mn){return function(...rs){return __awaiter$5(this,void 0,void 0,function*(){Fn.signer||logger$8.throwError("sending a transaction requires a signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),Fn.deployTransaction!=null&&(yield Fn._deployed());const is=yield populateTransaction(Fn,Mn,rs),os=yield Fn.signer.sendTransaction(is);return addContractWait(Fn,os),os})}}function buildDefault(Fn,Mn,rs){return Mn.constant?buildCall(Fn,Mn,rs):buildSend(Fn,Mn)}function getEventTag$1(Fn){return Fn.address&&(Fn.topics==null||Fn.topics.length===0)?"*":(Fn.address||"*")+"@"+(Fn.topics?Fn.topics.map(Mn=>Array.isArray(Mn)?Mn.join("|"):Mn).join(":"):"")}class RunningEvent{constructor(Mn,rs){defineReadOnly(this,"tag",Mn),defineReadOnly(this,"filter",rs),this._listeners=[]}addListener(Mn,rs){this._listeners.push({listener:Mn,once:rs})}removeListener(Mn){let rs=!1;this._listeners=this._listeners.filter(is=>rs||is.listener!==Mn?!0:(rs=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(Mn=>Mn.listener)}listenerCount(){return this._listeners.length}run(Mn){const rs=this.listenerCount();return this._listeners=this._listeners.filter(is=>{const os=Mn.slice();return setTimeout(()=>{is.listener.apply(this,os)},0),!is.once}),rs}prepareEvent(Mn){}getEmit(Mn){return[Mn]}}class ErrorRunningEvent extends RunningEvent{constructor(){super("error",null)}}class FragmentRunningEvent extends RunningEvent{constructor(Mn,rs,is,os){const as={address:Mn};let us=rs.getEventTopic(is);os?(us!==os[0]&&logger$8.throwArgumentError("topic mismatch","topics",os),as.topics=os.slice()):as.topics=[us],super(getEventTag$1(as),as),defineReadOnly(this,"address",Mn),defineReadOnly(this,"interface",rs),defineReadOnly(this,"fragment",is)}prepareEvent(Mn){super.prepareEvent(Mn),Mn.event=this.fragment.name,Mn.eventSignature=this.fragment.format(),Mn.decode=(rs,is)=>this.interface.decodeEventLog(this.fragment,rs,is);try{Mn.args=this.interface.decodeEventLog(this.fragment,Mn.data,Mn.topics)}catch(rs){Mn.args=null,Mn.decodeError=rs}}getEmit(Mn){const rs=checkResultErrors(Mn.args);if(rs.length)throw rs[0].error;const is=(Mn.args||[]).slice();return is.push(Mn),is}}class WildcardRunningEvent extends RunningEvent{constructor(Mn,rs){super("*",{address:Mn}),defineReadOnly(this,"address",Mn),defineReadOnly(this,"interface",rs)}prepareEvent(Mn){super.prepareEvent(Mn);try{const rs=this.interface.parseLog(Mn);Mn.event=rs.name,Mn.eventSignature=rs.signature,Mn.decode=(is,os)=>this.interface.decodeEventLog(rs.eventFragment,is,os),Mn.args=rs.args}catch{}}}class BaseContract{constructor(Mn,rs,is){defineReadOnly(this,"interface",getStatic(new.target,"getInterface")(rs)),is==null?(defineReadOnly(this,"provider",null),defineReadOnly(this,"signer",null)):Signer.isSigner(is)?(defineReadOnly(this,"provider",is.provider||null),defineReadOnly(this,"signer",is)):Provider.isProvider(is)?(defineReadOnly(this,"provider",is),defineReadOnly(this,"signer",null)):logger$8.throwArgumentError("invalid signer or provider","signerOrProvider",is),defineReadOnly(this,"callStatic",{}),defineReadOnly(this,"estimateGas",{}),defineReadOnly(this,"functions",{}),defineReadOnly(this,"populateTransaction",{}),defineReadOnly(this,"filters",{});{const us={};Object.keys(this.interface.events).forEach(ds=>{const hs=this.interface.events[ds];defineReadOnly(this.filters,ds,(...ps)=>({address:this.address,topics:this.interface.encodeFilterTopics(hs,ps)})),us[hs.name]||(us[hs.name]=[]),us[hs.name].push(ds)}),Object.keys(us).forEach(ds=>{const hs=us[ds];hs.length===1?defineReadOnly(this.filters,ds,this.filters[hs[0]]):logger$8.warn(`Duplicate definition of ${ds} (${hs.join(", ")})`)})}if(defineReadOnly(this,"_runningEvents",{}),defineReadOnly(this,"_wrappedEmits",{}),Mn==null&&logger$8.throwArgumentError("invalid contract address or ENS name","addressOrName",Mn),defineReadOnly(this,"address",Mn),this.provider)defineReadOnly(this,"resolvedAddress",resolveName(this.provider,Mn));else try{defineReadOnly(this,"resolvedAddress",Promise.resolve(getAddress(Mn)))}catch{logger$8.throwError("provider is required to use ENS name as contract address",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(us=>{});const os={},as={};Object.keys(this.interface.functions).forEach(us=>{const ds=this.interface.functions[us];if(as[us]){logger$8.warn(`Duplicate ABI entry for ${JSON.stringify(us)}`);return}as[us]=!0;{const hs=ds.name;os[`%${hs}`]||(os[`%${hs}`]=[]),os[`%${hs}`].push(us)}this[us]==null&&defineReadOnly(this,us,buildDefault(this,ds,!0)),this.functions[us]==null&&defineReadOnly(this.functions,us,buildDefault(this,ds,!1)),this.callStatic[us]==null&&defineReadOnly(this.callStatic,us,buildCall(this,ds,!0)),this.populateTransaction[us]==null&&defineReadOnly(this.populateTransaction,us,buildPopulate(this,ds)),this.estimateGas[us]==null&&defineReadOnly(this.estimateGas,us,buildEstimate(this,ds))}),Object.keys(os).forEach(us=>{const ds=os[us];if(ds.length>1)return;us=us.substring(1);const hs=ds[0];try{this[us]==null&&defineReadOnly(this,us,this[hs])}catch{}this.functions[us]==null&&defineReadOnly(this.functions,us,this.functions[hs]),this.callStatic[us]==null&&defineReadOnly(this.callStatic,us,this.callStatic[hs]),this.populateTransaction[us]==null&&defineReadOnly(this.populateTransaction,us,this.populateTransaction[hs]),this.estimateGas[us]==null&&defineReadOnly(this.estimateGas,us,this.estimateGas[hs])})}static getContractAddress(Mn){return getContractAddress(Mn)}static getInterface(Mn){return Interface.isInterface(Mn)?Mn:new Interface(Mn)}deployed(){return this._deployed()}_deployed(Mn){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,Mn).then(rs=>(rs==="0x"&&logger$8.throwError("contract not deployed",Logger$1.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(Mn){this.signer||logger$8.throwError("sending a transactions require a signer",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const rs=shallowCopy(Mn||{});return["from","to"].forEach(function(is){rs[is]!=null&&logger$8.throwError("cannot override "+is,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:is})}),rs.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(rs))}connect(Mn){typeof Mn=="string"&&(Mn=new VoidSigner(Mn,this.provider));const rs=new this.constructor(this.address,this.interface,Mn);return this.deployTransaction&&defineReadOnly(rs,"deployTransaction",this.deployTransaction),rs}attach(Mn){return new this.constructor(Mn,this.interface,this.signer||this.provider)}static isIndexed(Mn){return Indexed.isIndexed(Mn)}_normalizeRunningEvent(Mn){return this._runningEvents[Mn.tag]?this._runningEvents[Mn.tag]:Mn}_getRunningEvent(Mn){if(typeof Mn=="string"){if(Mn==="error")return this._normalizeRunningEvent(new ErrorRunningEvent);if(Mn==="event")return this._normalizeRunningEvent(new RunningEvent("event",null));if(Mn==="*")return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface));const rs=this.interface.getEvent(Mn);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,rs))}if(Mn.topics&&Mn.topics.length>0){try{const is=Mn.topics[0];if(typeof is!="string")throw new Error("invalid topic");const os=this.interface.getEvent(is);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,os,Mn.topics))}catch{}const rs={address:this.address,topics:Mn.topics};return this._normalizeRunningEvent(new RunningEvent(getEventTag$1(rs),rs))}return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface))}_checkRunningEvents(Mn){if(Mn.listenerCount()===0){delete this._runningEvents[Mn.tag];const rs=this._wrappedEmits[Mn.tag];rs&&Mn.filter&&(this.provider.off(Mn.filter,rs),delete this._wrappedEmits[Mn.tag])}}_wrapEvent(Mn,rs,is){const os=deepCopy(rs);return os.removeListener=()=>{is&&(Mn.removeListener(is),this._checkRunningEvents(Mn))},os.getBlock=()=>this.provider.getBlock(rs.blockHash),os.getTransaction=()=>this.provider.getTransaction(rs.transactionHash),os.getTransactionReceipt=()=>this.provider.getTransactionReceipt(rs.transactionHash),Mn.prepareEvent(os),os}_addEventListener(Mn,rs,is){if(this.provider||logger$8.throwError("events require a provider or a signer with a provider",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"once"}),Mn.addListener(rs,is),this._runningEvents[Mn.tag]=Mn,!this._wrappedEmits[Mn.tag]){const os=as=>{let us=this._wrapEvent(Mn,as,rs);if(us.decodeError==null)try{const ds=Mn.getEmit(us);this.emit(Mn.filter,...ds)}catch(ds){us.decodeError=ds.error}Mn.filter!=null&&this.emit("event",us),us.decodeError!=null&&this.emit("error",us.decodeError,us)};this._wrappedEmits[Mn.tag]=os,Mn.filter!=null&&this.provider.on(Mn.filter,os)}}queryFilter(Mn,rs,is){const os=this._getRunningEvent(Mn),as=shallowCopy(os.filter);return typeof rs=="string"&&isHexString(rs,32)?(is!=null&&logger$8.throwArgumentError("cannot specify toBlock with blockhash","toBlock",is),as.blockHash=rs):(as.fromBlock=rs??0,as.toBlock=is??"latest"),this.provider.getLogs(as).then(us=>us.map(ds=>this._wrapEvent(os,ds,null)))}on(Mn,rs){return this._addEventListener(this._getRunningEvent(Mn),rs,!1),this}once(Mn,rs){return this._addEventListener(this._getRunningEvent(Mn),rs,!0),this}emit(Mn,...rs){if(!this.provider)return!1;const is=this._getRunningEvent(Mn),os=is.run(rs)>0;return this._checkRunningEvents(is),os}listenerCount(Mn){return this.provider?Mn==null?Object.keys(this._runningEvents).reduce((rs,is)=>rs+this._runningEvents[is].listenerCount(),0):this._getRunningEvent(Mn).listenerCount():0}listeners(Mn){if(!this.provider)return[];if(Mn==null){const rs=[];for(let is in this._runningEvents)this._runningEvents[is].listeners().forEach(os=>{rs.push(os)});return rs}return this._getRunningEvent(Mn).listeners()}removeAllListeners(Mn){if(!this.provider)return this;if(Mn==null){for(const is in this._runningEvents){const os=this._runningEvents[is];os.removeAllListeners(),this._checkRunningEvents(os)}return this}const rs=this._getRunningEvent(Mn);return rs.removeAllListeners(),this._checkRunningEvents(rs),this}off(Mn,rs){if(!this.provider)return this;const is=this._getRunningEvent(Mn);return is.removeListener(rs),this._checkRunningEvents(is),this}removeListener(Mn,rs){return this.off(Mn,rs)}}class Contract extends BaseContract{}class BaseX{constructor(Mn){defineReadOnly(this,"alphabet",Mn),defineReadOnly(this,"base",Mn.length),defineReadOnly(this,"_alphabetMap",{}),defineReadOnly(this,"_leader",Mn.charAt(0));for(let rs=0;rs<Mn.length;rs++)this._alphabetMap[Mn.charAt(rs)]=rs}encode(Mn){let rs=arrayify(Mn);if(rs.length===0)return"";let is=[0];for(let as=0;as<rs.length;++as){let us=rs[as];for(let ds=0;ds<is.length;++ds)us+=is[ds]<<8,is[ds]=us%this.base,us=us/this.base|0;for(;us>0;)is.push(us%this.base),us=us/this.base|0}let os="";for(let as=0;rs[as]===0&&as<rs.length-1;++as)os+=this._leader;for(let as=is.length-1;as>=0;--as)os+=this.alphabet[is[as]];return os}decode(Mn){if(typeof Mn!="string")throw new TypeError("Expected String");let rs=[];if(Mn.length===0)return new Uint8Array(rs);rs.push(0);for(let is=0;is<Mn.length;is++){let os=this._alphabetMap[Mn[is]];if(os===void 0)throw new Error("Non-base"+this.base+" character");let as=os;for(let us=0;us<rs.length;++us)as+=rs[us]*this.base,rs[us]=as&255,as>>=8;for(;as>0;)rs.push(as&255),as>>=8}for(let is=0;Mn[is]===this._leader&&is<Mn.length-1;++is)rs.push(0);return arrayify(new Uint8Array(rs.reverse()))}}new BaseX("abcdefghijklmnopqrstuvwxyz234567");const Base58=new BaseX("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function sha256$1(Fn){return"0x"+hash$4.sha256().update(arrayify(Fn)).digest("hex")}const version$8="networks/5.7.1",logger$7=new Logger$1(version$8);function isRenetworkable(Fn){return Fn&&typeof Fn.renetwork=="function"}function ethDefaultProvider(Fn){const Mn=function(rs,is){is==null&&(is={});const os=[];if(rs.InfuraProvider&&is.infura!=="-")try{os.push(new rs.InfuraProvider(Fn,is.infura))}catch{}if(rs.EtherscanProvider&&is.etherscan!=="-")try{os.push(new rs.EtherscanProvider(Fn,is.etherscan))}catch{}if(rs.AlchemyProvider&&is.alchemy!=="-")try{os.push(new rs.AlchemyProvider(Fn,is.alchemy))}catch{}if(rs.PocketProvider&&is.pocket!=="-"){const as=["goerli","ropsten","rinkeby","sepolia"];try{const us=new rs.PocketProvider(Fn,is.pocket);us.network&&as.indexOf(us.network.name)===-1&&os.push(us)}catch{}}if(rs.CloudflareProvider&&is.cloudflare!=="-")try{os.push(new rs.CloudflareProvider(Fn))}catch{}if(rs.AnkrProvider&&is.ankr!=="-")try{const as=["ropsten"],us=new rs.AnkrProvider(Fn,is.ankr);us.network&&as.indexOf(us.network.name)===-1&&os.push(us)}catch{}if(os.length===0)return null;if(rs.FallbackProvider){let as=1;return is.quorum!=null?as=is.quorum:Fn==="homestead"&&(as=2),new rs.FallbackProvider(os,as)}return os[0]};return Mn.renetwork=function(rs){return ethDefaultProvider(rs)},Mn}function etcDefaultProvider(Fn,Mn){const rs=function(is,os){return is.JsonRpcProvider?new is.JsonRpcProvider(Fn,Mn):null};return rs.renetwork=function(is){return etcDefaultProvider(Fn,is)},rs}const homestead={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ethDefaultProvider("homestead")},ropsten={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ethDefaultProvider("ropsten")},classicMordor={chainId:63,name:"classicMordor",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/mordor","classicMordor")},networks$1={unspecified:{chainId:0,name:"unspecified"},homestead,mainnet:homestead,morden:{chainId:2,name:"morden"},ropsten,testnet:ropsten,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ethDefaultProvider("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ethDefaultProvider("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ethDefaultProvider("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:ethDefaultProvider("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor,classicTestnet:classicMordor,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:etcDefaultProvider("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ethDefaultProvider("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ethDefaultProvider("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function getNetwork(Fn){if(Fn==null)return null;if(typeof Fn=="number"){for(const is in networks$1){const os=networks$1[is];if(os.chainId===Fn)return{name:os.name,chainId:os.chainId,ensAddress:os.ensAddress||null,_defaultProvider:os._defaultProvider||null}}return{chainId:Fn,name:"unknown"}}if(typeof Fn=="string"){const is=networks$1[Fn];return is==null?null:{name:is.name,chainId:is.chainId,ensAddress:is.ensAddress,_defaultProvider:is._defaultProvider||null}}const Mn=networks$1[Fn.name];if(!Mn)return typeof Fn.chainId!="number"&&logger$7.throwArgumentError("invalid network chainId","network",Fn),Fn;Fn.chainId!==0&&Fn.chainId!==Mn.chainId&&logger$7.throwArgumentError("network chainId mismatch","network",Fn);let rs=Fn._defaultProvider||null;return rs==null&&Mn._defaultProvider&&(isRenetworkable(Mn._defaultProvider)?rs=Mn._defaultProvider.renetwork(Fn):rs=Mn._defaultProvider),{name:Fn.name,chainId:Mn.chainId,ensAddress:Fn.ensAddress||Mn.ensAddress||null,_defaultProvider:rs}}const version$7="web/5.7.1";var __awaiter$4=function(Fn,Mn,rs,is){function os(as){return as instanceof rs?as:new rs(function(us){us(as)})}return new(rs||(rs=Promise))(function(as,us){function ds(io){try{ps(is.next(io))}catch(fo){us(fo)}}function hs(io){try{ps(is.throw(io))}catch(fo){us(fo)}}function ps(io){io.done?as(io.value):os(io.value).then(ds,hs)}ps((is=is.apply(Fn,Mn||[])).next())})};function getUrl(Fn,Mn){return __awaiter$4(this,void 0,void 0,function*(){Mn==null&&(Mn={});const rs={method:Mn.method||"GET",headers:Mn.headers||{},body:Mn.body||void 0};if(Mn.skipFetchSetup!==!0&&(rs.mode="cors",rs.cache="no-cache",rs.credentials="same-origin",rs.redirect="follow",rs.referrer="client"),Mn.fetchOptions!=null){const us=Mn.fetchOptions;us.mode&&(rs.mode=us.mode),us.cache&&(rs.cache=us.cache),us.credentials&&(rs.credentials=us.credentials),us.redirect&&(rs.redirect=us.redirect),us.referrer&&(rs.referrer=us.referrer)}const is=yield fetch(Fn,rs),os=yield is.arrayBuffer(),as={};return is.headers.forEach?is.headers.forEach((us,ds)=>{as[ds.toLowerCase()]=us}):is.headers.keys().forEach(us=>{as[us.toLowerCase()]=is.headers.get(us)}),{headers:as,statusCode:is.status,statusMessage:is.statusText,body:arrayify(new Uint8Array(os))}})}var __awaiter$3=function(Fn,Mn,rs,is){function os(as){return as instanceof rs?as:new rs(function(us){us(as)})}return new(rs||(rs=Promise))(function(as,us){function ds(io){try{ps(is.next(io))}catch(fo){us(fo)}}function hs(io){try{ps(is.throw(io))}catch(fo){us(fo)}}function ps(io){io.done?as(io.value):os(io.value).then(ds,hs)}ps((is=is.apply(Fn,Mn||[])).next())})};const logger$6=new Logger$1(version$7);function staller(Fn){return new Promise(Mn=>{setTimeout(Mn,Fn)})}function bodyify(Fn,Mn){if(Fn==null)return null;if(typeof Fn=="string")return Fn;if(isBytesLike(Fn)){if(Mn&&(Mn.split("/")[0]==="text"||Mn.split(";")[0].trim()==="application/json"))try{return toUtf8String(Fn)}catch{}return hexlify(Fn)}return Fn}function unpercent(Fn){return toUtf8Bytes(Fn.replace(/%([0-9a-f][0-9a-f])/gi,(Mn,rs)=>String.fromCharCode(parseInt(rs,16))))}function _fetchData(Fn,Mn,rs){const is=typeof Fn=="object"&&Fn.throttleLimit!=null?Fn.throttleLimit:12;logger$6.assertArgument(is>0&&is%1===0,"invalid connection throttle limit","connection.throttleLimit",is);const os=typeof Fn=="object"?Fn.throttleCallback:null,as=typeof Fn=="object"&&typeof Fn.throttleSlotInterval=="number"?Fn.throttleSlotInterval:100;logger$6.assertArgument(as>0&&as%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",as);const us=typeof Fn=="object"?!!Fn.errorPassThrough:!1,ds={};let hs=null;const ps={method:"GET"};let io=!1,fo=2*60*1e3;if(typeof Fn=="string")hs=Fn;else if(typeof Fn=="object"){if((Fn==null||Fn.url==null)&&logger$6.throwArgumentError("missing URL","connection.url",Fn),hs=Fn.url,typeof Fn.timeout=="number"&&Fn.timeout>0&&(fo=Fn.timeout),Fn.headers)for(const Yo in Fn.headers)ds[Yo.toLowerCase()]={key:Yo,value:String(Fn.headers[Yo])},["if-none-match","if-modified-since"].indexOf(Yo.toLowerCase())>=0&&(io=!0);if(ps.allowGzip=!!Fn.allowGzip,Fn.user!=null&&Fn.password!=null){hs.substring(0,6)!=="https:"&&Fn.allowInsecureAuthentication!==!0&&logger$6.throwError("basic authentication requires a secure https url",Logger$1.errors.INVALID_ARGUMENT,{argument:"url",url:hs,user:Fn.user,password:"[REDACTED]"});const Yo=Fn.user+":"+Fn.password;ds.authorization={key:"Authorization",value:"Basic "+encode$5(toUtf8Bytes(Yo))}}Fn.skipFetchSetup!=null&&(ps.skipFetchSetup=!!Fn.skipFetchSetup),Fn.fetchOptions!=null&&(ps.fetchOptions=shallowCopy(Fn.fetchOptions))}const mo=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Ao=hs?hs.match(mo):null;if(Ao)try{const Yo={statusCode:200,statusMessage:"OK",headers:{"content-type":Ao[1]||"text/plain"},body:Ao[2]?decode$4(Ao[3]):unpercent(Ao[3])};let Wo=Yo.body;return rs&&(Wo=rs(Yo.body,Yo)),Promise.resolve(Wo)}catch(Yo){logger$6.throwError("processing response error",Logger$1.errors.SERVER_ERROR,{body:bodyify(Ao[1],Ao[2]),error:Yo,requestBody:null,requestMethod:"GET",url:hs})}Mn&&(ps.method="POST",ps.body=Mn,ds["content-type"]==null&&(ds["content-type"]={key:"Content-Type",value:"application/octet-stream"}),ds["content-length"]==null&&(ds["content-length"]={key:"Content-Length",value:String(Mn.length)}));const $o={};Object.keys(ds).forEach(Yo=>{const Wo=ds[Yo];$o[Wo.key]=Wo.value}),ps.headers=$o;const Lo=function(){let Yo=null;return{promise:new Promise(function(xl,_l){fo&&(Yo=setTimeout(()=>{Yo!=null&&(Yo=null,_l(logger$6.makeError("timeout",Logger$1.errors.TIMEOUT,{requestBody:bodyify(ps.body,$o["content-type"]),requestMethod:ps.method,timeout:fo,url:hs})))},fo))}),cancel:function(){Yo!=null&&(clearTimeout(Yo),Yo=null)}}}(),Go=function(){return __awaiter$3(this,void 0,void 0,function*(){for(let Yo=0;Yo<is;Yo++){let Wo=null;try{if(Wo=yield getUrl(hs,ps),Yo<is){if(Wo.statusCode===301||Wo.statusCode===302){const xl=Wo.headers.location||"";if(ps.method==="GET"&&xl.match(/^https:/)){hs=Wo.headers.location;continue}}else if(Wo.statusCode===429){let xl=!0;if(os&&(xl=yield os(Yo,hs)),xl){let _l=0;const Tl=Wo.headers["retry-after"];typeof Tl=="string"&&Tl.match(/^[1-9][0-9]*$/)?_l=parseInt(Tl)*1e3:_l=as*parseInt(String(Math.random()*Math.pow(2,Yo))),yield staller(_l);continue}}}}catch(xl){Wo=xl.response,Wo==null&&(Lo.cancel(),logger$6.throwError("missing response",Logger$1.errors.SERVER_ERROR,{requestBody:bodyify(ps.body,$o["content-type"]),requestMethod:ps.method,serverError:xl,url:hs}))}let Jo=Wo.body;if(io&&Wo.statusCode===304?Jo=null:!us&&(Wo.statusCode<200||Wo.statusCode>=300)&&(Lo.cancel(),logger$6.throwError("bad response",Logger$1.errors.SERVER_ERROR,{status:Wo.statusCode,headers:Wo.headers,body:bodyify(Jo,Wo.headers?Wo.headers["content-type"]:null),requestBody:bodyify(ps.body,$o["content-type"]),requestMethod:ps.method,url:hs})),rs)try{const xl=yield rs(Jo,Wo);return Lo.cancel(),xl}catch(xl){if(xl.throttleRetry&&Yo<is){let _l=!0;if(os&&(_l=yield os(Yo,hs)),_l){const Tl=as*parseInt(String(Math.random()*Math.pow(2,Yo)));yield staller(Tl);continue}}Lo.cancel(),logger$6.throwError("processing response error",Logger$1.errors.SERVER_ERROR,{body:bodyify(Jo,Wo.headers?Wo.headers["content-type"]:null),error:xl,requestBody:bodyify(ps.body,$o["content-type"]),requestMethod:ps.method,url:hs})}return Lo.cancel(),Jo}return logger$6.throwError("failed response",Logger$1.errors.SERVER_ERROR,{requestBody:bodyify(ps.body,$o["content-type"]),requestMethod:ps.method,url:hs})})}();return Promise.race([Lo.promise,Go])}function fetchJson(Fn,Mn,rs){let is=(as,us)=>{let ds=null;if(as!=null)try{ds=JSON.parse(toUtf8String(as))}catch(hs){logger$6.throwError("invalid JSON",Logger$1.errors.SERVER_ERROR,{body:as,error:hs})}return rs&&(ds=rs(ds,us)),ds},os=null;if(Mn!=null){os=toUtf8Bytes(Mn);const as=typeof Fn=="string"?{url:Fn}:shallowCopy(Fn);as.headers?Object.keys(as.headers).filter(ds=>ds.toLowerCase()==="content-type").length!==0||(as.headers=shallowCopy(as.headers),as.headers["content-type"]="application/json"):as.headers={"content-type":"application/json"},Fn=as}return _fetchData(Fn,os,is)}function poll(Fn,Mn){return Mn||(Mn={}),Mn=shallowCopy(Mn),Mn.floor==null&&(Mn.floor=0),Mn.ceiling==null&&(Mn.ceiling=1e4),Mn.interval==null&&(Mn.interval=250),new Promise(function(rs,is){let os=null,as=!1;const us=()=>as?!1:(as=!0,os&&clearTimeout(os),!0);Mn.timeout&&(os=setTimeout(()=>{us()&&is(new Error("timeout"))},Mn.timeout));const ds=Mn.retryLimit;let hs=0;function ps(){return Fn().then(function(io){if(io!==void 0)us()&&rs(io);else if(Mn.oncePoll)Mn.oncePoll.once("poll",ps);else if(Mn.onceBlock)Mn.onceBlock.once("block",ps);else if(!as){if(hs++,hs>ds){us()&&is(new Error("retry limit reached"));return}let fo=Mn.interval*parseInt(String(Math.random()*Math.pow(2,hs)));fo<Mn.floor&&(fo=Mn.floor),fo>Mn.ceiling&&(fo=Mn.ceiling),setTimeout(ps,fo)}return null},function(io){us()&&is(io)})}ps()})}var ALPHABET$1="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ALPHABET_MAP={};for(var z$9=0;z$9<ALPHABET$1.length;z$9++){var x$7=ALPHABET$1.charAt(z$9);if(ALPHABET_MAP[x$7]!==void 0)throw new TypeError(x$7+" is ambiguous");ALPHABET_MAP[x$7]=z$9}function polymodStep(Fn){var Mn=Fn>>25;return(Fn&33554431)<<5^-(Mn>>0&1)&996825010^-(Mn>>1&1)&642813549^-(Mn>>2&1)&513874426^-(Mn>>3&1)&1027748829^-(Mn>>4&1)&705979059}function prefixChk(Fn){for(var Mn=1,rs=0;rs<Fn.length;++rs){var is=Fn.charCodeAt(rs);if(is<33||is>126)return"Invalid prefix ("+Fn+")";Mn=polymodStep(Mn)^is>>5}for(Mn=polymodStep(Mn),rs=0;rs<Fn.length;++rs){var os=Fn.charCodeAt(rs);Mn=polymodStep(Mn)^os&31}return Mn}function encode$4(Fn,Mn,rs){if(rs=rs||90,Fn.length+7+Mn.length>rs)throw new TypeError("Exceeds length limit");Fn=Fn.toLowerCase();var is=prefixChk(Fn);if(typeof is=="string")throw new Error(is);for(var os=Fn+"1",as=0;as<Mn.length;++as){var us=Mn[as];if(us>>5)throw new Error("Non 5-bit word");is=polymodStep(is)^us,os+=ALPHABET$1.charAt(us)}for(as=0;as<6;++as)is=polymodStep(is);for(is^=1,as=0;as<6;++as){var ds=is>>(5-as)*5&31;os+=ALPHABET$1.charAt(ds)}return os}function __decode(Fn,Mn){if(Mn=Mn||90,Fn.length<8)return Fn+" too short";if(Fn.length>Mn)return"Exceeds length limit";var rs=Fn.toLowerCase(),is=Fn.toUpperCase();if(Fn!==rs&&Fn!==is)return"Mixed-case string "+Fn;Fn=rs;var os=Fn.lastIndexOf("1");if(os===-1)return"No separator character for "+Fn;if(os===0)return"Missing prefix for "+Fn;var as=Fn.slice(0,os),us=Fn.slice(os+1);if(us.length<6)return"Data too short";var ds=prefixChk(as);if(typeof ds=="string")return ds;for(var hs=[],ps=0;ps<us.length;++ps){var io=us.charAt(ps),fo=ALPHABET_MAP[io];if(fo===void 0)return"Unknown character "+io;ds=polymodStep(ds)^fo,!(ps+6>=us.length)&&hs.push(fo)}return ds!==1?"Invalid checksum for "+Fn:{prefix:as,words:hs}}function decodeUnsafe(){var Fn=__decode.apply(null,arguments);if(typeof Fn=="object")return Fn}function decode$3(Fn){var Mn=__decode.apply(null,arguments);if(typeof Mn=="object")return Mn;throw new Error(Mn)}function convert$1(Fn,Mn,rs,is){for(var os=0,as=0,us=(1<<rs)-1,ds=[],hs=0;hs<Fn.length;++hs)for(os=os<<Mn|Fn[hs],as+=Mn;as>=rs;)as-=rs,ds.push(os>>as&us);if(is)as>0&&ds.push(os<<rs-as&us);else{if(as>=Mn)return"Excess padding";if(os<<rs-as&us)return"Non-zero padding"}return ds}function toWordsUnsafe(Fn){var Mn=convert$1(Fn,8,5,!0);if(Array.isArray(Mn))return Mn}function toWords(Fn){var Mn=convert$1(Fn,8,5,!0);if(Array.isArray(Mn))return Mn;throw new Error(Mn)}function fromWordsUnsafe(Fn){var Mn=convert$1(Fn,5,8,!1);if(Array.isArray(Mn))return Mn}function fromWords(Fn){var Mn=convert$1(Fn,5,8,!1);if(Array.isArray(Mn))return Mn;throw new Error(Mn)}var bech32={decodeUnsafe,decode:decode$3,encode:encode$4,toWordsUnsafe,toWords,fromWordsUnsafe,fromWords};const bech32$1=getDefaultExportFromCjs(bech32),version$6="providers/5.7.2",logger$5=new Logger$1(version$6);let Formatter$1=class am{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const Mn={},rs=this.address.bind(this),is=this.bigNumber.bind(this),os=this.blockTag.bind(this),as=this.data.bind(this),us=this.hash.bind(this),ds=this.hex.bind(this),hs=this.number.bind(this),ps=this.type.bind(this),io=fo=>this.data(fo,!0);return Mn.transaction={hash:us,type:ps,accessList:am.allowNull(this.accessList.bind(this),null),blockHash:am.allowNull(us,null),blockNumber:am.allowNull(hs,null),transactionIndex:am.allowNull(hs,null),confirmations:am.allowNull(hs,null),from:rs,gasPrice:am.allowNull(is),maxPriorityFeePerGas:am.allowNull(is),maxFeePerGas:am.allowNull(is),gasLimit:is,to:am.allowNull(rs,null),value:is,nonce:hs,data:as,r:am.allowNull(this.uint256),s:am.allowNull(this.uint256),v:am.allowNull(hs),creates:am.allowNull(rs,null),raw:am.allowNull(as)},Mn.transactionRequest={from:am.allowNull(rs),nonce:am.allowNull(hs),gasLimit:am.allowNull(is),gasPrice:am.allowNull(is),maxPriorityFeePerGas:am.allowNull(is),maxFeePerGas:am.allowNull(is),to:am.allowNull(rs),value:am.allowNull(is),data:am.allowNull(io),type:am.allowNull(hs),accessList:am.allowNull(this.accessList.bind(this),null)},Mn.receiptLog={transactionIndex:hs,blockNumber:hs,transactionHash:us,address:rs,topics:am.arrayOf(us),data:as,logIndex:hs,blockHash:us},Mn.receipt={to:am.allowNull(this.address,null),from:am.allowNull(this.address,null),contractAddress:am.allowNull(rs,null),transactionIndex:hs,root:am.allowNull(ds),gasUsed:is,logsBloom:am.allowNull(as),blockHash:us,transactionHash:us,logs:am.arrayOf(this.receiptLog.bind(this)),blockNumber:hs,confirmations:am.allowNull(hs,null),cumulativeGasUsed:is,effectiveGasPrice:am.allowNull(is),status:am.allowNull(hs),type:ps},Mn.block={hash:am.allowNull(us),parentHash:us,number:hs,timestamp:hs,nonce:am.allowNull(ds),difficulty:this.difficulty.bind(this),gasLimit:is,gasUsed:is,miner:am.allowNull(rs),extraData:as,transactions:am.allowNull(am.arrayOf(us)),baseFeePerGas:am.allowNull(is)},Mn.blockWithTransactions=shallowCopy(Mn.block),Mn.blockWithTransactions.transactions=am.allowNull(am.arrayOf(this.transactionResponse.bind(this))),Mn.filter={fromBlock:am.allowNull(os,void 0),toBlock:am.allowNull(os,void 0),blockHash:am.allowNull(us,void 0),address:am.allowNull(rs,void 0),topics:am.allowNull(this.topics.bind(this),void 0)},Mn.filterLog={blockNumber:am.allowNull(hs),blockHash:am.allowNull(us),transactionIndex:hs,removed:am.allowNull(this.boolean.bind(this)),address:rs,data:am.allowFalsish(as,"0x"),topics:am.arrayOf(us),transactionHash:us,logIndex:hs},Mn}accessList(Mn){return accessListify(Mn||[])}number(Mn){return Mn==="0x"?0:BigNumber$1.from(Mn).toNumber()}type(Mn){return Mn==="0x"||Mn==null?0:BigNumber$1.from(Mn).toNumber()}bigNumber(Mn){return BigNumber$1.from(Mn)}boolean(Mn){if(typeof Mn=="boolean")return Mn;if(typeof Mn=="string"){if(Mn=Mn.toLowerCase(),Mn==="true")return!0;if(Mn==="false")return!1}throw new Error("invalid boolean - "+Mn)}hex(Mn,rs){return typeof Mn=="string"&&(!rs&&Mn.substring(0,2)!=="0x"&&(Mn="0x"+Mn),isHexString(Mn))?Mn.toLowerCase():logger$5.throwArgumentError("invalid hash","value",Mn)}data(Mn,rs){const is=this.hex(Mn,rs);if(is.length%2!==0)throw new Error("invalid data; odd-length - "+Mn);return is}address(Mn){return getAddress(Mn)}callAddress(Mn){if(!isHexString(Mn,32))return null;const rs=getAddress(hexDataSlice(Mn,12));return rs===AddressZero?null:rs}contractAddress(Mn){return getContractAddress(Mn)}blockTag(Mn){if(Mn==null)return"latest";if(Mn==="earliest")return"0x0";switch(Mn){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return Mn}if(typeof Mn=="number"||isHexString(Mn))return hexValue(Mn);throw new Error("invalid blockTag")}hash(Mn,rs){const is=this.hex(Mn,rs);return hexDataLength(is)!==32?logger$5.throwArgumentError("invalid hash","value",Mn):is}difficulty(Mn){if(Mn==null)return null;const rs=BigNumber$1.from(Mn);try{return rs.toNumber()}catch{}return null}uint256(Mn){if(!isHexString(Mn))throw new Error("invalid uint256");return hexZeroPad(Mn,32)}_block(Mn,rs){Mn.author!=null&&Mn.miner==null&&(Mn.miner=Mn.author);const is=Mn._difficulty!=null?Mn._difficulty:Mn.difficulty,os=am.check(rs,Mn);return os._difficulty=is==null?null:BigNumber$1.from(is),os}block(Mn){return this._block(Mn,this.formats.block)}blockWithTransactions(Mn){return this._block(Mn,this.formats.blockWithTransactions)}transactionRequest(Mn){return am.check(this.formats.transactionRequest,Mn)}transactionResponse(Mn){Mn.gas!=null&&Mn.gasLimit==null&&(Mn.gasLimit=Mn.gas),Mn.to&&BigNumber$1.from(Mn.to).isZero()&&(Mn.to="0x0000000000000000000000000000000000000000"),Mn.input!=null&&Mn.data==null&&(Mn.data=Mn.input),Mn.to==null&&Mn.creates==null&&(Mn.creates=this.contractAddress(Mn)),(Mn.type===1||Mn.type===2)&&Mn.accessList==null&&(Mn.accessList=[]);const rs=am.check(this.formats.transaction,Mn);if(Mn.chainId!=null){let is=Mn.chainId;isHexString(is)&&(is=BigNumber$1.from(is).toNumber()),rs.chainId=is}else{let is=Mn.networkId;is==null&&rs.v==null&&(is=Mn.chainId),isHexString(is)&&(is=BigNumber$1.from(is).toNumber()),typeof is!="number"&&rs.v!=null&&(is=(rs.v-35)/2,is<0&&(is=0),is=parseInt(is)),typeof is!="number"&&(is=0),rs.chainId=is}return rs.blockHash&&rs.blockHash.replace(/0/g,"")==="x"&&(rs.blockHash=null),rs}transaction(Mn){return parse$1(Mn)}receiptLog(Mn){return am.check(this.formats.receiptLog,Mn)}receipt(Mn){const rs=am.check(this.formats.receipt,Mn);if(rs.root!=null)if(rs.root.length<=4){const is=BigNumber$1.from(rs.root).toNumber();is===0||is===1?(rs.status!=null&&rs.status!==is&&logger$5.throwArgumentError("alt-root-status/status mismatch","value",{root:rs.root,status:rs.status}),rs.status=is,delete rs.root):logger$5.throwArgumentError("invalid alt-root-status","value.root",rs.root)}else rs.root.length!==66&&logger$5.throwArgumentError("invalid root hash","value.root",rs.root);return rs.status!=null&&(rs.byzantium=!0),rs}topics(Mn){return Array.isArray(Mn)?Mn.map(rs=>this.topics(rs)):Mn!=null?this.hash(Mn,!0):null}filter(Mn){return am.check(this.formats.filter,Mn)}filterLog(Mn){return am.check(this.formats.filterLog,Mn)}static check(Mn,rs){const is={};for(const os in Mn)try{const as=Mn[os](rs[os]);as!==void 0&&(is[os]=as)}catch(as){throw as.checkKey=os,as.checkValue=rs[os],as}return is}static allowNull(Mn,rs){return function(is){return is==null?rs:Mn(is)}}static allowFalsish(Mn,rs){return function(is){return is?Mn(is):rs}}static arrayOf(Mn){return function(rs){if(!Array.isArray(rs))throw new Error("not an array");const is=[];return rs.forEach(function(os){is.push(Mn(os))}),is}}};var __awaiter$2=function(Fn,Mn,rs,is){function os(as){return as instanceof rs?as:new rs(function(us){us(as)})}return new(rs||(rs=Promise))(function(as,us){function ds(io){try{ps(is.next(io))}catch(fo){us(fo)}}function hs(io){try{ps(is.throw(io))}catch(fo){us(fo)}}function ps(io){io.done?as(io.value):os(io.value).then(ds,hs)}ps((is=is.apply(Fn,Mn||[])).next())})};const logger$4=new Logger$1(version$6),MAX_CCIP_REDIRECTS=10;function checkTopic(Fn){return Fn==null?"null":(hexDataLength(Fn)!==32&&logger$4.throwArgumentError("invalid topic","topic",Fn),Fn.toLowerCase())}function serializeTopics(Fn){for(Fn=Fn.slice();Fn.length>0&&Fn[Fn.length-1]==null;)Fn.pop();return Fn.map(Mn=>{if(Array.isArray(Mn)){const rs={};Mn.forEach(os=>{rs[checkTopic(os)]=!0});const is=Object.keys(rs);return is.sort(),is.join("|")}else return checkTopic(Mn)}).join("&")}function deserializeTopics(Fn){return Fn===""?[]:Fn.split(/&/g).map(Mn=>{if(Mn==="")return[];const rs=Mn.split("|").map(is=>is==="null"?null:is);return rs.length===1?rs[0]:rs})}function getEventTag(Fn){if(typeof Fn=="string"){if(Fn=Fn.toLowerCase(),hexDataLength(Fn)===32)return"tx:"+Fn;if(Fn.indexOf(":")===-1)return Fn}else{if(Array.isArray(Fn))return"filter:*:"+serializeTopics(Fn);if(ForkEvent.isForkEvent(Fn))throw logger$4.warn("not implemented"),new Error("not implemented");if(Fn&&typeof Fn=="object")return"filter:"+(Fn.address||"*")+":"+serializeTopics(Fn.topics||[])}throw new Error("invalid event - "+Fn)}function getTime(){return new Date().getTime()}function stall(Fn){return new Promise(Mn=>{setTimeout(Mn,Fn)})}const PollableEvents=["block","network","pending","poll"];let Event$1=class{constructor(Mn,rs,is){defineReadOnly(this,"tag",Mn),defineReadOnly(this,"listener",rs),defineReadOnly(this,"once",is),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const Mn=this.tag.split(":");return Mn[0]!=="tx"?null:Mn[1]}get filter(){const Mn=this.tag.split(":");if(Mn[0]!=="filter")return null;const rs=Mn[1],is=deserializeTopics(Mn[2]),os={};return is.length>0&&(os.topics=is),rs&&rs!=="*"&&(os.address=rs),os}pollable(){return this.tag.indexOf(":")>=0||PollableEvents.indexOf(this.tag)>=0}};const coinInfos={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function bytes32ify(Fn){return hexZeroPad(BigNumber$1.from(Fn).toHexString(),32)}function base58Encode(Fn){return Base58.encode(concat$2([Fn,hexDataSlice(sha256$1(sha256$1(Fn)),0,4)]))}const matcherIpfs=new RegExp("^(ipfs)://(.*)$","i"),matchers=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),matcherIpfs,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function _parseString(Fn,Mn){try{return toUtf8String(_parseBytes(Fn,Mn))}catch{}return null}function _parseBytes(Fn,Mn){if(Fn==="0x")return null;const rs=BigNumber$1.from(hexDataSlice(Fn,Mn,Mn+32)).toNumber(),is=BigNumber$1.from(hexDataSlice(Fn,rs,rs+32)).toNumber();return hexDataSlice(Fn,rs+32,rs+32+is)}function getIpfsLink(Fn){return Fn.match(/^ipfs:\/\/ipfs\//i)?Fn=Fn.substring(12):Fn.match(/^ipfs:\/\//i)?Fn=Fn.substring(7):logger$4.throwArgumentError("unsupported IPFS format","link",Fn),`https://gateway.ipfs.io/ipfs/${Fn}`}function numPad(Fn){const Mn=arrayify(Fn);if(Mn.length>32)throw new Error("internal; should not happen");const rs=new Uint8Array(32);return rs.set(Mn,32-Mn.length),rs}function bytesPad(Fn){if(Fn.length%32===0)return Fn;const Mn=new Uint8Array(Math.ceil(Fn.length/32)*32);return Mn.set(Fn),Mn}function encodeBytes(Fn){const Mn=[];let rs=0;for(let is=0;is<Fn.length;is++)Mn.push(null),rs+=32;for(let is=0;is<Fn.length;is++){const os=arrayify(Fn[is]);Mn[is]=numPad(rs),Mn.push(numPad(os.length)),Mn.push(bytesPad(os)),rs+=32+Math.ceil(os.length/32)*32}return hexConcat(Mn)}class Resolver{constructor(Mn,rs,is,os){defineReadOnly(this,"provider",Mn),defineReadOnly(this,"name",is),defineReadOnly(this,"address",Mn.formatter.address(rs)),defineReadOnly(this,"_resolvedAddress",os)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(Mn=>BigNumber$1.from(Mn).eq(1)).catch(Mn=>{if(Mn.code===Logger$1.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,Mn})),this._supportsEip2544}_fetch(Mn,rs){return __awaiter$2(this,void 0,void 0,function*(){const is={to:this.address,ccipReadEnabled:!0,data:hexConcat([Mn,namehash(this.name),rs||"0x"])};let os=!1;(yield this.supportsWildcard())&&(os=!0,is.data=hexConcat(["0x9061b923",encodeBytes([dnsEncode(this.name),is.data])]));try{let as=yield this.provider.call(is);return arrayify(as).length%32===4&&logger$4.throwError("resolver threw error",Logger$1.errors.CALL_EXCEPTION,{transaction:is,data:as}),os&&(as=_parseBytes(as,0)),as}catch(as){if(as.code===Logger$1.errors.CALL_EXCEPTION)return null;throw as}})}_fetchBytes(Mn,rs){return __awaiter$2(this,void 0,void 0,function*(){const is=yield this._fetch(Mn,rs);return is!=null?_parseBytes(is,0):null})}_getAddress(Mn,rs){const is=coinInfos[String(Mn)];if(is==null&&logger$4.throwError(`unsupported coin type: ${Mn}`,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${Mn})`}),is.ilk==="eth")return this.provider.formatter.address(rs);const os=arrayify(rs);if(is.p2pkh!=null){const as=rs.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(as){const us=parseInt(as[1],16);if(as[2].length===us*2&&us>=1&&us<=75)return base58Encode(concat$2([[is.p2pkh],"0x"+as[2]]))}}if(is.p2sh!=null){const as=rs.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(as){const us=parseInt(as[1],16);if(as[2].length===us*2&&us>=1&&us<=75)return base58Encode(concat$2([[is.p2sh],"0x"+as[2]]))}}if(is.prefix!=null){const as=os[1];let us=os[0];if(us===0?as!==20&&as!==32&&(us=-1):us=-1,us>=0&&os.length===2+as&&as>=1&&as<=75){const ds=bech32$1.toWords(os.slice(2));return ds.unshift(us),bech32$1.encode(is.prefix,ds)}}return null}getAddress(Mn){return __awaiter$2(this,void 0,void 0,function*(){if(Mn==null&&(Mn=60),Mn===60)try{const os=yield this._fetch("0x3b3b57de");return os==="0x"||os===HashZero?null:this.provider.formatter.callAddress(os)}catch(os){if(os.code===Logger$1.errors.CALL_EXCEPTION)return null;throw os}const rs=yield this._fetchBytes("0xf1cb7e06",bytes32ify(Mn));if(rs==null||rs==="0x")return null;const is=this._getAddress(Mn,rs);return is==null&&logger$4.throwError("invalid or unsupported coin data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${Mn})`,coinType:Mn,data:rs}),is})}getAvatar(){return __awaiter$2(this,void 0,void 0,function*(){const Mn=[{type:"name",content:this.name}];try{const rs=yield this.getText("avatar");if(rs==null)return null;for(let is=0;is<matchers.length;is++){const os=rs.match(matchers[is]);if(os==null)continue;const as=os[1].toLowerCase();switch(as){case"https":return Mn.push({type:"url",content:rs}),{linkage:Mn,url:rs};case"data":return Mn.push({type:"data",content:rs}),{linkage:Mn,url:rs};case"ipfs":return Mn.push({type:"ipfs",content:rs}),{linkage:Mn,url:getIpfsLink(rs)};case"erc721":case"erc1155":{const us=as==="erc721"?"0xc87b56dd":"0x0e89341c";Mn.push({type:as,content:rs});const ds=this._resolvedAddress||(yield this.getAddress()),hs=(os[2]||"").split("/");if(hs.length!==2)return null;const ps=yield this.provider.formatter.address(hs[0]),io=hexZeroPad(BigNumber$1.from(hs[1]).toHexString(),32);if(as==="erc721"){const Lo=this.provider.formatter.callAddress(yield this.provider.call({to:ps,data:hexConcat(["0x6352211e",io])}));if(ds!==Lo)return null;Mn.push({type:"owner",content:Lo})}else if(as==="erc1155"){const Lo=BigNumber$1.from(yield this.provider.call({to:ps,data:hexConcat(["0x00fdd58e",hexZeroPad(ds,32),io])}));if(Lo.isZero())return null;Mn.push({type:"balance",content:Lo.toString()})}const fo={to:this.provider.formatter.address(hs[0]),data:hexConcat([us,io])};let mo=_parseString(yield this.provider.call(fo),0);if(mo==null)return null;Mn.push({type:"metadata-url-base",content:mo}),as==="erc1155"&&(mo=mo.replace("{id}",io.substring(2)),Mn.push({type:"metadata-url-expanded",content:mo})),mo.match(/^ipfs:/i)&&(mo=getIpfsLink(mo)),Mn.push({type:"metadata-url",content:mo});const Ao=yield fetchJson(mo);if(!Ao)return null;Mn.push({type:"metadata",content:JSON.stringify(Ao)});let $o=Ao.image;if(typeof $o!="string")return null;if(!$o.match(/^(https:\/\/|data:)/i)){if($o.match(matcherIpfs)==null)return null;Mn.push({type:"url-ipfs",content:$o}),$o=getIpfsLink($o)}return Mn.push({type:"url",content:$o}),{linkage:Mn,url:$o}}}}}catch{}return null})}getContentHash(){return __awaiter$2(this,void 0,void 0,function*(){const Mn=yield this._fetchBytes("0xbc1c58d1");if(Mn==null||Mn==="0x")return null;const rs=Mn.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(rs){const us=parseInt(rs[3],16);if(rs[4].length===us*2)return"ipfs://"+Base58.encode("0x"+rs[1])}const is=Mn.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(is){const us=parseInt(is[3],16);if(is[4].length===us*2)return"ipns://"+Base58.encode("0x"+is[1])}const os=Mn.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(os&&os[1].length===32*2)return"bzz://"+os[1];const as=Mn.match(/^0x90b2c605([0-9a-f]*)$/);if(as&&as[1].length===34*2){const us={"=":"","+":"-","/":"_"};return"sia://"+encode$5("0x"+as[1]).replace(/[=+\/]/g,hs=>us[hs])}return logger$4.throwError("invalid or unsupported content hash data",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:Mn})})}getText(Mn){return __awaiter$2(this,void 0,void 0,function*(){let rs=toUtf8Bytes(Mn);rs=concat$2([bytes32ify(64),bytes32ify(rs.length),rs]),rs.length%32!==0&&(rs=concat$2([rs,hexZeroPad("0x",32-Mn.length%32)]));const is=yield this._fetchBytes("0x59d1d43c",hexlify(rs));return is==null||is==="0x"?null:toUtf8String(is)})}}let defaultFormatter=null,nextPollId=1;class BaseProvider extends Provider{constructor(Mn){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),defineReadOnly(this,"anyNetwork",Mn==="any"),this.anyNetwork&&(Mn=this.detectNetwork()),Mn instanceof Promise)this._networkPromise=Mn,Mn.catch(rs=>{}),this._ready().catch(rs=>{});else{const rs=getStatic(new.target,"getNetwork")(Mn);rs?(defineReadOnly(this,"_network",rs),this.emit("network",rs,null)):logger$4.throwArgumentError("invalid network","network",Mn)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return __awaiter$2(this,void 0,void 0,function*(){if(this._network==null){let Mn=null;if(this._networkPromise)try{Mn=yield this._networkPromise}catch{}Mn==null&&(Mn=yield this.detectNetwork()),Mn||logger$4.throwError("no network detected",Logger$1.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=Mn:defineReadOnly(this,"_network",Mn),this.emit("network",Mn,null))}return this._network})}get ready(){return poll(()=>this._ready().then(Mn=>Mn,Mn=>{if(!(Mn.code===Logger$1.errors.NETWORK_ERROR&&Mn.event==="noNetwork"))throw Mn}))}static getFormatter(){return defaultFormatter==null&&(defaultFormatter=new Formatter$1),defaultFormatter}static getNetwork(Mn){return getNetwork(Mn??"homestead")}ccipReadFetch(Mn,rs,is){return __awaiter$2(this,void 0,void 0,function*(){if(this.disableCcipRead||is.length===0)return null;const os=Mn.to.toLowerCase(),as=rs.toLowerCase(),us=[];for(let ds=0;ds<is.length;ds++){const hs=is[ds],ps=hs.replace("{sender}",os).replace("{data}",as),io=hs.indexOf("{data}")>=0?null:JSON.stringify({data:as,sender:os}),fo=yield fetchJson({url:ps,errorPassThrough:!0},io,(Ao,$o)=>(Ao.status=$o.statusCode,Ao));if(fo.data)return fo.data;const mo=fo.message||"unknown error";if(fo.status>=400&&fo.status<500)return logger$4.throwError(`response not found during CCIP fetch: ${mo}`,Logger$1.errors.SERVER_ERROR,{url:hs,errorMessage:mo});us.push(mo)}return logger$4.throwError(`error encountered during CCIP fetch: ${us.map(ds=>JSON.stringify(ds)).join(", ")}`,Logger$1.errors.SERVER_ERROR,{urls:is,errorMessages:us})})}_getInternalBlockNumber(Mn){return __awaiter$2(this,void 0,void 0,function*(){if(yield this._ready(),Mn>0)for(;this._internalBlockNumber;){const os=this._internalBlockNumber;try{const as=yield os;if(getTime()-as.respTime<=Mn)return as.blockNumber;break}catch{if(this._internalBlockNumber===os)break}}const rs=getTime(),is=resolveProperties({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(os=>null,os=>os)}).then(({blockNumber:os,networkError:as})=>{if(as)throw this._internalBlockNumber===is&&(this._internalBlockNumber=null),as;const us=getTime();return os=BigNumber$1.from(os).toNumber(),os<this._maxInternalBlockNumber&&(os=this._maxInternalBlockNumber),this._maxInternalBlockNumber=os,this._setFastBlockNumber(os),{blockNumber:os,reqTime:rs,respTime:us}});return this._internalBlockNumber=is,is.catch(os=>{this._internalBlockNumber===is&&(this._internalBlockNumber=null)}),(yield is).blockNumber})}poll(){return __awaiter$2(this,void 0,void 0,function*(){const Mn=nextPollId++,rs=[];let is=null;try{is=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(os){this.emit("error",os);return}if(this._setFastBlockNumber(is),this.emit("poll",Mn,is),is===this._lastBlockNumber){this.emit("didPoll",Mn);return}if(this._emitted.block===-2&&(this._emitted.block=is-1),Math.abs(this._emitted.block-is)>1e3)logger$4.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${is})`),this.emit("error",logger$4.makeError("network block skew detected",Logger$1.errors.NETWORK_ERROR,{blockNumber:is,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",is);else for(let os=this._emitted.block+1;os<=is;os++)this.emit("block",os);this._emitted.block!==is&&(this._emitted.block=is,Object.keys(this._emitted).forEach(os=>{if(os==="block")return;const as=this._emitted[os];as!=="pending"&&is-as>12&&delete this._emitted[os]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=is-1),this._events.forEach(os=>{switch(os.type){case"tx":{const as=os.hash;let us=this.getTransactionReceipt(as).then(ds=>(!ds||ds.blockNumber==null||(this._emitted["t:"+as]=ds.blockNumber,this.emit(as,ds)),null)).catch(ds=>{this.emit("error",ds)});rs.push(us);break}case"filter":{if(!os._inflight){os._inflight=!0,os._lastBlockNumber===-2&&(os._lastBlockNumber=is-1);const as=os.filter;as.fromBlock=os._lastBlockNumber+1,as.toBlock=is;const us=as.toBlock-this._maxFilterBlockRange;us>as.fromBlock&&(as.fromBlock=us),as.fromBlock<0&&(as.fromBlock=0);const ds=this.getLogs(as).then(hs=>{os._inflight=!1,hs.length!==0&&hs.forEach(ps=>{ps.blockNumber>os._lastBlockNumber&&(os._lastBlockNumber=ps.blockNumber),this._emitted["b:"+ps.blockHash]=ps.blockNumber,this._emitted["t:"+ps.transactionHash]=ps.blockNumber,this.emit(as,ps)})}).catch(hs=>{this.emit("error",hs),os._inflight=!1});rs.push(ds)}break}}}),this._lastBlockNumber=is,Promise.all(rs).then(()=>{this.emit("didPoll",Mn)}).catch(os=>{this.emit("error",os)})})}resetEventsBlock(Mn){this._lastBlockNumber=Mn-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return __awaiter$2(this,void 0,void 0,function*(){return logger$4.throwError("provider does not support network detection",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return __awaiter$2(this,void 0,void 0,function*(){const Mn=yield this._ready(),rs=yield this.detectNetwork();if(Mn.chainId!==rs.chainId){if(this.anyNetwork)return this._network=rs,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",rs,Mn),yield stall(0),this._network;const is=logger$4.makeError("underlying network changed",Logger$1.errors.NETWORK_ERROR,{event:"changed",network:Mn,detectedNetwork:rs});throw this.emit("error",is),is}return Mn})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(Mn=>{this._setFastBlockNumber(Mn)},Mn=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(Mn){Mn&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!Mn&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(Mn){if(typeof Mn!="number"||Mn<=0||parseInt(String(Mn))!=Mn)throw new Error("invalid polling interval");this._pollingInterval=Mn,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const Mn=getTime();return Mn-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=Mn,this._fastBlockNumberPromise=this.getBlockNumber().then(rs=>((this._fastBlockNumber==null||rs>this._fastBlockNumber)&&(this._fastBlockNumber=rs),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(Mn){this._fastBlockNumber!=null&&Mn<this._fastBlockNumber||(this._fastQueryDate=getTime(),(this._fastBlockNumber==null||Mn>this._fastBlockNumber)&&(this._fastBlockNumber=Mn,this._fastBlockNumberPromise=Promise.resolve(Mn)))}waitForTransaction(Mn,rs,is){return __awaiter$2(this,void 0,void 0,function*(){return this._waitForTransaction(Mn,rs??1,is||0,null)})}_waitForTransaction(Mn,rs,is,os){return __awaiter$2(this,void 0,void 0,function*(){const as=yield this.getTransactionReceipt(Mn);return(as?as.confirmations:0)>=rs?as:new Promise((us,ds)=>{const hs=[];let ps=!1;const io=function(){return ps?!0:(ps=!0,hs.forEach(mo=>{mo()}),!1)},fo=mo=>{mo.confirmations<rs||io()||us(mo)};if(this.on(Mn,fo),hs.push(()=>{this.removeListener(Mn,fo)}),os){let mo=os.startBlock,Ao=null;const $o=Lo=>__awaiter$2(this,void 0,void 0,function*(){ps||(yield stall(1e3),this.getTransactionCount(os.from).then(Go=>__awaiter$2(this,void 0,void 0,function*(){if(!ps){if(Go<=os.nonce)mo=Lo;else{{const Yo=yield this.getTransaction(Mn);if(Yo&&Yo.blockNumber!=null)return}for(Ao==null&&(Ao=mo-3,Ao<os.startBlock&&(Ao=os.startBlock));Ao<=Lo;){if(ps)return;const Yo=yield this.getBlockWithTransactions(Ao);for(let Wo=0;Wo<Yo.transactions.length;Wo++){const Jo=Yo.transactions[Wo];if(Jo.hash===Mn)return;if(Jo.from===os.from&&Jo.nonce===os.nonce){if(ps)return;const xl=yield this.waitForTransaction(Jo.hash,rs);if(io())return;let _l="replaced";Jo.data===os.data&&Jo.to===os.to&&Jo.value.eq(os.value)?_l="repriced":Jo.data==="0x"&&Jo.from===Jo.to&&Jo.value.isZero()&&(_l="cancelled"),ds(logger$4.makeError("transaction was replaced",Logger$1.errors.TRANSACTION_REPLACED,{cancelled:_l==="replaced"||_l==="cancelled",reason:_l,replacement:this._wrapTransaction(Jo),hash:Mn,receipt:xl}));return}}Ao++}}ps||this.once("block",$o)}}),Go=>{ps||this.once("block",$o)}))});if(ps)return;this.once("block",$o),hs.push(()=>{this.removeListener("block",$o)})}if(typeof is=="number"&&is>0){const mo=setTimeout(()=>{io()||ds(logger$4.makeError("timeout exceeded",Logger$1.errors.TIMEOUT,{timeout:is}))},is);mo.unref&&mo.unref(),hs.push(()=>{clearTimeout(mo)})}})})}getBlockNumber(){return __awaiter$2(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork();const Mn=yield this.perform("getGasPrice",{});try{return BigNumber$1.from(Mn)}catch(rs){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getGasPrice",result:Mn,error:rs})}})}getBalance(Mn,rs){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork();const is=yield resolveProperties({address:this._getAddress(Mn),blockTag:this._getBlockTag(rs)}),os=yield this.perform("getBalance",is);try{return BigNumber$1.from(os)}catch(as){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getBalance",params:is,result:os,error:as})}})}getTransactionCount(Mn,rs){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork();const is=yield resolveProperties({address:this._getAddress(Mn),blockTag:this._getBlockTag(rs)}),os=yield this.perform("getTransactionCount",is);try{return BigNumber$1.from(os).toNumber()}catch(as){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getTransactionCount",params:is,result:os,error:as})}})}getCode(Mn,rs){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork();const is=yield resolveProperties({address:this._getAddress(Mn),blockTag:this._getBlockTag(rs)}),os=yield this.perform("getCode",is);try{return hexlify(os)}catch(as){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getCode",params:is,result:os,error:as})}})}getStorageAt(Mn,rs,is){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork();const os=yield resolveProperties({address:this._getAddress(Mn),blockTag:this._getBlockTag(is),position:Promise.resolve(rs).then(us=>hexValue(us))}),as=yield this.perform("getStorageAt",os);try{return hexlify(as)}catch(us){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"getStorageAt",params:os,result:as,error:us})}})}_wrapTransaction(Mn,rs,is){if(rs!=null&&hexDataLength(rs)!==32)throw new Error("invalid response - sendTransaction");const os=Mn;return rs!=null&&Mn.hash!==rs&&logger$4.throwError("Transaction hash mismatch from Provider.sendTransaction.",Logger$1.errors.UNKNOWN_ERROR,{expectedHash:Mn.hash,returnedHash:rs}),os.wait=(as,us)=>__awaiter$2(this,void 0,void 0,function*(){as==null&&(as=1),us==null&&(us=0);let ds;as!==0&&is!=null&&(ds={data:Mn.data,from:Mn.from,nonce:Mn.nonce,to:Mn.to,value:Mn.value,startBlock:is});const hs=yield this._waitForTransaction(Mn.hash,as,us,ds);return hs==null&&as===0?null:(this._emitted["t:"+Mn.hash]=hs.blockNumber,hs.status===0&&logger$4.throwError("transaction failed",Logger$1.errors.CALL_EXCEPTION,{transactionHash:Mn.hash,transaction:Mn,receipt:hs}),hs)}),os}sendTransaction(Mn){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork();const rs=yield Promise.resolve(Mn).then(as=>hexlify(as)),is=this.formatter.transaction(Mn);is.confirmations==null&&(is.confirmations=0);const os=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const as=yield this.perform("sendTransaction",{signedTransaction:rs});return this._wrapTransaction(is,as,os)}catch(as){throw as.transaction=is,as.transactionHash=is.hash,as}})}_getTransactionRequest(Mn){return __awaiter$2(this,void 0,void 0,function*(){const rs=yield Mn,is={};return["from","to"].forEach(os=>{rs[os]!=null&&(is[os]=Promise.resolve(rs[os]).then(as=>as?this._getAddress(as):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(os=>{rs[os]!=null&&(is[os]=Promise.resolve(rs[os]).then(as=>as?BigNumber$1.from(as):null))}),["type"].forEach(os=>{rs[os]!=null&&(is[os]=Promise.resolve(rs[os]).then(as=>as??null))}),rs.accessList&&(is.accessList=this.formatter.accessList(rs.accessList)),["data"].forEach(os=>{rs[os]!=null&&(is[os]=Promise.resolve(rs[os]).then(as=>as?hexlify(as):null))}),this.formatter.transactionRequest(yield resolveProperties(is))})}_getFilter(Mn){return __awaiter$2(this,void 0,void 0,function*(){Mn=yield Mn;const rs={};return Mn.address!=null&&(rs.address=this._getAddress(Mn.address)),["blockHash","topics"].forEach(is=>{Mn[is]!=null&&(rs[is]=Mn[is])}),["fromBlock","toBlock"].forEach(is=>{Mn[is]!=null&&(rs[is]=this._getBlockTag(Mn[is]))}),this.formatter.filter(yield resolveProperties(rs))})}_call(Mn,rs,is){return __awaiter$2(this,void 0,void 0,function*(){is>=MAX_CCIP_REDIRECTS&&logger$4.throwError("CCIP read exceeded maximum redirections",Logger$1.errors.SERVER_ERROR,{redirects:is,transaction:Mn});const os=Mn.to,as=yield this.perform("call",{transaction:Mn,blockTag:rs});if(is>=0&&rs==="latest"&&os!=null&&as.substring(0,10)==="0x556f1830"&&hexDataLength(as)%32===4)try{const us=hexDataSlice(as,4),ds=hexDataSlice(us,0,32);BigNumber$1.from(ds).eq(os)||logger$4.throwError("CCIP Read sender did not match",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:Mn,data:as});const hs=[],ps=BigNumber$1.from(hexDataSlice(us,32,64)).toNumber(),io=BigNumber$1.from(hexDataSlice(us,ps,ps+32)).toNumber(),fo=hexDataSlice(us,ps+32);for(let Yo=0;Yo<io;Yo++){const Wo=_parseString(fo,Yo*32);Wo==null&&logger$4.throwError("CCIP Read contained corrupt URL string",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:Mn,data:as}),hs.push(Wo)}const mo=_parseBytes(us,64);BigNumber$1.from(hexDataSlice(us,100,128)).isZero()||logger$4.throwError("CCIP Read callback selector included junk",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:Mn,data:as});const Ao=hexDataSlice(us,96,100),$o=_parseBytes(us,128),Lo=yield this.ccipReadFetch(Mn,mo,hs);Lo==null&&logger$4.throwError("CCIP Read disabled or provided no URLs",Logger$1.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:Mn,data:as});const Go={to:os,data:hexConcat([Ao,encodeBytes([Lo,$o])])};return this._call(Go,rs,is+1)}catch(us){if(us.code===Logger$1.errors.SERVER_ERROR)throw us}try{return hexlify(as)}catch(us){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"call",params:{transaction:Mn,blockTag:rs},result:as,error:us})}})}call(Mn,rs){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork();const is=yield resolveProperties({transaction:this._getTransactionRequest(Mn),blockTag:this._getBlockTag(rs),ccipReadEnabled:Promise.resolve(Mn.ccipReadEnabled)});return this._call(is.transaction,is.blockTag,is.ccipReadEnabled?0:-1)})}estimateGas(Mn){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork();const rs=yield resolveProperties({transaction:this._getTransactionRequest(Mn)}),is=yield this.perform("estimateGas",rs);try{return BigNumber$1.from(is)}catch(os){return logger$4.throwError("bad result from backend",Logger$1.errors.SERVER_ERROR,{method:"estimateGas",params:rs,result:is,error:os})}})}_getAddress(Mn){return __awaiter$2(this,void 0,void 0,function*(){Mn=yield Mn,typeof Mn!="string"&&logger$4.throwArgumentError("invalid address or ENS name","name",Mn);const rs=yield this.resolveName(Mn);return rs==null&&logger$4.throwError("ENS name not configured",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(Mn)})`}),rs})}_getBlock(Mn,rs){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork(),Mn=yield Mn;let is=-128;const os={includeTransactions:!!rs};if(isHexString(Mn,32))os.blockHash=Mn;else try{os.blockTag=yield this._getBlockTag(Mn),isHexString(os.blockTag)&&(is=parseInt(os.blockTag.substring(2),16))}catch{logger$4.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",Mn)}return poll(()=>__awaiter$2(this,void 0,void 0,function*(){const as=yield this.perform("getBlock",os);if(as==null)return os.blockHash!=null&&this._emitted["b:"+os.blockHash]==null||os.blockTag!=null&&is>this._emitted.block?null:void 0;if(rs){let us=null;for(let hs=0;hs<as.transactions.length;hs++){const ps=as.transactions[hs];if(ps.blockNumber==null)ps.confirmations=0;else if(ps.confirmations==null){us==null&&(us=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let io=us-ps.blockNumber+1;io<=0&&(io=1),ps.confirmations=io}}const ds=this.formatter.blockWithTransactions(as);return ds.transactions=ds.transactions.map(hs=>this._wrapTransaction(hs)),ds}return this.formatter.block(as)}),{oncePoll:this})})}getBlock(Mn){return this._getBlock(Mn,!1)}getBlockWithTransactions(Mn){return this._getBlock(Mn,!0)}getTransaction(Mn){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork(),Mn=yield Mn;const rs={transactionHash:this.formatter.hash(Mn,!0)};return poll(()=>__awaiter$2(this,void 0,void 0,function*(){const is=yield this.perform("getTransaction",rs);if(is==null)return this._emitted["t:"+Mn]==null?null:void 0;const os=this.formatter.transactionResponse(is);if(os.blockNumber==null)os.confirmations=0;else if(os.confirmations==null){let us=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-os.blockNumber+1;us<=0&&(us=1),os.confirmations=us}return this._wrapTransaction(os)}),{oncePoll:this})})}getTransactionReceipt(Mn){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork(),Mn=yield Mn;const rs={transactionHash:this.formatter.hash(Mn,!0)};return poll(()=>__awaiter$2(this,void 0,void 0,function*(){const is=yield this.perform("getTransactionReceipt",rs);if(is==null)return this._emitted["t:"+Mn]==null?null:void 0;if(is.blockHash==null)return;const os=this.formatter.receipt(is);if(os.blockNumber==null)os.confirmations=0;else if(os.confirmations==null){let us=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-os.blockNumber+1;us<=0&&(us=1),os.confirmations=us}return os}),{oncePoll:this})})}getLogs(Mn){return __awaiter$2(this,void 0,void 0,function*(){yield this.getNetwork();const rs=yield resolveProperties({filter:this._getFilter(Mn)}),is=yield this.perform("getLogs",rs);return is.forEach(os=>{os.removed==null&&(os.removed=!1)}),Formatter$1.arrayOf(this.formatter.filterLog.bind(this.formatter))(is)})}getEtherPrice(){return __awaiter$2(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(Mn){return __awaiter$2(this,void 0,void 0,function*(){if(Mn=yield Mn,typeof Mn=="number"&&Mn<0){Mn%1&&logger$4.throwArgumentError("invalid BlockTag","blockTag",Mn);let rs=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return rs+=Mn,rs<0&&(rs=0),this.formatter.blockTag(rs)}return this.formatter.blockTag(Mn)})}getResolver(Mn){return __awaiter$2(this,void 0,void 0,function*(){let rs=Mn;for(;;){if(rs===""||rs==="."||Mn!=="eth"&&rs==="eth")return null;const is=yield this._getResolver(rs,"getResolver");if(is!=null){const os=new Resolver(this,is,Mn);return rs!==Mn&&!(yield os.supportsWildcard())?null:os}rs=rs.split(".").slice(1).join(".")}})}_getResolver(Mn,rs){return __awaiter$2(this,void 0,void 0,function*(){rs==null&&(rs="ENS");const is=yield this.getNetwork();is.ensAddress||logger$4.throwError("network does not support ENS",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:rs,network:is.name});try{const os=yield this.call({to:is.ensAddress,data:"0x0178b8bf"+namehash(Mn).substring(2)});return this.formatter.callAddress(os)}catch{}return null})}resolveName(Mn){return __awaiter$2(this,void 0,void 0,function*(){Mn=yield Mn;try{return Promise.resolve(this.formatter.address(Mn))}catch(is){if(isHexString(Mn))throw is}typeof Mn!="string"&&logger$4.throwArgumentError("invalid ENS name","name",Mn);const rs=yield this.getResolver(Mn);return rs?yield rs.getAddress():null})}lookupAddress(Mn){return __awaiter$2(this,void 0,void 0,function*(){Mn=yield Mn,Mn=this.formatter.address(Mn);const rs=Mn.substring(2).toLowerCase()+".addr.reverse",is=yield this._getResolver(rs,"lookupAddress");if(is==null)return null;const os=_parseString(yield this.call({to:is,data:"0x691f3431"+namehash(rs).substring(2)}),0);return(yield this.resolveName(os))!=Mn?null:os})}getAvatar(Mn){return __awaiter$2(this,void 0,void 0,function*(){let rs=null;if(isHexString(Mn)){const as=this.formatter.address(Mn).substring(2).toLowerCase()+".addr.reverse",us=yield this._getResolver(as,"getAvatar");if(!us)return null;rs=new Resolver(this,us,as);try{const ds=yield rs.getAvatar();if(ds)return ds.url}catch(ds){if(ds.code!==Logger$1.errors.CALL_EXCEPTION)throw ds}try{const ds=_parseString(yield this.call({to:us,data:"0x691f3431"+namehash(as).substring(2)}),0);rs=yield this.getResolver(ds)}catch(ds){if(ds.code!==Logger$1.errors.CALL_EXCEPTION)throw ds;return null}}else if(rs=yield this.getResolver(Mn),!rs)return null;const is=yield rs.getAvatar();return is==null?null:is.url})}perform(Mn,rs){return logger$4.throwError(Mn+" not implemented",Logger$1.errors.NOT_IMPLEMENTED,{operation:Mn})}_startEvent(Mn){this.polling=this._events.filter(rs=>rs.pollable()).length>0}_stopEvent(Mn){this.polling=this._events.filter(rs=>rs.pollable()).length>0}_addEventListener(Mn,rs,is){const os=new Event$1(getEventTag(Mn),rs,is);return this._events.push(os),this._startEvent(os),this}on(Mn,rs){return this._addEventListener(Mn,rs,!1)}once(Mn,rs){return this._addEventListener(Mn,rs,!0)}emit(Mn,...rs){let is=!1,os=[],as=getEventTag(Mn);return this._events=this._events.filter(us=>us.tag!==as?!0:(setTimeout(()=>{us.listener.apply(this,rs)},0),is=!0,us.once?(os.push(us),!1):!0)),os.forEach(us=>{this._stopEvent(us)}),is}listenerCount(Mn){if(!Mn)return this._events.length;let rs=getEventTag(Mn);return this._events.filter(is=>is.tag===rs).length}listeners(Mn){if(Mn==null)return this._events.map(is=>is.listener);let rs=getEventTag(Mn);return this._events.filter(is=>is.tag===rs).map(is=>is.listener)}off(Mn,rs){if(rs==null)return this.removeAllListeners(Mn);const is=[];let os=!1,as=getEventTag(Mn);return this._events=this._events.filter(us=>us.tag!==as||us.listener!=rs||os?!0:(os=!0,is.push(us),!1)),is.forEach(us=>{this._stopEvent(us)}),this}removeAllListeners(Mn){let rs=[];if(Mn==null)rs=this._events,this._events=[];else{const is=getEventTag(Mn);this._events=this._events.filter(os=>os.tag!==is?!0:(rs.push(os),!1))}return rs.forEach(is=>{this._stopEvent(is)}),this}}var __awaiter$1=function(Fn,Mn,rs,is){function os(as){return as instanceof rs?as:new rs(function(us){us(as)})}return new(rs||(rs=Promise))(function(as,us){function ds(io){try{ps(is.next(io))}catch(fo){us(fo)}}function hs(io){try{ps(is.throw(io))}catch(fo){us(fo)}}function ps(io){io.done?as(io.value):os(io.value).then(ds,hs)}ps((is=is.apply(Fn,Mn||[])).next())})};const logger$3=new Logger$1(version$6),errorGas=["call","estimateGas"];function spelunk(Fn,Mn){if(Fn==null)return null;if(typeof Fn.message=="string"&&Fn.message.match("reverted")){const rs=isHexString(Fn.data)?Fn.data:null;if(!Mn||rs)return{message:Fn.message,data:rs}}if(typeof Fn=="object"){for(const rs in Fn){const is=spelunk(Fn[rs],Mn);if(is)return is}return null}if(typeof Fn=="string")try{return spelunk(JSON.parse(Fn),Mn)}catch{}return null}function checkError(Fn,Mn,rs){const is=rs.transaction||rs.signedTransaction;if(Fn==="call"){const as=spelunk(Mn,!0);if(as)return as.data;logger$3.throwError("missing revert data in call exception; Transaction reverted without a reason string",Logger$1.errors.CALL_EXCEPTION,{data:"0x",transaction:is,error:Mn})}if(Fn==="estimateGas"){let as=spelunk(Mn.body,!1);as==null&&(as=spelunk(Mn,!1)),as&&logger$3.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{reason:as.message,method:Fn,transaction:is,error:Mn})}let os=Mn.message;throw Mn.code===Logger$1.errors.SERVER_ERROR&&Mn.error&&typeof Mn.error.message=="string"?os=Mn.error.message:typeof Mn.body=="string"?os=Mn.body:typeof Mn.responseText=="string"&&(os=Mn.responseText),os=(os||"").toLowerCase(),os.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&logger$3.throwError("insufficient funds for intrinsic transaction cost",Logger$1.errors.INSUFFICIENT_FUNDS,{error:Mn,method:Fn,transaction:is}),os.match(/nonce (is )?too low/i)&&logger$3.throwError("nonce has already been used",Logger$1.errors.NONCE_EXPIRED,{error:Mn,method:Fn,transaction:is}),os.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&logger$3.throwError("replacement fee too low",Logger$1.errors.REPLACEMENT_UNDERPRICED,{error:Mn,method:Fn,transaction:is}),os.match(/only replay-protected/i)&&logger$3.throwError("legacy pre-eip-155 transactions not supported",Logger$1.errors.UNSUPPORTED_OPERATION,{error:Mn,method:Fn,transaction:is}),errorGas.indexOf(Fn)>=0&&os.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&logger$3.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Logger$1.errors.UNPREDICTABLE_GAS_LIMIT,{error:Mn,method:Fn,transaction:is}),Mn}function timer(Fn){return new Promise(function(Mn){setTimeout(Mn,Fn)})}function getResult(Fn){if(Fn.error){const Mn=new Error(Fn.error.message);throw Mn.code=Fn.error.code,Mn.data=Fn.error.data,Mn}return Fn.result}function getLowerCase(Fn){return Fn&&Fn.toLowerCase()}const _constructorGuard={};class JsonRpcSigner extends Signer{constructor(Mn,rs,is){if(super(),Mn!==_constructorGuard)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");defineReadOnly(this,"provider",rs),is==null&&(is=0),typeof is=="string"?(defineReadOnly(this,"_address",this.provider.formatter.address(is)),defineReadOnly(this,"_index",null)):typeof is=="number"?(defineReadOnly(this,"_index",is),defineReadOnly(this,"_address",null)):logger$3.throwArgumentError("invalid address or index","addressOrIndex",is)}connect(Mn){return logger$3.throwError("cannot alter JSON-RPC Signer connection",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new UncheckedJsonRpcSigner(_constructorGuard,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(Mn=>(Mn.length<=this._index&&logger$3.throwError("unknown account #"+this._index,Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(Mn[this._index])))}sendUncheckedTransaction(Mn){Mn=shallowCopy(Mn);const rs=this.getAddress().then(is=>(is&&(is=is.toLowerCase()),is));if(Mn.gasLimit==null){const is=shallowCopy(Mn);is.from=rs,Mn.gasLimit=this.provider.estimateGas(is)}return Mn.to!=null&&(Mn.to=Promise.resolve(Mn.to).then(is=>__awaiter$1(this,void 0,void 0,function*(){if(is==null)return null;const os=yield this.provider.resolveName(is);return os==null&&logger$3.throwArgumentError("provided ENS name resolves to null","tx.to",is),os}))),resolveProperties({tx:resolveProperties(Mn),sender:rs}).then(({tx:is,sender:os})=>{is.from!=null?is.from.toLowerCase()!==os&&logger$3.throwArgumentError("from address mismatch","transaction",Mn):is.from=os;const as=this.provider.constructor.hexlifyTransaction(is,{from:!0});return this.provider.send("eth_sendTransaction",[as]).then(us=>us,us=>(typeof us.message=="string"&&us.message.match(/user denied/i)&&logger$3.throwError("user rejected transaction",Logger$1.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:is}),checkError("sendTransaction",us,as)))})}signTransaction(Mn){return logger$3.throwError("signing transactions is unsupported",Logger$1.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(Mn){return __awaiter$1(this,void 0,void 0,function*(){const rs=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),is=yield this.sendUncheckedTransaction(Mn);try{return yield poll(()=>__awaiter$1(this,void 0,void 0,function*(){const os=yield this.provider.getTransaction(is);if(os!==null)return this.provider._wrapTransaction(os,is,rs)}),{oncePoll:this.provider})}catch(os){throw os.transactionHash=is,os}})}signMessage(Mn){return __awaiter$1(this,void 0,void 0,function*(){const rs=typeof Mn=="string"?toUtf8Bytes(Mn):Mn,is=yield this.getAddress();try{return yield this.provider.send("personal_sign",[hexlify(rs),is.toLowerCase()])}catch(os){throw typeof os.message=="string"&&os.message.match(/user denied/i)&&logger$3.throwError("user rejected signing",Logger$1.errors.ACTION_REJECTED,{action:"signMessage",from:is,messageData:Mn}),os}})}_legacySignMessage(Mn){return __awaiter$1(this,void 0,void 0,function*(){const rs=typeof Mn=="string"?toUtf8Bytes(Mn):Mn,is=yield this.getAddress();try{return yield this.provider.send("eth_sign",[is.toLowerCase(),hexlify(rs)])}catch(os){throw typeof os.message=="string"&&os.message.match(/user denied/i)&&logger$3.throwError("user rejected signing",Logger$1.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:is,messageData:Mn}),os}})}_signTypedData(Mn,rs,is){return __awaiter$1(this,void 0,void 0,function*(){const os=yield TypedDataEncoder.resolveNames(Mn,rs,is,us=>this.provider.resolveName(us)),as=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[as.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(os.domain,rs,os.value))])}catch(us){throw typeof us.message=="string"&&us.message.match(/user denied/i)&&logger$3.throwError("user rejected signing",Logger$1.errors.ACTION_REJECTED,{action:"_signTypedData",from:as,messageData:{domain:os.domain,types:rs,value:os.value}}),us}})}unlock(Mn){return __awaiter$1(this,void 0,void 0,function*(){const rs=this.provider,is=yield this.getAddress();return rs.send("personal_unlockAccount",[is.toLowerCase(),Mn,null])})}}class UncheckedJsonRpcSigner extends JsonRpcSigner{sendTransaction(Mn){return this.sendUncheckedTransaction(Mn).then(rs=>({hash:rs,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:is=>this.provider.waitForTransaction(rs,is)}))}}const allowedTransactionKeys={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class JsonRpcProvider extends BaseProvider{constructor(Mn,rs){let is=rs;is==null&&(is=new Promise((os,as)=>{setTimeout(()=>{this.detectNetwork().then(us=>{os(us)},us=>{as(us)})},0)})),super(is),Mn||(Mn=getStatic(this.constructor,"defaultUrl")()),typeof Mn=="string"?defineReadOnly(this,"connection",Object.freeze({url:Mn})):defineReadOnly(this,"connection",Object.freeze(shallowCopy(Mn))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return __awaiter$1(this,void 0,void 0,function*(){yield timer(0);let Mn=null;try{Mn=yield this.send("eth_chainId",[])}catch{try{Mn=yield this.send("net_version",[])}catch{}}if(Mn!=null){const rs=getStatic(this.constructor,"getNetwork");try{return rs(BigNumber$1.from(Mn).toNumber())}catch(is){return logger$3.throwError("could not detect network",Logger$1.errors.NETWORK_ERROR,{chainId:Mn,event:"invalidNetwork",serverError:is})}}return logger$3.throwError("could not detect network",Logger$1.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(Mn){return new JsonRpcSigner(_constructorGuard,this,Mn)}getUncheckedSigner(Mn){return this.getSigner(Mn).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(Mn=>Mn.map(rs=>this.formatter.address(rs)))}send(Mn,rs){const is={method:Mn,params:rs,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:deepCopy(is),provider:this});const os=["eth_chainId","eth_blockNumber"].indexOf(Mn)>=0;if(os&&this._cache[Mn])return this._cache[Mn];const as=fetchJson(this.connection,JSON.stringify(is),getResult).then(us=>(this.emit("debug",{action:"response",request:is,response:us,provider:this}),us),us=>{throw this.emit("debug",{action:"response",error:us,request:is,provider:this}),us});return os&&(this._cache[Mn]=as,setTimeout(()=>{this._cache[Mn]=null},0)),as}prepareRequest(Mn,rs){switch(Mn){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[getLowerCase(rs.address),rs.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[getLowerCase(rs.address),rs.blockTag]];case"getCode":return["eth_getCode",[getLowerCase(rs.address),rs.blockTag]];case"getStorageAt":return["eth_getStorageAt",[getLowerCase(rs.address),hexZeroPad(rs.position,32),rs.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[rs.signedTransaction]];case"getBlock":return rs.blockTag?["eth_getBlockByNumber",[rs.blockTag,!!rs.includeTransactions]]:rs.blockHash?["eth_getBlockByHash",[rs.blockHash,!!rs.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[rs.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[rs.transactionHash]];case"call":return["eth_call",[getStatic(this.constructor,"hexlifyTransaction")(rs.transaction,{from:!0}),rs.blockTag]];case"estimateGas":return["eth_estimateGas",[getStatic(this.constructor,"hexlifyTransaction")(rs.transaction,{from:!0})]];case"getLogs":return rs.filter&&rs.filter.address!=null&&(rs.filter.address=getLowerCase(rs.filter.address)),["eth_getLogs",[rs.filter]]}return null}perform(Mn,rs){return __awaiter$1(this,void 0,void 0,function*(){if(Mn==="call"||Mn==="estimateGas"){const os=rs.transaction;if(os&&os.type!=null&&BigNumber$1.from(os.type).isZero()&&os.maxFeePerGas==null&&os.maxPriorityFeePerGas==null){const as=yield this.getFeeData();as.maxFeePerGas==null&&as.maxPriorityFeePerGas==null&&(rs=shallowCopy(rs),rs.transaction=shallowCopy(os),delete rs.transaction.type)}}const is=this.prepareRequest(Mn,rs);is==null&&logger$3.throwError(Mn+" not implemented",Logger$1.errors.NOT_IMPLEMENTED,{operation:Mn});try{return yield this.send(is[0],is[1])}catch(os){return checkError(Mn,os,rs)}})}_startEvent(Mn){Mn.tag==="pending"&&this._startPending(),super._startEvent(Mn)}_startPending(){if(this._pendingFilter!=null)return;const Mn=this,rs=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=rs,rs.then(function(is){function os(){Mn.send("eth_getFilterChanges",[is]).then(function(as){if(Mn._pendingFilter!=rs)return null;let us=Promise.resolve();return as.forEach(function(ds){Mn._emitted["t:"+ds.toLowerCase()]="pending",us=us.then(function(){return Mn.getTransaction(ds).then(function(hs){return Mn.emit("pending",hs),null})})}),us.then(function(){return timer(1e3)})}).then(function(){if(Mn._pendingFilter!=rs){Mn.send("eth_uninstallFilter",[is]);return}return setTimeout(function(){os()},0),null}).catch(as=>{})}return os(),is}).catch(is=>{})}_stopEvent(Mn){Mn.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(Mn)}static hexlifyTransaction(Mn,rs){const is=shallowCopy(allowedTransactionKeys);if(rs)for(const as in rs)rs[as]&&(is[as]=!0);checkProperties(Mn,is);const os={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(as){if(Mn[as]==null)return;const us=hexValue(BigNumber$1.from(Mn[as]));as==="gasLimit"&&(as="gas"),os[as]=us}),["from","to","data"].forEach(function(as){Mn[as]!=null&&(os[as]=hexlify(Mn[as]))}),Mn.accessList&&(os.accessList=accessListify(Mn.accessList)),os}}const logger$2=new Logger$1(version$6);let _nextId=1;function buildWeb3LegacyFetcher(Fn,Mn){const rs="Web3LegacyFetcher";return function(is,os){const as={method:is,params:os,id:_nextId++,jsonrpc:"2.0"};return new Promise((us,ds)=>{this.emit("debug",{action:"request",fetcher:rs,request:deepCopy(as),provider:this}),Mn(as,(hs,ps)=>{if(hs)return this.emit("debug",{action:"response",fetcher:rs,error:hs,request:as,provider:this}),ds(hs);if(this.emit("debug",{action:"response",fetcher:rs,request:as,response:ps,provider:this}),ps.error){const io=new Error(ps.error.message);return io.code=ps.error.code,io.data=ps.error.data,ds(io)}us(ps.result)})})}}function buildEip1193Fetcher(Fn){return function(Mn,rs){rs==null&&(rs=[]);const is={method:Mn,params:rs};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:deepCopy(is),provider:this}),Fn.request(is).then(os=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:is,response:os,provider:this}),os),os=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:is,error:os,provider:this}),os})}}class Web3Provider extends JsonRpcProvider{constructor(Mn,rs){Mn==null&&logger$2.throwArgumentError("missing provider","provider",Mn);let is=null,os=null,as=null;typeof Mn=="function"?(is="unknown:",os=Mn):(is=Mn.host||Mn.path||"",!is&&Mn.isMetaMask&&(is="metamask"),as=Mn,Mn.request?(is===""&&(is="eip-1193:"),os=buildEip1193Fetcher(Mn)):Mn.sendAsync?os=buildWeb3LegacyFetcher(Mn,Mn.sendAsync.bind(Mn)):Mn.send?os=buildWeb3LegacyFetcher(Mn,Mn.send.bind(Mn)):logger$2.throwArgumentError("unsupported provider","provider",Mn),is||(is="unknown:")),super(is,rs),defineReadOnly(this,"jsonRpcFetchFunc",os),defineReadOnly(this,"provider",as)}send(Mn,rs){return this.jsonRpcFetchFunc(Mn,rs)}}const version$5="solidity/5.7.0",regexBytes=new RegExp("^bytes([0-9]+)$"),regexNumber=new RegExp("^(u?int)([0-9]*)$"),regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$"),Zeros="0000000000000000000000000000000000000000000000000000000000000000",logger$1=new Logger$1(version$5);function _pack(Fn,Mn,rs){switch(Fn){case"address":return rs?zeroPad(Mn,32):arrayify(Mn);case"string":return toUtf8Bytes(Mn);case"bytes":return arrayify(Mn);case"bool":return Mn=Mn?"0x01":"0x00",rs?zeroPad(Mn,32):arrayify(Mn)}let is=Fn.match(regexNumber);if(is){let os=parseInt(is[2]||"256");return(is[2]&&String(os)!==is[2]||os%8!==0||os===0||os>256)&&logger$1.throwArgumentError("invalid number type","type",Fn),rs&&(os=256),Mn=BigNumber$1.from(Mn).toTwos(os),zeroPad(Mn,os/8)}if(is=Fn.match(regexBytes),is){const os=parseInt(is[1]);return(String(os)!==is[1]||os===0||os>32)&&logger$1.throwArgumentError("invalid bytes type","type",Fn),arrayify(Mn).byteLength!==os&&logger$1.throwArgumentError(`invalid value for ${Fn}`,"value",Mn),rs?arrayify((Mn+Zeros).substring(0,66)):Mn}if(is=Fn.match(regexArray),is&&Array.isArray(Mn)){const os=is[1];parseInt(is[2]||String(Mn.length))!=Mn.length&&logger$1.throwArgumentError(`invalid array length for ${Fn}`,"value",Mn);const us=[];return Mn.forEach(function(ds){us.push(_pack(os,ds,!0))}),concat$2(us)}return logger$1.throwArgumentError("invalid type","type",Fn)}function pack(Fn,Mn){Fn.length!=Mn.length&&logger$1.throwArgumentError("wrong number of values; expected ${ types.length }","values",Mn);const rs=[];return Fn.forEach(function(is,os){rs.push(_pack(is,Mn[os]))}),hexlify(concat$2(rs))}const version$4="units/5.7.0",logger=new Logger$1(version$4),names$2=["wei","kwei","mwei","gwei","szabo","finney","ether"];function formatUnits(Fn,Mn){if(typeof Mn=="string"){const rs=names$2.indexOf(Mn);rs!==-1&&(Mn=3*rs)}return formatFixed(Fn,Mn??18)}function parseUnits(Fn,Mn){if(typeof Fn!="string"&&logger.throwArgumentError("value must be a string","value",Fn),typeof Mn=="string"){const rs=names$2.indexOf(Mn);rs!==-1&&(Mn=3*rs)}return parseFixed(Fn,Mn??18)}function parseEther(Fn){return parseUnits(Fn,18)}const ETH_Logo="/assets/Eth-DVbUYFUi.svg",BTC_Logo="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='2500'%20height='2500'%20viewBox='.004%200%2063.993%2064'%20id='bitcoin'%3e%3cpath%20fill='%23f7931a'%20d='M63.04%2039.741c-4.274%2017.143-21.638%2027.575-38.783%2023.301C7.12%2058.768-3.313%2041.404.962%2024.262%205.234%207.117%2022.597-3.317%2039.737.957c17.144%204.274%2027.576%2021.64%2023.302%2038.784z'%3e%3c/path%3e%3cpath%20fill='%23fff'%20d='M46.11%2027.441c.636-4.258-2.606-6.547-7.039-8.074l1.438-5.768-3.512-.875-1.4%205.616c-.922-.23-1.87-.447-2.812-.662l1.41-5.653-3.509-.875-1.439%205.766c-.764-.174-1.514-.346-2.242-.527l.004-.018-4.842-1.209-.934%203.75s2.605.597%202.55.634c1.422.355%201.68%201.296%201.636%202.042l-1.638%206.571c.098.025.225.061.365.117l-.37-.092-2.297%209.205c-.174.432-.615%201.08-1.609.834.035.051-2.552-.637-2.552-.637l-1.743%204.02%204.57%201.139c.85.213%201.683.436%202.502.646l-1.453%205.835%203.507.875%201.44-5.772c.957.26%201.887.5%202.797.726L27.504%2050.8l3.511.875%201.453-5.823c5.987%201.133%2010.49.676%2012.383-4.738%201.527-4.36-.075-6.875-3.225-8.516%202.294-.531%204.022-2.04%204.483-5.157zM38.087%2038.69c-1.086%204.36-8.426%202.004-10.807%201.412l1.928-7.729c2.38.594%2010.011%201.77%208.88%206.317zm1.085-11.312c-.99%203.966-7.1%201.951-9.083%201.457l1.748-7.01c1.983.494%208.367%201.416%207.335%205.553z'%3e%3c/path%3e%3c/svg%3e",PEPE_Logo="/assets/PEPE_USD-DgZaHcRN.png",WIF_Logo="/assets/WIF_USD-CUIlH7GB.png",DOGE_Logo="/assets/DOGE_USD-Cy8MiZHN.svg",FLOKI_Logo="/assets/FLOKIF_USD-DYKIIrl2.png",BONK_Logo="/assets/BONK_USD-DlJeqw1Q.svg",__vite_import_meta_env__$2={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_ARBITRUM_BTC_CALL_CONTROLLER_ADDRESS:"0x88e7a3A04384B873121A3D4D8c7260C30a17f9b6",VITE_ARBITRUM_BTC_CALL_LONGTOKEN_ADDRESS:"0x849A6746D6235087593789184215B16a09353b58",VITE_ARBITRUM_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0x0f4f76a9DC0C9e5920928D443BD56a9910B9d440",VITE_ARBITRUM_BTC_CALL_SHORTTOKEN_ADDRESS:"0x7204F3591EfA344D7Db30A93B53f7ee896407A46",VITE_ARBITRUM_BTC_CALL_VAULT_ADDRESS:"0x1EF72E09cdcc719994Df01ef420413c387afF523",VITE_ARBITRUM_BTC_PUT_CONTROLLER_ADDRESS:"0x023b95F123d9F1f7c501cBC0Ff119C1148ae244d",VITE_ARBITRUM_BTC_PUT_LONGTOKEN_ADDRESS:"0x2A1be4b228e486d33988549b72fc0EDE7c67DfeC",VITE_ARBITRUM_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x6d635c3059C42e661D4f4D1aB3Ad7ad8Cb21a0ea",VITE_ARBITRUM_BTC_PUT_SHORTTOKEN_ADDRESS:"0x1ca634Fc2ba18EF9e23a1a4f50C204Fccee5b959",VITE_ARBITRUM_BTC_PUT_VAULT_ADDRESS:"0xCF4cb0D6058f6a0a2599997CB66EaC0AeBdB4be4",VITE_ARBITRUM_CANDLE_INTERVAL:"1",VITE_ARBITRUM_CHAIN_ID:"421614",VITE_ARBITRUM_CHAIN_ID_HEX:"0x66eee",VITE_ARBITRUM_CHAIN_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_CONNECT_NETWORK_NAME:"arbitrumSepolia",VITE_ARBITRUM_CYCLE_DURATION:"5",VITE_ARBITRUM_ETH_CALL_CONTROLLER_ADDRESS:"0xFf72B4fBCCeC5a01554BeE50595E999B84c4b5cd",VITE_ARBITRUM_ETH_CALL_LONGTOKEN_ADDRESS:"0x331D8e8e0ad743F3A1908734106051a21A79a809",VITE_ARBITRUM_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5f9A93b04De5fCFd4FA552Bab87927B4F7811283",VITE_ARBITRUM_ETH_CALL_SHORTTOKEN_ADDRESS:"0xe5a3222720347c3ABAD046D69C16f97B3f69D6e6",VITE_ARBITRUM_ETH_CALL_VAULT_ADDRESS:"0x3d2D17Dd22AAF2b5E78aC8287e91D94c6f293264",VITE_ARBITRUM_ETH_PUT_CONTROLLER_ADDRESS:"0x7113e58c3E35E4adcF49f8C94915541BF3c0b54b",VITE_ARBITRUM_ETH_PUT_LONGTOKEN_ADDRESS:"0x623AC047de297c98B0a300299D66334Fb6653334",VITE_ARBITRUM_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x8BD2f0d7713AF3Fbd1bCd4837D6B0dEE2424BF62",VITE_ARBITRUM_ETH_PUT_SHORTTOKEN_ADDRESS:"0x555FaB7E6909d62812a57a22A4e4782fB227943a",VITE_ARBITRUM_ETH_PUT_VAULT_ADDRESS:"0xD5a2e5eC7B7E12E4D13fF0CD86510e5d0ED9f22F",VITE_ARBITRUM_EXPLORER_LINK:"https://sepolia.arbiscan.io",VITE_ARBITRUM_FAUCET_URL:"https://www.alchemy.com/faucets/arbitrum-sepolia",VITE_ARBITRUM_GAS_MULTIPLIER:"200",VITE_ARBITRUM_INFO_AGGREGATOR_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_ARBITRUM_NATIVE_TOKEN:"Arbitrum ETH",VITE_ARBITRUM_NATIVE_TOKEN_DECIMALS:"18",VITE_ARBITRUM_NATIVE_TOKEN_NAME:"ETH",VITE_ARBITRUM_NATIVE_TOKEN_SYMBOL:"ETH",VITE_ARBITRUM_NETWORK_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_PEPE_CALL_CONTROLLER_ADDRESS:"0x9e4c0853D182280dDb07700E754f5164870b19b8",VITE_ARBITRUM_PEPE_CALL_LONGTOKEN_ADDRESS:"0x59c5c8cAf2f35711D6AeB3aB10d9C0941332c8C1",VITE_ARBITRUM_PEPE_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5b7B8058f9E42f5E1a1c8a5777e4fc7337ea388e",VITE_ARBITRUM_PEPE_CALL_SHORTTOKEN_ADDRESS:"0x2A92e73FB8E70245d8e5a02796Fbd337f218a2b3",VITE_ARBITRUM_PEPE_CALL_VAULT_ADDRESS:"0x47D92807f3DD509ca9263ad89869eedc2c929d8D",VITE_ARBITRUM_PEPE_PUT_CONTROLLER_ADDRESS:"0x335Aa597E78Ce41df4BFC5d8Fb239CE788549Fbf",VITE_ARBITRUM_PEPE_PUT_LONGTOKEN_ADDRESS:"0x0833370393c95F6248B0993f72115049a17C7e2B",VITE_ARBITRUM_PEPE_PUT_SETTLEMENTMANAGER_ADDRESS:"0xcF237Eaf46ec94003CF6BAfcB2d7ec1bdD9760aa",VITE_ARBITRUM_PEPE_PUT_SHORTTOKEN_ADDRESS:"0xDf148c772598A24eA94A96FA6556D53EBED5E248",VITE_ARBITRUM_PEPE_PUT_VAULT_ADDRESS:"0x6A1Fd2267bC482C8D5833F6cE54e34951b6554cf",VITE_ARBITRUM_PREMIUM_PER_CYCLE:"0.5",VITE_ARBITRUM_PUBLIC_RPC:"https://arbitrum-sepolia.blockpi.network/v1/rpc/public",VITE_ARBITRUM_RPC:"https://greatest-falling-patron.arbitrum-sepolia.quiknode.pro/933e64a18e212561d0a0fdab953df2fdc1c06080",VITE_ARBITRUM_SCRAPPING_TIME:"30",VITE_ARBITRUM_SETTLEMENT_TOKEN_ADDRESS:"0x30B74a8766563DbAbAf04e0FFE392817F2D02Da1",VITE_ARBITRUM_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_ARBITRUM_WIF_CALL_CONTROLLER_ADDRESS:"0x4871807209e54b608e5844107Cf06Bcf12129F80",VITE_ARBITRUM_WIF_CALL_LONGTOKEN_ADDRESS:"0xa8DdE51B13C7d81b4D9c2c8EAa2E79bB828d82C4",VITE_ARBITRUM_WIF_CALL_SETTLEMENTMANAGER_ADDRESS:"0x583855075C098F2Cd7b2dA5995a2B329f0aE0f3c",VITE_ARBITRUM_WIF_CALL_SHORTTOKEN_ADDRESS:"0x582071a082189236f41527339DBb56B0c111CD6E",VITE_ARBITRUM_WIF_CALL_VAULT_ADDRESS:"0xFbd0Df32C6f75374B4b4Cb03f405932b4eeAC199",VITE_ARBITRUM_WIF_PUT_CONTROLLER_ADDRESS:"0x463377730eCaa7310Dcb3A3d48aDE097A23Bdd42",VITE_ARBITRUM_WIF_PUT_LONGTOKEN_ADDRESS:"0x607324341E75a5a51959a7b541cC8Fd7576e3066",VITE_ARBITRUM_WIF_PUT_SETTLEMENTMANAGER_ADDRESS:"0xFaA4AbaF2890958B200A04AE4cB2880Ad929d8A9",VITE_ARBITRUM_WIF_PUT_SHORTTOKEN_ADDRESS:"0x3FD0b87A9b30738F8086f0c2fDDe469687250FEb",VITE_ARBITRUM_WIF_PUT_VAULT_ADDRESS:"0x4C585D80bDDa554278F909bA51F2E42A2d5f5b96",VITE_BACKEND_URL:"https://switch-testnet-backend.kanalabs.io",VITE_BINANCE_BTC_CALL_CONTROLLER_ADDRESS:"0xC0028f1E9493bdba1670E8C65284f43F897D16d4",VITE_BINANCE_BTC_CALL_LONGTOKEN_ADDRESS:"0xA3fD705798AF4FA090B4dC95E97Ffb353a576969",VITE_BINANCE_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0xd38fd86FCCBf8DE9102d7C3D82799432D0B8da32",VITE_BINANCE_BTC_CALL_SHORTTOKEN_ADDRESS:"0xCaEC56628DCe5709F6B17De68C3431f45D4aBc37",VITE_BINANCE_BTC_CALL_VAULT_ADDRESS:"0x2fdbb070D4767cb11fe176CE48986aF222830437",VITE_BINANCE_BTC_PUT_CONTROLLER_ADDRESS:"0xBd99Fdae11A55E41e9ce1Cb27F2A6182dB579af8",VITE_BINANCE_BTC_PUT_LONGTOKEN_ADDRESS:"0x5E7f282a9Cd7BF64fD4EccD13b34703D7F27333d",VITE_BINANCE_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x9f3D3a8D3f0215Fe2D7692096DBC4b097EF5D963",VITE_BINANCE_BTC_PUT_SHORTTOKEN_ADDRESS:"0x7961F22D5931a510b40f740a005339109243Ca30",VITE_BINANCE_BTC_PUT_VAULT_ADDRESS:"0xaaBbF2bC143F59ab731C48FD687a14a8c30F2383",VITE_BINANCE_CANDLE_INTERVAL:"15",VITE_BINANCE_CHAIN_ID:"97",VITE_BINANCE_CHAIN_ID_HEX:"0x61",VITE_BINANCE_CHAIN_NAME:"BNB Smart Chain Testnet",VITE_BINANCE_CONNECT_NETWORK_NAME:"bscTestnet",VITE_BINANCE_CYCLE_DURATION:"120",VITE_BINANCE_ETH_CALL_CONTROLLER_ADDRESS:"0x9e35EDB90CF67A455Dc54418363bd6EC8fd0750d",VITE_BINANCE_ETH_CALL_LONGTOKEN_ADDRESS:"0x264821A828df29D027AF824Fb8A3a9cCCfbfB4bE",VITE_BINANCE_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0xbfE633B7A33e75EfD4af4522666a1c8eac4b3b65",VITE_BINANCE_ETH_CALL_SHORTTOKEN_ADDRESS:"0xE649a5a93224F6dc9bD9d5934A93b28F0a153956",VITE_BINANCE_ETH_CALL_VAULT_ADDRESS:"0x1E88b5ffd67313aC35cb13b4574284a1856047a3",VITE_BINANCE_ETH_PUT_CONTROLLER_ADDRESS:"0x3a577c95f96990E7741F8c07568476bA84567356",VITE_BINANCE_ETH_PUT_LONGTOKEN_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_BINANCE_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x254FF4CFa3d7dd1829B408243266870266f841CA",VITE_BINANCE_ETH_PUT_SHORTTOKEN_ADDRESS:"0x7051898114C8347fea6a2dcd6E3606D3FB31508F",VITE_BINANCE_ETH_PUT_VAULT_ADDRESS:"0x1FEF214CAdc20AB09562ECa67408e2cda49518A2",VITE_BINANCE_EXPLORER_LINK:"https://testnet.bscscan.com",VITE_BINANCE_FAUCET_URL:"https://testnet.bnbchain.org/faucet-smart",VITE_BINANCE_GAS_MULTIPLIER:"110",VITE_BINANCE_INFO_AGGREGATOR_ADDRESS:"0x3DFc4c69bce8e9455EafE3f429590fa9De5f128d",VITE_BINANCE_NATIVE_TOKEN:"tBNB",VITE_BINANCE_NATIVE_TOKEN_DECIMALS:"18",VITE_BINANCE_NATIVE_TOKEN_NAME:"tBNB",VITE_BINANCE_NATIVE_TOKEN_SYMBOL:"tBNB",VITE_BINANCE_NETWORK_NAME:"Binance Testnet",VITE_BINANCE_PREMIUM_PER_CYCLE:"0.5",VITE_BINANCE_PUBLIC_RPC:"https://endpoints.omniatech.io/v1/bsc/testnet/public",VITE_BINANCE_RPC:"https://cold-burned-general.bsc-testnet.quiknode.pro/5dc69c2182e7f66da44461e6dde3d7d786575a30/",VITE_BINANCE_SCRAPPING_TIME:"300",VITE_BINANCE_SETTLEMENT_TOKEN_ADDRESS:"0xDD0020ffDD1B371189778954Cf556B2979b0D33d",VITE_BINANCE_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_CHAIN_TOKEN_ARRAY:"BINANCE_ETH,BINANCE_BTC,ARBITRUM_ETH,ARBITRUM_PEPE",VITE_CIPHERDATA:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjRlYjViZDZhOWNmNDE2YzJmNzc3ZjU2OTg3ODkzNWE4OTBlMTc5NDdjODUyZmRjMzNlYjU1NmZmNzNkZjE5OGUyODU1NTg4NGNkYzM1ZWMwZjQwNzZkMWE4M2RhNTFiM2ZjYTA1YmQ1YTBlNTIwZGViZGVkZTViNzQ5NjdlMGEwIn0.b7ECWqqAvXtC8fblJcVKLO0GKBxa7rfNDtUwsnAaUno",VITE_MORALIS_API_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjM1MGU5MDEyLTU1Y2MtNDZkMi1iZTRkLWU2YTNhNTFmYzIxYyIsIm9yZ0lkIjoiMzczNjA3IiwidXNlcklkIjoiMzgzOTUxIiwidHlwZUlkIjoiYTBlZWJlNWYtMjQ3Ny00NTRjLWFlMDEtYmIxMThjYzliNjZiIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MDU5MTM4MTMsImV4cCI6NDg2MTY3MzgxM30.6ChaPKm5D80_qsZMnlsCoSumD2z9gkBWSP7wwoCAido",VITE_NETWORK:"TESTNET",VITE_PAYMASTER_API_KEY:"6kz6vdwgdbzs3w55jbn45chhhkw7yq8yk",VITE_QUICKNODE_KEY:"f2d17d0c3e7ac54189a60dad8133a533c4b4e945",VITE_VERCEL_BRANCH_URL:"kana-operps-frontend-git-testnet-operps-projects.vercel.app",VITE_VERCEL_ENV:"preview",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"operps",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"operps",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Merge pull request #409 from operps/devnet

Devnet`,VITE_VERCEL_GIT_COMMIT_REF:"testnet",VITE_VERCEL_GIT_COMMIT_SHA:"226178a17dbaec9ac480571ddea005cdee23e6a9",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"800575360",VITE_VERCEL_GIT_REPO_OWNER:"operps",VITE_VERCEL_GIT_REPO_SLUG:"kana-operps-frontend",VITE_VERCEL_PROJECT_PRODUCTION_URL:"operps.kanalabs.io",VITE_VERCEL_URL:"kana-operps-frontend-1n78omxub-operps-projects.vercel.app",VITE_WALLETCONNECTPROJECTID:"b8d15d96157934a210eb13769a539caa"};var Network=(Fn=>(Fn.MAINNET="MAINNET",Fn.TESTNET="TESTNET",Fn))(Network||{}),NetworkURL=(Fn=>(Fn.MAINNET="https://operps.kanalabs.io",Fn.TESTNET="https://testnet-operps.kanalabs.io",Fn))(NetworkURL||{}),OPTIONS=(Fn=>(Fn.PUT="PUT",Fn.CALL="CALL",Fn))(OPTIONS||{});const LINKS={DISCORD:"https://discord.gg/b69DknANUX",TELEGRAM:"https://t.me/switch_officialtg",GITBOOK:"https://ethosx.gitbook.io/ethosx-kanalabs-operps",FAQ:"https://ethosx.gitbook.io/operps/faqs"},SWITCHBACKENDURL="https://switch-testnet-backend.kanalabs.io",TOKEN_NAME={ETH:"ethereum",BTC:"bitcoin",PEPE:"pepe",WIF:"wif",DOGE:"doge",FLOKI:"floki",BONK:"bonk"},TOKEN_PRICE_USE_DECIMALS={ETH:3,BTC:3,PEPE:8,WIF:3,DOGE:6,FLOKI:8,BONK:8},TOKEN_LOGO={ETH:ETH_Logo,BTC:BTC_Logo,PEPE:PEPE_Logo,WIF:WIF_Logo,DOGE:DOGE_Logo,FLOKI:FLOKI_Logo,BONK:BONK_Logo},chain_token_array="BINANCE_ETH,BINANCE_BTC,ARBITRUM_ETH,ARBITRUM_PEPE".split(","),chains=chain_token_array.map(Fn=>Fn.split("_")[0]).filter((Fn,Mn,rs)=>rs.indexOf(Fn)===Mn);chain_token_array.map(Fn=>Fn.split("_")[0]).filter((Fn,Mn,rs)=>rs.indexOf(Fn)===Mn);let CHAIN_TOKEN_MAP={};chain_token_array.forEach(Fn=>{const Mn=__vite_import_meta_env__$2[`VITE_${Fn.split("_")[0]}_CHAIN_ID`],rs=Fn.split("_")[1];CHAIN_TOKEN_MAP[Mn]===void 0&&(CHAIN_TOKEN_MAP[Mn]=[]),CHAIN_TOKEN_MAP[Mn].push(rs+"_CALL"),CHAIN_TOKEN_MAP[Mn].push(rs+"_PUT")});let CHOOSE_OPTION_TYPE={};chain_token_array.forEach(Fn=>{const Mn=__vite_import_meta_env__$2[`VITE_${Fn.split("_")[0]}_CHAIN_ID`],rs=Fn.split("_")[1];CHOOSE_OPTION_TYPE[Mn]===void 0&&(CHOOSE_OPTION_TYPE[Mn]={}),CHOOSE_OPTION_TYPE[Mn][rs]===void 0&&(CHOOSE_OPTION_TYPE[Mn][rs]={}),CHOOSE_OPTION_TYPE[Mn][rs].PUT={Controller:__vite_import_meta_env__$2[`VITE_${Fn.split("_")[0]}_${rs}_PUT_CONTROLLER_ADDRESS`],Vault:__vite_import_meta_env__$2[`VITE_${Fn.split("_")[0]}_${rs}_PUT_VAULT_ADDRESS`],LongToken:__vite_import_meta_env__$2[`VITE_${Fn.split("_")[0]}_${rs}_PUT_LONGTOKEN_ADDRESS`],ShortToken:__vite_import_meta_env__$2[`VITE_${Fn.split("_")[0]}_${rs}_PUT_SHORTTOKEN_ADDRESS`]},CHOOSE_OPTION_TYPE[Mn][rs].CALL={Controller:__vite_import_meta_env__$2[`VITE_${Fn.split("_")[0]}_${rs}_CALL_CONTROLLER_ADDRESS`],Vault:__vite_import_meta_env__$2[`VITE_${Fn.split("_")[0]}_${rs}_CALL_VAULT_ADDRESS`],LongToken:__vite_import_meta_env__$2[`VITE_${Fn.split("_")[0]}_${rs}_CALL_LONGTOKEN_ADDRESS`],ShortToken:__vite_import_meta_env__$2[`VITE_${Fn.split("_")[0]}_${rs}_CALL_SHORTTOKEN_ADDRESS`]}});const CHAIN_PARAMS_CONFIG=Object.fromEntries(chains.map(Fn=>[Number(__vite_import_meta_env__$2[`VITE_${Fn}_CHAIN_ID`]),{name:__vite_import_meta_env__$2[`VITE_${Fn}_NETWORK_NAME`],chain_id:Number(__vite_import_meta_env__$2[`VITE_${Fn}_CHAIN_ID`]),hex_chain_id:__vite_import_meta_env__$2[`VITE_${Fn}_CHAIN_ID_HEX`],premium_per_cycle:Number(__vite_import_meta_env__$2[`VITE_${Fn}_PREMIUM_PER_CYCLE`]),cycle_duration:Number(__vite_import_meta_env__$2[`VITE_${Fn}_CYCLE_DURATION`]),scrapping_time:Number(__vite_import_meta_env__$2[`VITE_${Fn}_SCRAPPING_TIME`]),info_aggregator_address:__vite_import_meta_env__$2[`VITE_${Fn}_INFO_AGGREGATOR_ADDRESS`],native_token:__vite_import_meta_env__$2[`VITE_${Fn}_NATIVE_TOKEN`],gas_multiplier:Number(__vite_import_meta_env__$2[`VITE_${Fn}_GAS_MULTIPLIER`]),candle_interval:Number(__vite_import_meta_env__$2[`VITE_${Fn}_CANDLE_INTERVAL`]),explorer_link:__vite_import_meta_env__$2[`VITE_${Fn}_EXPLORER_LINK`],user_limit:__vite_import_meta_env__$2[`VITE_${Fn}_USER_LIMIT`],settlement_token_address:__vite_import_meta_env__$2[`VITE_${Fn}_SETTLEMENT_TOKEN_ADDRESS`],settlement_token_decimals:Number(__vite_import_meta_env__$2[`VITE_${Fn}_SETTLEMENT_TOKEN_DECIMALS`]),rpc_url:__vite_import_meta_env__$2[`VITE_${Fn}_RPC`],provider:new JsonRpcProvider(__vite_import_meta_env__$2[`VITE_${Fn}_RPC`]),faucet_url:__vite_import_meta_env__$2[`VITE_${Fn}_FAUCET_URL`]}])),PROXY_ADDRESS_CONFIG=Object.fromEntries(chains.map(Fn=>[__vite_import_meta_env__$2[`VITE_${Fn}_CHAIN_ID`],{proxy_address:__vite_import_meta_env__$2[`VITE_${Fn}_SETTLEMENT_TOKEN_ADDRESS`]}]));Object.fromEntries(chains.map(Fn=>[__vite_import_meta_env__$2[`VITE_${Fn}_CHAIN_ID`],__vite_import_meta_env__$2[`VITE_${Fn}_CONNECT_NETWORK_NAME`]]));const networkConfigs=Object.fromEntries(chains.map(Fn=>[__vite_import_meta_env__$2[`VITE_${Fn}_CHAIN_ID`],{chainId:__vite_import_meta_env__$2[`VITE_${Fn}_CHAIN_ID_HEX`],chainName:__vite_import_meta_env__$2[`VITE_${Fn}_CHAIN_NAME`],rpcUrls:[__vite_import_meta_env__$2[`VITE_${Fn}_PUBLIC_RPC`]],nativeCurrency:{name:__vite_import_meta_env__$2[`VITE_${Fn}_NATIVE_TOKEN_NAME`],symbol:__vite_import_meta_env__$2[`VITE_${Fn}_NATIVE_TOKEN_SYMBOL`],decimals:Number(__vite_import_meta_env__$2[`VITE_${Fn}_NATIVE_TOKEN_DECIMALS`])},blockExplorerUrls:[__vite_import_meta_env__$2[`VITE_${Fn}_EXPLORER_LINK`]]}])),BINANCE_CHAIN_ID=97,DEFAULT_CHAIN_ID=421614,cipherData="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjRlYjViZDZhOWNmNDE2YzJmNzc3ZjU2OTg3ODkzNWE4OTBlMTc5NDdjODUyZmRjMzNlYjU1NmZmNzNkZjE5OGUyODU1NTg4NGNkYzM1ZWMwZjQwNzZkMWE4M2RhNTFiM2ZjYTA1YmQ1YTBlNTIwZGViZGVkZTViNzQ5NjdlMGEwIn0.b7ECWqqAvXtC8fblJcVKLO0GKBxa7rfNDtUwsnAaUno",createAppSlice=Fn=>({isMode:OPTIONS.CALL,isItLongSwitchChart:!0,isDarkMode:localStorage.getItem("isDarkMode")==="true",isWalletConnectVisible:!1,isSelectedChain:DEFAULT_CHAIN_ID,web3AuthInfo:"",isCalculateVisible:!1,isCalculateVisibleShort:!1,isDisclaimerVisible:!1,isGuidePopupVisible:!0,dashboardInputValue:"",chartValue:[],multiMarketTokenPrices:{},selectedTokenPrice:0,progressPercent:0,selectedCrypto:"ETH",expectedReturn:{},timing:{lastSettlementTime:"00:00",nextSettlementTime:"00:00",cycleStartTimestampFinal:"00:00",tentativeCycleEndTimeFinal:"00:00",cycleStartPriceFinal:"0.00",tentativeCycleEndPriceFinal:"0.00",triggerPriceUp:"0.00",triggerPriceDown:"0.00",currentExpectedPremium:"0.00",nextExpectedPremium:"0.00",currentPercentageChart:{longTokenPercentage:0,shortTokenPercentage:0},nextPercentageChart:{longTokenPercentage:0,shortTokenPercentage:0},currentCyclelongTokenSupply:0,currentCycleshortTokenSupply:0,nextCyclelongTokenSupply:0,nextCycleshortTokenSupply:0,currentLeverage:0,nextLeverage:0,breakEvenPrice:0,CurrentLSPnl:"0.00",CurrentSSPnl:"0.00",shortLastDayAPY:"0.00",shortLastWeekAPY:"0.00"},pnl:{CurrentLSPnl:"0.00",CurrentSSPnl:"0.00"},apy:{shortLastDayAPY:"0.00",shortLastWeekAPY:"0.00"},isHedgeStakeVisible:!1,isAdvancedView:localStorage.getItem("isAdvancedView")==="true",isLoader:!1,isLoaderFaucet:!1,isCalculateType:0,isInitialTableLoaded:!1,isVideoVisible:!1,isLongTourVisible:!1,isShortTourVisible:!1,isOperpsPoster:!0,isGobackMenu:!0,isLeverageTrading:!1,isEarningPremium:!1,bullish:!1,bearish:!1,isCallModeSet:!0,isPutModeSet:!1,selectedTabIndex:0,isCheckedDontshow:!1,isQuestionVisible:!1,isConnectWalletPrompt:!0,openOrders:[],positions:[],withdrawable:[],trades:[],isGuideOpen:!1,currentGuideStep:0,totalGuideSteps:13,targetElementId:null,targetRect:null,isGuideDontShowChecked:!1,isPosterVisible:!0,usdcBalance:0,multiMarketOpenOrders:[],multiMarketPositionData:[],multiMarketBalanceData:[],multiMarketWithdrawalData:[],multiMarketPnlData:[],isFetchingData:!1,setIsItLongSwitchChart(Mn){Fn({isItLongSwitchChart:Mn}),localStorage.setItem("isItLongSwitchChart",Mn)},setProgressPercent(Mn){Fn({progressPercent:Mn})},setIsMode(Mn){Fn({isMode:Mn})},updateIsDarkMode(Mn){Fn({isDarkMode:Mn}),localStorage.setItem("isDarkMode",Mn.toString())},updateIsWalletConnectVisible(Mn){Fn({isWalletConnectVisible:Mn})},updateIsSelectedChain(Mn){Fn({isSelectedChain:Mn})},updateWeb3AuthInfo(Mn){Fn({web3AuthInfo:Mn})},updateIsCalculateVisible(Mn){Fn({isCalculateVisible:Mn})},updateIsCalculateVisibleShort(Mn){Fn({isCalculateVisibleShort:Mn})},updateIsDisclaimerVisible(Mn){Fn({isDisclaimerVisible:Mn})},updateIsGuidePopupVisible(Mn){Fn({isGuidePopupVisible:Mn})},updateDashboardInputValue(Mn){Fn({dashboardInputValue:Mn})},updateChartValue(Mn){Fn({chartValue:Mn})},updateMultiMarketTokenPrices(Mn){Fn({multiMarketTokenPrices:Mn})},updateSelectedTokenPrice(Mn){Fn({selectedTokenPrice:Mn})},setSelectedCrypto(Mn){Fn({selectedCrypto:Mn})},updateTiming(Mn){Fn({timing:Mn})},updateCurrentPnL(Mn){Fn({pnl:Mn})},updateCurrentAPY(Mn){Fn({apy:Mn})},updateIsHedgeStakeVisible(Mn){Fn({isHedgeStakeVisible:Mn})},updateIsAdvancedView(Mn){Fn({isAdvancedView:Mn}),localStorage.setItem("isAdvancedView",Mn.toString())},updateIsLoader(Mn){Fn({isLoader:Mn})},updateIsLoaderFaucet(Mn){Fn({isLoaderFaucet:Mn})},updateIsCalculateType(Mn){Fn({isCalculateType:Mn})},updateIsInitialTableLoaded(Mn){Fn({isInitialTableLoaded:Mn})},updateIsVideoVisible(Mn){Fn({isVideoVisible:Mn})},updateIsLongTourVisible(Mn){Fn({isLongTourVisible:Mn})},updateIsShortTourVisible(Mn){Fn({isShortTourVisible:Mn})},updateIsOperpsPoster(Mn){Fn({isOperpsPoster:Mn}),localStorage.setItem("isOperpsPoster",Mn.toString())},updateIsGobackMenu(Mn){Fn({isGobackMenu:Mn})},updateIsLeverageTrading(Mn){Fn({isLeverageTrading:Mn})},updateIsEarningPremium(Mn){Fn({isEarningPremium:Mn})},setBullish(Mn){Fn({bullish:Mn})},setBearish(Mn){Fn({bearish:Mn})},setCallModeSet(Mn){Fn({isCallModeSet:Mn})},setPutModeSet(Mn){Fn({isPutModeSet:Mn})},setSelectedTabIndex(Mn){Fn({selectedTabIndex:Mn})},setIsCheckedDontshow(Mn){Fn({isCheckedDontshow:Mn})},updateIsQuestionVisible(Mn){Fn({isQuestionVisible:Mn})},setIsConnectWalletPrompt(Mn){Fn({isConnectWalletPrompt:Mn})},updateOpenOrders(Mn){Fn({openOrders:Mn})},updatePositions(Mn){Fn({positions:Mn})},updateWithdrawable(Mn){Fn({withdrawable:Mn})},updateTrades(Mn){Fn({trades:Mn})},setIsGuideOpen(Mn){Fn({isGuideOpen:Mn})},setCurrentGuideStep(Mn){Fn({currentGuideStep:Mn})},nextGuideStep(){Fn(Mn=>({currentGuideStep:Math.min(Mn.currentGuideStep+1,Mn.totalGuideSteps)}))},prevGuideStep(){Fn(Mn=>({currentGuideStep:Math.max(Mn.currentGuideStep-1,0)}))},restartGuide(){Fn({currentGuideStep:0,isGuideOpen:!0})},setTargetElementId(Mn){Fn({targetElementId:Mn})},setTargetRect(Mn){Fn({targetRect:Mn})},setIsGuideDontShowChecked(Mn){Fn({isGuideDontShowChecked:Mn})},updateIsPosterVisible(Mn){Fn({isPosterVisible:Mn})},setUsdcBalance(Mn){Fn({usdcBalance:Mn})},setMultiMarketOpenOrders(Mn){Fn({multiMarketOpenOrders:Mn})},setMultiMarketPositionData(Mn){Fn({multiMarketPositionData:Mn})},setMultiMarketBalanceData(Mn){Fn({multiMarketBalanceData:Mn})},setMultiMarketWithdrawalData(Mn){Fn({multiMarketWithdrawalData:Mn})},setMultiMarketPnlData(Mn){Fn({multiMarketPnlData:Mn})},updateIsFetchingData(Mn){Fn({isFetchingData:Mn})}}),__vite_import_meta_env__$1={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_ARBITRUM_BTC_CALL_CONTROLLER_ADDRESS:"0x88e7a3A04384B873121A3D4D8c7260C30a17f9b6",VITE_ARBITRUM_BTC_CALL_LONGTOKEN_ADDRESS:"0x849A6746D6235087593789184215B16a09353b58",VITE_ARBITRUM_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0x0f4f76a9DC0C9e5920928D443BD56a9910B9d440",VITE_ARBITRUM_BTC_CALL_SHORTTOKEN_ADDRESS:"0x7204F3591EfA344D7Db30A93B53f7ee896407A46",VITE_ARBITRUM_BTC_CALL_VAULT_ADDRESS:"0x1EF72E09cdcc719994Df01ef420413c387afF523",VITE_ARBITRUM_BTC_PUT_CONTROLLER_ADDRESS:"0x023b95F123d9F1f7c501cBC0Ff119C1148ae244d",VITE_ARBITRUM_BTC_PUT_LONGTOKEN_ADDRESS:"0x2A1be4b228e486d33988549b72fc0EDE7c67DfeC",VITE_ARBITRUM_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x6d635c3059C42e661D4f4D1aB3Ad7ad8Cb21a0ea",VITE_ARBITRUM_BTC_PUT_SHORTTOKEN_ADDRESS:"0x1ca634Fc2ba18EF9e23a1a4f50C204Fccee5b959",VITE_ARBITRUM_BTC_PUT_VAULT_ADDRESS:"0xCF4cb0D6058f6a0a2599997CB66EaC0AeBdB4be4",VITE_ARBITRUM_CANDLE_INTERVAL:"1",VITE_ARBITRUM_CHAIN_ID:"421614",VITE_ARBITRUM_CHAIN_ID_HEX:"0x66eee",VITE_ARBITRUM_CHAIN_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_CONNECT_NETWORK_NAME:"arbitrumSepolia",VITE_ARBITRUM_CYCLE_DURATION:"5",VITE_ARBITRUM_ETH_CALL_CONTROLLER_ADDRESS:"0xFf72B4fBCCeC5a01554BeE50595E999B84c4b5cd",VITE_ARBITRUM_ETH_CALL_LONGTOKEN_ADDRESS:"0x331D8e8e0ad743F3A1908734106051a21A79a809",VITE_ARBITRUM_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5f9A93b04De5fCFd4FA552Bab87927B4F7811283",VITE_ARBITRUM_ETH_CALL_SHORTTOKEN_ADDRESS:"0xe5a3222720347c3ABAD046D69C16f97B3f69D6e6",VITE_ARBITRUM_ETH_CALL_VAULT_ADDRESS:"0x3d2D17Dd22AAF2b5E78aC8287e91D94c6f293264",VITE_ARBITRUM_ETH_PUT_CONTROLLER_ADDRESS:"0x7113e58c3E35E4adcF49f8C94915541BF3c0b54b",VITE_ARBITRUM_ETH_PUT_LONGTOKEN_ADDRESS:"0x623AC047de297c98B0a300299D66334Fb6653334",VITE_ARBITRUM_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x8BD2f0d7713AF3Fbd1bCd4837D6B0dEE2424BF62",VITE_ARBITRUM_ETH_PUT_SHORTTOKEN_ADDRESS:"0x555FaB7E6909d62812a57a22A4e4782fB227943a",VITE_ARBITRUM_ETH_PUT_VAULT_ADDRESS:"0xD5a2e5eC7B7E12E4D13fF0CD86510e5d0ED9f22F",VITE_ARBITRUM_EXPLORER_LINK:"https://sepolia.arbiscan.io",VITE_ARBITRUM_FAUCET_URL:"https://www.alchemy.com/faucets/arbitrum-sepolia",VITE_ARBITRUM_GAS_MULTIPLIER:"200",VITE_ARBITRUM_INFO_AGGREGATOR_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_ARBITRUM_NATIVE_TOKEN:"Arbitrum ETH",VITE_ARBITRUM_NATIVE_TOKEN_DECIMALS:"18",VITE_ARBITRUM_NATIVE_TOKEN_NAME:"ETH",VITE_ARBITRUM_NATIVE_TOKEN_SYMBOL:"ETH",VITE_ARBITRUM_NETWORK_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_PEPE_CALL_CONTROLLER_ADDRESS:"0x9e4c0853D182280dDb07700E754f5164870b19b8",VITE_ARBITRUM_PEPE_CALL_LONGTOKEN_ADDRESS:"0x59c5c8cAf2f35711D6AeB3aB10d9C0941332c8C1",VITE_ARBITRUM_PEPE_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5b7B8058f9E42f5E1a1c8a5777e4fc7337ea388e",VITE_ARBITRUM_PEPE_CALL_SHORTTOKEN_ADDRESS:"0x2A92e73FB8E70245d8e5a02796Fbd337f218a2b3",VITE_ARBITRUM_PEPE_CALL_VAULT_ADDRESS:"0x47D92807f3DD509ca9263ad89869eedc2c929d8D",VITE_ARBITRUM_PEPE_PUT_CONTROLLER_ADDRESS:"0x335Aa597E78Ce41df4BFC5d8Fb239CE788549Fbf",VITE_ARBITRUM_PEPE_PUT_LONGTOKEN_ADDRESS:"0x0833370393c95F6248B0993f72115049a17C7e2B",VITE_ARBITRUM_PEPE_PUT_SETTLEMENTMANAGER_ADDRESS:"0xcF237Eaf46ec94003CF6BAfcB2d7ec1bdD9760aa",VITE_ARBITRUM_PEPE_PUT_SHORTTOKEN_ADDRESS:"0xDf148c772598A24eA94A96FA6556D53EBED5E248",VITE_ARBITRUM_PEPE_PUT_VAULT_ADDRESS:"0x6A1Fd2267bC482C8D5833F6cE54e34951b6554cf",VITE_ARBITRUM_PREMIUM_PER_CYCLE:"0.5",VITE_ARBITRUM_PUBLIC_RPC:"https://arbitrum-sepolia.blockpi.network/v1/rpc/public",VITE_ARBITRUM_RPC:"https://greatest-falling-patron.arbitrum-sepolia.quiknode.pro/933e64a18e212561d0a0fdab953df2fdc1c06080",VITE_ARBITRUM_SCRAPPING_TIME:"30",VITE_ARBITRUM_SETTLEMENT_TOKEN_ADDRESS:"0x30B74a8766563DbAbAf04e0FFE392817F2D02Da1",VITE_ARBITRUM_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_ARBITRUM_WIF_CALL_CONTROLLER_ADDRESS:"0x4871807209e54b608e5844107Cf06Bcf12129F80",VITE_ARBITRUM_WIF_CALL_LONGTOKEN_ADDRESS:"0xa8DdE51B13C7d81b4D9c2c8EAa2E79bB828d82C4",VITE_ARBITRUM_WIF_CALL_SETTLEMENTMANAGER_ADDRESS:"0x583855075C098F2Cd7b2dA5995a2B329f0aE0f3c",VITE_ARBITRUM_WIF_CALL_SHORTTOKEN_ADDRESS:"0x582071a082189236f41527339DBb56B0c111CD6E",VITE_ARBITRUM_WIF_CALL_VAULT_ADDRESS:"0xFbd0Df32C6f75374B4b4Cb03f405932b4eeAC199",VITE_ARBITRUM_WIF_PUT_CONTROLLER_ADDRESS:"0x463377730eCaa7310Dcb3A3d48aDE097A23Bdd42",VITE_ARBITRUM_WIF_PUT_LONGTOKEN_ADDRESS:"0x607324341E75a5a51959a7b541cC8Fd7576e3066",VITE_ARBITRUM_WIF_PUT_SETTLEMENTMANAGER_ADDRESS:"0xFaA4AbaF2890958B200A04AE4cB2880Ad929d8A9",VITE_ARBITRUM_WIF_PUT_SHORTTOKEN_ADDRESS:"0x3FD0b87A9b30738F8086f0c2fDDe469687250FEb",VITE_ARBITRUM_WIF_PUT_VAULT_ADDRESS:"0x4C585D80bDDa554278F909bA51F2E42A2d5f5b96",VITE_BACKEND_URL:"https://switch-testnet-backend.kanalabs.io",VITE_BINANCE_BTC_CALL_CONTROLLER_ADDRESS:"0xC0028f1E9493bdba1670E8C65284f43F897D16d4",VITE_BINANCE_BTC_CALL_LONGTOKEN_ADDRESS:"0xA3fD705798AF4FA090B4dC95E97Ffb353a576969",VITE_BINANCE_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0xd38fd86FCCBf8DE9102d7C3D82799432D0B8da32",VITE_BINANCE_BTC_CALL_SHORTTOKEN_ADDRESS:"0xCaEC56628DCe5709F6B17De68C3431f45D4aBc37",VITE_BINANCE_BTC_CALL_VAULT_ADDRESS:"0x2fdbb070D4767cb11fe176CE48986aF222830437",VITE_BINANCE_BTC_PUT_CONTROLLER_ADDRESS:"0xBd99Fdae11A55E41e9ce1Cb27F2A6182dB579af8",VITE_BINANCE_BTC_PUT_LONGTOKEN_ADDRESS:"0x5E7f282a9Cd7BF64fD4EccD13b34703D7F27333d",VITE_BINANCE_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x9f3D3a8D3f0215Fe2D7692096DBC4b097EF5D963",VITE_BINANCE_BTC_PUT_SHORTTOKEN_ADDRESS:"0x7961F22D5931a510b40f740a005339109243Ca30",VITE_BINANCE_BTC_PUT_VAULT_ADDRESS:"0xaaBbF2bC143F59ab731C48FD687a14a8c30F2383",VITE_BINANCE_CANDLE_INTERVAL:"15",VITE_BINANCE_CHAIN_ID:"97",VITE_BINANCE_CHAIN_ID_HEX:"0x61",VITE_BINANCE_CHAIN_NAME:"BNB Smart Chain Testnet",VITE_BINANCE_CONNECT_NETWORK_NAME:"bscTestnet",VITE_BINANCE_CYCLE_DURATION:"120",VITE_BINANCE_ETH_CALL_CONTROLLER_ADDRESS:"0x9e35EDB90CF67A455Dc54418363bd6EC8fd0750d",VITE_BINANCE_ETH_CALL_LONGTOKEN_ADDRESS:"0x264821A828df29D027AF824Fb8A3a9cCCfbfB4bE",VITE_BINANCE_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0xbfE633B7A33e75EfD4af4522666a1c8eac4b3b65",VITE_BINANCE_ETH_CALL_SHORTTOKEN_ADDRESS:"0xE649a5a93224F6dc9bD9d5934A93b28F0a153956",VITE_BINANCE_ETH_CALL_VAULT_ADDRESS:"0x1E88b5ffd67313aC35cb13b4574284a1856047a3",VITE_BINANCE_ETH_PUT_CONTROLLER_ADDRESS:"0x3a577c95f96990E7741F8c07568476bA84567356",VITE_BINANCE_ETH_PUT_LONGTOKEN_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_BINANCE_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x254FF4CFa3d7dd1829B408243266870266f841CA",VITE_BINANCE_ETH_PUT_SHORTTOKEN_ADDRESS:"0x7051898114C8347fea6a2dcd6E3606D3FB31508F",VITE_BINANCE_ETH_PUT_VAULT_ADDRESS:"0x1FEF214CAdc20AB09562ECa67408e2cda49518A2",VITE_BINANCE_EXPLORER_LINK:"https://testnet.bscscan.com",VITE_BINANCE_FAUCET_URL:"https://testnet.bnbchain.org/faucet-smart",VITE_BINANCE_GAS_MULTIPLIER:"110",VITE_BINANCE_INFO_AGGREGATOR_ADDRESS:"0x3DFc4c69bce8e9455EafE3f429590fa9De5f128d",VITE_BINANCE_NATIVE_TOKEN:"tBNB",VITE_BINANCE_NATIVE_TOKEN_DECIMALS:"18",VITE_BINANCE_NATIVE_TOKEN_NAME:"tBNB",VITE_BINANCE_NATIVE_TOKEN_SYMBOL:"tBNB",VITE_BINANCE_NETWORK_NAME:"Binance Testnet",VITE_BINANCE_PREMIUM_PER_CYCLE:"0.5",VITE_BINANCE_PUBLIC_RPC:"https://endpoints.omniatech.io/v1/bsc/testnet/public",VITE_BINANCE_RPC:"https://cold-burned-general.bsc-testnet.quiknode.pro/5dc69c2182e7f66da44461e6dde3d7d786575a30/",VITE_BINANCE_SCRAPPING_TIME:"300",VITE_BINANCE_SETTLEMENT_TOKEN_ADDRESS:"0xDD0020ffDD1B371189778954Cf556B2979b0D33d",VITE_BINANCE_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_CHAIN_TOKEN_ARRAY:"BINANCE_ETH,BINANCE_BTC,ARBITRUM_ETH,ARBITRUM_PEPE",VITE_CIPHERDATA:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjRlYjViZDZhOWNmNDE2YzJmNzc3ZjU2OTg3ODkzNWE4OTBlMTc5NDdjODUyZmRjMzNlYjU1NmZmNzNkZjE5OGUyODU1NTg4NGNkYzM1ZWMwZjQwNzZkMWE4M2RhNTFiM2ZjYTA1YmQ1YTBlNTIwZGViZGVkZTViNzQ5NjdlMGEwIn0.b7ECWqqAvXtC8fblJcVKLO0GKBxa7rfNDtUwsnAaUno",VITE_MORALIS_API_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjM1MGU5MDEyLTU1Y2MtNDZkMi1iZTRkLWU2YTNhNTFmYzIxYyIsIm9yZ0lkIjoiMzczNjA3IiwidXNlcklkIjoiMzgzOTUxIiwidHlwZUlkIjoiYTBlZWJlNWYtMjQ3Ny00NTRjLWFlMDEtYmIxMThjYzliNjZiIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MDU5MTM4MTMsImV4cCI6NDg2MTY3MzgxM30.6ChaPKm5D80_qsZMnlsCoSumD2z9gkBWSP7wwoCAido",VITE_NETWORK:"TESTNET",VITE_PAYMASTER_API_KEY:"6kz6vdwgdbzs3w55jbn45chhhkw7yq8yk",VITE_QUICKNODE_KEY:"f2d17d0c3e7ac54189a60dad8133a533c4b4e945",VITE_VERCEL_BRANCH_URL:"kana-operps-frontend-git-testnet-operps-projects.vercel.app",VITE_VERCEL_ENV:"preview",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"operps",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"operps",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Merge pull request #409 from operps/devnet

Devnet`,VITE_VERCEL_GIT_COMMIT_REF:"testnet",VITE_VERCEL_GIT_COMMIT_SHA:"226178a17dbaec9ac480571ddea005cdee23e6a9",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"800575360",VITE_VERCEL_GIT_REPO_OWNER:"operps",VITE_VERCEL_GIT_REPO_SLUG:"kana-operps-frontend",VITE_VERCEL_PROJECT_PRODUCTION_URL:"operps.kanalabs.io",VITE_VERCEL_URL:"kana-operps-frontend-1n78omxub-operps-projects.vercel.app",VITE_WALLETCONNECTPROJECTID:"b8d15d96157934a210eb13769a539caa"},trackedConnections=new Map,getTrackedConnectionState=Fn=>{const Mn=trackedConnections.get(Fn);return Mn?Object.fromEntries(Object.entries(Mn.stores).map(([rs,is])=>[rs,is.getState()])):{}},extractConnectionInformation=(Fn,Mn,rs)=>{if(Fn===void 0)return{type:"untracked",connection:Mn.connect(rs)};const is=trackedConnections.get(rs.name);if(is)return{type:"tracked",store:Fn,...is};const os={connection:Mn.connect(rs),stores:{}};return trackedConnections.set(rs.name,os),{type:"tracked",store:Fn,...os}},devtoolsImpl=(Fn,Mn={})=>(rs,is,os)=>{const{enabled:as,anonymousActionType:us,store:ds,...hs}=Mn;let ps;try{ps=(as??(__vite_import_meta_env__$1?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!ps)return(__vite_import_meta_env__$1?"production":void 0)!=="production"&&as&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),Fn(rs,is,os);const{connection:io,...fo}=extractConnectionInformation(ds,ps,hs);let mo=!0;os.setState=(Lo,Go,Yo)=>{const Wo=rs(Lo,Go);if(!mo)return Wo;const Jo=Yo===void 0?{type:us||"anonymous"}:typeof Yo=="string"?{type:Yo}:Yo;return ds===void 0?(io==null||io.send(Jo,is()),Wo):(io==null||io.send({...Jo,type:`${ds}/${Jo.type}`},{...getTrackedConnectionState(hs.name),[ds]:os.getState()}),Wo)};const Ao=(...Lo)=>{const Go=mo;mo=!1,rs(...Lo),mo=Go},$o=Fn(os.setState,is,os);if(fo.type==="untracked"?io==null||io.init($o):(fo.stores[fo.store]=os,io==null||io.init(Object.fromEntries(Object.entries(fo.stores).map(([Lo,Go])=>[Lo,Lo===fo.store?$o:Go.getState()])))),os.dispatchFromDevtools&&typeof os.dispatch=="function"){let Lo=!1;const Go=os.dispatch;os.dispatch=(...Yo)=>{(__vite_import_meta_env__$1?"production":void 0)!=="production"&&Yo[0].type==="__setState"&&!Lo&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),Lo=!0),Go(...Yo)}}return io.subscribe(Lo=>{var Go;switch(Lo.type){case"ACTION":if(typeof Lo.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return parseJsonThen(Lo.payload,Yo=>{if(Yo.type==="__setState"){if(ds===void 0){Ao(Yo.state);return}Object.keys(Yo.state).length!==1&&console.error(`
                    [zustand devtools middleware] Unsupported __setState action format. 
                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
                    `);const Wo=Yo.state[ds];if(Wo==null)return;JSON.stringify(os.getState())!==JSON.stringify(Wo)&&Ao(Wo);return}os.dispatchFromDevtools&&typeof os.dispatch=="function"&&os.dispatch(Yo)});case"DISPATCH":switch(Lo.payload.type){case"RESET":return Ao($o),ds===void 0?io==null?void 0:io.init(os.getState()):io==null?void 0:io.init(getTrackedConnectionState(hs.name));case"COMMIT":if(ds===void 0){io==null||io.init(os.getState());return}return io==null?void 0:io.init(getTrackedConnectionState(hs.name));case"ROLLBACK":return parseJsonThen(Lo.state,Yo=>{if(ds===void 0){Ao(Yo),io==null||io.init(os.getState());return}Ao(Yo[ds]),io==null||io.init(getTrackedConnectionState(hs.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return parseJsonThen(Lo.state,Yo=>{if(ds===void 0){Ao(Yo);return}JSON.stringify(os.getState())!==JSON.stringify(Yo[ds])&&Ao(Yo[ds])});case"IMPORT_STATE":{const{nextLiftedState:Yo}=Lo.payload,Wo=(Go=Yo.computedStates.slice(-1)[0])==null?void 0:Go.state;if(!Wo)return;Ao(ds===void 0?Wo:Wo[ds]),io==null||io.send(null,Yo);return}case"PAUSE_RECORDING":return mo=!mo}return}}),$o},devtools=devtoolsImpl,parseJsonThen=(Fn,Mn)=>{let rs;try{rs=JSON.parse(Fn)}catch(is){console.error("[zustand devtools middleware] Could not parse the received json",is)}rs!==void 0&&Mn(rs)};function n$a(Fn){for(var Mn=arguments.length,rs=Array(Mn>1?Mn-1:0),is=1;is<Mn;is++)rs[is-1]=arguments[is];throw Error("[Immer] minified error nr: "+Fn+(rs.length?" "+rs.map(function(os){return"'"+os+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r$a(Fn){return!!Fn&&!!Fn[Q$3]}function t$5(Fn){var Mn;return!!Fn&&(function(rs){if(!rs||typeof rs!="object")return!1;var is=Object.getPrototypeOf(rs);if(is===null)return!0;var os=Object.hasOwnProperty.call(is,"constructor")&&is.constructor;return os===Object||typeof os=="function"&&Function.toString.call(os)===Z$2}(Fn)||Array.isArray(Fn)||!!Fn[L$2]||!!(!((Mn=Fn.constructor)===null||Mn===void 0)&&Mn[L$2])||s$4(Fn)||v$7(Fn))}function i$7(Fn,Mn,rs){rs===void 0&&(rs=!1),o$6(Fn)===0?(rs?Object.keys:nn$2)(Fn).forEach(function(is){rs&&typeof is=="symbol"||Mn(is,Fn[is],Fn)}):Fn.forEach(function(is,os){return Mn(os,is,Fn)})}function o$6(Fn){var Mn=Fn[Q$3];return Mn?Mn.i>3?Mn.i-4:Mn.i:Array.isArray(Fn)?1:s$4(Fn)?2:v$7(Fn)?3:0}function u$2(Fn,Mn){return o$6(Fn)===2?Fn.has(Mn):Object.prototype.hasOwnProperty.call(Fn,Mn)}function a$3(Fn,Mn){return o$6(Fn)===2?Fn.get(Mn):Fn[Mn]}function f$7(Fn,Mn,rs){var is=o$6(Fn);is===2?Fn.set(Mn,rs):is===3?Fn.add(rs):Fn[Mn]=rs}function c$8(Fn,Mn){return Fn===Mn?Fn!==0||1/Fn==1/Mn:Fn!=Fn&&Mn!=Mn}function s$4(Fn){return X&&Fn instanceof Map}function v$7(Fn){return q$3&&Fn instanceof Set}function p$5(Fn){return Fn.o||Fn.t}function l$6(Fn){if(Array.isArray(Fn))return Array.prototype.slice.call(Fn);var Mn=rn$2(Fn);delete Mn[Q$3];for(var rs=nn$2(Mn),is=0;is<rs.length;is++){var os=rs[is],as=Mn[os];as.writable===!1&&(as.writable=!0,as.configurable=!0),(as.get||as.set)&&(Mn[os]={configurable:!0,writable:!0,enumerable:as.enumerable,value:Fn[os]})}return Object.create(Object.getPrototypeOf(Fn),Mn)}function d$5(Fn,Mn){return Mn===void 0&&(Mn=!1),y$7(Fn)||r$a(Fn)||!t$5(Fn)||(o$6(Fn)>1&&(Fn.set=Fn.add=Fn.clear=Fn.delete=h$9),Object.freeze(Fn),Mn&&i$7(Fn,function(rs,is){return d$5(is,!0)},!0)),Fn}function h$9(){n$a(2)}function y$7(Fn){return Fn==null||typeof Fn!="object"||Object.isFrozen(Fn)}function b$4(Fn){var Mn=tn$2[Fn];return Mn||n$a(18,Fn),Mn}function _$4(){return U$2}function j$5(Fn,Mn){Mn&&(b$4("Patches"),Fn.u=[],Fn.s=[],Fn.v=Mn)}function g$5(Fn){O$5(Fn),Fn.p.forEach(S$5),Fn.p=null}function O$5(Fn){Fn===U$2&&(U$2=Fn.l)}function w$7(Fn){return U$2={p:[],l:U$2,h:Fn,m:!0,_:0}}function S$5(Fn){var Mn=Fn[Q$3];Mn.i===0||Mn.i===1?Mn.j():Mn.g=!0}function P$3(Fn,Mn){Mn._=Mn.p.length;var rs=Mn.p[0],is=Fn!==void 0&&Fn!==rs;return Mn.h.O||b$4("ES5").S(Mn,Fn,is),is?(rs[Q$3].P&&(g$5(Mn),n$a(4)),t$5(Fn)&&(Fn=M$3(Mn,Fn),Mn.l||x$6(Mn,Fn)),Mn.u&&b$4("Patches").M(rs[Q$3].t,Fn,Mn.u,Mn.s)):Fn=M$3(Mn,rs,[]),g$5(Mn),Mn.u&&Mn.v(Mn.u,Mn.s),Fn!==H?Fn:void 0}function M$3(Fn,Mn,rs){if(y$7(Mn))return Mn;var is=Mn[Q$3];if(!is)return i$7(Mn,function(ds,hs){return A$3(Fn,is,Mn,ds,hs,rs)},!0),Mn;if(is.A!==Fn)return Mn;if(!is.P)return x$6(Fn,is.t,!0),is.t;if(!is.I){is.I=!0,is.A._--;var os=is.i===4||is.i===5?is.o=l$6(is.k):is.o,as=os,us=!1;is.i===3&&(as=new Set(os),os.clear(),us=!0),i$7(as,function(ds,hs){return A$3(Fn,is,os,ds,hs,rs,us)}),x$6(Fn,os,!1),rs&&Fn.u&&b$4("Patches").N(is,rs,Fn.u,Fn.s)}return is.o}function A$3(Fn,Mn,rs,is,os,as,us){if(r$a(os)){var ds=M$3(Fn,os,as&&Mn&&Mn.i!==3&&!u$2(Mn.R,is)?as.concat(is):void 0);if(f$7(rs,is,ds),!r$a(ds))return;Fn.m=!1}else us&&rs.add(os);if(t$5(os)&&!y$7(os)){if(!Fn.h.D&&Fn._<1)return;M$3(Fn,os),Mn&&Mn.A.l||x$6(Fn,os)}}function x$6(Fn,Mn,rs){rs===void 0&&(rs=!1),!Fn.l&&Fn.h.D&&Fn.m&&d$5(Mn,rs)}function z$8(Fn,Mn){var rs=Fn[Q$3];return(rs?p$5(rs):Fn)[Mn]}function I$3(Fn,Mn){if(Mn in Fn)for(var rs=Object.getPrototypeOf(Fn);rs;){var is=Object.getOwnPropertyDescriptor(rs,Mn);if(is)return is;rs=Object.getPrototypeOf(rs)}}function k$4(Fn){Fn.P||(Fn.P=!0,Fn.l&&k$4(Fn.l))}function E$4(Fn){Fn.o||(Fn.o=l$6(Fn.t))}function N$2(Fn,Mn,rs){var is=s$4(Mn)?b$4("MapSet").F(Mn,rs):v$7(Mn)?b$4("MapSet").T(Mn,rs):Fn.O?function(os,as){var us=Array.isArray(os),ds={i:us?1:0,A:as?as.A:_$4(),P:!1,I:!1,R:{},l:as,t:os,k:null,o:null,j:null,C:!1},hs=ds,ps=en$4;us&&(hs=[ds],ps=on$2);var io=Proxy.revocable(hs,ps),fo=io.revoke,mo=io.proxy;return ds.k=mo,ds.j=fo,mo}(Mn,rs):b$4("ES5").J(Mn,rs);return(rs?rs.A:_$4()).p.push(is),is}function R$3(Fn){return r$a(Fn)||n$a(22,Fn),function Mn(rs){if(!t$5(rs))return rs;var is,os=rs[Q$3],as=o$6(rs);if(os){if(!os.P&&(os.i<4||!b$4("ES5").K(os)))return os.t;os.I=!0,is=D$3(rs,as),os.I=!1}else is=D$3(rs,as);return i$7(is,function(us,ds){os&&a$3(os.t,us)===ds||f$7(is,us,Mn(ds))}),as===3?new Set(is):is}(Fn)}function D$3(Fn,Mn){switch(Mn){case 2:return new Map(Fn);case 3:return Array.from(Fn)}return l$6(Fn)}var G$2,U$2,W=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",X=typeof Map<"u",q$3=typeof Set<"u",B$2=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",H=W?Symbol.for("immer-nothing"):((G$2={})["immer-nothing"]=!0,G$2),L$2=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q$3=W?Symbol.for("immer-state"):"__$immer_state",Z$2=""+Object.prototype.constructor,nn$2=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(Fn){return Object.getOwnPropertyNames(Fn).concat(Object.getOwnPropertySymbols(Fn))}:Object.getOwnPropertyNames,rn$2=Object.getOwnPropertyDescriptors||function(Fn){var Mn={};return nn$2(Fn).forEach(function(rs){Mn[rs]=Object.getOwnPropertyDescriptor(Fn,rs)}),Mn},tn$2={},en$4={get:function(Fn,Mn){if(Mn===Q$3)return Fn;var rs=p$5(Fn);if(!u$2(rs,Mn))return function(os,as,us){var ds,hs=I$3(as,us);return hs?"value"in hs?hs.value:(ds=hs.get)===null||ds===void 0?void 0:ds.call(os.k):void 0}(Fn,rs,Mn);var is=rs[Mn];return Fn.I||!t$5(is)?is:is===z$8(Fn.t,Mn)?(E$4(Fn),Fn.o[Mn]=N$2(Fn.A.h,is,Fn)):is},has:function(Fn,Mn){return Mn in p$5(Fn)},ownKeys:function(Fn){return Reflect.ownKeys(p$5(Fn))},set:function(Fn,Mn,rs){var is=I$3(p$5(Fn),Mn);if(is!=null&&is.set)return is.set.call(Fn.k,rs),!0;if(!Fn.P){var os=z$8(p$5(Fn),Mn),as=os==null?void 0:os[Q$3];if(as&&as.t===rs)return Fn.o[Mn]=rs,Fn.R[Mn]=!1,!0;if(c$8(rs,os)&&(rs!==void 0||u$2(Fn.t,Mn)))return!0;E$4(Fn),k$4(Fn)}return Fn.o[Mn]===rs&&(rs!==void 0||Mn in Fn.o)||Number.isNaN(rs)&&Number.isNaN(Fn.o[Mn])||(Fn.o[Mn]=rs,Fn.R[Mn]=!0),!0},deleteProperty:function(Fn,Mn){return z$8(Fn.t,Mn)!==void 0||Mn in Fn.t?(Fn.R[Mn]=!1,E$4(Fn),k$4(Fn)):delete Fn.R[Mn],Fn.o&&delete Fn.o[Mn],!0},getOwnPropertyDescriptor:function(Fn,Mn){var rs=p$5(Fn),is=Reflect.getOwnPropertyDescriptor(rs,Mn);return is&&{writable:!0,configurable:Fn.i!==1||Mn!=="length",enumerable:is.enumerable,value:rs[Mn]}},defineProperty:function(){n$a(11)},getPrototypeOf:function(Fn){return Object.getPrototypeOf(Fn.t)},setPrototypeOf:function(){n$a(12)}},on$2={};i$7(en$4,function(Fn,Mn){on$2[Fn]=function(){return arguments[0]=arguments[0][0],Mn.apply(this,arguments)}}),on$2.deleteProperty=function(Fn,Mn){return on$2.set.call(this,Fn,Mn,void 0)},on$2.set=function(Fn,Mn,rs){return en$4.set.call(this,Fn[0],Mn,rs,Fn[0])};var un$2=function(){function Fn(rs){var is=this;this.O=B$2,this.D=!0,this.produce=function(os,as,us){if(typeof os=="function"&&typeof as!="function"){var ds=as;as=os;var hs=is;return function(Lo){var Go=this;Lo===void 0&&(Lo=ds);for(var Yo=arguments.length,Wo=Array(Yo>1?Yo-1:0),Jo=1;Jo<Yo;Jo++)Wo[Jo-1]=arguments[Jo];return hs.produce(Lo,function(xl){var _l;return(_l=as).call.apply(_l,[Go,xl].concat(Wo))})}}var ps;if(typeof as!="function"&&n$a(6),us!==void 0&&typeof us!="function"&&n$a(7),t$5(os)){var io=w$7(is),fo=N$2(is,os,void 0),mo=!0;try{ps=as(fo),mo=!1}finally{mo?g$5(io):O$5(io)}return typeof Promise<"u"&&ps instanceof Promise?ps.then(function(Lo){return j$5(io,us),P$3(Lo,io)},function(Lo){throw g$5(io),Lo}):(j$5(io,us),P$3(ps,io))}if(!os||typeof os!="object"){if((ps=as(os))===void 0&&(ps=os),ps===H&&(ps=void 0),is.D&&d$5(ps,!0),us){var Ao=[],$o=[];b$4("Patches").M(os,ps,Ao,$o),us(Ao,$o)}return ps}n$a(21,os)},this.produceWithPatches=function(os,as){if(typeof os=="function")return function(ps){for(var io=arguments.length,fo=Array(io>1?io-1:0),mo=1;mo<io;mo++)fo[mo-1]=arguments[mo];return is.produceWithPatches(ps,function(Ao){return os.apply(void 0,[Ao].concat(fo))})};var us,ds,hs=is.produce(os,as,function(ps,io){us=ps,ds=io});return typeof Promise<"u"&&hs instanceof Promise?hs.then(function(ps){return[ps,us,ds]}):[hs,us,ds]},typeof(rs==null?void 0:rs.useProxies)=="boolean"&&this.setUseProxies(rs.useProxies),typeof(rs==null?void 0:rs.autoFreeze)=="boolean"&&this.setAutoFreeze(rs.autoFreeze)}var Mn=Fn.prototype;return Mn.createDraft=function(rs){t$5(rs)||n$a(8),r$a(rs)&&(rs=R$3(rs));var is=w$7(this),os=N$2(this,rs,void 0);return os[Q$3].C=!0,O$5(is),os},Mn.finishDraft=function(rs,is){var os=rs&&rs[Q$3],as=os.A;return j$5(as,is),P$3(void 0,as)},Mn.setAutoFreeze=function(rs){this.D=rs},Mn.setUseProxies=function(rs){rs&&!B$2&&n$a(20),this.O=rs},Mn.applyPatches=function(rs,is){var os;for(os=is.length-1;os>=0;os--){var as=is[os];if(as.path.length===0&&as.op==="replace"){rs=as.value;break}}os>-1&&(is=is.slice(os+1));var us=b$4("Patches").$;return r$a(rs)?us(rs,is):this.produce(rs,function(ds){return us(ds,is)})},Fn}(),an$2=new un$2,fn$2=an$2.produce;an$2.produceWithPatches.bind(an$2);an$2.setAutoFreeze.bind(an$2);an$2.setUseProxies.bind(an$2);an$2.applyPatches.bind(an$2);an$2.createDraft.bind(an$2);an$2.finishDraft.bind(an$2);const immerImpl=Fn=>(Mn,rs,is)=>(is.setState=(os,as,...us)=>{const ds=typeof os=="function"?fn$2(os):os;return Mn(ds,as,...us)},Fn(is.setState,rs,is)),immer=immerImpl,useStore=react$1(devtools(immer((...Fn)=>({...createAppSlice(...Fn)})))),Vectorlight="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='M6%209L12%2015L18%209'%20stroke='%230E9384'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function warn(){if(console&&console.warn){for(var Fn=arguments.length,Mn=new Array(Fn),rs=0;rs<Fn;rs++)Mn[rs]=arguments[rs];typeof Mn[0]=="string"&&(Mn[0]=`react-i18next:: ${Mn[0]}`),console.warn(...Mn)}}const alreadyWarned={};function warnOnce(){for(var Fn=arguments.length,Mn=new Array(Fn),rs=0;rs<Fn;rs++)Mn[rs]=arguments[rs];typeof Mn[0]=="string"&&alreadyWarned[Mn[0]]||(typeof Mn[0]=="string"&&(alreadyWarned[Mn[0]]=new Date),warn(...Mn))}const loadedClb=(Fn,Mn)=>()=>{if(Fn.isInitialized)Mn();else{const rs=()=>{setTimeout(()=>{Fn.off("initialized",rs)},0),Mn()};Fn.on("initialized",rs)}};function loadNamespaces(Fn,Mn,rs){Fn.loadNamespaces(Mn,loadedClb(Fn,rs))}function loadLanguages(Fn,Mn,rs,is){typeof rs=="string"&&(rs=[rs]),rs.forEach(os=>{Fn.options.ns.indexOf(os)<0&&Fn.options.ns.push(os)}),Fn.loadLanguages(Mn,loadedClb(Fn,is))}function oldI18nextHasLoadedNamespace(Fn,Mn){let rs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const is=Mn.languages[0],os=Mn.options?Mn.options.fallbackLng:!1,as=Mn.languages[Mn.languages.length-1];if(is.toLowerCase()==="cimode")return!0;const us=(ds,hs)=>{const ps=Mn.services.backendConnector.state[`${ds}|${hs}`];return ps===-1||ps===2};return rs.bindI18n&&rs.bindI18n.indexOf("languageChanging")>-1&&Mn.services.backendConnector.backend&&Mn.isLanguageChangingTo&&!us(Mn.isLanguageChangingTo,Fn)?!1:!!(Mn.hasResourceBundle(is,Fn)||!Mn.services.backendConnector.backend||Mn.options.resources&&!Mn.options.partialBundledLanguages||us(is,Fn)&&(!os||us(as,Fn)))}function hasLoadedNamespace(Fn,Mn){let rs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!Mn.languages||!Mn.languages.length?(warnOnce("i18n.languages were undefined or empty",Mn.languages),!0):Mn.options.ignoreJSONStructure!==void 0?Mn.hasLoadedNamespace(Fn,{lng:rs.lng,precheck:(os,as)=>{if(rs.bindI18n&&rs.bindI18n.indexOf("languageChanging")>-1&&os.services.backendConnector.backend&&os.isLanguageChangingTo&&!as(os.isLanguageChangingTo,Fn))return!1}}):oldI18nextHasLoadedNamespace(Fn,Mn,rs)}const matchHtmlEntity=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,htmlEntities={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},unescapeHtmlEntity=Fn=>htmlEntities[Fn],unescape$1=Fn=>Fn.replace(matchHtmlEntity,unescapeHtmlEntity);let defaultOptions={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:unescape$1};function setDefaults(){let Fn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};defaultOptions={...defaultOptions,...Fn}}function getDefaults(){return defaultOptions}let i18nInstance;function setI18n(Fn){i18nInstance=Fn}function getI18n(){return i18nInstance}const initReactI18next={type:"3rdParty",init(Fn){setDefaults(Fn.options.react),setI18n(Fn)}},I18nContext=reactExports.createContext();class ReportNamespaces{constructor(){this.usedNamespaces={}}addUsedNamespaces(Mn){Mn.forEach(rs=>{this.usedNamespaces[rs]||(this.usedNamespaces[rs]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const usePrevious=(Fn,Mn)=>{const rs=reactExports.useRef();return reactExports.useEffect(()=>{rs.current=Fn},[Fn,Mn]),rs.current};function useTranslation(Fn){let Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:rs}=Mn,{i18n:is,defaultNS:os}=reactExports.useContext(I18nContext)||{},as=rs||is||getI18n();if(as&&!as.reportNamespaces&&(as.reportNamespaces=new ReportNamespaces),!as){warnOnce("You will need to pass in an i18next instance by using initReactI18next");const Jo=(_l,Tl)=>typeof Tl=="string"?Tl:Tl&&typeof Tl=="object"&&typeof Tl.defaultValue=="string"?Tl.defaultValue:Array.isArray(_l)?_l[_l.length-1]:_l,xl=[Jo,{},!1];return xl.t=Jo,xl.i18n={},xl.ready=!1,xl}as.options.react&&as.options.react.wait!==void 0&&warnOnce("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const us={...getDefaults(),...as.options.react,...Mn},{useSuspense:ds,keyPrefix:hs}=us;let ps=os||as.options&&as.options.defaultNS;ps=typeof ps=="string"?[ps]:ps||["translation"],as.reportNamespaces.addUsedNamespaces&&as.reportNamespaces.addUsedNamespaces(ps);const io=(as.isInitialized||as.initializedStoreOnce)&&ps.every(Jo=>hasLoadedNamespace(Jo,as,us));function fo(){return as.getFixedT(Mn.lng||null,us.nsMode==="fallback"?ps:ps[0],hs)}const[mo,Ao]=reactExports.useState(fo);let $o=ps.join();Mn.lng&&($o=`${Mn.lng}${$o}`);const Lo=usePrevious($o),Go=reactExports.useRef(!0);reactExports.useEffect(()=>{const{bindI18n:Jo,bindI18nStore:xl}=us;Go.current=!0,!io&&!ds&&(Mn.lng?loadLanguages(as,Mn.lng,ps,()=>{Go.current&&Ao(fo)}):loadNamespaces(as,ps,()=>{Go.current&&Ao(fo)})),io&&Lo&&Lo!==$o&&Go.current&&Ao(fo);function _l(){Go.current&&Ao(fo)}return Jo&&as&&as.on(Jo,_l),xl&&as&&as.store.on(xl,_l),()=>{Go.current=!1,Jo&&as&&Jo.split(" ").forEach(Tl=>as.off(Tl,_l)),xl&&as&&xl.split(" ").forEach(Tl=>as.store.off(Tl,_l))}},[as,$o]);const Yo=reactExports.useRef(!0);reactExports.useEffect(()=>{Go.current&&!Yo.current&&Ao(fo),Yo.current=!1},[as,hs]);const Wo=[mo,as,io];if(Wo.t=mo,Wo.i18n=as,Wo.ready=io,io||!io&&!ds)return Wo;throw new Promise(Jo=>{Mn.lng?loadLanguages(as,Mn.lng,ps,()=>Jo()):loadNamespaces(as,ps,()=>Jo())})}const UserCircle="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='M5.3163%2019.4384C5.92462%2018.0052%207.34492%2017%209%2017H15C16.6551%2017%2018.0754%2018.0052%2018.6837%2019.4384M16%209.5C16%2011.7091%2014.2091%2013.5%2012%2013.5C9.79086%2013.5%208%2011.7091%208%209.5C8%207.29086%209.79086%205.5%2012%205.5C14.2091%205.5%2016%207.29086%2016%209.5ZM22%2012C22%2017.5228%2017.5228%2022%2012%2022C6.47715%2022%202%2017.5228%202%2012C2%206.47715%206.47715%202%2012%202C17.5228%202%2022%206.47715%2022%2012Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",UserCircleWhite="data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.64967%2019.4384C6.25799%2018.0052%207.6783%2017%209.33337%2017H15.3334C16.9885%2017%2018.4087%2018.0052%2019.0171%2019.4384M16.3334%209.5C16.3334%2011.7091%2014.5425%2013.5%2012.3334%2013.5C10.1242%2013.5%208.33337%2011.7091%208.33337%209.5C8.33337%207.29086%2010.1242%205.5%2012.3334%205.5C14.5425%205.5%2016.3334%207.29086%2016.3334%209.5ZM22.3334%2012C22.3334%2017.5228%2017.8562%2022%2012.3334%2022C6.81053%2022%202.33337%2017.5228%202.33337%2012C2.33337%206.47715%206.81053%202%2012.3334%202C17.8562%202%2022.3334%206.47715%2022.3334%2012Z'%20stroke='%230E9384'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ABI={InfoAggregator:[{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[],name:"__FrontEndHelper_init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"token",type:"string"},{internalType:"string",name:"option_type",type:"string"}],name:"getAddresses",outputs:[{components:[{internalType:"address",name:"settlement_token_address",type:"address"},{internalType:"address",name:"vault_address",type:"address"},{internalType:"address",name:"long_token_address",type:"address"},{internalType:"address",name:"short_token_address",type:"address"},{internalType:"address",name:"controller_address",type:"address"},{internalType:"address",name:"settlement_manager_address",type:"address"}],internalType:"struct Addresses",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user_address",type:"address"},{internalType:"string",name:"token",type:"string"},{internalType:"string",name:"option_type",type:"string"}],name:"getAllBalances",outputs:[{components:[{internalType:"uint256",name:"native_token_balance",type:"uint256"},{internalType:"uint256",name:"settlement_token_balance",type:"uint256"},{internalType:"uint256",name:"long_token_balance",type:"uint256"},{internalType:"uint256",name:"short_token_balance",type:"uint256"}],internalType:"struct BalanceInfo",name:"all_balances",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"token",type:"string"},{internalType:"string",name:"option_type",type:"string"}],name:"getAllContractsInfo",outputs:[{components:[{components:[{internalType:"uint256",name:"long_deposit_amount",type:"uint256"},{internalType:"uint256",name:"long_withdraw_amount",type:"uint256"},{internalType:"uint256",name:"short_deposit_amount",type:"uint256"},{internalType:"uint256",name:"short_withdraw_amount",type:"uint256"},{internalType:"uint256",name:"long_switch_amount",type:"uint256"},{internalType:"uint256",name:"short_switch_amount",type:"uint256"}],internalType:"struct VaultDeposits",name:"vault_deposits",type:"tuple"},{internalType:"uint256",name:"long_token_supply",type:"uint256"},{internalType:"uint256",name:"short_token_supply",type:"uint256"},{internalType:"int8",name:"opt_type",type:"int8"},{components:[{internalType:"uint256",name:"loading_fees_long",type:"uint256"},{internalType:"uint256",name:"unloading_fees_long",type:"uint256"},{internalType:"uint256",name:"switching_fees_long",type:"uint256"},{internalType:"uint256",name:"settlement_fees_long",type:"uint256"},{internalType:"uint256",name:"loading_fees_short",type:"uint256"},{internalType:"uint256",name:"unloading_fees_short",type:"uint256"},{internalType:"uint256",name:"switching_fees_short",type:"uint256"},{internalType:"uint256",name:"settlement_fees_short",type:"uint256"}],internalType:"struct FeesParams",name:"fees_params",type:"tuple"},{internalType:"uint256",name:"controller_prev_settlement_price",type:"uint256"},{components:[{internalType:"uint256",name:"cycle_start_time",type:"uint256"},{internalType:"uint256",name:"cycle_end_time",type:"uint256"}],internalType:"struct CycleData",name:"cycle_data",type:"tuple"},{internalType:"uint256",name:"latest_settlement_price",type:"uint256"},{internalType:"uint256",name:"latest_settlement_time",type:"uint256"}],internalType:"struct AllContractsInfo",name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user_address",type:"address"},{internalType:"string[]",name:"tokens",type:"string[]"}],name:"getMultiMarketBalances",outputs:[{components:[{internalType:"uint256",name:"native_token_balance",type:"uint256"},{internalType:"uint256",name:"settlement_token_balance",type:"uint256"},{components:[{internalType:"uint256",name:"long_call_token_balance",type:"uint256"},{internalType:"uint256",name:"short_call_token_balance",type:"uint256"},{internalType:"uint256",name:"long_put_token_balance",type:"uint256"},{internalType:"uint256",name:"short_put_token_balance",type:"uint256"}],internalType:"struct TokenBalance[]",name:"multi_market_token_balances",type:"tuple[]"}],internalType:"struct MultiMarketBalanceInfo",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user_address",type:"address"},{internalType:"uint256[]",name:"vault_ids",type:"uint256[]"},{internalType:"string",name:"token",type:"string"},{internalType:"string",name:"option_type",type:"string"}],name:"getVaultShareAndClaimBalance",outputs:[{internalType:"uint256[]",name:"claim_token_balances_",type:"uint256[]"},{internalType:"uint256[]",name:"vault_share_balances_",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"settlement_token_address",type:"address"},{internalType:"address",name:"vault_address",type:"address"},{internalType:"address",name:"long_token_address",type:"address"},{internalType:"address",name:"short_token_address",type:"address"},{internalType:"address",name:"controller_address",type:"address"},{internalType:"address",name:"settlement_manager_address",type:"address"}],internalType:"struct Addresses",name:"addresses",type:"tuple"},{internalType:"string",name:"token",type:"string"},{internalType:"string",name:"option_type",type:"string"}],name:"setAddresses",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],Controller:[{inputs:[{internalType:"address",name:"target",type:"address"}],name:"AddressEmptyCode",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"AddressInsufficientBalance",type:"error"},{inputs:[],name:"FailedInnerCall",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"SafeERC20FailedOperation",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"buyer_address",type:"address"},{indexed:!1,internalType:"uint256",name:"buy_amount_usdc",type:"uint256"}],name:"BuyLongTokenDone",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"buyer_address",type:"address"},{indexed:!1,internalType:"uint256",name:"buy_amount_usdc",type:"uint256"}],name:"BuyShortTokenDone",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"address_",type:"address"},{indexed:!1,internalType:"uint256",name:"vault_id_",type:"uint256"}],name:"CancelOrderDone",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferStarted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"seller_address",type:"address"},{indexed:!1,internalType:"uint256",name:"sell_amount_token",type:"uint256"}],name:"SellLongTokenDone",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"seller_address",type:"address"},{indexed:!1,internalType:"uint256",name:"sell_amount_token",type:"uint256"}],name:"SellShortTokenDone",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"long_token_balance_before",type:"uint256"},{indexed:!1,internalType:"uint256",name:"short_token_balance_before",type:"uint256"},{indexed:!1,internalType:"uint256",name:"long_token_balance_after",type:"uint256"},{indexed:!1,internalType:"uint256",name:"short_token_balance_after",type:"uint256"}],name:"SettlementDone",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"switcher_address",type:"address"},{indexed:!1,internalType:"uint256",name:"switch_amount_token",type:"uint256"}],name:"SwitchFromLongToShortDone",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"switcher_address",type:"address"},{indexed:!1,internalType:"uint256",name:"switch_amount_token",type:"uint256"}],name:"SwitchFromShortToLongDone",type:"event"},{inputs:[{internalType:"int8",name:"opt_type_",type:"int8"},{internalType:"uint256",name:"cycle_premium_",type:"uint256"},{internalType:"uint256",name:"payoff_cap_",type:"uint256"},{internalType:"address",name:"long_token_address_",type:"address"},{internalType:"address",name:"short_token_address_",type:"address"},{internalType:"address",name:"settlement_token_address_",type:"address"}],name:"__ControllerBase_init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"acceptOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"buy_amount_usdc_",type:"uint256"}],name:"buyLongToken",outputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"uint256",name:"vault_token_amount_",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"buy_amount_usdc_",type:"uint256"}],name:"buyShortToken",outputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"uint256",name:"vault_token_amount_",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"}],name:"cancelOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"cyclePremium",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"current_price_",type:"uint256"},{internalType:"uint256",name:"timestamp_",type:"uint256"}],name:"executeSettlement",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"fees_params",outputs:[{internalType:"uint256",name:"loading_fees_long",type:"uint256"},{internalType:"uint256",name:"unloading_fees_long",type:"uint256"},{internalType:"uint256",name:"switching_fees_long",type:"uint256"},{internalType:"uint256",name:"settlement_fees_long",type:"uint256"},{internalType:"uint256",name:"loading_fees_short",type:"uint256"},{internalType:"uint256",name:"unloading_fees_short",type:"uint256"},{internalType:"uint256",name:"switching_fees_short",type:"uint256"},{internalType:"uint256",name:"settlement_fees_short",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLongTokenAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getSettlementTokenAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getShortTokenAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getTotalCollateralValue",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getVaultAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"lastSettlementPricePerToken",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"longTokenBuyAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"longTokenSellAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"longTokenSwitchAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"optType",outputs:[{internalType:"int8",name:"",type:"int8"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"payoffCap",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"pendingOwner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"prevSettlementPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"prevSettlementTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"pricePerToken",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"timestamp_",type:"uint256"}],name:"scrapCycle",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"sell_amount_token_",type:"uint256"}],name:"sellLongToken",outputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"uint256",name:"vault_token_amount_",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"sell_amount_token_",type:"uint256"}],name:"sellShortToken",outputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"uint256",name:"vault_token_amount_",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"cycle_premium_",type:"uint256"}],name:"setCyclePremium",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"fee_collector_",type:"address"}],name:"setFeeCollector",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"loading_fees_long_",type:"uint256"},{internalType:"uint256",name:"unloading_fees_long_",type:"uint256"},{internalType:"uint256",name:"switching_fees_long_",type:"uint256"},{internalType:"uint256",name:"settlement_fees_long_",type:"uint256"},{internalType:"uint256",name:"loading_fees_short_",type:"uint256"},{internalType:"uint256",name:"unloading_fees_short_",type:"uint256"},{internalType:"uint256",name:"switching_fees_short_",type:"uint256"},{internalType:"uint256",name:"settlement_fees_short_",type:"uint256"}],name:"setFeesParams",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"payoff_cap_",type:"uint256"}],name:"setPayoffCap",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"settlement_manager_",type:"address"}],name:"setSettlementManagerAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"vault_",type:"address"}],name:"setVaultAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"shortTokenBuyAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"shortTokenSellAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"shortTokenSwitchAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"switch_amount_",type:"uint256"}],name:"switchFromLongToShort",outputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"uint256",name:"vault_token_amount_",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"switch_amount_",type:"uint256"}],name:"switchFromShortToLong",outputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"uint256",name:"vault_token_amount_",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"totalLongTokenSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalShortTokenSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],SwitchToken:[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"burn_address",type:"address"},{indexed:!1,internalType:"uint256",name:"burn_amount",type:"uint256"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"mint_address",type:"address"},{indexed:!1,internalType:"uint256",name:"mint_amount",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],name:"__ERC20ReBaseUpgradeable_init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],name:"__SwitchToken_init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"burn_address_",type:"address"},{internalType:"uint256",name:"burn_amount_",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"mint_address_",type:"address"},{internalType:"uint256",name:"mint_amount_",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"adj_factor_",type:"uint256"}],name:"runSettlement",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"shareAmount",type:"uint256"}],name:"convertToAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}],Vault:[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"AddressEmptyCode",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"AddressInsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC1155InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC1155InvalidApprover",type:"error"},{inputs:[{internalType:"uint256",name:"idsLength",type:"uint256"},{internalType:"uint256",name:"valuesLength",type:"uint256"}],name:"ERC1155InvalidArrayLength",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC1155InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC1155InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC1155InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"owner",type:"address"}],name:"ERC1155MissingApprovalForAll",type:"error"},{inputs:[],name:"FailedInnerCall",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"}],name:"SafeERC20FailedOperation",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",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:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[],name:"__Vault_init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account_address_",type:"address"},{internalType:"uint256[]",name:"vault_ids_",type:"uint256[]"}],name:"batchBalanceOfClaimTokens",outputs:[{internalType:"uint256[]",name:"claim_token_balances_",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account_address_",type:"address"},{internalType:"uint256[]",name:"vault_ids_",type:"uint256[]"}],name:"batchBalanceOfDepositTokens",outputs:[{internalType:"uint256[]",name:"deposit_token_balances_",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"burn_address_",type:"address"},{internalType:"address",name:"deposit_token_address_",type:"address"},{internalType:"uint256",name:"vault_id_",type:"uint256"}],name:"burnAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"uint256",name:"claim_amount_",type:"uint256"}],name:"claim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"uint256",name:"claim_amount_",type:"uint256"}],name:"claimAmount",outputs:[{internalType:"uint256",name:"amount_to_transfer_claim_token_",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"}],name:"claimToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"}],name:"depositToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"exists",outputs:[{internalType:"bool",name:"",type:"bool"}],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:"uint256",name:"vault_id_",type:"uint256"},{internalType:"address",name:"deposit_token_address_",type:"address"}],name:"makeDeposit",outputs:[{internalType:"uint256",name:"deposit_amount_",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"mint_address_",type:"address"},{internalType:"address",name:"deposit_token_address_",type:"address"},{internalType:"address",name:"claim_token_address_",type:"address"},{internalType:"bool",name:"is_deposit_token_rebaseable_",type:"bool"},{internalType:"bool",name:"is_claim_token_rebaseable_",type:"bool"},{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"uint256",name:"deposit_amount_",type:"uint256"}],name:"mint",outputs:[{internalType:"uint256",name:"vault_token_amount_",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"address",name:"claim_token_address_",type:"address"},{internalType:"uint256",name:"claimable_amount_",type:"uint256"}],name:"setClaimable",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"}],name:"totalClaimTokenAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"vault_id_",type:"uint256"},{internalType:"address",name:"deposit_token_address_",type:"address"}],name:"totalDepositTokenAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],SettlementManager:[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"last_settlement_time_",type:"uint256"},{indexed:!1,internalType:"uint256",name:"current_settlement_time_",type:"uint256"},{indexed:!1,internalType:"uint256",name:"last_settlement_px_",type:"uint256"},{indexed:!1,internalType:"uint256",name:"current_settlement_px_",type:"uint256"}],name:"SettlementCalled",type:"event"},{inputs:[{internalType:"address",name:"user_interface_address_",type:"address"},{internalType:"address",name:"price_oracle_address_",type:"address"}],name:"__SettlementManager_init",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"",type:"bytes"}],name:"checkUpkeep",outputs:[{internalType:"bool",name:"upkeep_needed_",type:"bool"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"lastSettlementPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"lastSettlementTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"latestCycleStartPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"latestCycleStartTime",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pendingSettlementCyclesCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"",type:"bytes"}],name:"performUpkeep",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"settlement_cycles",outputs:[{internalType:"uint256",name:"cycle_start_time",type:"uint256"},{internalType:"uint256",name:"cycle_start_price",type:"uint256"},{internalType:"uint256",name:"cycle_end_time",type:"uint256"},{internalType:"uint256",name:"cycle_end_price",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"settlementsCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],ProxyUSDC:[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"burner",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"MINT_PER_ETH",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"burn_amount_",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"selfDestruct",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"withdrawFunds",outputs:[],stateMutability:"nonpayable",type:"function"}]};function bind$1(Fn,Mn){return function(){return Fn.apply(Mn,arguments)}}const{toString:toString$4}=Object.prototype,{getPrototypeOf}=Object,kindOf=(Fn=>Mn=>{const rs=toString$4.call(Mn);return Fn[rs]||(Fn[rs]=rs.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=Fn=>(Fn=Fn.toLowerCase(),Mn=>kindOf(Mn)===Fn),typeOfTest=Fn=>Mn=>typeof Mn===Fn,{isArray:isArray$2}=Array,isUndefined=typeOfTest("undefined");function isBuffer$1(Fn){return Fn!==null&&!isUndefined(Fn)&&Fn.constructor!==null&&!isUndefined(Fn.constructor)&&isFunction$1(Fn.constructor.isBuffer)&&Fn.constructor.isBuffer(Fn)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(Fn){let Mn;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?Mn=ArrayBuffer.isView(Fn):Mn=Fn&&Fn.buffer&&isArrayBuffer(Fn.buffer),Mn}const isString=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$3=Fn=>Fn!==null&&typeof Fn=="object",isBoolean=Fn=>Fn===!0||Fn===!1,isPlainObject=Fn=>{if(kindOf(Fn)!=="object")return!1;const Mn=getPrototypeOf(Fn);return(Mn===null||Mn===Object.prototype||Object.getPrototypeOf(Mn)===null)&&!(Symbol.toStringTag in Fn)&&!(Symbol.iterator in Fn)},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=Fn=>isObject$3(Fn)&&isFunction$1(Fn.pipe),isFormData=Fn=>{let Mn;return Fn&&(typeof FormData=="function"&&Fn instanceof FormData||isFunction$1(Fn.append)&&((Mn=kindOf(Fn))==="formdata"||Mn==="object"&&isFunction$1(Fn.toString)&&Fn.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=Fn=>Fn.trim?Fn.trim():Fn.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(Fn,Mn,{allOwnKeys:rs=!1}={}){if(Fn===null||typeof Fn>"u")return;let is,os;if(typeof Fn!="object"&&(Fn=[Fn]),isArray$2(Fn))for(is=0,os=Fn.length;is<os;is++)Mn.call(null,Fn[is],is,Fn);else{const as=rs?Object.getOwnPropertyNames(Fn):Object.keys(Fn),us=as.length;let ds;for(is=0;is<us;is++)ds=as[is],Mn.call(null,Fn[ds],ds,Fn)}}function findKey(Fn,Mn){Mn=Mn.toLowerCase();const rs=Object.keys(Fn);let is=rs.length,os;for(;is-- >0;)if(os=rs[is],Mn===os.toLowerCase())return os;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global$2,isContextDefined=Fn=>!isUndefined(Fn)&&Fn!==_global;function merge$1(){const{caseless:Fn}=isContextDefined(this)&&this||{},Mn={},rs=(is,os)=>{const as=Fn&&findKey(Mn,os)||os;isPlainObject(Mn[as])&&isPlainObject(is)?Mn[as]=merge$1(Mn[as],is):isPlainObject(is)?Mn[as]=merge$1({},is):isArray$2(is)?Mn[as]=is.slice():Mn[as]=is};for(let is=0,os=arguments.length;is<os;is++)arguments[is]&&forEach(arguments[is],rs);return Mn}const extend=(Fn,Mn,rs,{allOwnKeys:is}={})=>(forEach(Mn,(os,as)=>{rs&&isFunction$1(os)?Fn[as]=bind$1(os,rs):Fn[as]=os},{allOwnKeys:is}),Fn),stripBOM=Fn=>(Fn.charCodeAt(0)===65279&&(Fn=Fn.slice(1)),Fn),inherits$3=(Fn,Mn,rs,is)=>{Fn.prototype=Object.create(Mn.prototype,is),Fn.prototype.constructor=Fn,Object.defineProperty(Fn,"super",{value:Mn.prototype}),rs&&Object.assign(Fn.prototype,rs)},toFlatObject=(Fn,Mn,rs,is)=>{let os,as,us;const ds={};if(Mn=Mn||{},Fn==null)return Mn;do{for(os=Object.getOwnPropertyNames(Fn),as=os.length;as-- >0;)us=os[as],(!is||is(us,Fn,Mn))&&!ds[us]&&(Mn[us]=Fn[us],ds[us]=!0);Fn=rs!==!1&&getPrototypeOf(Fn)}while(Fn&&(!rs||rs(Fn,Mn))&&Fn!==Object.prototype);return Mn},endsWith=(Fn,Mn,rs)=>{Fn=String(Fn),(rs===void 0||rs>Fn.length)&&(rs=Fn.length),rs-=Mn.length;const is=Fn.indexOf(Mn,rs);return is!==-1&&is===rs},toArray=Fn=>{if(!Fn)return null;if(isArray$2(Fn))return Fn;let Mn=Fn.length;if(!isNumber$1(Mn))return null;const rs=new Array(Mn);for(;Mn-- >0;)rs[Mn]=Fn[Mn];return rs},isTypedArray=(Fn=>Mn=>Fn&&Mn instanceof Fn)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(Fn,Mn)=>{const is=(Fn&&Fn[Symbol.iterator]).call(Fn);let os;for(;(os=is.next())&&!os.done;){const as=os.value;Mn.call(Fn,as[0],as[1])}},matchAll=(Fn,Mn)=>{let rs;const is=[];for(;(rs=Fn.exec(Mn))!==null;)is.push(rs);return is},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=Fn=>Fn.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(rs,is,os){return is.toUpperCase()+os}),hasOwnProperty$1=(({hasOwnProperty:Fn})=>(Mn,rs)=>Fn.call(Mn,rs))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(Fn,Mn)=>{const rs=Object.getOwnPropertyDescriptors(Fn),is={};forEach(rs,(os,as)=>{let us;(us=Mn(os,as,Fn))!==!1&&(is[as]=us||os)}),Object.defineProperties(Fn,is)},freezeMethods=Fn=>{reduceDescriptors(Fn,(Mn,rs)=>{if(isFunction$1(Fn)&&["arguments","caller","callee"].indexOf(rs)!==-1)return!1;const is=Fn[rs];if(isFunction$1(is)){if(Mn.enumerable=!1,"writable"in Mn){Mn.writable=!1;return}Mn.set||(Mn.set=()=>{throw Error("Can not rewrite read-only method '"+rs+"'")})}})},toObjectSet=(Fn,Mn)=>{const rs={},is=os=>{os.forEach(as=>{rs[as]=!0})};return isArray$2(Fn)?is(Fn):is(String(Fn).split(Mn)),rs},noop$4=()=>{},toFiniteNumber=(Fn,Mn)=>Fn!=null&&Number.isFinite(Fn=+Fn)?Fn:Mn,ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(Fn=16,Mn=ALPHABET.ALPHA_DIGIT)=>{let rs="";const{length:is}=Mn;for(;Fn--;)rs+=Mn[Math.random()*is|0];return rs};function isSpecCompliantForm(Fn){return!!(Fn&&isFunction$1(Fn.append)&&Fn[Symbol.toStringTag]==="FormData"&&Fn[Symbol.iterator])}const toJSONObject=Fn=>{const Mn=new Array(10),rs=(is,os)=>{if(isObject$3(is)){if(Mn.indexOf(is)>=0)return;if(!("toJSON"in is)){Mn[os]=is;const as=isArray$2(is)?[]:{};return forEach(is,(us,ds)=>{const hs=rs(us,os+1);!isUndefined(hs)&&(as[ds]=hs)}),Mn[os]=void 0,as}}return is};return rs(Fn,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=Fn=>Fn&&(isObject$3(Fn)||isFunction$1(Fn))&&isFunction$1(Fn.then)&&isFunction$1(Fn.catch),_setImmediate=((Fn,Mn)=>Fn?setImmediate:Mn?((rs,is)=>(_global.addEventListener("message",({source:os,data:as})=>{os===_global&&as===rs&&is.length&&is.shift()()},!1),os=>{is.push(os),_global.postMessage(rs,"*")}))(`axios@${Math.random()}`,[]):rs=>setTimeout(rs))(typeof setImmediate=="function",isFunction$1(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof browser$1$1<"u"&&browser$1$1.nextTick||_setImmediate,utils$i={isArray:isArray$2,isArrayBuffer,isBuffer:isBuffer$1,isFormData,isArrayBufferView,isString,isNumber:isNumber$1,isBoolean,isObject:isObject$3,isPlainObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge:merge$1,extend,trim,stripBOM,inherits:inherits$3,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$1,hasOwnProp:hasOwnProperty$1,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$4,toFiniteNumber,findKey,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap};var lookup$1=[],revLookup$1=[],Arr$1=typeof Uint8Array<"u"?Uint8Array:Array,inited=!1;function init$2(){inited=!0;for(var Fn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mn=0,rs=Fn.length;Mn<rs;++Mn)lookup$1[Mn]=Fn[Mn],revLookup$1[Fn.charCodeAt(Mn)]=Mn;revLookup$1[45]=62,revLookup$1[95]=63}function toByteArray$1(Fn){inited||init$2();var Mn,rs,is,os,as,us,ds=Fn.length;if(ds%4>0)throw new Error("Invalid string. Length must be a multiple of 4");as=Fn[ds-2]==="="?2:Fn[ds-1]==="="?1:0,us=new Arr$1(ds*3/4-as),is=as>0?ds-4:ds;var hs=0;for(Mn=0,rs=0;Mn<is;Mn+=4,rs+=3)os=revLookup$1[Fn.charCodeAt(Mn)]<<18|revLookup$1[Fn.charCodeAt(Mn+1)]<<12|revLookup$1[Fn.charCodeAt(Mn+2)]<<6|revLookup$1[Fn.charCodeAt(Mn+3)],us[hs++]=os>>16&255,us[hs++]=os>>8&255,us[hs++]=os&255;return as===2?(os=revLookup$1[Fn.charCodeAt(Mn)]<<2|revLookup$1[Fn.charCodeAt(Mn+1)]>>4,us[hs++]=os&255):as===1&&(os=revLookup$1[Fn.charCodeAt(Mn)]<<10|revLookup$1[Fn.charCodeAt(Mn+1)]<<4|revLookup$1[Fn.charCodeAt(Mn+2)]>>2,us[hs++]=os>>8&255,us[hs++]=os&255),us}function tripletToBase64$1(Fn){return lookup$1[Fn>>18&63]+lookup$1[Fn>>12&63]+lookup$1[Fn>>6&63]+lookup$1[Fn&63]}function encodeChunk$1(Fn,Mn,rs){for(var is,os=[],as=Mn;as<rs;as+=3)is=(Fn[as]<<16)+(Fn[as+1]<<8)+Fn[as+2],os.push(tripletToBase64$1(is));return os.join("")}function fromByteArray$1(Fn){inited||init$2();for(var Mn,rs=Fn.length,is=rs%3,os="",as=[],us=16383,ds=0,hs=rs-is;ds<hs;ds+=us)as.push(encodeChunk$1(Fn,ds,ds+us>hs?hs:ds+us));return is===1?(Mn=Fn[rs-1],os+=lookup$1[Mn>>2],os+=lookup$1[Mn<<4&63],os+="=="):is===2&&(Mn=(Fn[rs-2]<<8)+Fn[rs-1],os+=lookup$1[Mn>>10],os+=lookup$1[Mn>>4&63],os+=lookup$1[Mn<<2&63],os+="="),as.push(os),as.join("")}function read(Fn,Mn,rs,is,os){var as,us,ds=os*8-is-1,hs=(1<<ds)-1,ps=hs>>1,io=-7,fo=rs?os-1:0,mo=rs?-1:1,Ao=Fn[Mn+fo];for(fo+=mo,as=Ao&(1<<-io)-1,Ao>>=-io,io+=ds;io>0;as=as*256+Fn[Mn+fo],fo+=mo,io-=8);for(us=as&(1<<-io)-1,as>>=-io,io+=is;io>0;us=us*256+Fn[Mn+fo],fo+=mo,io-=8);if(as===0)as=1-ps;else{if(as===hs)return us?NaN:(Ao?-1:1)*(1/0);us=us+Math.pow(2,is),as=as-ps}return(Ao?-1:1)*us*Math.pow(2,as-is)}function write(Fn,Mn,rs,is,os,as){var us,ds,hs,ps=as*8-os-1,io=(1<<ps)-1,fo=io>>1,mo=os===23?Math.pow(2,-24)-Math.pow(2,-77):0,Ao=is?0:as-1,$o=is?1:-1,Lo=Mn<0||Mn===0&&1/Mn<0?1:0;for(Mn=Math.abs(Mn),isNaN(Mn)||Mn===1/0?(ds=isNaN(Mn)?1:0,us=io):(us=Math.floor(Math.log(Mn)/Math.LN2),Mn*(hs=Math.pow(2,-us))<1&&(us--,hs*=2),us+fo>=1?Mn+=mo/hs:Mn+=mo*Math.pow(2,1-fo),Mn*hs>=2&&(us++,hs/=2),us+fo>=io?(ds=0,us=io):us+fo>=1?(ds=(Mn*hs-1)*Math.pow(2,os),us=us+fo):(ds=Mn*Math.pow(2,fo-1)*Math.pow(2,os),us=0));os>=8;Fn[rs+Ao]=ds&255,Ao+=$o,ds/=256,os-=8);for(us=us<<os|ds,ps+=os;ps>0;Fn[rs+Ao]=us&255,Ao+=$o,us/=256,ps-=8);Fn[rs+Ao-$o]|=Lo*128}var toString$3={}.toString,isArray$1=Array.isArray||function(Fn){return toString$3.call(Fn)=="[object Array]"};/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */var INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global$2.TYPED_ARRAY_SUPPORT!==void 0?global$2.TYPED_ARRAY_SUPPORT:!0;kMaxLength();function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(Fn,Mn){if(kMaxLength()<Mn)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(Fn=new Uint8Array(Mn),Fn.__proto__=Buffer.prototype):(Fn===null&&(Fn=new Buffer(Mn)),Fn.length=Mn),Fn}function Buffer(Fn,Mn,rs){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer))return new Buffer(Fn,Mn,rs);if(typeof Fn=="number"){if(typeof Mn=="string")throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe$2(this,Fn)}return from$2(this,Fn,Mn,rs)}Buffer.poolSize=8192;Buffer._augment=function(Fn){return Fn.__proto__=Buffer.prototype,Fn};function from$2(Fn,Mn,rs,is){if(typeof Mn=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&Mn instanceof ArrayBuffer?fromArrayBuffer(Fn,Mn,rs,is):typeof Mn=="string"?fromString$3(Fn,Mn,rs):fromObject$1(Fn,Mn)}Buffer.from=function(Fn,Mn,rs){return from$2(null,Fn,Mn,rs)};Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Buffer[Symbol.species]);function assertSize(Fn){if(typeof Fn!="number")throw new TypeError('"size" argument must be a number');if(Fn<0)throw new RangeError('"size" argument must not be negative')}function alloc(Fn,Mn,rs,is){return assertSize(Mn),Mn<=0?createBuffer(Fn,Mn):rs!==void 0?typeof is=="string"?createBuffer(Fn,Mn).fill(rs,is):createBuffer(Fn,Mn).fill(rs):createBuffer(Fn,Mn)}Buffer.alloc=function(Fn,Mn,rs){return alloc(null,Fn,Mn,rs)};function allocUnsafe$2(Fn,Mn){if(assertSize(Mn),Fn=createBuffer(Fn,Mn<0?0:checked(Mn)|0),!Buffer.TYPED_ARRAY_SUPPORT)for(var rs=0;rs<Mn;++rs)Fn[rs]=0;return Fn}Buffer.allocUnsafe=function(Fn){return allocUnsafe$2(null,Fn)};Buffer.allocUnsafeSlow=function(Fn){return allocUnsafe$2(null,Fn)};function fromString$3(Fn,Mn,rs){if((typeof rs!="string"||rs==="")&&(rs="utf8"),!Buffer.isEncoding(rs))throw new TypeError('"encoding" must be a valid string encoding');var is=byteLength$1(Mn,rs)|0;Fn=createBuffer(Fn,is);var os=Fn.write(Mn,rs);return os!==is&&(Fn=Fn.slice(0,os)),Fn}function fromArrayLike(Fn,Mn){var rs=Mn.length<0?0:checked(Mn.length)|0;Fn=createBuffer(Fn,rs);for(var is=0;is<rs;is+=1)Fn[is]=Mn[is]&255;return Fn}function fromArrayBuffer(Fn,Mn,rs,is){if(Mn.byteLength,rs<0||Mn.byteLength<rs)throw new RangeError("'offset' is out of bounds");if(Mn.byteLength<rs+(is||0))throw new RangeError("'length' is out of bounds");return rs===void 0&&is===void 0?Mn=new Uint8Array(Mn):is===void 0?Mn=new Uint8Array(Mn,rs):Mn=new Uint8Array(Mn,rs,is),Buffer.TYPED_ARRAY_SUPPORT?(Fn=Mn,Fn.__proto__=Buffer.prototype):Fn=fromArrayLike(Fn,Mn),Fn}function fromObject$1(Fn,Mn){if(internalIsBuffer(Mn)){var rs=checked(Mn.length)|0;return Fn=createBuffer(Fn,rs),Fn.length===0||Mn.copy(Fn,0,0,rs),Fn}if(Mn){if(typeof ArrayBuffer<"u"&&Mn.buffer instanceof ArrayBuffer||"length"in Mn)return typeof Mn.length!="number"||isnan(Mn.length)?createBuffer(Fn,0):fromArrayLike(Fn,Mn);if(Mn.type==="Buffer"&&isArray$1(Mn.data))return fromArrayLike(Fn,Mn.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(Fn){if(Fn>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return Fn|0}Buffer.isBuffer=isBuffer;function internalIsBuffer(Fn){return!!(Fn!=null&&Fn._isBuffer)}Buffer.compare=function(Mn,rs){if(!internalIsBuffer(Mn)||!internalIsBuffer(rs))throw new TypeError("Arguments must be Buffers");if(Mn===rs)return 0;for(var is=Mn.length,os=rs.length,as=0,us=Math.min(is,os);as<us;++as)if(Mn[as]!==rs[as]){is=Mn[as],os=rs[as];break}return is<os?-1:os<is?1:0};Buffer.isEncoding=function(Mn){switch(String(Mn).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};Buffer.concat=function(Mn,rs){if(!isArray$1(Mn))throw new TypeError('"list" argument must be an Array of Buffers');if(Mn.length===0)return Buffer.alloc(0);var is;if(rs===void 0)for(rs=0,is=0;is<Mn.length;++is)rs+=Mn[is].length;var os=Buffer.allocUnsafe(rs),as=0;for(is=0;is<Mn.length;++is){var us=Mn[is];if(!internalIsBuffer(us))throw new TypeError('"list" argument must be an Array of Buffers');us.copy(os,as),as+=us.length}return os};function byteLength$1(Fn,Mn){if(internalIsBuffer(Fn))return Fn.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(Fn)||Fn instanceof ArrayBuffer))return Fn.byteLength;typeof Fn!="string"&&(Fn=""+Fn);var rs=Fn.length;if(rs===0)return 0;for(var is=!1;;)switch(Mn){case"ascii":case"latin1":case"binary":return rs;case"utf8":case"utf-8":case void 0:return utf8ToBytes(Fn).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rs*2;case"hex":return rs>>>1;case"base64":return base64ToBytes(Fn).length;default:if(is)return utf8ToBytes(Fn).length;Mn=(""+Mn).toLowerCase(),is=!0}}Buffer.byteLength=byteLength$1;function slowToString(Fn,Mn,rs){var is=!1;if((Mn===void 0||Mn<0)&&(Mn=0),Mn>this.length||((rs===void 0||rs>this.length)&&(rs=this.length),rs<=0)||(rs>>>=0,Mn>>>=0,rs<=Mn))return"";for(Fn||(Fn="utf8");;)switch(Fn){case"hex":return hexSlice(this,Mn,rs);case"utf8":case"utf-8":return utf8Slice(this,Mn,rs);case"ascii":return asciiSlice(this,Mn,rs);case"latin1":case"binary":return latin1Slice(this,Mn,rs);case"base64":return base64Slice(this,Mn,rs);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,Mn,rs);default:if(is)throw new TypeError("Unknown encoding: "+Fn);Fn=(Fn+"").toLowerCase(),is=!0}}Buffer.prototype._isBuffer=!0;function swap$1(Fn,Mn,rs){var is=Fn[Mn];Fn[Mn]=Fn[rs],Fn[rs]=is}Buffer.prototype.swap16=function(){var Mn=this.length;if(Mn%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var rs=0;rs<Mn;rs+=2)swap$1(this,rs,rs+1);return this};Buffer.prototype.swap32=function(){var Mn=this.length;if(Mn%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var rs=0;rs<Mn;rs+=4)swap$1(this,rs,rs+3),swap$1(this,rs+1,rs+2);return this};Buffer.prototype.swap64=function(){var Mn=this.length;if(Mn%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var rs=0;rs<Mn;rs+=8)swap$1(this,rs,rs+7),swap$1(this,rs+1,rs+6),swap$1(this,rs+2,rs+5),swap$1(this,rs+3,rs+4);return this};Buffer.prototype.toString=function(){var Mn=this.length|0;return Mn===0?"":arguments.length===0?utf8Slice(this,0,Mn):slowToString.apply(this,arguments)};Buffer.prototype.equals=function(Mn){if(!internalIsBuffer(Mn))throw new TypeError("Argument must be a Buffer");return this===Mn?!0:Buffer.compare(this,Mn)===0};Buffer.prototype.inspect=function(){var Mn="",rs=INSPECT_MAX_BYTES;return this.length>0&&(Mn=this.toString("hex",0,rs).match(/.{2}/g).join(" "),this.length>rs&&(Mn+=" ... ")),"<Buffer "+Mn+">"};Buffer.prototype.compare=function(Mn,rs,is,os,as){if(!internalIsBuffer(Mn))throw new TypeError("Argument must be a Buffer");if(rs===void 0&&(rs=0),is===void 0&&(is=Mn?Mn.length:0),os===void 0&&(os=0),as===void 0&&(as=this.length),rs<0||is>Mn.length||os<0||as>this.length)throw new RangeError("out of range index");if(os>=as&&rs>=is)return 0;if(os>=as)return-1;if(rs>=is)return 1;if(rs>>>=0,is>>>=0,os>>>=0,as>>>=0,this===Mn)return 0;for(var us=as-os,ds=is-rs,hs=Math.min(us,ds),ps=this.slice(os,as),io=Mn.slice(rs,is),fo=0;fo<hs;++fo)if(ps[fo]!==io[fo]){us=ps[fo],ds=io[fo];break}return us<ds?-1:ds<us?1:0};function bidirectionalIndexOf(Fn,Mn,rs,is,os){if(Fn.length===0)return-1;if(typeof rs=="string"?(is=rs,rs=0):rs>2147483647?rs=2147483647:rs<-2147483648&&(rs=-2147483648),rs=+rs,isNaN(rs)&&(rs=os?0:Fn.length-1),rs<0&&(rs=Fn.length+rs),rs>=Fn.length){if(os)return-1;rs=Fn.length-1}else if(rs<0)if(os)rs=0;else return-1;if(typeof Mn=="string"&&(Mn=Buffer.from(Mn,is)),internalIsBuffer(Mn))return Mn.length===0?-1:arrayIndexOf(Fn,Mn,rs,is,os);if(typeof Mn=="number")return Mn=Mn&255,Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?os?Uint8Array.prototype.indexOf.call(Fn,Mn,rs):Uint8Array.prototype.lastIndexOf.call(Fn,Mn,rs):arrayIndexOf(Fn,[Mn],rs,is,os);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(Fn,Mn,rs,is,os){var as=1,us=Fn.length,ds=Mn.length;if(is!==void 0&&(is=String(is).toLowerCase(),is==="ucs2"||is==="ucs-2"||is==="utf16le"||is==="utf-16le")){if(Fn.length<2||Mn.length<2)return-1;as=2,us/=2,ds/=2,rs/=2}function hs(Ao,$o){return as===1?Ao[$o]:Ao.readUInt16BE($o*as)}var ps;if(os){var io=-1;for(ps=rs;ps<us;ps++)if(hs(Fn,ps)===hs(Mn,io===-1?0:ps-io)){if(io===-1&&(io=ps),ps-io+1===ds)return io*as}else io!==-1&&(ps-=ps-io),io=-1}else for(rs+ds>us&&(rs=us-ds),ps=rs;ps>=0;ps--){for(var fo=!0,mo=0;mo<ds;mo++)if(hs(Fn,ps+mo)!==hs(Mn,mo)){fo=!1;break}if(fo)return ps}return-1}Buffer.prototype.includes=function(Mn,rs,is){return this.indexOf(Mn,rs,is)!==-1};Buffer.prototype.indexOf=function(Mn,rs,is){return bidirectionalIndexOf(this,Mn,rs,is,!0)};Buffer.prototype.lastIndexOf=function(Mn,rs,is){return bidirectionalIndexOf(this,Mn,rs,is,!1)};function hexWrite(Fn,Mn,rs,is){rs=Number(rs)||0;var os=Fn.length-rs;is?(is=Number(is),is>os&&(is=os)):is=os;var as=Mn.length;if(as%2!==0)throw new TypeError("Invalid hex string");is>as/2&&(is=as/2);for(var us=0;us<is;++us){var ds=parseInt(Mn.substr(us*2,2),16);if(isNaN(ds))return us;Fn[rs+us]=ds}return us}function utf8Write(Fn,Mn,rs,is){return blitBuffer(utf8ToBytes(Mn,Fn.length-rs),Fn,rs,is)}function asciiWrite(Fn,Mn,rs,is){return blitBuffer(asciiToBytes(Mn),Fn,rs,is)}function latin1Write(Fn,Mn,rs,is){return asciiWrite(Fn,Mn,rs,is)}function base64Write(Fn,Mn,rs,is){return blitBuffer(base64ToBytes(Mn),Fn,rs,is)}function ucs2Write(Fn,Mn,rs,is){return blitBuffer(utf16leToBytes(Mn,Fn.length-rs),Fn,rs,is)}Buffer.prototype.write=function(Mn,rs,is,os){if(rs===void 0)os="utf8",is=this.length,rs=0;else if(is===void 0&&typeof rs=="string")os=rs,is=this.length,rs=0;else if(isFinite(rs))rs=rs|0,isFinite(is)?(is=is|0,os===void 0&&(os="utf8")):(os=is,is=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var as=this.length-rs;if((is===void 0||is>as)&&(is=as),Mn.length>0&&(is<0||rs<0)||rs>this.length)throw new RangeError("Attempt to write outside buffer bounds");os||(os="utf8");for(var us=!1;;)switch(os){case"hex":return hexWrite(this,Mn,rs,is);case"utf8":case"utf-8":return utf8Write(this,Mn,rs,is);case"ascii":return asciiWrite(this,Mn,rs,is);case"latin1":case"binary":return latin1Write(this,Mn,rs,is);case"base64":return base64Write(this,Mn,rs,is);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,Mn,rs,is);default:if(us)throw new TypeError("Unknown encoding: "+os);os=(""+os).toLowerCase(),us=!0}};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(Fn,Mn,rs){return Mn===0&&rs===Fn.length?fromByteArray$1(Fn):fromByteArray$1(Fn.slice(Mn,rs))}function utf8Slice(Fn,Mn,rs){rs=Math.min(Fn.length,rs);for(var is=[],os=Mn;os<rs;){var as=Fn[os],us=null,ds=as>239?4:as>223?3:as>191?2:1;if(os+ds<=rs){var hs,ps,io,fo;switch(ds){case 1:as<128&&(us=as);break;case 2:hs=Fn[os+1],(hs&192)===128&&(fo=(as&31)<<6|hs&63,fo>127&&(us=fo));break;case 3:hs=Fn[os+1],ps=Fn[os+2],(hs&192)===128&&(ps&192)===128&&(fo=(as&15)<<12|(hs&63)<<6|ps&63,fo>2047&&(fo<55296||fo>57343)&&(us=fo));break;case 4:hs=Fn[os+1],ps=Fn[os+2],io=Fn[os+3],(hs&192)===128&&(ps&192)===128&&(io&192)===128&&(fo=(as&15)<<18|(hs&63)<<12|(ps&63)<<6|io&63,fo>65535&&fo<1114112&&(us=fo))}}us===null?(us=65533,ds=1):us>65535&&(us-=65536,is.push(us>>>10&1023|55296),us=56320|us&1023),is.push(us),os+=ds}return decodeCodePointsArray(is)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(Fn){var Mn=Fn.length;if(Mn<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,Fn);for(var rs="",is=0;is<Mn;)rs+=String.fromCharCode.apply(String,Fn.slice(is,is+=MAX_ARGUMENTS_LENGTH));return rs}function asciiSlice(Fn,Mn,rs){var is="";rs=Math.min(Fn.length,rs);for(var os=Mn;os<rs;++os)is+=String.fromCharCode(Fn[os]&127);return is}function latin1Slice(Fn,Mn,rs){var is="";rs=Math.min(Fn.length,rs);for(var os=Mn;os<rs;++os)is+=String.fromCharCode(Fn[os]);return is}function hexSlice(Fn,Mn,rs){var is=Fn.length;(!Mn||Mn<0)&&(Mn=0),(!rs||rs<0||rs>is)&&(rs=is);for(var os="",as=Mn;as<rs;++as)os+=toHex(Fn[as]);return os}function utf16leSlice(Fn,Mn,rs){for(var is=Fn.slice(Mn,rs),os="",as=0;as<is.length;as+=2)os+=String.fromCharCode(is[as]+is[as+1]*256);return os}Buffer.prototype.slice=function(Mn,rs){var is=this.length;Mn=~~Mn,rs=rs===void 0?is:~~rs,Mn<0?(Mn+=is,Mn<0&&(Mn=0)):Mn>is&&(Mn=is),rs<0?(rs+=is,rs<0&&(rs=0)):rs>is&&(rs=is),rs<Mn&&(rs=Mn);var os;if(Buffer.TYPED_ARRAY_SUPPORT)os=this.subarray(Mn,rs),os.__proto__=Buffer.prototype;else{var as=rs-Mn;os=new Buffer(as,void 0);for(var us=0;us<as;++us)os[us]=this[us+Mn]}return os};function checkOffset(Fn,Mn,rs){if(Fn%1!==0||Fn<0)throw new RangeError("offset is not uint");if(Fn+Mn>rs)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function(Mn,rs,is){Mn=Mn|0,rs=rs|0,is||checkOffset(Mn,rs,this.length);for(var os=this[Mn],as=1,us=0;++us<rs&&(as*=256);)os+=this[Mn+us]*as;return os};Buffer.prototype.readUIntBE=function(Mn,rs,is){Mn=Mn|0,rs=rs|0,is||checkOffset(Mn,rs,this.length);for(var os=this[Mn+--rs],as=1;rs>0&&(as*=256);)os+=this[Mn+--rs]*as;return os};Buffer.prototype.readUInt8=function(Mn,rs){return rs||checkOffset(Mn,1,this.length),this[Mn]};Buffer.prototype.readUInt16LE=function(Mn,rs){return rs||checkOffset(Mn,2,this.length),this[Mn]|this[Mn+1]<<8};Buffer.prototype.readUInt16BE=function(Mn,rs){return rs||checkOffset(Mn,2,this.length),this[Mn]<<8|this[Mn+1]};Buffer.prototype.readUInt32LE=function(Mn,rs){return rs||checkOffset(Mn,4,this.length),(this[Mn]|this[Mn+1]<<8|this[Mn+2]<<16)+this[Mn+3]*16777216};Buffer.prototype.readUInt32BE=function(Mn,rs){return rs||checkOffset(Mn,4,this.length),this[Mn]*16777216+(this[Mn+1]<<16|this[Mn+2]<<8|this[Mn+3])};Buffer.prototype.readIntLE=function(Mn,rs,is){Mn=Mn|0,rs=rs|0,is||checkOffset(Mn,rs,this.length);for(var os=this[Mn],as=1,us=0;++us<rs&&(as*=256);)os+=this[Mn+us]*as;return as*=128,os>=as&&(os-=Math.pow(2,8*rs)),os};Buffer.prototype.readIntBE=function(Mn,rs,is){Mn=Mn|0,rs=rs|0,is||checkOffset(Mn,rs,this.length);for(var os=rs,as=1,us=this[Mn+--os];os>0&&(as*=256);)us+=this[Mn+--os]*as;return as*=128,us>=as&&(us-=Math.pow(2,8*rs)),us};Buffer.prototype.readInt8=function(Mn,rs){return rs||checkOffset(Mn,1,this.length),this[Mn]&128?(255-this[Mn]+1)*-1:this[Mn]};Buffer.prototype.readInt16LE=function(Mn,rs){rs||checkOffset(Mn,2,this.length);var is=this[Mn]|this[Mn+1]<<8;return is&32768?is|4294901760:is};Buffer.prototype.readInt16BE=function(Mn,rs){rs||checkOffset(Mn,2,this.length);var is=this[Mn+1]|this[Mn]<<8;return is&32768?is|4294901760:is};Buffer.prototype.readInt32LE=function(Mn,rs){return rs||checkOffset(Mn,4,this.length),this[Mn]|this[Mn+1]<<8|this[Mn+2]<<16|this[Mn+3]<<24};Buffer.prototype.readInt32BE=function(Mn,rs){return rs||checkOffset(Mn,4,this.length),this[Mn]<<24|this[Mn+1]<<16|this[Mn+2]<<8|this[Mn+3]};Buffer.prototype.readFloatLE=function(Mn,rs){return rs||checkOffset(Mn,4,this.length),read(this,Mn,!0,23,4)};Buffer.prototype.readFloatBE=function(Mn,rs){return rs||checkOffset(Mn,4,this.length),read(this,Mn,!1,23,4)};Buffer.prototype.readDoubleLE=function(Mn,rs){return rs||checkOffset(Mn,8,this.length),read(this,Mn,!0,52,8)};Buffer.prototype.readDoubleBE=function(Mn,rs){return rs||checkOffset(Mn,8,this.length),read(this,Mn,!1,52,8)};function checkInt(Fn,Mn,rs,is,os,as){if(!internalIsBuffer(Fn))throw new TypeError('"buffer" argument must be a Buffer instance');if(Mn>os||Mn<as)throw new RangeError('"value" argument is out of bounds');if(rs+is>Fn.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function(Mn,rs,is,os){if(Mn=+Mn,rs=rs|0,is=is|0,!os){var as=Math.pow(2,8*is)-1;checkInt(this,Mn,rs,is,as,0)}var us=1,ds=0;for(this[rs]=Mn&255;++ds<is&&(us*=256);)this[rs+ds]=Mn/us&255;return rs+is};Buffer.prototype.writeUIntBE=function(Mn,rs,is,os){if(Mn=+Mn,rs=rs|0,is=is|0,!os){var as=Math.pow(2,8*is)-1;checkInt(this,Mn,rs,is,as,0)}var us=is-1,ds=1;for(this[rs+us]=Mn&255;--us>=0&&(ds*=256);)this[rs+us]=Mn/ds&255;return rs+is};Buffer.prototype.writeUInt8=function(Mn,rs,is){return Mn=+Mn,rs=rs|0,is||checkInt(this,Mn,rs,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(Mn=Math.floor(Mn)),this[rs]=Mn&255,rs+1};function objectWriteUInt16(Fn,Mn,rs,is){Mn<0&&(Mn=65535+Mn+1);for(var os=0,as=Math.min(Fn.length-rs,2);os<as;++os)Fn[rs+os]=(Mn&255<<8*(is?os:1-os))>>>(is?os:1-os)*8}Buffer.prototype.writeUInt16LE=function(Mn,rs,is){return Mn=+Mn,rs=rs|0,is||checkInt(this,Mn,rs,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[rs]=Mn&255,this[rs+1]=Mn>>>8):objectWriteUInt16(this,Mn,rs,!0),rs+2};Buffer.prototype.writeUInt16BE=function(Mn,rs,is){return Mn=+Mn,rs=rs|0,is||checkInt(this,Mn,rs,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[rs]=Mn>>>8,this[rs+1]=Mn&255):objectWriteUInt16(this,Mn,rs,!1),rs+2};function objectWriteUInt32(Fn,Mn,rs,is){Mn<0&&(Mn=4294967295+Mn+1);for(var os=0,as=Math.min(Fn.length-rs,4);os<as;++os)Fn[rs+os]=Mn>>>(is?os:3-os)*8&255}Buffer.prototype.writeUInt32LE=function(Mn,rs,is){return Mn=+Mn,rs=rs|0,is||checkInt(this,Mn,rs,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[rs+3]=Mn>>>24,this[rs+2]=Mn>>>16,this[rs+1]=Mn>>>8,this[rs]=Mn&255):objectWriteUInt32(this,Mn,rs,!0),rs+4};Buffer.prototype.writeUInt32BE=function(Mn,rs,is){return Mn=+Mn,rs=rs|0,is||checkInt(this,Mn,rs,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[rs]=Mn>>>24,this[rs+1]=Mn>>>16,this[rs+2]=Mn>>>8,this[rs+3]=Mn&255):objectWriteUInt32(this,Mn,rs,!1),rs+4};Buffer.prototype.writeIntLE=function(Mn,rs,is,os){if(Mn=+Mn,rs=rs|0,!os){var as=Math.pow(2,8*is-1);checkInt(this,Mn,rs,is,as-1,-as)}var us=0,ds=1,hs=0;for(this[rs]=Mn&255;++us<is&&(ds*=256);)Mn<0&&hs===0&&this[rs+us-1]!==0&&(hs=1),this[rs+us]=(Mn/ds>>0)-hs&255;return rs+is};Buffer.prototype.writeIntBE=function(Mn,rs,is,os){if(Mn=+Mn,rs=rs|0,!os){var as=Math.pow(2,8*is-1);checkInt(this,Mn,rs,is,as-1,-as)}var us=is-1,ds=1,hs=0;for(this[rs+us]=Mn&255;--us>=0&&(ds*=256);)Mn<0&&hs===0&&this[rs+us+1]!==0&&(hs=1),this[rs+us]=(Mn/ds>>0)-hs&255;return rs+is};Buffer.prototype.writeInt8=function(Mn,rs,is){return Mn=+Mn,rs=rs|0,is||checkInt(this,Mn,rs,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(Mn=Math.floor(Mn)),Mn<0&&(Mn=255+Mn+1),this[rs]=Mn&255,rs+1};Buffer.prototype.writeInt16LE=function(Mn,rs,is){return Mn=+Mn,rs=rs|0,is||checkInt(this,Mn,rs,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[rs]=Mn&255,this[rs+1]=Mn>>>8):objectWriteUInt16(this,Mn,rs,!0),rs+2};Buffer.prototype.writeInt16BE=function(Mn,rs,is){return Mn=+Mn,rs=rs|0,is||checkInt(this,Mn,rs,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[rs]=Mn>>>8,this[rs+1]=Mn&255):objectWriteUInt16(this,Mn,rs,!1),rs+2};Buffer.prototype.writeInt32LE=function(Mn,rs,is){return Mn=+Mn,rs=rs|0,is||checkInt(this,Mn,rs,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[rs]=Mn&255,this[rs+1]=Mn>>>8,this[rs+2]=Mn>>>16,this[rs+3]=Mn>>>24):objectWriteUInt32(this,Mn,rs,!0),rs+4};Buffer.prototype.writeInt32BE=function(Mn,rs,is){return Mn=+Mn,rs=rs|0,is||checkInt(this,Mn,rs,4,2147483647,-2147483648),Mn<0&&(Mn=4294967295+Mn+1),Buffer.TYPED_ARRAY_SUPPORT?(this[rs]=Mn>>>24,this[rs+1]=Mn>>>16,this[rs+2]=Mn>>>8,this[rs+3]=Mn&255):objectWriteUInt32(this,Mn,rs,!1),rs+4};function checkIEEE754(Fn,Mn,rs,is,os,as){if(rs+is>Fn.length)throw new RangeError("Index out of range");if(rs<0)throw new RangeError("Index out of range")}function writeFloat(Fn,Mn,rs,is,os){return os||checkIEEE754(Fn,Mn,rs,4),write(Fn,Mn,rs,is,23,4),rs+4}Buffer.prototype.writeFloatLE=function(Mn,rs,is){return writeFloat(this,Mn,rs,!0,is)};Buffer.prototype.writeFloatBE=function(Mn,rs,is){return writeFloat(this,Mn,rs,!1,is)};function writeDouble(Fn,Mn,rs,is,os){return os||checkIEEE754(Fn,Mn,rs,8),write(Fn,Mn,rs,is,52,8),rs+8}Buffer.prototype.writeDoubleLE=function(Mn,rs,is){return writeDouble(this,Mn,rs,!0,is)};Buffer.prototype.writeDoubleBE=function(Mn,rs,is){return writeDouble(this,Mn,rs,!1,is)};Buffer.prototype.copy=function(Mn,rs,is,os){if(is||(is=0),!os&&os!==0&&(os=this.length),rs>=Mn.length&&(rs=Mn.length),rs||(rs=0),os>0&&os<is&&(os=is),os===is||Mn.length===0||this.length===0)return 0;if(rs<0)throw new RangeError("targetStart out of bounds");if(is<0||is>=this.length)throw new RangeError("sourceStart out of bounds");if(os<0)throw new RangeError("sourceEnd out of bounds");os>this.length&&(os=this.length),Mn.length-rs<os-is&&(os=Mn.length-rs+is);var as=os-is,us;if(this===Mn&&is<rs&&rs<os)for(us=as-1;us>=0;--us)Mn[us+rs]=this[us+is];else if(as<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(us=0;us<as;++us)Mn[us+rs]=this[us+is];else Uint8Array.prototype.set.call(Mn,this.subarray(is,is+as),rs);return as};Buffer.prototype.fill=function(Mn,rs,is,os){if(typeof Mn=="string"){if(typeof rs=="string"?(os=rs,rs=0,is=this.length):typeof is=="string"&&(os=is,is=this.length),Mn.length===1){var as=Mn.charCodeAt(0);as<256&&(Mn=as)}if(os!==void 0&&typeof os!="string")throw new TypeError("encoding must be a string");if(typeof os=="string"&&!Buffer.isEncoding(os))throw new TypeError("Unknown encoding: "+os)}else typeof Mn=="number"&&(Mn=Mn&255);if(rs<0||this.length<rs||this.length<is)throw new RangeError("Out of range index");if(is<=rs)return this;rs=rs>>>0,is=is===void 0?this.length:is>>>0,Mn||(Mn=0);var us;if(typeof Mn=="number")for(us=rs;us<is;++us)this[us]=Mn;else{var ds=internalIsBuffer(Mn)?Mn:utf8ToBytes(new Buffer(Mn,os).toString()),hs=ds.length;for(us=0;us<is-rs;++us)this[us+rs]=ds[us%hs]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(Fn){if(Fn=stringtrim(Fn).replace(INVALID_BASE64_RE,""),Fn.length<2)return"";for(;Fn.length%4!==0;)Fn=Fn+"=";return Fn}function stringtrim(Fn){return Fn.trim?Fn.trim():Fn.replace(/^\s+|\s+$/g,"")}function toHex(Fn){return Fn<16?"0"+Fn.toString(16):Fn.toString(16)}function utf8ToBytes(Fn,Mn){Mn=Mn||1/0;for(var rs,is=Fn.length,os=null,as=[],us=0;us<is;++us){if(rs=Fn.charCodeAt(us),rs>55295&&rs<57344){if(!os){if(rs>56319){(Mn-=3)>-1&&as.push(239,191,189);continue}else if(us+1===is){(Mn-=3)>-1&&as.push(239,191,189);continue}os=rs;continue}if(rs<56320){(Mn-=3)>-1&&as.push(239,191,189),os=rs;continue}rs=(os-55296<<10|rs-56320)+65536}else os&&(Mn-=3)>-1&&as.push(239,191,189);if(os=null,rs<128){if((Mn-=1)<0)break;as.push(rs)}else if(rs<2048){if((Mn-=2)<0)break;as.push(rs>>6|192,rs&63|128)}else if(rs<65536){if((Mn-=3)<0)break;as.push(rs>>12|224,rs>>6&63|128,rs&63|128)}else if(rs<1114112){if((Mn-=4)<0)break;as.push(rs>>18|240,rs>>12&63|128,rs>>6&63|128,rs&63|128)}else throw new Error("Invalid code point")}return as}function asciiToBytes(Fn){for(var Mn=[],rs=0;rs<Fn.length;++rs)Mn.push(Fn.charCodeAt(rs)&255);return Mn}function utf16leToBytes(Fn,Mn){for(var rs,is,os,as=[],us=0;us<Fn.length&&!((Mn-=2)<0);++us)rs=Fn.charCodeAt(us),is=rs>>8,os=rs%256,as.push(os),as.push(is);return as}function base64ToBytes(Fn){return toByteArray$1(base64clean(Fn))}function blitBuffer(Fn,Mn,rs,is){for(var os=0;os<is&&!(os+rs>=Mn.length||os>=Fn.length);++os)Mn[os+rs]=Fn[os];return os}function isnan(Fn){return Fn!==Fn}function isBuffer(Fn){return Fn!=null&&(!!Fn._isBuffer||isFastBuffer(Fn)||isSlowBuffer(Fn))}function isFastBuffer(Fn){return!!Fn.constructor&&typeof Fn.constructor.isBuffer=="function"&&Fn.constructor.isBuffer(Fn)}function isSlowBuffer(Fn){return typeof Fn.readFloatLE=="function"&&typeof Fn.slice=="function"&&isFastBuffer(Fn.slice(0,0))}function AxiosError(Fn,Mn,rs,is,os){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=Fn,this.name="AxiosError",Mn&&(this.code=Mn),rs&&(this.config=rs),is&&(this.request=is),os&&(this.response=os)}utils$i.inherits(AxiosError,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:utils$i.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors$1={};["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(Fn=>{descriptors$1[Fn]={value:Fn}});Object.defineProperties(AxiosError,descriptors$1);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(Fn,Mn,rs,is,os,as)=>{const us=Object.create(prototype$1);return utils$i.toFlatObject(Fn,us,function(hs){return hs!==Error.prototype},ds=>ds!=="isAxiosError"),AxiosError.call(us,Fn.message,Mn,rs,is,os),us.cause=Fn,us.name=Fn.name,as&&Object.assign(us,as),us};const httpAdapter=null;function isVisitable(Fn){return utils$i.isPlainObject(Fn)||utils$i.isArray(Fn)}function removeBrackets(Fn){return utils$i.endsWith(Fn,"[]")?Fn.slice(0,-2):Fn}function renderKey(Fn,Mn,rs){return Fn?Fn.concat(Mn).map(function(os,as){return os=removeBrackets(os),!rs&&as?"["+os+"]":os}).join(rs?".":""):Mn}function isFlatArray(Fn){return utils$i.isArray(Fn)&&!Fn.some(isVisitable)}const predicates=utils$i.toFlatObject(utils$i,{},null,function(Mn){return/^is[A-Z]/.test(Mn)});function toFormData(Fn,Mn,rs){if(!utils$i.isObject(Fn))throw new TypeError("target must be an object");Mn=Mn||new FormData,rs=utils$i.toFlatObject(rs,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Lo,Go){return!utils$i.isUndefined(Go[Lo])});const is=rs.metaTokens,os=rs.visitor||io,as=rs.dots,us=rs.indexes,hs=(rs.Blob||typeof Blob<"u"&&Blob)&&utils$i.isSpecCompliantForm(Mn);if(!utils$i.isFunction(os))throw new TypeError("visitor must be a function");function ps($o){if($o===null)return"";if(utils$i.isDate($o))return $o.toISOString();if(!hs&&utils$i.isBlob($o))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils$i.isArrayBuffer($o)||utils$i.isTypedArray($o)?hs&&typeof Blob=="function"?new Blob([$o]):Buffer.from($o):$o}function io($o,Lo,Go){let Yo=$o;if($o&&!Go&&typeof $o=="object"){if(utils$i.endsWith(Lo,"{}"))Lo=is?Lo:Lo.slice(0,-2),$o=JSON.stringify($o);else if(utils$i.isArray($o)&&isFlatArray($o)||(utils$i.isFileList($o)||utils$i.endsWith(Lo,"[]"))&&(Yo=utils$i.toArray($o)))return Lo=removeBrackets(Lo),Yo.forEach(function(Jo,xl){!(utils$i.isUndefined(Jo)||Jo===null)&&Mn.append(us===!0?renderKey([Lo],xl,as):us===null?Lo:Lo+"[]",ps(Jo))}),!1}return isVisitable($o)?!0:(Mn.append(renderKey(Go,Lo,as),ps($o)),!1)}const fo=[],mo=Object.assign(predicates,{defaultVisitor:io,convertValue:ps,isVisitable});function Ao($o,Lo){if(!utils$i.isUndefined($o)){if(fo.indexOf($o)!==-1)throw Error("Circular reference detected in "+Lo.join("."));fo.push($o),utils$i.forEach($o,function(Yo,Wo){(!(utils$i.isUndefined(Yo)||Yo===null)&&os.call(Mn,Yo,utils$i.isString(Wo)?Wo.trim():Wo,Lo,mo))===!0&&Ao(Yo,Lo?Lo.concat(Wo):[Wo])}),fo.pop()}}if(!utils$i.isObject(Fn))throw new TypeError("data must be an object");return Ao(Fn),Mn}function encode$3(Fn){const Mn={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(Fn).replace(/[!'()~]|%20|%00/g,function(is){return Mn[is]})}function AxiosURLSearchParams(Fn,Mn){this._pairs=[],Fn&&toFormData(Fn,this,Mn)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(Mn,rs){this._pairs.push([Mn,rs])};prototype.toString=function(Mn){const rs=Mn?function(is){return Mn.call(this,is,encode$3)}:encode$3;return this._pairs.map(function(os){return rs(os[0])+"="+rs(os[1])},"").join("&")};function encode$2(Fn){return encodeURIComponent(Fn).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(Fn,Mn,rs){if(!Mn)return Fn;const is=rs&&rs.encode||encode$2,os=rs&&rs.serialize;let as;if(os?as=os(Mn,rs):as=utils$i.isURLSearchParams(Mn)?Mn.toString():new AxiosURLSearchParams(Mn,rs).toString(is),as){const us=Fn.indexOf("#");us!==-1&&(Fn=Fn.slice(0,us)),Fn+=(Fn.indexOf("?")===-1?"?":"&")+as}return Fn}class InterceptorManager{constructor(){this.handlers=[]}use(Mn,rs,is){return this.handlers.push({fulfilled:Mn,rejected:rs,synchronous:is?is.synchronous:!1,runWhen:is?is.runWhen:null}),this.handlers.length-1}eject(Mn){this.handlers[Mn]&&(this.handlers[Mn]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(Mn){utils$i.forEach(this.handlers,function(is){is!==null&&Mn(is)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",hasStandardBrowserEnv=(Fn=>hasBrowserEnv&&["ReactNative","NativeScript","NS"].indexOf(Fn)<0)(typeof navigator<"u"&&navigator.product),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils$h=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils$h,...platform$1};function toURLEncodedForm(Fn,Mn){return toFormData(Fn,new platform.classes.URLSearchParams,Object.assign({visitor:function(rs,is,os,as){return platform.isNode&&utils$i.isBuffer(rs)?(this.append(is,rs.toString("base64")),!1):as.defaultVisitor.apply(this,arguments)}},Mn))}function parsePropPath(Fn){return utils$i.matchAll(/\w+|\[(\w*)]/g,Fn).map(Mn=>Mn[0]==="[]"?"":Mn[1]||Mn[0])}function arrayToObject(Fn){const Mn={},rs=Object.keys(Fn);let is;const os=rs.length;let as;for(is=0;is<os;is++)as=rs[is],Mn[as]=Fn[as];return Mn}function formDataToJSON(Fn){function Mn(rs,is,os,as){let us=rs[as++];if(us==="__proto__")return!0;const ds=Number.isFinite(+us),hs=as>=rs.length;return us=!us&&utils$i.isArray(os)?os.length:us,hs?(utils$i.hasOwnProp(os,us)?os[us]=[os[us],is]:os[us]=is,!ds):((!os[us]||!utils$i.isObject(os[us]))&&(os[us]=[]),Mn(rs,is,os[us],as)&&utils$i.isArray(os[us])&&(os[us]=arrayToObject(os[us])),!ds)}if(utils$i.isFormData(Fn)&&utils$i.isFunction(Fn.entries)){const rs={};return utils$i.forEachEntry(Fn,(is,os)=>{Mn(parsePropPath(is),os,rs,0)}),rs}return null}function stringifySafely(Fn,Mn,rs){if(utils$i.isString(Fn))try{return(Mn||JSON.parse)(Fn),utils$i.trim(Fn)}catch(is){if(is.name!=="SyntaxError")throw is}return(rs||JSON.stringify)(Fn)}const defaults$1={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(Mn,rs){const is=rs.getContentType()||"",os=is.indexOf("application/json")>-1,as=utils$i.isObject(Mn);if(as&&utils$i.isHTMLForm(Mn)&&(Mn=new FormData(Mn)),utils$i.isFormData(Mn))return os?JSON.stringify(formDataToJSON(Mn)):Mn;if(utils$i.isArrayBuffer(Mn)||utils$i.isBuffer(Mn)||utils$i.isStream(Mn)||utils$i.isFile(Mn)||utils$i.isBlob(Mn)||utils$i.isReadableStream(Mn))return Mn;if(utils$i.isArrayBufferView(Mn))return Mn.buffer;if(utils$i.isURLSearchParams(Mn))return rs.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),Mn.toString();let ds;if(as){if(is.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(Mn,this.formSerializer).toString();if((ds=utils$i.isFileList(Mn))||is.indexOf("multipart/form-data")>-1){const hs=this.env&&this.env.FormData;return toFormData(ds?{"files[]":Mn}:Mn,hs&&new hs,this.formSerializer)}}return as||os?(rs.setContentType("application/json",!1),stringifySafely(Mn)):Mn}],transformResponse:[function(Mn){const rs=this.transitional||defaults$1.transitional,is=rs&&rs.forcedJSONParsing,os=this.responseType==="json";if(utils$i.isResponse(Mn)||utils$i.isReadableStream(Mn))return Mn;if(Mn&&utils$i.isString(Mn)&&(is&&!this.responseType||os)){const us=!(rs&&rs.silentJSONParsing)&&os;try{return JSON.parse(Mn)}catch(ds){if(us)throw ds.name==="SyntaxError"?AxiosError.from(ds,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):ds}}return Mn}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(Mn){return Mn>=200&&Mn<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$i.forEach(["delete","get","head","post","put","patch"],Fn=>{defaults$1.headers[Fn]={}});const ignoreDuplicateOf=utils$i.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"]),parseHeaders=Fn=>{const Mn={};let rs,is,os;return Fn&&Fn.split(`
`).forEach(function(us){os=us.indexOf(":"),rs=us.substring(0,os).trim().toLowerCase(),is=us.substring(os+1).trim(),!(!rs||Mn[rs]&&ignoreDuplicateOf[rs])&&(rs==="set-cookie"?Mn[rs]?Mn[rs].push(is):Mn[rs]=[is]:Mn[rs]=Mn[rs]?Mn[rs]+", "+is:is)}),Mn},$internals=Symbol("internals");function normalizeHeader(Fn){return Fn&&String(Fn).trim().toLowerCase()}function normalizeValue(Fn){return Fn===!1||Fn==null?Fn:utils$i.isArray(Fn)?Fn.map(normalizeValue):String(Fn)}function parseTokens(Fn){const Mn=Object.create(null),rs=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let is;for(;is=rs.exec(Fn);)Mn[is[1]]=is[2];return Mn}const isValidHeaderName=Fn=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(Fn.trim());function matchHeaderValue(Fn,Mn,rs,is,os){if(utils$i.isFunction(is))return is.call(this,Mn,rs);if(os&&(Mn=rs),!!utils$i.isString(Mn)){if(utils$i.isString(is))return Mn.indexOf(is)!==-1;if(utils$i.isRegExp(is))return is.test(Mn)}}function formatHeader(Fn){return Fn.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(Mn,rs,is)=>rs.toUpperCase()+is)}function buildAccessors(Fn,Mn){const rs=utils$i.toCamelCase(" "+Mn);["get","set","has"].forEach(is=>{Object.defineProperty(Fn,is+rs,{value:function(os,as,us){return this[is].call(this,Mn,os,as,us)},configurable:!0})})}class AxiosHeaders{constructor(Mn){Mn&&this.set(Mn)}set(Mn,rs,is){const os=this;function as(ds,hs,ps){const io=normalizeHeader(hs);if(!io)throw new Error("header name must be a non-empty string");const fo=utils$i.findKey(os,io);(!fo||os[fo]===void 0||ps===!0||ps===void 0&&os[fo]!==!1)&&(os[fo||hs]=normalizeValue(ds))}const us=(ds,hs)=>utils$i.forEach(ds,(ps,io)=>as(ps,io,hs));if(utils$i.isPlainObject(Mn)||Mn instanceof this.constructor)us(Mn,rs);else if(utils$i.isString(Mn)&&(Mn=Mn.trim())&&!isValidHeaderName(Mn))us(parseHeaders(Mn),rs);else if(utils$i.isHeaders(Mn))for(const[ds,hs]of Mn.entries())as(hs,ds,is);else Mn!=null&&as(rs,Mn,is);return this}get(Mn,rs){if(Mn=normalizeHeader(Mn),Mn){const is=utils$i.findKey(this,Mn);if(is){const os=this[is];if(!rs)return os;if(rs===!0)return parseTokens(os);if(utils$i.isFunction(rs))return rs.call(this,os,is);if(utils$i.isRegExp(rs))return rs.exec(os);throw new TypeError("parser must be boolean|regexp|function")}}}has(Mn,rs){if(Mn=normalizeHeader(Mn),Mn){const is=utils$i.findKey(this,Mn);return!!(is&&this[is]!==void 0&&(!rs||matchHeaderValue(this,this[is],is,rs)))}return!1}delete(Mn,rs){const is=this;let os=!1;function as(us){if(us=normalizeHeader(us),us){const ds=utils$i.findKey(is,us);ds&&(!rs||matchHeaderValue(is,is[ds],ds,rs))&&(delete is[ds],os=!0)}}return utils$i.isArray(Mn)?Mn.forEach(as):as(Mn),os}clear(Mn){const rs=Object.keys(this);let is=rs.length,os=!1;for(;is--;){const as=rs[is];(!Mn||matchHeaderValue(this,this[as],as,Mn,!0))&&(delete this[as],os=!0)}return os}normalize(Mn){const rs=this,is={};return utils$i.forEach(this,(os,as)=>{const us=utils$i.findKey(is,as);if(us){rs[us]=normalizeValue(os),delete rs[as];return}const ds=Mn?formatHeader(as):String(as).trim();ds!==as&&delete rs[as],rs[ds]=normalizeValue(os),is[ds]=!0}),this}concat(...Mn){return this.constructor.concat(this,...Mn)}toJSON(Mn){const rs=Object.create(null);return utils$i.forEach(this,(is,os)=>{is!=null&&is!==!1&&(rs[os]=Mn&&utils$i.isArray(is)?is.join(", "):is)}),rs}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([Mn,rs])=>Mn+": "+rs).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(Mn){return Mn instanceof this?Mn:new this(Mn)}static concat(Mn,...rs){const is=new this(Mn);return rs.forEach(os=>is.set(os)),is}static accessor(Mn){const is=(this[$internals]=this[$internals]={accessors:{}}).accessors,os=this.prototype;function as(us){const ds=normalizeHeader(us);is[ds]||(buildAccessors(os,us),is[ds]=!0)}return utils$i.isArray(Mn)?Mn.forEach(as):as(Mn),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$i.reduceDescriptors(AxiosHeaders.prototype,({value:Fn},Mn)=>{let rs=Mn[0].toUpperCase()+Mn.slice(1);return{get:()=>Fn,set(is){this[rs]=is}}});utils$i.freezeMethods(AxiosHeaders);function transformData(Fn,Mn){const rs=this||defaults$1,is=Mn||rs,os=AxiosHeaders.from(is.headers);let as=is.data;return utils$i.forEach(Fn,function(ds){as=ds.call(rs,as,os.normalize(),Mn?Mn.status:void 0)}),os.normalize(),as}function isCancel(Fn){return!!(Fn&&Fn.__CANCEL__)}function CanceledError(Fn,Mn,rs){AxiosError.call(this,Fn??"canceled",AxiosError.ERR_CANCELED,Mn,rs),this.name="CanceledError"}utils$i.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(Fn,Mn,rs){const is=rs.config.validateStatus;!rs.status||!is||is(rs.status)?Fn(rs):Mn(new AxiosError("Request failed with status code "+rs.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(rs.status/100)-4],rs.config,rs.request,rs))}function parseProtocol(Fn){const Mn=/^([-+\w]{1,25})(:?\/\/|:)/.exec(Fn);return Mn&&Mn[1]||""}function speedometer(Fn,Mn){Fn=Fn||10;const rs=new Array(Fn),is=new Array(Fn);let os=0,as=0,us;return Mn=Mn!==void 0?Mn:1e3,function(hs){const ps=Date.now(),io=is[as];us||(us=ps),rs[os]=hs,is[os]=ps;let fo=as,mo=0;for(;fo!==os;)mo+=rs[fo++],fo=fo%Fn;if(os=(os+1)%Fn,os===as&&(as=(as+1)%Fn),ps-us<Mn)return;const Ao=io&&ps-io;return Ao?Math.round(mo*1e3/Ao):void 0}}function throttle(Fn,Mn){let rs=0,is=1e3/Mn,os,as;const us=(ps,io=Date.now())=>{rs=io,os=null,as&&(clearTimeout(as),as=null),Fn.apply(null,ps)};return[(...ps)=>{const io=Date.now(),fo=io-rs;fo>=is?us(ps,io):(os=ps,as||(as=setTimeout(()=>{as=null,us(os)},is-fo)))},()=>os&&us(os)]}const progressEventReducer=(Fn,Mn,rs=3)=>{let is=0;const os=speedometer(50,250);return throttle(as=>{const us=as.loaded,ds=as.lengthComputable?as.total:void 0,hs=us-is,ps=os(hs),io=us<=ds;is=us;const fo={loaded:us,total:ds,progress:ds?us/ds:void 0,bytes:hs,rate:ps||void 0,estimated:ps&&ds&&io?(ds-us)/ps:void 0,event:as,lengthComputable:ds!=null,[Mn?"download":"upload"]:!0};Fn(fo)},rs)},progressEventDecorator=(Fn,Mn)=>{const rs=Fn!=null;return[is=>Mn[0]({lengthComputable:rs,total:Fn,loaded:is}),Mn[1]]},asyncDecorator=Fn=>(...Mn)=>utils$i.asap(()=>Fn(...Mn)),isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const Mn=/(msie|trident)/i.test(navigator.userAgent),rs=document.createElement("a");let is;function os(as){let us=as;return Mn&&(rs.setAttribute("href",us),us=rs.href),rs.setAttribute("href",us),{href:rs.href,protocol:rs.protocol?rs.protocol.replace(/:$/,""):"",host:rs.host,search:rs.search?rs.search.replace(/^\?/,""):"",hash:rs.hash?rs.hash.replace(/^#/,""):"",hostname:rs.hostname,port:rs.port,pathname:rs.pathname.charAt(0)==="/"?rs.pathname:"/"+rs.pathname}}return is=os(window.location.href),function(us){const ds=utils$i.isString(us)?os(us):us;return ds.protocol===is.protocol&&ds.host===is.host}}():function(){return function(){return!0}}(),cookies=platform.hasStandardBrowserEnv?{write(Fn,Mn,rs,is,os,as){const us=[Fn+"="+encodeURIComponent(Mn)];utils$i.isNumber(rs)&&us.push("expires="+new Date(rs).toGMTString()),utils$i.isString(is)&&us.push("path="+is),utils$i.isString(os)&&us.push("domain="+os),as===!0&&us.push("secure"),document.cookie=us.join("; ")},read(Fn){const Mn=document.cookie.match(new RegExp("(^|;\\s*)("+Fn+")=([^;]*)"));return Mn?decodeURIComponent(Mn[3]):null},remove(Fn){this.write(Fn,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(Fn){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(Fn)}function combineURLs(Fn,Mn){return Mn?Fn.replace(/\/?\/$/,"")+"/"+Mn.replace(/^\/+/,""):Fn}function buildFullPath(Fn,Mn){return Fn&&!isAbsoluteURL(Mn)?combineURLs(Fn,Mn):Mn}const headersToObject=Fn=>Fn instanceof AxiosHeaders?{...Fn}:Fn;function mergeConfig(Fn,Mn){Mn=Mn||{};const rs={};function is(ps,io,fo){return utils$i.isPlainObject(ps)&&utils$i.isPlainObject(io)?utils$i.merge.call({caseless:fo},ps,io):utils$i.isPlainObject(io)?utils$i.merge({},io):utils$i.isArray(io)?io.slice():io}function os(ps,io,fo){if(utils$i.isUndefined(io)){if(!utils$i.isUndefined(ps))return is(void 0,ps,fo)}else return is(ps,io,fo)}function as(ps,io){if(!utils$i.isUndefined(io))return is(void 0,io)}function us(ps,io){if(utils$i.isUndefined(io)){if(!utils$i.isUndefined(ps))return is(void 0,ps)}else return is(void 0,io)}function ds(ps,io,fo){if(fo in Mn)return is(ps,io);if(fo in Fn)return is(void 0,ps)}const hs={url:as,method:as,data:as,baseURL:us,transformRequest:us,transformResponse:us,paramsSerializer:us,timeout:us,timeoutMessage:us,withCredentials:us,withXSRFToken:us,adapter:us,responseType:us,xsrfCookieName:us,xsrfHeaderName:us,onUploadProgress:us,onDownloadProgress:us,decompress:us,maxContentLength:us,maxBodyLength:us,beforeRedirect:us,transport:us,httpAgent:us,httpsAgent:us,cancelToken:us,socketPath:us,responseEncoding:us,validateStatus:ds,headers:(ps,io)=>os(headersToObject(ps),headersToObject(io),!0)};return utils$i.forEach(Object.keys(Object.assign({},Fn,Mn)),function(io){const fo=hs[io]||os,mo=fo(Fn[io],Mn[io],io);utils$i.isUndefined(mo)&&fo!==ds||(rs[io]=mo)}),rs}const resolveConfig=Fn=>{const Mn=mergeConfig({},Fn);let{data:rs,withXSRFToken:is,xsrfHeaderName:os,xsrfCookieName:as,headers:us,auth:ds}=Mn;Mn.headers=us=AxiosHeaders.from(us),Mn.url=buildURL(buildFullPath(Mn.baseURL,Mn.url),Fn.params,Fn.paramsSerializer),ds&&us.set("Authorization","Basic "+btoa((ds.username||"")+":"+(ds.password?unescape(encodeURIComponent(ds.password)):"")));let hs;if(utils$i.isFormData(rs)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)us.setContentType(void 0);else if((hs=us.getContentType())!==!1){const[ps,...io]=hs?hs.split(";").map(fo=>fo.trim()).filter(Boolean):[];us.setContentType([ps||"multipart/form-data",...io].join("; "))}}if(platform.hasStandardBrowserEnv&&(is&&utils$i.isFunction(is)&&(is=is(Mn)),is||is!==!1&&isURLSameOrigin(Mn.url))){const ps=os&&as&&cookies.read(as);ps&&us.set(os,ps)}return Mn},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(Fn){return new Promise(function(rs,is){const os=resolveConfig(Fn);let as=os.data;const us=AxiosHeaders.from(os.headers).normalize();let{responseType:ds,onUploadProgress:hs,onDownloadProgress:ps}=os,io,fo,mo,Ao,$o;function Lo(){Ao&&Ao(),$o&&$o(),os.cancelToken&&os.cancelToken.unsubscribe(io),os.signal&&os.signal.removeEventListener("abort",io)}let Go=new XMLHttpRequest;Go.open(os.method.toUpperCase(),os.url,!0),Go.timeout=os.timeout;function Yo(){if(!Go)return;const Jo=AxiosHeaders.from("getAllResponseHeaders"in Go&&Go.getAllResponseHeaders()),_l={data:!ds||ds==="text"||ds==="json"?Go.responseText:Go.response,status:Go.status,statusText:Go.statusText,headers:Jo,config:Fn,request:Go};settle(function(Sl){rs(Sl),Lo()},function(Sl){is(Sl),Lo()},_l),Go=null}"onloadend"in Go?Go.onloadend=Yo:Go.onreadystatechange=function(){!Go||Go.readyState!==4||Go.status===0&&!(Go.responseURL&&Go.responseURL.indexOf("file:")===0)||setTimeout(Yo)},Go.onabort=function(){Go&&(is(new AxiosError("Request aborted",AxiosError.ECONNABORTED,Fn,Go)),Go=null)},Go.onerror=function(){is(new AxiosError("Network Error",AxiosError.ERR_NETWORK,Fn,Go)),Go=null},Go.ontimeout=function(){let xl=os.timeout?"timeout of "+os.timeout+"ms exceeded":"timeout exceeded";const _l=os.transitional||transitionalDefaults;os.timeoutErrorMessage&&(xl=os.timeoutErrorMessage),is(new AxiosError(xl,_l.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,Fn,Go)),Go=null},as===void 0&&us.setContentType(null),"setRequestHeader"in Go&&utils$i.forEach(us.toJSON(),function(xl,_l){Go.setRequestHeader(_l,xl)}),utils$i.isUndefined(os.withCredentials)||(Go.withCredentials=!!os.withCredentials),ds&&ds!=="json"&&(Go.responseType=os.responseType),ps&&([mo,$o]=progressEventReducer(ps,!0),Go.addEventListener("progress",mo)),hs&&Go.upload&&([fo,Ao]=progressEventReducer(hs),Go.upload.addEventListener("progress",fo),Go.upload.addEventListener("loadend",Ao)),(os.cancelToken||os.signal)&&(io=Jo=>{Go&&(is(!Jo||Jo.type?new CanceledError(null,Fn,Go):Jo),Go.abort(),Go=null)},os.cancelToken&&os.cancelToken.subscribe(io),os.signal&&(os.signal.aborted?io():os.signal.addEventListener("abort",io)));const Wo=parseProtocol(os.url);if(Wo&&platform.protocols.indexOf(Wo)===-1){is(new AxiosError("Unsupported protocol "+Wo+":",AxiosError.ERR_BAD_REQUEST,Fn));return}Go.send(as||null)})},composeSignals=(Fn,Mn)=>{let rs=new AbortController,is;const os=function(hs){if(!is){is=!0,us();const ps=hs instanceof Error?hs:this.reason;rs.abort(ps instanceof AxiosError?ps:new CanceledError(ps instanceof Error?ps.message:ps))}};let as=Mn&&setTimeout(()=>{os(new AxiosError(`timeout ${Mn} of ms exceeded`,AxiosError.ETIMEDOUT))},Mn);const us=()=>{Fn&&(as&&clearTimeout(as),as=null,Fn.forEach(hs=>{hs&&(hs.removeEventListener?hs.removeEventListener("abort",os):hs.unsubscribe(os))}),Fn=null)};Fn.forEach(hs=>hs&&hs.addEventListener&&hs.addEventListener("abort",os));const{signal:ds}=rs;return ds.unsubscribe=us,[ds,()=>{as&&clearTimeout(as),as=null}]},streamChunk=function*(Fn,Mn){let rs=Fn.byteLength;if(!Mn||rs<Mn){yield Fn;return}let is=0,os;for(;is<rs;)os=is+Mn,yield Fn.slice(is,os),is=os},readBytes=async function*(Fn,Mn,rs){for await(const is of Fn)yield*streamChunk(ArrayBuffer.isView(is)?is:await rs(String(is)),Mn)},trackStream=(Fn,Mn,rs,is,os)=>{const as=readBytes(Fn,Mn,os);let us=0,ds,hs=ps=>{ds||(ds=!0,is&&is(ps))};return new ReadableStream({async pull(ps){try{const{done:io,value:fo}=await as.next();if(io){hs(),ps.close();return}let mo=fo.byteLength;if(rs){let Ao=us+=mo;rs(Ao)}ps.enqueue(new Uint8Array(fo))}catch(io){throw hs(io),io}},cancel(ps){return hs(ps),as.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(Fn=>Mn=>Fn.encode(Mn))(new TextEncoder):async Fn=>new Uint8Array(await new Response(Fn).arrayBuffer())),test=(Fn,...Mn)=>{try{return!!Fn(...Mn)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let Fn=!1;const Mn=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return Fn=!0,"half"}}).headers.has("Content-Type");return Fn&&!Mn}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$i.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(Fn=>Fn.body)};isFetchSupported&&(Fn=>{["text","arrayBuffer","blob","formData","stream"].forEach(Mn=>{!resolvers[Mn]&&(resolvers[Mn]=utils$i.isFunction(Fn[Mn])?rs=>rs[Mn]():(rs,is)=>{throw new AxiosError(`Response type '${Mn}' is not supported`,AxiosError.ERR_NOT_SUPPORT,is)})})})(new Response);const getBodyLength=async Fn=>{if(Fn==null)return 0;if(utils$i.isBlob(Fn))return Fn.size;if(utils$i.isSpecCompliantForm(Fn))return(await new Request(Fn).arrayBuffer()).byteLength;if(utils$i.isArrayBufferView(Fn)||utils$i.isArrayBuffer(Fn))return Fn.byteLength;if(utils$i.isURLSearchParams(Fn)&&(Fn=Fn+""),utils$i.isString(Fn))return(await encodeText(Fn)).byteLength},resolveBodyLength=async(Fn,Mn)=>{const rs=utils$i.toFiniteNumber(Fn.getContentLength());return rs??getBodyLength(Mn)},fetchAdapter=isFetchSupported&&(async Fn=>{let{url:Mn,method:rs,data:is,signal:os,cancelToken:as,timeout:us,onDownloadProgress:ds,onUploadProgress:hs,responseType:ps,headers:io,withCredentials:fo="same-origin",fetchOptions:mo}=resolveConfig(Fn);ps=ps?(ps+"").toLowerCase():"text";let[Ao,$o]=os||as||us?composeSignals([os,as],us):[],Lo,Go;const Yo=()=>{!Lo&&setTimeout(()=>{Ao&&Ao.unsubscribe()}),Lo=!0};let Wo;try{if(hs&&supportsRequestStream&&rs!=="get"&&rs!=="head"&&(Wo=await resolveBodyLength(io,is))!==0){let Tl=new Request(Mn,{method:"POST",body:is,duplex:"half"}),Sl;if(utils$i.isFormData(is)&&(Sl=Tl.headers.get("content-type"))&&io.setContentType(Sl),Tl.body){const[$l,Pl]=progressEventDecorator(Wo,progressEventReducer(asyncDecorator(hs)));is=trackStream(Tl.body,DEFAULT_CHUNK_SIZE,$l,Pl,encodeText)}}utils$i.isString(fo)||(fo=fo?"include":"omit"),Go=new Request(Mn,{...mo,signal:Ao,method:rs.toUpperCase(),headers:io.normalize().toJSON(),body:is,duplex:"half",credentials:fo});let Jo=await fetch(Go);const xl=supportsResponseStream&&(ps==="stream"||ps==="response");if(supportsResponseStream&&(ds||xl)){const Tl={};["status","statusText","headers"].forEach(Dl=>{Tl[Dl]=Jo[Dl]});const Sl=utils$i.toFiniteNumber(Jo.headers.get("content-length")),[$l,Pl]=ds&&progressEventDecorator(Sl,progressEventReducer(asyncDecorator(ds),!0))||[];Jo=new Response(trackStream(Jo.body,DEFAULT_CHUNK_SIZE,$l,()=>{Pl&&Pl(),xl&&Yo()},encodeText),Tl)}ps=ps||"text";let _l=await resolvers[utils$i.findKey(resolvers,ps)||"text"](Jo,Fn);return!xl&&Yo(),$o&&$o(),await new Promise((Tl,Sl)=>{settle(Tl,Sl,{data:_l,headers:AxiosHeaders.from(Jo.headers),status:Jo.status,statusText:Jo.statusText,config:Fn,request:Go})})}catch(Jo){throw Yo(),Jo&&Jo.name==="TypeError"&&/fetch/i.test(Jo.message)?Object.assign(new AxiosError("Network Error",AxiosError.ERR_NETWORK,Fn,Go),{cause:Jo.cause||Jo}):AxiosError.from(Jo,Jo&&Jo.code,Fn,Go)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$i.forEach(knownAdapters,(Fn,Mn)=>{if(Fn){try{Object.defineProperty(Fn,"name",{value:Mn})}catch{}Object.defineProperty(Fn,"adapterName",{value:Mn})}});const renderReason=Fn=>`- ${Fn}`,isResolvedHandle=Fn=>utils$i.isFunction(Fn)||Fn===null||Fn===!1,adapters$1={getAdapter:Fn=>{Fn=utils$i.isArray(Fn)?Fn:[Fn];const{length:Mn}=Fn;let rs,is;const os={};for(let as=0;as<Mn;as++){rs=Fn[as];let us;if(is=rs,!isResolvedHandle(rs)&&(is=knownAdapters[(us=String(rs)).toLowerCase()],is===void 0))throw new AxiosError(`Unknown adapter '${us}'`);if(is)break;os[us||"#"+as]=is}if(!is){const as=Object.entries(os).map(([ds,hs])=>`adapter ${ds} `+(hs===!1?"is not supported by the environment":"is not available in the build"));let us=Mn?as.length>1?`since :
`+as.map(renderReason).join(`
`):" "+renderReason(as[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+us,"ERR_NOT_SUPPORT")}return is},adapters:knownAdapters};function throwIfCancellationRequested(Fn){if(Fn.cancelToken&&Fn.cancelToken.throwIfRequested(),Fn.signal&&Fn.signal.aborted)throw new CanceledError(null,Fn)}function dispatchRequest(Fn){return throwIfCancellationRequested(Fn),Fn.headers=AxiosHeaders.from(Fn.headers),Fn.data=transformData.call(Fn,Fn.transformRequest),["post","put","patch"].indexOf(Fn.method)!==-1&&Fn.headers.setContentType("application/x-www-form-urlencoded",!1),adapters$1.getAdapter(Fn.adapter||defaults$1.adapter)(Fn).then(function(is){return throwIfCancellationRequested(Fn),is.data=transformData.call(Fn,Fn.transformResponse,is),is.headers=AxiosHeaders.from(is.headers),is},function(is){return isCancel(is)||(throwIfCancellationRequested(Fn),is&&is.response&&(is.response.data=transformData.call(Fn,Fn.transformResponse,is.response),is.response.headers=AxiosHeaders.from(is.response.headers))),Promise.reject(is)})}const VERSION="1.7.4",validators$1={};["object","boolean","number","function","string","symbol"].forEach((Fn,Mn)=>{validators$1[Fn]=function(is){return typeof is===Fn||"a"+(Mn<1?"n ":" ")+Fn}});const deprecatedWarnings={};validators$1.transitional=function(Mn,rs,is){function os(as,us){return"[Axios v"+VERSION+"] Transitional option '"+as+"'"+us+(is?". "+is:"")}return(as,us,ds)=>{if(Mn===!1)throw new AxiosError(os(us," has been removed"+(rs?" in "+rs:"")),AxiosError.ERR_DEPRECATED);return rs&&!deprecatedWarnings[us]&&(deprecatedWarnings[us]=!0,console.warn(os(us," has been deprecated since v"+rs+" and will be removed in the near future"))),Mn?Mn(as,us,ds):!0}};function assertOptions(Fn,Mn,rs){if(typeof Fn!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const is=Object.keys(Fn);let os=is.length;for(;os-- >0;){const as=is[os],us=Mn[as];if(us){const ds=Fn[as],hs=ds===void 0||us(ds,as,Fn);if(hs!==!0)throw new AxiosError("option "+as+" must be "+hs,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(rs!==!0)throw new AxiosError("Unknown option "+as,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(Mn){this.defaults=Mn,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(Mn,rs){try{return await this._request(Mn,rs)}catch(is){if(is instanceof Error){let os;Error.captureStackTrace?Error.captureStackTrace(os={}):os=new Error;const as=os.stack?os.stack.replace(/^.+\n/,""):"";try{is.stack?as&&!String(is.stack).endsWith(as.replace(/^.+\n.+\n/,""))&&(is.stack+=`
`+as):is.stack=as}catch{}}throw is}}_request(Mn,rs){typeof Mn=="string"?(rs=rs||{},rs.url=Mn):rs=Mn||{},rs=mergeConfig(this.defaults,rs);const{transitional:is,paramsSerializer:os,headers:as}=rs;is!==void 0&&validator.assertOptions(is,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),os!=null&&(utils$i.isFunction(os)?rs.paramsSerializer={serialize:os}:validator.assertOptions(os,{encode:validators.function,serialize:validators.function},!0)),rs.method=(rs.method||this.defaults.method||"get").toLowerCase();let us=as&&utils$i.merge(as.common,as[rs.method]);as&&utils$i.forEach(["delete","get","head","post","put","patch","common"],$o=>{delete as[$o]}),rs.headers=AxiosHeaders.concat(us,as);const ds=[];let hs=!0;this.interceptors.request.forEach(function(Lo){typeof Lo.runWhen=="function"&&Lo.runWhen(rs)===!1||(hs=hs&&Lo.synchronous,ds.unshift(Lo.fulfilled,Lo.rejected))});const ps=[];this.interceptors.response.forEach(function(Lo){ps.push(Lo.fulfilled,Lo.rejected)});let io,fo=0,mo;if(!hs){const $o=[dispatchRequest.bind(this),void 0];for($o.unshift.apply($o,ds),$o.push.apply($o,ps),mo=$o.length,io=Promise.resolve(rs);fo<mo;)io=io.then($o[fo++],$o[fo++]);return io}mo=ds.length;let Ao=rs;for(fo=0;fo<mo;){const $o=ds[fo++],Lo=ds[fo++];try{Ao=$o(Ao)}catch(Go){Lo.call(this,Go);break}}try{io=dispatchRequest.call(this,Ao)}catch($o){return Promise.reject($o)}for(fo=0,mo=ps.length;fo<mo;)io=io.then(ps[fo++],ps[fo++]);return io}getUri(Mn){Mn=mergeConfig(this.defaults,Mn);const rs=buildFullPath(Mn.baseURL,Mn.url);return buildURL(rs,Mn.params,Mn.paramsSerializer)}}utils$i.forEach(["delete","get","head","options"],function(Mn){Axios.prototype[Mn]=function(rs,is){return this.request(mergeConfig(is||{},{method:Mn,url:rs,data:(is||{}).data}))}});utils$i.forEach(["post","put","patch"],function(Mn){function rs(is){return function(as,us,ds){return this.request(mergeConfig(ds||{},{method:Mn,headers:is?{"Content-Type":"multipart/form-data"}:{},url:as,data:us}))}}Axios.prototype[Mn]=rs(),Axios.prototype[Mn+"Form"]=rs(!0)});class CancelToken{constructor(Mn){if(typeof Mn!="function")throw new TypeError("executor must be a function.");let rs;this.promise=new Promise(function(as){rs=as});const is=this;this.promise.then(os=>{if(!is._listeners)return;let as=is._listeners.length;for(;as-- >0;)is._listeners[as](os);is._listeners=null}),this.promise.then=os=>{let as;const us=new Promise(ds=>{is.subscribe(ds),as=ds}).then(os);return us.cancel=function(){is.unsubscribe(as)},us},Mn(function(as,us,ds){is.reason||(is.reason=new CanceledError(as,us,ds),rs(is.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(Mn){if(this.reason){Mn(this.reason);return}this._listeners?this._listeners.push(Mn):this._listeners=[Mn]}unsubscribe(Mn){if(!this._listeners)return;const rs=this._listeners.indexOf(Mn);rs!==-1&&this._listeners.splice(rs,1)}static source(){let Mn;return{token:new CancelToken(function(os){Mn=os}),cancel:Mn}}}function spread(Fn){return function(rs){return Fn.apply(null,rs)}}function isAxiosError(Fn){return utils$i.isObject(Fn)&&Fn.isAxiosError===!0}const HttpStatusCode={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(HttpStatusCode).forEach(([Fn,Mn])=>{HttpStatusCode[Mn]=Fn});function createInstance(Fn){const Mn=new Axios(Fn),rs=bind$1(Axios.prototype.request,Mn);return utils$i.extend(rs,Axios.prototype,Mn,{allOwnKeys:!0}),utils$i.extend(rs,Mn,null,{allOwnKeys:!0}),rs.create=function(os){return createInstance(mergeConfig(Fn,os))},rs}const axios=createInstance(defaults$1);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(Mn){return Promise.all(Mn)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=Fn=>formDataToJSON(utils$i.isHTMLForm(Fn)?new FormData(Fn):Fn);axios.getAdapter=adapters$1.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;parseEther("1");function computeBreakEvenPrice(Fn,Mn,rs,is,os){var as=is==OPTIONS.CALL?1:-1,us=Fn*(1+as*(rs/Mn));return Number(us.toFixed(os))}function computeBigNumberRatio(Fn,Mn){return Fn.mul(parseUnits("1",6)).div(Mn).toNumber()/Math.pow(10,6)}async function computeCurrentPnL(Fn,Mn,rs,is,os,as,us){var ds=BigNumber$1.from(rs),hs=BigNumber$1.from(is),ps=BigNumber$1.from(os),io=Removedecimal(Number(ps)).toFixed(TOKEN_PRICE_USE_DECIMALS[as]);const fo=parseFloat(io);let mo=Fn/fo-1;mo=Math.max(-.025,Math.min(.025,mo));let Ao=0;if(us==OPTIONS.CALL)Ao=Math.max(0,mo);else if(us==OPTIONS.PUT)Ao=Math.abs(Math.min(0,mo));else throw"Invalid Option Type/Mode";let $o="0",Lo="0";return hs.eq(0)||ds.eq(0)||($o=((Ao*computeBigNumberRatio(hs,ds)-CHAIN_PARAMS_CONFIG[Mn].premium_per_cycle)*100).toFixed(2),Lo=((CHAIN_PARAMS_CONFIG[Mn].premium_per_cycle*computeBigNumberRatio(ds,hs)-Ao)*100).toFixed(4)),{CurrentLSPnl:$o,CurrentSSPnl:Lo}}async function getCurrentAPY(Fn,Mn,rs){let is=await getShortAPY(1440/CHAIN_PARAMS_CONFIG[Fn].cycle_duration,Fn,Mn,rs),os=await getShortAPY(7*24*60/CHAIN_PARAMS_CONFIG[Fn].cycle_duration,Fn,Mn,rs);return{shortLastDayAPY:is,shortLastWeekAPY:os}}async function tentativeStateForNextCycleNew(Fn,Mn,rs,is,os,as){let us=await fetchCycleInfo(is,os,as),ds,hs=us.last_settlement_time.toString(),ps=BigNumber$1.from(us.last_settlement_time).add(CHAIN_PARAMS_CONFIG[is].cycle_duration*60).toString(),io=BigNumber$1.from(us.longTokenSupply),fo=BigNumber$1.from(us.shortTokenSupply),mo,Ao;us.cycle_end_price,us.cycle_end_time,us.cycle_start_price,us.cycle_start_time,Ao=Number(BigNumber$1.from(us.cycle_start_price)),mo=BigNumber$1.from(us.cycle_start_time),ds={longTokenSupply:BigNumber$1.from(us.tentativeLongTokenSupply),shortTokenSupply:BigNumber$1.from(us.tentativeShortTokenSupply)};const $o=BigNumber$1.from(Math.pow(10,CHAIN_PARAMS_CONFIG[is].settlement_token_decimals).toString()),Lo=formatTimestamp(mo.toString()),Go=formatTimestamp((Number(mo)+CHAIN_PARAMS_CONFIG[is].cycle_duration*60).toString());let Yo=Removedecimal(Ao).toFixed(TOKEN_PRICE_USE_DECIMALS[os]),Wo=Number(Fn).toFixed(TOKEN_PRICE_USE_DECIMALS[os]),Jo=calculateEthDeviation(Number(Yo),2.5),xl=Jo.above.toFixed(TOKEN_PRICE_USE_DECIMALS[os]),_l=Jo.below.toFixed(TOKEN_PRICE_USE_DECIMALS[os]),Tl=calculatePercentageDifference(Number(io.div($o).toString()),Number(fo.div($o).toString())),Sl=calculatePercentageDifference(Number(ds.longTokenSupply.div($o).toString()),Number(ds.shortTokenSupply.div($o).toString())),$l=Number(io.mul(100).div($o).toString())/100,Pl=Number(fo.mul(100).div($o).toString())/100,Dl=Number(ds.longTokenSupply.mul(100).div($o).toString())/100,Ol=Number(ds.shortTokenSupply.mul(100).div($o).toString())/100,Rl="0",Vo="0",jo=0,Ho=0,Qo=Number(Yo);ds.longTokenSupply.eq(0)||ds.shortTokenSupply.eq(0)||(Vo=(CHAIN_PARAMS_CONFIG[is].premium_per_cycle*100*computeBigNumberRatio(ds.longTokenSupply,ds.shortTokenSupply)).toFixed(4),Ho=Number(computeBigNumberRatio(ds.shortTokenSupply,ds.longTokenSupply).toFixed(2)));const El=parseFloat(Yo);let Xo=rs/El-1;Xo=Math.max(-.025,Math.min(.025,Xo));let Al=0;if(as==OPTIONS.CALL)Al=Math.max(0,Xo);else if(as==OPTIONS.PUT)Al=Math.abs(Math.min(0,Xo));else throw"Invalid Option Type/Mode";let wl="0",yl="0";return fo.eq(0)||io.eq(0)||(jo=Number(computeBigNumberRatio(fo,io).toFixed(2)),Qo=computeBreakEvenPrice(Number(Yo),jo,CHAIN_PARAMS_CONFIG[is].premium_per_cycle,as,TOKEN_PRICE_USE_DECIMALS[os]),Rl=(CHAIN_PARAMS_CONFIG[is].premium_per_cycle*100*computeBigNumberRatio(io,fo)).toFixed(4),wl=((Al*computeBigNumberRatio(fo,io)-CHAIN_PARAMS_CONFIG[is].premium_per_cycle)*100).toFixed(2),yl=((CHAIN_PARAMS_CONFIG[is].premium_per_cycle*computeBigNumberRatio(io,fo)-Al)*100).toFixed(4)),{lastSettlementTime:hs,nextSettlementTime:ps,cycleStartTimestampFinal:Lo,tentativeCycleEndTimeFinal:Go,cycleStartPriceFinal:Yo,tentativeCycleEndPriceFinal:Wo,triggerPriceUp:xl,triggerPriceDown:_l,currentExpectedPremium:Rl,nextExpectedPremium:Vo,currentPercentageChart:Tl,nextPercentageChart:Sl,currentCyclelongTokenSupply:$l,currentCycleshortTokenSupply:Pl,nextCyclelongTokenSupply:Dl,nextCycleshortTokenSupply:Ol,currentLeverage:jo,nextLeverage:Ho,breakEvenPrice:Qo,CurrentLSPnl:wl,CurrentSSPnl:yl,shortLastDayAPY:"0.0",shortLastWeekAPY:"0.0"}}function calculateEthDeviation(Fn,Mn){if(Fn<0||Mn<0||Mn>=100)throw new Error("Invalid input. ETH value and threshold percentage must be positive.");const rs=Mn/100*Fn,is=Fn+rs,os=Fn-rs;return{above:is,below:os}}function formatTimestamp(Fn){const Mn=new Date(Fn*1e3),rs=Mn.getHours(),is=Mn.getMinutes(),os=Mn.getSeconds(),as=rs>=12?"PM":"AM",us=(rs%12===0?12:rs%12).toString().padStart(2,"0"),ds=is.toString().padStart(2,"0"),hs=os.toString().padStart(2,"0");return`${us}:${ds}:${hs} ${as}`}function Removedecimal(Fn){return Fn/Math.pow(10,18)}function calculatePercentageDifference(Fn,Mn){const rs=Fn+Mn,is=Number((Fn/rs*100).toFixed()),os=Number((Mn/rs*100).toFixed());return{longTokenPercentage:is,shortTokenPercentage:os}}function canCancel(Fn,Mn,rs,is){return Mn>Fn+rs+is}async function currentVaultIDs(Fn,Mn,rs){var Jo,xl;const is=TOKEN_NAME[Mn];if((xl=(Jo=CHOOSE_OPTION_TYPE[Fn])==null?void 0:Jo[Mn])==null||xl[rs],CHAIN_PARAMS_CONFIG[Fn].provider,!is)throw new Error("Invalid token, or option_type value");let as=await fetchCycleInfo(Fn,Mn,rs);const us=BigNumber$1.from(as.last_settlement_time),ds=CHAIN_PARAMS_CONFIG[Fn].cycle_duration*60,hs=CHAIN_PARAMS_CONFIG[Fn].scrapping_time,ps=Date.now()/1e3,io=Number(us.toString())+ds*Math.floor((ps-Number(us.toString()))/ds);var fo=Array.from({length:(io-Number(us.toString()))/ds+1},(_l,Tl)=>Number(us.toString())+Tl*ds);const mo=fo.map(function(_l){return{vault_time:_l,canCancel:canCancel(_l,ps,ds,hs)}}),Ao=mo.map(function(_l){return{vaultId:BigNumber$1.from(keccak256(pack(["string","uint256"],["LONG_TOKEN_DEPOSIT",_l.vault_time]))).toString(),canCancel:_l.canCancel,nextSettlementTime:io+ds}}),$o=mo.map(function(_l){return{vaultId:BigNumber$1.from(keccak256(pack(["string","uint256"],["SHORT_TOKEN_DEPOSIT",_l.vault_time]))).toString(),canCancel:_l.canCancel,nextSettlementTime:io+ds}}),Lo=mo.map(function(_l){return{vaultId:BigNumber$1.from(keccak256(pack(["string","uint256"],["LONG_TOKEN_WITHDRAWAL",_l.vault_time]))).toString(),canCancel:_l.canCancel,nextSettlementTime:io+ds}}),Go=mo.map(function(_l){return{vaultId:BigNumber$1.from(keccak256(pack(["string","uint256"],["SHORT_TOKEN_WITHDRAWAL",_l.vault_time]))).toString(),canCancel:_l.canCancel,nextSettlementTime:io+ds}}),Yo=mo.map(function(_l){return{vaultId:BigNumber$1.from(keccak256(pack(["string","uint256"],["LONG_TOKEN_SWITCH",_l.vault_time]))).toString(),canCancel:_l.canCancel,nextSettlementTime:io+ds}}),Wo=mo.map(function(_l){return{vaultId:BigNumber$1.from(keccak256(pack(["string","uint256"],["SHORT_TOKEN_SWITCH",_l.vault_time]))).toString(),canCancel:_l.canCancel,nextSettlementTime:io+ds}});return{longDepositTokenIds:Ao,shortDepositTokenIds:$o,longWithdrawalTokenIds:Lo,shortWithdrawalTokenIds:Go,longSwitchTokenIds:Yo,shortSwitchTokenIds:Wo}}const trxTypeMap_CALL=new Map([["buyLongToken(uint256)",["Long CALL OPerps Token Buy","LCO","Long","From Long CALL OPerps Token (BUY)","Buy"]],["buyShortToken(uint256)",["Short CALL OPerps Token Buy","SCO","Short","From Short CALL OPerps Token (BUY)","Buy"]],["cancelLongTokenBuy()",["Long CALL OPerps Token Buy","LCO","Long","From Long CALL OPerps Token (BUY)","Buy"]],["cancelShortTokenBuy",["Short CALL OPerps Token Buy","SCO","Short","From Short CALL OPerps Token (BUY)","Buy"]],["sellLongToken(uint256)",["Long CALL OPerps Token Sell","LCO","Long","From Long CALL OPerps Token (SELL)","Sell"]],["sellShortToken(uint256)",["Short CALL OPerps Token Sell","SCO","Short","From Short CALL OPerps Token (SELL)","Sell"]],["cancelLongTokenSell()",["Long CALL OPerps Token Sell","LCO","Long","From Long CALL OPerps Token (SELL)","Sell"]],["cancelShortTokenSell()",["Short CALL OPerps Token Sell","SCO","Short","From Short CALL OPerps Token (SELL)","Sell"]]]),trxTypeMap_PUT=new Map([["buyLongToken(uint256)",["Long PUT OPerps Token Buy","LPO","Long","From Long PUT OPerps Token (BUY)","Buy"]],["buyShortToken(uint256)",["Short PUT OPerps Token Buy","SPO","Short","From Short PUT OPerps Token (BUY)","Buy"]],["cancelLongTokenBuy()",["Long PUT OPerps Token Buy","LPO","Long","From Long PUT OPerps Token (BUY)","Buy"]],["cancelShortTokenBuy",["Short PUT OPerps Token Buy","SPO","Short","From Short PUT OPerps Token (BUY)","Buy"]],["sellLongToken(uint256)",["Long PUT OPerps Token Sell","LPO","Long","From Long PUT OPerps Token (SELL)","Sell"]],["sellShortToken(uint256)",["Short PUT OPerps Token Sell","SPO","Short","From Short PUT OPerps Token (SELL)","Sell"]],["cancelLongTokenSell()",["Long PUT OPerps Token Sell","LPO","Long","From Long PUT OPerps Token (SELL)","Sell"]],["cancelShortTokenSell()",["Short PUT OPerps Token Sell","SPO","Short","From Short PUT OPerps Token (SELL)","Sell"]]]),functionSignatureDict={"0x7b6ee8a0":{transaction_type:"buyLongToken(uint256)",vaultTokenAmountMultiplier:1},"0x085f2665":{transaction_type:"buyShortToken(uint256)",vaultTokenAmountMultiplier:1},"0xc0b18cee":{transaction_type:"cancelLongTokenBuy()",vaultTokenAmountMultiplier:-1},"0x00804375":{transaction_type:"cancelLongTokenSell()",vaultTokenAmountMultiplier:-1},"0xfaddd238":{transaction_type:"sellLongToken(uint256)",vaultTokenAmountMultiplier:1},"0x7f28f496":{transaction_type:"sellShortToken(uint256)",vaultTokenAmountMultiplier:1},"0xb2d37b6d":{transaction_type:"cancelShortTokenBuy()",vaultTokenAmountMultiplier:-1},"0xb4d121a0":{transaction_type:"cancelShortTokenSell()",vaultTokenAmountMultiplier:-1}};function truncateDecimals(Fn,Mn){var rs=Fn.indexOf(".");return rs==-1?Fn:Fn.substr(0,rs+Mn+1)}const writeTransactionRow=async(Fn,Mn,rs,is,os,as)=>{var Rl,Vo;const us=new Interface(["event Transfer(address indexed from, address indexed to, uint256 value)"]),ds=new Interface(["event TransferSingle(address indexed _operator, address indexed from, address indexed to, uint256 id, uint256 value)"]),hs=new Interface(["function handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address)"]),ps=new Interface(["function executeBatch(address[],uint256[],bytes[])"]),fo=CHAIN_PARAMS_CONFIG[is].provider,mo=await fo.getTransaction(Fn.transactionHash),Ao=(await fo.getBlock(Fn.blockHash)).timestamp;let $o=mo.data.substring(0,10),Lo="",Go=mo.data;const Yo=TOKEN_NAME[os],Wo=(Vo=(Rl=CHOOSE_OPTION_TYPE[is])==null?void 0:Rl[os])==null?void 0:Vo[as];if(!Yo||!Wo.Controller)throw new Error("Invalid token, or option_type value");if($o=="0x1fad948c"){const jo=hs.decodeFunctionData("handleOps((address,uint256,bytes,bytes,uint256,uint256,uint256,uint256,uint256,bytes,bytes)[],address)",mo.data);Lo=jo[0][0][0];const Ho=ps.decodeFunctionData("executeBatch(address[],uint256[],bytes[])",jo[0][0][3]);Ho[0].includes(Wo.Controller)&&(Ho[0].length===2?($o=Ho[2][1].substring(0,10),Go=Ho[2][1]):Ho[0].length===1&&($o=Ho[2][0].substring(0,10),Go=Ho[2][0]))}const Jo=functionSignatureDict[$o];if(!Jo){console.log("Function signature not found in our map. Not writing this transaction in the database");return}const xl=Fn.logs.filter(jo=>jo.topics[0]===us.getEventTopic("Transfer")),_l=formatUnits(us.parseLog(xl[0]).args.value.toString(),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals),Tl=Fn.logs.filter(jo=>jo.topics[0]===ds.getEventTopic("TransferSingle")),Sl=ds.parseLog(Tl[0]).args,$l={chain_id:CHAIN_PARAMS_CONFIG[is].name,chain:is,token:os,option_type:as,transaction_hash:Fn.transactionHash,user_walletaddress:Lo==""?Fn.from:Lo,from_address:Fn.from,to_address:Fn.to,transaction_type:Jo.transaction_type,block_timestamp:new Date(Ao*1e3).toISOString(),timestamp_number:Ao,block_number:Fn.blockNumber,value:_l,orig_value:_l,input_data:Go,vault_id:Sl.id.toString(),vault_shares:Sl.value.mul(Jo.vaultTokenAmountMultiplier).toString(),investment_sold:rs.toString(),end_of_trade:Mn},Pl=await generateRandomDataAndNonce(),Dl={method:"POST",headers:{"Content-Type":"application/json","x-nonce":Pl.nonceValue,"x-hash":Pl.hash},body:JSON.stringify({row:$l})},Ol=`${SWITCHBACKENDURL}/writeTransaction`;try{console.log("calling writeTransaction on backend for trx_hash:",Fn.transactionHash);const Ho=await(await fetch(Ol,Dl)).json();return console.log("Received response",Ho),Ho.data}catch(jo){console.error("Error writeTransactionRow data:",jo)}},fetchVaultWiseInvestment=async(Fn,Mn,rs,is)=>{const os={chain:Mn,token:rs,option_type:is},as=await generateRandomDataAndNonce(),us={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","x-nonce":as.nonceValue,"x-hash":as.hash},body:JSON.stringify(os)},ds=`${SWITCHBACKENDURL}/vaultWiseInvestment?address=${Fn}`;try{return(await(await fetch(ds,us)).json()).data}catch(hs){console.error("Error fetchVaultWiseInvestment data:",hs)}},fetchVaultWiseWithdrawal=async(Fn,Mn,rs,is)=>{const os={chain:Mn,token:rs,option_type:is},as=await generateRandomDataAndNonce(),us={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","x-nonce":as.nonceValue,"x-hash":as.hash},body:JSON.stringify(os)},ds=`${SWITCHBACKENDURL}/vaultWiseWithdrawal?address=${Fn}`;try{return(await(await fetch(ds,us)).json()).data}catch(hs){console.error("Error fetchVaultWiseWithdrawal data:",hs)}},fetchCycleInfo=async(Fn,Mn,rs)=>{const is=localStorage.getItem("allCycleData");if(is)return JSON.parse(is).find(us=>us.chain===Fn&&us.token===Mn&&us.option_type===rs)},fetchTokenPrices=async Fn=>{const Mn=localStorage.getItem("allCycleData");if(Mn)return JSON.parse(Mn).filter(os=>os.chain===Fn)},fetchgHistoryData=async(Fn,Mn)=>{const rs=await generateRandomDataAndNonce(),is={method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json","x-nonce":rs.nonceValue,"x-hash":rs.hash}},os=`${SWITCHBACKENDURL}/multiMarketHistory?address=${Fn}&chain=${Mn}`;try{return(await(await fetch(os,is)).json()).data}catch(as){console.error("Error in fetchgHistoryData :",as)}},preventPasteNegativeNumber=Fn=>{const rs=(Fn.clipboardData||window.clipboardData).getData("text");(!rs||rs.includes("-")||parseFloat(rs)<0)&&Fn.preventDefault()};async function updateMultiMarketOpenOrdersReceiveValue(Fn,Mn){for(const[rs,is]of Object.entries(Fn))for(const[os,as]of Object.entries(is)){const us=Mn[rs][os];Fn[rs][os]=await updateOpenOrdersReceiveValue(as,us.CurrentLSPnl,us.CurrentSSPnl)}return Fn}async function updateOpenOrdersReceiveValue(Fn,Mn,rs){if(Fn!=null)return Fn.forEach(function(is,os){is.in_vaule=is.out_vaule*(is.side==="Buy"?is.direction==="Long"?.99:1:1+(is.direction==="Long"?Mn:rs)/100)}),Fn}async function updateMultiMarketPnLs(Fn,Mn){for(const[rs,is]of Object.entries(Fn))for(const[os,as]of Object.entries(is)){const us=Mn[rs][os];Fn[rs][os]=await updateAllPnLs(as,us.CurrentLSPnl,us.CurrentSSPnl)}return Fn}async function updateAllPnLs(Fn,Mn,rs){if(Fn!=null)return Fn.longClaims.forEach(function(is,os){is.Balance=is.onChainBalance*(1+Mn/100),is.pnl=is.Balance-is["Invested Amount"]}),Fn.shortClaims.forEach(function(is,os){is.Balance=is.onChainBalance*(1+rs/100),is.pnl=is.Balance-is["Invested Amount"]}),Fn.inWalletLongItem.Balance=Fn.inWalletLongItem.onChainBalance*(1+Mn/100),Fn.inWalletLongItem.pnl=Fn.inWalletLongItem.Balance-Fn.inWalletLongItem["Invested Amount"],Fn.inWalletShortItem.Balance=Fn.inWalletShortItem.onChainBalance*(1+rs/100),Fn.inWalletShortItem.pnl=Fn.inWalletShortItem.Balance-Fn.inWalletShortItem["Invested Amount"],Fn.totalLongItem.Balance=Fn.totalLongItem.onChainBalance*(1+Mn/100),Fn.totalLongItem.pnl=Fn.totalLongItem.Balance-Fn.totalLongItem["Invested Amount"],Fn.totalShortItem.Balance=Fn.totalShortItem.onChainBalance*(1+rs/100),Fn.totalShortItem.pnl=Fn.totalShortItem.Balance-Fn.totalShortItem["Invested Amount"],Fn}async function getActiveClaims(Fn,Mn,rs,is){let os=await fetchCycleInfo(Mn,rs,is);const as=Number(os.cycle_end_time);var us=await fetchVaultWiseInvestment(Fn,Mn,rs,is);const ds=await currentVaultIDs(Mn,rs,is);var hs=ds.longDepositTokenIds.map($o=>$o.vaultId),ps=ds.shortDepositTokenIds.map($o=>$o.vaultId);us=us.filter($o=>!(hs.includes($o.vault_id)||ps.includes($o.vault_id)));const io=await Promise.all(us.map(async $o=>$o.vault_id)),fo=new Contract(CHAIN_PARAMS_CONFIG[Mn].info_aggregator_address,ABI.InfoAggregator,CHAIN_PARAMS_CONFIG[Mn].provider),[mo,Ao]=await fo.getVaultShareAndClaimBalance(Fn,io,rs,is);return us.forEach(function($o,Lo){$o.entryTime=Number($o.entryTime)+(as-Number($o.entryTime))%(CHAIN_PARAMS_CONFIG[Mn].cycle_duration*60),$o.entryTime=new Date($o.entryTime*1e3).toISOString(),$o.direction=$o.buyLongAmount!=0?"Long":"Short",$o["Invested Amount"]=$o.buyLongAmount!=0?$o.buyLongAmount:$o.buyShortAmount,$o.onChainBalance=formatUnits([mo[Lo]].toString(),CHAIN_PARAMS_CONFIG[Mn].settlement_token_decimals),$o.onChainBalance=Number(truncateDecimals($o.onChainBalance,6)),$o.shareBalance=Ao[Lo]}),us}async function getMultiMarketActiveClaims(Fn,Mn){let rs={};return await Promise.all(CHAIN_TOKEN_MAP[Mn].map(async function(is){var os=is.split("_")[0],as=is.split("_")[1];const us=await getActiveClaims(Fn,Mn,os,as);rs[os]===void 0&&(rs[os]={}),rs[os][as]=us})),rs}async function getMultiMarketPositionData(Fn,Mn,rs,is){const os={};for(const[as,us]of Object.entries(Fn)){os[as]={};for(const[ds,hs]of Object.entries(us)){const ps=rs[as][ds],io=Mn[as][ds];os[as][ds]=await getAllPnLs(Fn[as][ds],io,ps.CurrentLSPnl,ps.CurrentSSPnl,is,as,ds)}}return os}async function getAllPnLs(Fn,Mn,rs,is,os,as,us){rs=isNaN(rs)?0:rs,is=isNaN(is)?0:is,Fn.forEach(function(Qo){Qo.Balance=Qo.onChainBalance*(1+(Qo.buyLongAmount!=0?rs:is)/100)});const ds=Fn.filter(Qo=>Qo.shareBalance.gt(0)&&(Qo.buyLongAmount>0||Qo.buyShortAmount>0));let hs=0,ps=0;for(let Qo=0;Qo<Fn.length;Qo++)hs+=Fn[Qo].buyLongAmount-Fn[Qo].sellLongAmount,ps+=Fn[Qo].buyShortAmount-Fn[Qo].sellShortAmount;await Promise.all(ds.map(async Qo=>(Qo.status="In Vault",Qo.pnl=Qo.Balance-Qo["Invested Amount"],Qo.token=as,Qo.option_type=us,Qo)));const io=ds.filter(Qo=>Qo.direction=="Long"),fo=ds.filter(Qo=>Qo.direction=="Short"),mo=io.map(Qo=>Qo.buyLongAmount).reduce((Qo,El)=>Qo+El,0),Ao=fo.map(Qo=>Qo.buyShortAmount).reduce((Qo,El)=>Qo+El,0),$o=io.map(Qo=>Qo.Balance).reduce((Qo,El)=>Qo+El,0),Lo=fo.map(Qo=>Qo.Balance).reduce((Qo,El)=>Qo+El,0),Go=io.map(Qo=>Qo.onChainBalance).reduce((Qo,El)=>Qo+El,0),Yo=fo.map(Qo=>Qo.onChainBalance).reduce((Qo,El)=>Qo+El,0),Wo=hs-mo,Jo=ps-Ao;var xl=Mn.longToken?Mn.longToken:0,_l=Mn.shortToken?Mn.shortToken:0;xl=xl<.01?0:xl,_l=_l<.01?0:_l;const Tl=xl*(1+rs/100),Sl=_l*(1+is/100),$l=$o+Tl,Pl=Lo+Sl,Dl=Go+xl,Ol=Yo+_l,Rl={entryTime:"...",token:as,option_type:us,direction:"Long","Invested Amount":Wo,onChainBalance:xl,Balance:Tl,pnl:Tl-Wo,status:"In Wallet"},Vo={entryTime:"...",token:as,option_type:us,direction:"Short","Invested Amount":Jo,onChainBalance:_l,Balance:Sl,pnl:Sl-Jo,status:"In Wallet"},jo={entryTime:"Total",token:as,option_type:us,direction:"Long","Invested Amount":hs,onChainBalance:Dl,Balance:$l,pnl:$l-hs,status:"..."},Ho={entryTime:"Total",token:as,option_type:us,direction:"Short","Invested Amount":ps,onChainBalance:Ol,Balance:Pl,pnl:Pl-ps,status:"..."};return{totalLongItem:jo,inWalletLongItem:Rl,longClaims:io,totalShortItem:Ho,inWalletShortItem:Vo,shortClaims:fo}}async function getMultiMarketCurrentPnL(Fn){const Mn=await fetchTokenPrices(Fn);if(Mn){let rs={};return Mn.forEach(async function(is,os){const as=is.token,us=is.option_type;let ds=(is.cycle_end_price/Math.pow(10,18)).toFixed(TOKEN_PRICE_USE_DECIMALS[as]),hs=await computeCurrentPnL(ds,Fn,is.longTokenSupply,is.shortTokenSupply,is.cycle_start_price,as,us);rs[as]===void 0&&(rs[as]={}),rs[as][us]=hs}),rs}else return null}async function getAllWithdrawals(Fn,Mn,rs,is){var Jo,xl;const os=TOKEN_NAME[rs],as=(xl=(Jo=CHOOSE_OPTION_TYPE[Mn])==null?void 0:Jo[rs])==null?void 0:xl[is];if(!os||!as.Vault)throw new Error("Invalid token, or option_type value");let us=await fetchCycleInfo(Mn,rs,is);const ds=Number(us.cycle_end_time),hs=await fetchVaultWiseWithdrawal(Fn,Mn,rs,is),ps=await Promise.all(hs.map(async _l=>_l.vault_id)),fo=await new Contract(as.Vault,ABI.Vault,CHAIN_PARAMS_CONFIG[Mn].provider).batchBalanceOfClaimTokens(Fn,ps);hs.forEach(function(_l,Tl){_l.exitTime=Number(_l.exitTime)+(ds-Number(_l.exitTime))%(CHAIN_PARAMS_CONFIG[Mn].cycle_duration*60),_l.exitTime=new Date(_l.exitTime*1e3).toISOString(),_l.direction=_l.sellLongAmount!=0?"Long":"Short",_l.Balance=Number(truncateDecimals(formatUnits([fo[Tl]].toString(),CHAIN_PARAMS_CONFIG[Mn].settlement_token_decimals),6)).toFixed(2)});const mo=hs.filter(_l=>_l.Balance>=.01);await Promise.all(mo.map(async _l=>(_l.token=rs,_l.option_type=is,_l)));let Ao=0,$o=0;for(let _l=0;_l<mo.length;_l++)Ao+=mo[_l].sellLongAmount,$o=mo[_l].sellShortAmount;const Lo=mo.filter(_l=>_l.direction=="Long"),Go=mo.filter(_l=>_l.direction=="Short");return{totalLongItem:{exitTime:"Total",token:rs,option_type:is,direction:"Long",Balance:Ao},longClaims:Lo,totalShortItem:{exitTime:"Total",token:rs,option_type:is,direction:"Short",Balance:$o},shortClaims:Go}}async function getMultiMarketWithdrawals(Fn,Mn){let rs={};return await Promise.all(CHAIN_TOKEN_MAP[Mn].map(async function(is){var os=is.split("_")[0],as=is.split("_")[1];const us=await getAllWithdrawals(Fn,Mn,os,as);rs[os]===void 0&&(rs[os]={}),rs[os][as]=us})),rs}async function getMultiMarketHistory(Fn,Mn,rs){const is=await fetchgHistoryData(Fn,rs);try{return is?await Promise.all(is.map(async as=>{const us=new Date(as.timestamp_number*1e3);let ds=new Date(us);var hs={year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"numeric",hour12:!0};let ps=ds.toLocaleString("en-US",hs),io=trxTypeMap_CALL.get(as.transaction_type);return as.option_type==OPTIONS.PUT&&(io=trxTypeMap_PUT.get(as.transaction_type)),as.time=ps,as.name=io[4],as.symbol=io[1],as})):[]}catch(os){throw console.error("Error:",os),os}}async function getMultiMarketOpenOrders(Fn,Mn,rs,is){let os={};return await Promise.all(CHAIN_TOKEN_MAP[is].map(async function(as){const[us,ds]=as.split("_");if(rs==null&&(rs=await getMultiMarketCurrentPnL(is)),!rs[us]||!rs[us][ds]){console.warn(`PnL data missing for token: ${us}, option_type: ${ds}`);return}const hs=await getOpenOrders(Fn,Mn,rs[us][ds].CurrentLSPnl,rs[us][ds].CurrentSSPnl,is,us,ds);os[us]===void 0&&(os[us]={}),os[us][ds]=hs})),os}async function getOpenOrders(Fn,Mn,rs,is,os,as,us){var xl,_l;rs=isNaN(rs)?0:rs,is=isNaN(is)?0:is;const ds=CHAIN_PARAMS_CONFIG[os],hs=TOKEN_NAME[as],ps=(_l=(xl=CHOOSE_OPTION_TYPE[os])==null?void 0:xl[as])==null?void 0:_l[us];if(!ds||!hs||!ps)throw new Error("Invalid chain, token, or option_type value");const io=await currentVaultIDs(os,as,us),fo=new Contract(ps.Vault,ABI.Vault,Mn);let mo=io.longDepositTokenIds.map(function(Tl){return{id:Tl.vaultId,name:"Long "+us+" OPerps Token Buy",side:"Buy",symbol:"L"+us.charAt(0)+"O",can_cancel:Tl.canCancel,nextSettlementTime:Tl.nextSettlementTime,direction:"Long",token:as,option_type:us}}),Ao=io.longWithdrawalTokenIds.map(function(Tl){return{id:Tl.vaultId,name:"Long "+us+" OPerps Token Sell",side:"Sell",symbol:"L"+us.charAt(0)+"O",can_cancel:Tl.canCancel,nextSettlementTime:Tl.nextSettlementTime,direction:"Long",token:as,option_type:us}}),$o=io.shortDepositTokenIds.map(function(Tl){return{id:Tl.vaultId,name:"Short "+us+" OPerps Token Buy",side:"Buy",symbol:"S"+us.charAt(0)+"O",can_cancel:Tl.canCancel,nextSettlementTime:Tl.nextSettlementTime,direction:"Short",token:as,option_type:us}}),Lo=io.shortWithdrawalTokenIds.map(function(Tl){return{id:Tl.vaultId,name:"Short "+us+" OPerps Token Sell",side:"Sell",symbol:"S"+us.charAt(0)+"O",can_cancel:Tl.canCancel,nextSettlementTime:Tl.nextSettlementTime,direction:"Short",token:as,option_type:us}}),Go=mo.concat(Ao,$o,Lo),Yo=Go.map(function(Tl){return Tl.id});const Wo=await fo.batchBalanceOfDepositTokens(Fn,Yo);return Go.forEach(function(Tl,Sl){Tl.balance=Number(truncateDecimals(formatUnits([Wo[Sl]].toString(),CHAIN_PARAMS_CONFIG[os].settlement_token_decimals),6)).toFixed(2),Tl.out_vaule=Tl.balance,Tl.in_vaule=Tl.out_vaule*(Tl.side==="Buy"?Tl.direction==="Long"?.99:1:1+(Tl.direction==="Long"?rs:is)/100),Tl.in_symbol=Tl.side==="Sell"?"USDC":Tl.symbol,Tl.out_symbol=Tl.side==="Buy"?"USDC":Tl.symbol}),Go.filter(Tl=>Tl.balance!=0)}const getERC20Allowance=async(Fn,Mn,rs,is)=>{const os=parseUnits(truncateDecimals(is.toString(),CHAIN_PARAMS_CONFIG[Fn].settlement_token_decimals),CHAIN_PARAMS_CONFIG[Fn].settlement_token_decimals);let as=!1;try{const ds=PROXY_ADDRESS_CONFIG[Fn].proxy_address,ps=await new Contract(ds,ABI.ProxyUSDC,Mn).allowance(Mn._address,rs);return Number(parseInt(ps._hex))>=Number(parseInt(os._hex))&&(as=!0),as}catch(us){return console.error("Error:",us),!1}};async function getLongShortHoldings(Fn,Mn){var rs=Fn!==null?Fn.totalLongItem.onChainBalance:0,is=Fn!==null?Fn.totalShortItem.onChainBalance:0;if(Mn&&Mn.length>0)for(const as of Mn)as.side=="Buy"&&(as.direction=="Long"?rs=rs+Number(as.balance):is=is+Number(as.balance));const os={long:rs,short:is};return console.log("final",os),os}async function getTiming(Fn,Mn,rs,is,os,as){return await tentativeStateForNextCycleNew(Fn,Mn,rs,is,os,as)}async function calculateValue(Fn,Mn,rs){const is=Number(Fn)*rs*Number(Mn.nextCyclelongTokenSupply)/(Number(Mn.nextCycleshortTokenSupply)-Number(Fn)*rs);return Math.abs(is)}async function calculateAmounttobeInvestedLong(Fn,Mn,rs,is,os){return calculateLong(Number(Mn.nextCyclelongTokenSupply),Number(Mn.nextCycleshortTokenSupply),CHAIN_PARAMS_CONFIG[is].premium_per_cycle,Number(Fn),rs/100,os)}async function calculateAmounttobeInvestedShort(Fn,Mn,rs,is,os){return calculateShort(Number(Mn.nextCyclelongTokenSupply),Number(Mn.nextCycleshortTokenSupply),CHAIN_PARAMS_CONFIG[is].premium_per_cycle,Number(Fn),rs/100,os)}function calculateLong(Fn,Mn,rs,is,os,as){let us=0;if(as==OPTIONS.CALL)us=Math.max(0,os);else if(as==OPTIONS.PUT)us=Math.abs(Math.min(0,os));else throw"Invalid Option Type/Mode";return us=Math.min(us,.025),((us*Mn-(Fn+is)*rs)*(is/(is+Fn))).toFixed(2)}function calculateShort(Fn,Mn,rs,is,os,as){let us=0;if(as==OPTIONS.CALL)us=Math.max(0,os);else if(as==OPTIONS.PUT)us=Math.abs(Math.min(0,os));else throw"Invalid Option Type/Mode";return us=Math.min(us,.025),((Fn*rs-us*(Mn+is))*(is/(is+Mn))).toFixed(2)}const getEventData=async(Fn,Mn,rs)=>{const is=await generateRandomDataAndNonce(),os={method:"GET",headers:{"Content-Type":"application/json","x-nonce":is.nonceValue,"x-hash":is.hash}};let as=await axios.get(`${SWITCHBACKENDURL}/fetchChartData?chain=${Fn}&token=${Mn}&option_type=${rs}`,os);return as==null?void 0:as.data.data},fetchRetData=async(Fn,Mn,rs,is)=>{const os={chain:Mn,token:rs,option_type:is},as=await generateRandomDataAndNonce(),us={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","x-nonce":as.nonceValue,"x-hash":as.hash},body:JSON.stringify(os)},ds=`${SWITCHBACKENDURL}/retData?numRows=${Fn}`;try{return(await(await fetch(ds,us)).json()).data}catch(hs){console.error("Error fetchRetData data:",hs)}};async function getShortAPY(Fn,Mn,rs,is){const as=(await fetchRetData(Fn,Mn,rs,is)).map((hs,ps)=>{const io=Number(hs.shortBefore);return io!==0?(Number(hs.shortAfter)-io)/io:0}),us=as.length;return((Math.pow(1+calculateGeometricMean(as,us),365*24*60/CHAIN_PARAMS_CONFIG[Mn].cycle_duration)-1)*100).toFixed(2)}async function getChart$1(Fn,Mn,rs){const is=await getEventData(Fn,Mn,rs);return is.day.slice(0,6).map((us,ds)=>{const{time:hs,date:ps}=formatDateTime(is.day.slice(0,7)[ds+1].blockTimeStamp),io=(Sl,$l)=>(($l-Sl)/Sl*100).toFixed(2),fo=io(us.longBefore,us.longAfter),mo=io(us.shortBefore,us.shortAfter),Ao=us.longBefore,$o=us.shortBefore;let Lo=null;const Go=formatDateTime(us.currentTime),Yo=formatDateTime(us.lastTime);Lo=calculateTimeDifference(Yo.date,Yo.time,Go.date,Go.time);const Wo=us.currentPrice,Jo=us.lastPrice,xl=calculateEthPriceDifference(Number(Wo),Number(Jo)).toFixed(2),_l=Number($o/Ao).toFixed(2),Tl=convertDate(ps);return{time:hs,date:ps,long:fo,short:mo,longValue:Ao,shortValue:$o,timeDuration:Lo,eth:xl,leverage:_l,shortdate:Tl}}).reverse()}function formatDateTime(Fn){const Mn=new Date(Fn*1e3),rs=new Date(Mn),is={year:"numeric",month:"2-digit",day:"2-digit"},os={hour:"2-digit",minute:"2-digit",hour12:!0},as=rs.toLocaleString(void 0,is);return{time:rs.toLocaleString(void 0,os).toLocaleUpperCase(),date:as}}function parseDateString(Fn,Mn){const[rs,is,os]=Fn.split("/").map(Number),[as,us]=Mn.split(" ");let[ds,hs]=as.split(":").map(Number);return us&&us.toLowerCase()==="pm"&&ds<12?ds+=12:us&&us.toLowerCase()==="am"&&ds===12&&(ds=0),new Date(os,is-1,rs,ds,hs)}function calculateTimeDifference(Fn,Mn,rs,is){const os=parseDateString(Fn,Mn),us=parseDateString(rs,is).getTime()-os.getTime(),ds=Math.floor(us/(1e3*60)%60);return`${Math.floor(us/(1e3*60*60))} Hrs ${ds} Mins`}function calculateEthPriceDifference(Fn,Mn){return(Fn-Mn)/Fn*100}function convertDate(Fn){const Mn=Fn.split("/");if(Mn.length===3){const rs=Mn[0];return Mn[1]+"/"+rs}else return"Invalid date"}function calculateGeometricMean(Fn,Mn){if(Mn<=0)throw new Error("n must be a positive integer");if(Fn.length!==Mn)throw new Error("The number of values must match n");const rs=Fn.reduce((os,as)=>os*(1+as),1);return Math.pow(rs,1/Mn)-1}function formatNumber$1(Fn,Mn=2){const is=[{suffix:"T",threshold:1e12},{suffix:"B",threshold:1e9},{suffix:"M",threshold:1e6},{suffix:"K",threshold:1e3},{suffix:"",threshold:1}].find(os=>Math.abs(Fn)>=os.threshold);return is?(Fn/is.threshold).toFixed(Mn)+is.suffix:Fn}const fetchQuestion=async Fn=>{const Mn=await generateRandomDataAndNonce(),rs={method:"GET",headers:{"Content-Type":"application/json","x-nonce":Mn.nonceValue,"x-hash":Mn.hash}},is=`${SWITCHBACKENDURL}/fetchQuestion?address=${Fn}`;try{return(await(await fetch(is,rs)).json()).message}catch(os){console.error("Error fetchProfitData data:",os)}},insertUserLimitationData=async(Fn,Mn,rs)=>{const is=await generateRandomDataAndNonce(),os={method:"GET",headers:{"Content-Type":"application/json","x-nonce":is.nonceValue,"x-hash":is.hash}},as=`${SWITCHBACKENDURL}/insertUserLimitation?chain=${Fn}&address=${Mn}&tx_hash=${rs}`;try{return(await(await fetch(as,os)).json()).message}catch(us){console.error("Error insertUserLimitationData data:",us)}},fetchDisclaimer=async Fn=>{const Mn=await generateRandomDataAndNonce(),rs={method:"GET",headers:{"Content-Type":"application/json","x-nonce":Mn.nonceValue,"x-hash":Mn.hash}},is=`${SWITCHBACKENDURL}/fetchDisclaimer?address=${Fn}`;try{return(await(await fetch(is,rs)).json()).message}catch(os){console.error("Error fetchDisclaimer data:",os)}},insertTokenAddedData=async(Fn,Mn,rs)=>{const is=await generateRandomDataAndNonce(),os={method:"GET",headers:{"Content-Type":"application/json","x-nonce":is.nonceValue,"x-hash":is.hash}},as=`${SWITCHBACKENDURL}/insertTokenAdded?address=${Fn}&chain=${Mn}&symbol=${rs}`;try{return(await(await fetch(as,os)).json()).message}catch(us){console.error("Error insertTokenAdded data:",us)}},fetchTokenAddedData=async(Fn,Mn,rs)=>{const is=await generateRandomDataAndNonce(),os={method:"GET",headers:{"Content-Type":"application/json","x-nonce":is.nonceValue,"x-hash":is.hash}},as=`${SWITCHBACKENDURL}/fetchTokenAdded?address=${Fn}&chain=${Mn}&symbol=${rs}`;try{return(await(await fetch(as,os)).json()).message}catch(us){console.error("Error fetchTokenAdded data:",us)}};function generateNonce(Fn){const Mn=new Uint8Array(Fn);return crypto.getRandomValues(Mn),Array.from(Mn,rs=>rs.toString(16).padStart(2,"0")).join("")}async function generateHash(Fn){const rs=new TextEncoder().encode(Fn),is=await crypto.subtle.digest("SHA-256",rs);return Array.from(new Uint8Array(is)).map(os=>os.toString(16).padStart(2,"0")).join("")}let nonceValue,hash$3;const generateRandomDataAndNonce=async()=>{nonceValue=generateNonce(16);const Fn=cipherData+nonceValue;return hash$3=await generateHash(Fn),{nonceValue,hash:hash$3}},fetchAllCycleData=async()=>{try{const Fn=`${SWITCHBACKENDURL}/tokenPrices?chain=${DEFAULT_CHAIN_ID}`,Mn=`${SWITCHBACKENDURL}/tokenPrices?chain=${BINANCE_CHAIN_ID}`,rs=await fetch(Fn).then(ds=>ds.json()),is=await fetch(Mn).then(ds=>ds.json()),os=rs.data,as=is.data,us=[];us.push(...os),us.push(...as),localStorage.setItem("allCycleData",JSON.stringify(us))}catch(Fn){console.error("Error:",Fn)}},executeOpenOrder=async(Fn,Mn,rs,is,os,as)=>{var us,ds;try{if(!rs)throw new Error("Signer is undefined");const hs=TOKEN_NAME[os],ps=(ds=(us=CHOOSE_OPTION_TYPE[is])==null?void 0:us[os])==null?void 0:ds[as];if(!hs||!ps.Vault||!ps.Controller)throw new Error("Invalid token, or option_type value");const io=new Contract(ps.Controller,ABI.Controller,rs),mo={maxFeePerGas:(await rs.getGasPrice()).mul(CHAIN_PARAMS_CONFIG[is].gas_multiplier).div(100)};let Ao,$o;if(Fn==="buyLong"){let Lo,Go=!1;try{if(Mn&&(Lo=await getERC20Allowance(is,rs,ps.Vault,5e7)),Lo)Go=!0;else{const xl=PROXY_ADDRESS_CONFIG[is].proxy_address,_l=new Contract(xl,ABI.ProxyUSDC,rs),Tl=MaxUint256$1;await(await _l.connect(rs).approve(ps.Vault,Tl)).wait()}}catch{Go=!0}if(Mn&&(Ao=await getERC20Allowance(is,rs,ps.Vault,Mn)),!Ao&&Go){const xl=PROXY_ADDRESS_CONFIG[is].proxy_address,_l=new Contract(xl,ABI.ProxyUSDC,rs),Tl=parseUnits(truncateDecimals(Mn.toString(),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals);await(await _l.connect(rs).approve(ps.Vault,Tl)).wait()}const Yo=parseUnits(truncateDecimals(Mn.toString(),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals);$o=await(await io.buyLongToken(Yo)).wait()}else if(Fn==="buyShort"){let Lo,Go=!1;try{if(Mn&&(Lo=await getERC20Allowance(is,rs,ps.Vault,5e7)),Lo)Go=!0;else{const xl=PROXY_ADDRESS_CONFIG[is].proxy_address,_l=new Contract(xl,ABI.ProxyUSDC,rs),Tl=MaxUint256$1;await(await _l.connect(rs).approve(ps.Vault,Tl)).wait()}}catch{Go=!0}if(Mn&&(Ao=await getERC20Allowance(is,rs,ps.Vault,Mn)),!Ao&&Go){const xl=PROXY_ADDRESS_CONFIG[is].proxy_address,_l=new Contract(xl,ABI.ProxyUSDC,rs),Tl=parseUnits(truncateDecimals(Mn.toString(),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals);await(await _l.connect(rs).approve(ps.Vault,Tl)).wait()}const Yo=parseUnits(truncateDecimals(Mn.toString(),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals);$o=await(await io.buyShortToken(Yo)).wait()}else if(Fn==="sellLong"){const Lo=parseUnits(truncateDecimals(Mn.toString(),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals);$o=await(await io.sellLongToken(Lo)).wait()}else if(Fn==="sellShort"){const Lo=parseUnits(truncateDecimals(Mn.toString(),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals),CHAIN_PARAMS_CONFIG[is].settlement_token_decimals);$o=await(await io.sellShortToken(Lo)).wait()}else console.log("Unsupported order type:",Fn);return $o}catch(hs){if(hs.toString().includes("Error: user rejected transaction")){if(hs.code==="ACTION_REJECTED")throw console.log("Error code is ACTION_REJECTED:",hs.code),"ACTION_REJECTED"}else throw console.error("Error executing order:",hs.toString()),hs}},executeCancelOrder=async(Fn,Mn,rs,is,os)=>{var as,us;try{if(!Mn)throw new Error("Signer is undefined");const ds=(us=(as=CHOOSE_OPTION_TYPE[rs])==null?void 0:as[is])==null?void 0:us[os];if(!ds.Controller)throw new Error("Invalid token, or option_type value");return await(await new Contract(ds.Controller,ABI.Controller,Mn).cancelOrder(Fn)).wait()}catch(ds){if(ds.toString().includes("Error: user rejected transaction")){if(ds.code==="ACTION_REJECTED")throw console.log("Error code is ACTION_REJECTED:",ds.code),"ACTION_REJECTED"}else throw console.error("Error executing order:",ds.toString()),ds}},executeClaimOrder=async(Fn,Mn,rs,is,os)=>{var as,us;try{if(!Mn)throw new Error("Signer is undefined");const ds=TOKEN_NAME[is],hs=(us=(as=CHOOSE_OPTION_TYPE[rs])==null?void 0:as[is])==null?void 0:us[os];if(!ds||!hs.Vault)throw new Error("Invalid token, or option_type value");const ps=new Contract(hs.Vault,ABI.Vault,Mn),fo={maxFeePerGas:(await Mn.getGasPrice()).mul(CHAIN_PARAMS_CONFIG[rs].gas_multiplier).div(100)};let mo;if(Fn){const Ao=await ps.balanceOf(Mn.getAddress(),Fn);mo=await(await ps.claim(Fn,Ao.toString())).wait()}return mo}catch(ds){if(ds.toString().includes("Error: user rejected transaction")){if(ds.code==="ACTION_REJECTED")throw console.log("Error code is ACTION_REJECTED:",ds.code),"ACTION_REJECTED"}else throw console.error("Error executing order:",ds.toString()),ds}},submitFaucetPayload=async(Fn,Mn)=>{try{if(!Fn)throw new Error("address is undefined");const rs=await generateRandomDataAndNonce(),is={method:"GET",headers:{accept:"application/json","x-nonce":rs.nonceValue,"x-hash":rs.hash}},os=`${SWITCHBACKENDURL}/faucet?address=${Fn}&chainId=${Mn}`;try{return await(await fetch(os,is)).json()}catch(as){console.error("Error submitFaucetPayload data:",as)}}catch(rs){throw console.error("Error executing order:",rs.toString()),rs}};var lottie$1={exports:{}};(function(module,exports){typeof navigator<"u"&&function(Fn,Mn){module.exports=Mn()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(Mn){_useWebWorker=!!Mn},getWebWorker=function(){return _useWebWorker},setLocationHref=function(Mn){locationHref=Mn},getLocationHref=function(){return locationHref};function createTag(Fn){return document.createElement(Fn)}function extendPrototype(Fn,Mn){var rs,is=Fn.length,os;for(rs=0;rs<is;rs+=1){os=Fn[rs].prototype;for(var as in os)Object.prototype.hasOwnProperty.call(os,as)&&(Mn.prototype[as]=os[as])}}function getDescriptor(Fn,Mn){return Object.getOwnPropertyDescriptor(Fn,Mn)}function createProxyFunction(Fn){function Mn(){}return Mn.prototype=Fn,Mn}var audioControllerFactory=function(){function Fn(Mn){this.audios=[],this.audioFactory=Mn,this._volume=1,this._isMuted=!1}return Fn.prototype={addAudio:function(rs){this.audios.push(rs)},pause:function(){var rs,is=this.audios.length;for(rs=0;rs<is;rs+=1)this.audios[rs].pause()},resume:function(){var rs,is=this.audios.length;for(rs=0;rs<is;rs+=1)this.audios[rs].resume()},setRate:function(rs){var is,os=this.audios.length;for(is=0;is<os;is+=1)this.audios[is].setRate(rs)},createAudio:function(rs){return this.audioFactory?this.audioFactory(rs):window.Howl?new window.Howl({src:[rs]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(rs){this.audioFactory=rs},setVolume:function(rs){this._volume=rs,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var rs,is=this.audios.length;for(rs=0;rs<is;rs+=1)this.audios[rs].volume(this._volume*(this._isMuted?0:1))}},function(){return new Fn}}(),createTypedArray=function(){function Fn(rs,is){var os=0,as=[],us;switch(rs){case"int16":case"uint8c":us=1;break;default:us=1.1;break}for(os=0;os<is;os+=1)as.push(us);return as}function Mn(rs,is){return rs==="float32"?new Float32Array(is):rs==="int16"?new Int16Array(is):rs==="uint8c"?new Uint8ClampedArray(is):Fn(rs,is)}return typeof Uint8ClampedArray=="function"&&typeof Float32Array=="function"?Mn:Fn}();function createSizedArray(Fn){return Array.apply(null,{length:Fn})}function _typeof$6(Fn){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$6=function(rs){return typeof rs}:_typeof$6=function(rs){return rs&&typeof Symbol=="function"&&rs.constructor===Symbol&&rs!==Symbol.prototype?"symbol":typeof rs},_typeof$6(Fn)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};(function(){var Fn=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],Mn,rs=Fn.length;for(Mn=0;Mn<rs;Mn+=1)BMMath[Fn[Mn]]=Math[Fn[Mn]]})(),BMMath.random=Math.random,BMMath.abs=function(Fn){var Mn=_typeof$6(Fn);if(Mn==="object"&&Fn.length){var rs=createSizedArray(Fn.length),is,os=Fn.length;for(is=0;is<os;is+=1)rs[is]=Math.abs(Fn[is]);return rs}return Math.abs(Fn)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(Fn){Fn.style.position="absolute",Fn.style.top=0,Fn.style.left=0,Fn.style.display="block",Fn.style.transformOrigin="0 0",Fn.style.webkitTransformOrigin="0 0",Fn.style.backfaceVisibility="visible",Fn.style.webkitBackfaceVisibility="visible",Fn.style.transformStyle="preserve-3d",Fn.style.webkitTransformStyle="preserve-3d",Fn.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(Fn,Mn,rs,is){this.type=Fn,this.currentTime=Mn,this.totalTime=rs,this.direction=is<0?-1:1}function BMCompleteEvent(Fn,Mn){this.type=Fn,this.direction=Mn<0?-1:1}function BMCompleteLoopEvent(Fn,Mn,rs,is){this.type=Fn,this.currentLoop=rs,this.totalLoops=Mn,this.direction=is<0?-1:1}function BMSegmentStartEvent(Fn,Mn,rs){this.type=Fn,this.firstFrame=Mn,this.totalFrames=rs}function BMDestroyEvent(Fn,Mn){this.type=Fn,this.target=Mn}function BMRenderFrameErrorEvent(Fn,Mn){this.type="renderFrameError",this.nativeError=Fn,this.currentTime=Mn}function BMConfigErrorEvent(Fn){this.type="configError",this.nativeError=Fn}var createElementID=function(){var Fn=0;return function(){return Fn+=1,idPrefix$1+"__lottie_element_"+Fn}}();function HSVtoRGB(Fn,Mn,rs){var is,os,as,us,ds,hs,ps,io;switch(us=Math.floor(Fn*6),ds=Fn*6-us,hs=rs*(1-Mn),ps=rs*(1-ds*Mn),io=rs*(1-(1-ds)*Mn),us%6){case 0:is=rs,os=io,as=hs;break;case 1:is=ps,os=rs,as=hs;break;case 2:is=hs,os=rs,as=io;break;case 3:is=hs,os=ps,as=rs;break;case 4:is=io,os=hs,as=rs;break;case 5:is=rs,os=hs,as=ps;break}return[is,os,as]}function RGBtoHSV(Fn,Mn,rs){var is=Math.max(Fn,Mn,rs),os=Math.min(Fn,Mn,rs),as=is-os,us,ds=is===0?0:as/is,hs=is/255;switch(is){case os:us=0;break;case Fn:us=Mn-rs+as*(Mn<rs?6:0),us/=6*as;break;case Mn:us=rs-Fn+as*2,us/=6*as;break;case rs:us=Fn-Mn+as*4,us/=6*as;break}return[us,ds,hs]}function addSaturationToRGB(Fn,Mn){var rs=RGBtoHSV(Fn[0]*255,Fn[1]*255,Fn[2]*255);return rs[1]+=Mn,rs[1]>1?rs[1]=1:rs[1]<=0&&(rs[1]=0),HSVtoRGB(rs[0],rs[1],rs[2])}function addBrightnessToRGB(Fn,Mn){var rs=RGBtoHSV(Fn[0]*255,Fn[1]*255,Fn[2]*255);return rs[2]+=Mn,rs[2]>1?rs[2]=1:rs[2]<0&&(rs[2]=0),HSVtoRGB(rs[0],rs[1],rs[2])}function addHueToRGB(Fn,Mn){var rs=RGBtoHSV(Fn[0]*255,Fn[1]*255,Fn[2]*255);return rs[0]+=Mn/360,rs[0]>1?rs[0]-=1:rs[0]<0&&(rs[0]+=1),HSVtoRGB(rs[0],rs[1],rs[2])}var rgbToHex=function(){var Fn=[],Mn,rs;for(Mn=0;Mn<256;Mn+=1)rs=Mn.toString(16),Fn[Mn]=rs.length===1?"0"+rs:rs;return function(is,os,as){return is<0&&(is=0),os<0&&(os=0),as<0&&(as=0),"#"+Fn[is]+Fn[os]+Fn[as]}}(),setSubframeEnabled=function(Mn){subframeEnabled=!!Mn},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(Mn){expressionsPlugin=Mn},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(Mn){expressionsInterfaces=Mn},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(Mn){defaultCurveSegments=Mn},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(Mn){idPrefix$1=Mn};function createNS(Fn){return document.createElementNS(svgNS,Fn)}function _typeof$5(Fn){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function(rs){return typeof rs}:_typeof$5=function(rs){return rs&&typeof Symbol=="function"&&rs.constructor===Symbol&&rs!==Symbol.prototype?"symbol":typeof rs},_typeof$5(Fn)}var dataManager=function(){var Fn=1,Mn=[],rs,is,os={onmessage:function(){},postMessage:function(Ao){rs({data:Ao})}},as={postMessage:function(Ao){os.onmessage({data:Ao})}};function us(mo){if(window.Worker&&window.Blob&&getWebWorker()){var Ao=new Blob(["var _workerSelf = self; self.onmessage = ",mo.toString()],{type:"text/javascript"}),$o=URL.createObjectURL(Ao);return new Worker($o)}return rs=mo,os}function ds(){is||(is=us(function(Ao){function $o(){function Go(Ho,Qo){var El,Xo,Al=Ho.length,wl,yl,Il,Bl;for(Xo=0;Xo<Al;Xo+=1)if(El=Ho[Xo],"ks"in El&&!El.completed){if(El.completed=!0,El.hasMask){var Gl=El.masksProperties;for(yl=Gl.length,wl=0;wl<yl;wl+=1)if(Gl[wl].pt.k.i)_l(Gl[wl].pt.k);else for(Bl=Gl[wl].pt.k.length,Il=0;Il<Bl;Il+=1)Gl[wl].pt.k[Il].s&&_l(Gl[wl].pt.k[Il].s[0]),Gl[wl].pt.k[Il].e&&_l(Gl[wl].pt.k[Il].e[0])}El.ty===0?(El.layers=Jo(El.refId,Qo),Go(El.layers,Qo)):El.ty===4?xl(El.shapes):El.ty===5&&Vo(El)}}function Yo(Ho,Qo){if(Ho){var El=0,Xo=Ho.length;for(El=0;El<Xo;El+=1)Ho[El].t===1&&(Ho[El].data.layers=Jo(Ho[El].data.refId,Qo),Go(Ho[El].data.layers,Qo))}}function Wo(Ho,Qo){for(var El=0,Xo=Qo.length;El<Xo;){if(Qo[El].id===Ho)return Qo[El];El+=1}return null}function Jo(Ho,Qo){var El=Wo(Ho,Qo);return El?El.layers.__used?JSON.parse(JSON.stringify(El.layers)):(El.layers.__used=!0,El.layers):null}function xl(Ho){var Qo,El=Ho.length,Xo,Al;for(Qo=El-1;Qo>=0;Qo-=1)if(Ho[Qo].ty==="sh")if(Ho[Qo].ks.k.i)_l(Ho[Qo].ks.k);else for(Al=Ho[Qo].ks.k.length,Xo=0;Xo<Al;Xo+=1)Ho[Qo].ks.k[Xo].s&&_l(Ho[Qo].ks.k[Xo].s[0]),Ho[Qo].ks.k[Xo].e&&_l(Ho[Qo].ks.k[Xo].e[0]);else Ho[Qo].ty==="gr"&&xl(Ho[Qo].it)}function _l(Ho){var Qo,El=Ho.i.length;for(Qo=0;Qo<El;Qo+=1)Ho.i[Qo][0]+=Ho.v[Qo][0],Ho.i[Qo][1]+=Ho.v[Qo][1],Ho.o[Qo][0]+=Ho.v[Qo][0],Ho.o[Qo][1]+=Ho.v[Qo][1]}function Tl(Ho,Qo){var El=Qo?Qo.split("."):[100,100,100];return Ho[0]>El[0]?!0:El[0]>Ho[0]?!1:Ho[1]>El[1]?!0:El[1]>Ho[1]?!1:Ho[2]>El[2]?!0:El[2]>Ho[2]?!1:null}var Sl=function(){var Ho=[4,4,14];function Qo(Xo){var Al=Xo.t.d;Xo.t.d={k:[{s:Al,t:0}]}}function El(Xo){var Al,wl=Xo.length;for(Al=0;Al<wl;Al+=1)Xo[Al].ty===5&&Qo(Xo[Al])}return function(Xo){if(Tl(Ho,Xo.v)&&(El(Xo.layers),Xo.assets)){var Al,wl=Xo.assets.length;for(Al=0;Al<wl;Al+=1)Xo.assets[Al].layers&&El(Xo.assets[Al].layers)}}}(),$l=function(){var Ho=[4,7,99];return function(Qo){if(Qo.chars&&!Tl(Ho,Qo.v)){var El,Xo=Qo.chars.length;for(El=0;El<Xo;El+=1){var Al=Qo.chars[El];Al.data&&Al.data.shapes&&(xl(Al.data.shapes),Al.data.ip=0,Al.data.op=99999,Al.data.st=0,Al.data.sr=1,Al.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},Qo.chars[El].t||(Al.data.shapes.push({ty:"no"}),Al.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}}(),Pl=function(){var Ho=[5,7,15];function Qo(Xo){var Al=Xo.t.p;typeof Al.a=="number"&&(Al.a={a:0,k:Al.a}),typeof Al.p=="number"&&(Al.p={a:0,k:Al.p}),typeof Al.r=="number"&&(Al.r={a:0,k:Al.r})}function El(Xo){var Al,wl=Xo.length;for(Al=0;Al<wl;Al+=1)Xo[Al].ty===5&&Qo(Xo[Al])}return function(Xo){if(Tl(Ho,Xo.v)&&(El(Xo.layers),Xo.assets)){var Al,wl=Xo.assets.length;for(Al=0;Al<wl;Al+=1)Xo.assets[Al].layers&&El(Xo.assets[Al].layers)}}}(),Dl=function(){var Ho=[4,1,9];function Qo(Xo){var Al,wl=Xo.length,yl,Il;for(Al=0;Al<wl;Al+=1)if(Xo[Al].ty==="gr")Qo(Xo[Al].it);else if(Xo[Al].ty==="fl"||Xo[Al].ty==="st")if(Xo[Al].c.k&&Xo[Al].c.k[0].i)for(Il=Xo[Al].c.k.length,yl=0;yl<Il;yl+=1)Xo[Al].c.k[yl].s&&(Xo[Al].c.k[yl].s[0]/=255,Xo[Al].c.k[yl].s[1]/=255,Xo[Al].c.k[yl].s[2]/=255,Xo[Al].c.k[yl].s[3]/=255),Xo[Al].c.k[yl].e&&(Xo[Al].c.k[yl].e[0]/=255,Xo[Al].c.k[yl].e[1]/=255,Xo[Al].c.k[yl].e[2]/=255,Xo[Al].c.k[yl].e[3]/=255);else Xo[Al].c.k[0]/=255,Xo[Al].c.k[1]/=255,Xo[Al].c.k[2]/=255,Xo[Al].c.k[3]/=255}function El(Xo){var Al,wl=Xo.length;for(Al=0;Al<wl;Al+=1)Xo[Al].ty===4&&Qo(Xo[Al].shapes)}return function(Xo){if(Tl(Ho,Xo.v)&&(El(Xo.layers),Xo.assets)){var Al,wl=Xo.assets.length;for(Al=0;Al<wl;Al+=1)Xo.assets[Al].layers&&El(Xo.assets[Al].layers)}}}(),Ol=function(){var Ho=[4,4,18];function Qo(Xo){var Al,wl=Xo.length,yl,Il;for(Al=wl-1;Al>=0;Al-=1)if(Xo[Al].ty==="sh")if(Xo[Al].ks.k.i)Xo[Al].ks.k.c=Xo[Al].closed;else for(Il=Xo[Al].ks.k.length,yl=0;yl<Il;yl+=1)Xo[Al].ks.k[yl].s&&(Xo[Al].ks.k[yl].s[0].c=Xo[Al].closed),Xo[Al].ks.k[yl].e&&(Xo[Al].ks.k[yl].e[0].c=Xo[Al].closed);else Xo[Al].ty==="gr"&&Qo(Xo[Al].it)}function El(Xo){var Al,wl,yl=Xo.length,Il,Bl,Gl,Nl;for(wl=0;wl<yl;wl+=1){if(Al=Xo[wl],Al.hasMask){var zl=Al.masksProperties;for(Bl=zl.length,Il=0;Il<Bl;Il+=1)if(zl[Il].pt.k.i)zl[Il].pt.k.c=zl[Il].cl;else for(Nl=zl[Il].pt.k.length,Gl=0;Gl<Nl;Gl+=1)zl[Il].pt.k[Gl].s&&(zl[Il].pt.k[Gl].s[0].c=zl[Il].cl),zl[Il].pt.k[Gl].e&&(zl[Il].pt.k[Gl].e[0].c=zl[Il].cl)}Al.ty===4&&Qo(Al.shapes)}}return function(Xo){if(Tl(Ho,Xo.v)&&(El(Xo.layers),Xo.assets)){var Al,wl=Xo.assets.length;for(Al=0;Al<wl;Al+=1)Xo.assets[Al].layers&&El(Xo.assets[Al].layers)}}}();function Rl(Ho){Ho.__complete||(Dl(Ho),Sl(Ho),$l(Ho),Pl(Ho),Ol(Ho),Go(Ho.layers,Ho.assets),Yo(Ho.chars,Ho.assets),Ho.__complete=!0)}function Vo(Ho){Ho.t.a.length===0&&"m"in Ho.t.p}var jo={};return jo.completeData=Rl,jo.checkColors=Dl,jo.checkChars=$l,jo.checkPathProperties=Pl,jo.checkShapes=Ol,jo.completeLayers=Go,jo}if(as.dataManager||(as.dataManager=$o()),as.assetLoader||(as.assetLoader=function(){function Go(Wo){var Jo=Wo.getResponseHeader("content-type");return Jo&&Wo.responseType==="json"&&Jo.indexOf("json")!==-1||Wo.response&&_typeof$5(Wo.response)==="object"?Wo.response:Wo.response&&typeof Wo.response=="string"?JSON.parse(Wo.response):Wo.responseText?JSON.parse(Wo.responseText):null}function Yo(Wo,Jo,xl,_l){var Tl,Sl=new XMLHttpRequest;try{Sl.responseType="json"}catch{}Sl.onreadystatechange=function(){if(Sl.readyState===4)if(Sl.status===200)Tl=Go(Sl),xl(Tl);else try{Tl=Go(Sl),xl(Tl)}catch($l){_l&&_l($l)}};try{Sl.open(["G","E","T"].join(""),Wo,!0)}catch{Sl.open(["G","E","T"].join(""),Jo+"/"+Wo,!0)}Sl.send()}return{load:Yo}}()),Ao.data.type==="loadAnimation")as.assetLoader.load(Ao.data.path,Ao.data.fullPath,function(Go){as.dataManager.completeData(Go),as.postMessage({id:Ao.data.id,payload:Go,status:"success"})},function(){as.postMessage({id:Ao.data.id,status:"error"})});else if(Ao.data.type==="complete"){var Lo=Ao.data.animation;as.dataManager.completeData(Lo),as.postMessage({id:Ao.data.id,payload:Lo,status:"success"})}else Ao.data.type==="loadData"&&as.assetLoader.load(Ao.data.path,Ao.data.fullPath,function(Go){as.postMessage({id:Ao.data.id,payload:Go,status:"success"})},function(){as.postMessage({id:Ao.data.id,status:"error"})})}),is.onmessage=function(mo){var Ao=mo.data,$o=Ao.id,Lo=Mn[$o];Mn[$o]=null,Ao.status==="success"?Lo.onComplete(Ao.payload):Lo.onError&&Lo.onError()})}function hs(mo,Ao){Fn+=1;var $o="processId_"+Fn;return Mn[$o]={onComplete:mo,onError:Ao},$o}function ps(mo,Ao,$o){ds();var Lo=hs(Ao,$o);is.postMessage({type:"loadAnimation",path:mo,fullPath:window.location.origin+window.location.pathname,id:Lo})}function io(mo,Ao,$o){ds();var Lo=hs(Ao,$o);is.postMessage({type:"loadData",path:mo,fullPath:window.location.origin+window.location.pathname,id:Lo})}function fo(mo,Ao,$o){ds();var Lo=hs(Ao,$o);is.postMessage({type:"complete",animation:mo,id:Lo})}return{loadAnimation:ps,loadData:io,completeAnimation:fo}}(),ImagePreloader=function(){var Fn=function(){var Yo=createTag("canvas");Yo.width=1,Yo.height=1;var Wo=Yo.getContext("2d");return Wo.fillStyle="rgba(0,0,0,0)",Wo.fillRect(0,0,1,1),Yo}();function Mn(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function rs(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function is(Yo,Wo,Jo){var xl="";if(Yo.e)xl=Yo.p;else if(Wo){var _l=Yo.p;_l.indexOf("images/")!==-1&&(_l=_l.split("/")[1]),xl=Wo+_l}else xl=Jo,xl+=Yo.u?Yo.u:"",xl+=Yo.p;return xl}function os(Yo){var Wo=0,Jo=setInterval((function(){var xl=Yo.getBBox();(xl.width||Wo>500)&&(this._imageLoaded(),clearInterval(Jo)),Wo+=1}).bind(this),50)}function as(Yo){var Wo=is(Yo,this.assetsPath,this.path),Jo=createNS("image");isSafari?this.testImageLoaded(Jo):Jo.addEventListener("load",this._imageLoaded,!1),Jo.addEventListener("error",(function(){xl.img=Fn,this._imageLoaded()}).bind(this),!1),Jo.setAttributeNS("http://www.w3.org/1999/xlink","href",Wo),this._elementHelper.append?this._elementHelper.append(Jo):this._elementHelper.appendChild(Jo);var xl={img:Jo,assetData:Yo};return xl}function us(Yo){var Wo=is(Yo,this.assetsPath,this.path),Jo=createTag("img");Jo.crossOrigin="anonymous",Jo.addEventListener("load",this._imageLoaded,!1),Jo.addEventListener("error",(function(){xl.img=Fn,this._imageLoaded()}).bind(this),!1),Jo.src=Wo;var xl={img:Jo,assetData:Yo};return xl}function ds(Yo){var Wo={assetData:Yo},Jo=is(Yo,this.assetsPath,this.path);return dataManager.loadData(Jo,(function(xl){Wo.img=xl,this._footageLoaded()}).bind(this),(function(){Wo.img={},this._footageLoaded()}).bind(this)),Wo}function hs(Yo,Wo){this.imagesLoadedCb=Wo;var Jo,xl=Yo.length;for(Jo=0;Jo<xl;Jo+=1)Yo[Jo].layers||(!Yo[Jo].t||Yo[Jo].t==="seq"?(this.totalImages+=1,this.images.push(this._createImageData(Yo[Jo]))):Yo[Jo].t===3&&(this.totalFootages+=1,this.images.push(this.createFootageData(Yo[Jo]))))}function ps(Yo){this.path=Yo||""}function io(Yo){this.assetsPath=Yo||""}function fo(Yo){for(var Wo=0,Jo=this.images.length;Wo<Jo;){if(this.images[Wo].assetData===Yo)return this.images[Wo].img;Wo+=1}return null}function mo(){this.imagesLoadedCb=null,this.images.length=0}function Ao(){return this.totalImages===this.loadedAssets}function $o(){return this.totalFootages===this.loadedFootagesCount}function Lo(Yo,Wo){Yo==="svg"?(this._elementHelper=Wo,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function Go(){this._imageLoaded=Mn.bind(this),this._footageLoaded=rs.bind(this),this.testImageLoaded=os.bind(this),this.createFootageData=ds.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return Go.prototype={loadAssets:hs,setAssetsPath:io,setPath:ps,loadedImages:Ao,loadedFootages:$o,destroy:mo,getAsset:fo,createImgData:us,createImageData:as,imageLoaded:Mn,footageLoaded:rs,setCacheType:Lo},Go}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(Mn,rs){if(this._cbs[Mn])for(var is=this._cbs[Mn],os=0;os<is.length;os+=1)is[os](rs)},addEventListener:function(Mn,rs){return this._cbs[Mn]||(this._cbs[Mn]=[]),this._cbs[Mn].push(rs),(function(){this.removeEventListener(Mn,rs)}).bind(this)},removeEventListener:function(Mn,rs){if(!rs)this._cbs[Mn]=null;else if(this._cbs[Mn]){for(var is=0,os=this._cbs[Mn].length;is<os;)this._cbs[Mn][is]===rs&&(this._cbs[Mn].splice(is,1),is-=1,os-=1),is+=1;this._cbs[Mn].length||(this._cbs[Mn]=null)}}};var markerParser=function(){function Fn(Mn){for(var rs=Mn.split(`\r
`),is={},os,as=0,us=0;us<rs.length;us+=1)os=rs[us].split(":"),os.length===2&&(is[os[0]]=os[1].trim(),as+=1);if(as===0)throw new Error;return is}return function(Mn){for(var rs=[],is=0;is<Mn.length;is+=1){var os=Mn[is],as={time:os.tm,duration:os.dr};try{as.payload=JSON.parse(Mn[is].cm)}catch{try{as.payload=Fn(Mn[is].cm)}catch{as.payload={name:Mn[is].cm}}}rs.push(as)}return rs}}(),ProjectInterface=function(){function Fn(Mn){this.compositions.push(Mn)}return function(){function Mn(rs){for(var is=0,os=this.compositions.length;is<os;){if(this.compositions[is].data&&this.compositions[is].data.nm===rs)return this.compositions[is].prepareFrame&&this.compositions[is].data.xt&&this.compositions[is].prepareFrame(this.currentFrame),this.compositions[is].compInterface;is+=1}return null}return Mn.compositions=[],Mn.currentFrame=0,Mn.registerComposition=Fn,Mn}}(),renderers={},registerRenderer=function(Mn,rs){renderers[Mn]=rs};function getRenderer(Fn){return renderers[Fn]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var Fn in renderers)if(renderers[Fn])return Fn;return""}function _typeof$4(Fn){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$4=function(rs){return typeof rs}:_typeof$4=function(rs){return rs&&typeof Symbol=="function"&&rs.constructor===Symbol&&rs!==Symbol.prototype?"symbol":typeof rs},_typeof$4(Fn)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(Fn){(Fn.wrapper||Fn.container)&&(this.wrapper=Fn.wrapper||Fn.container);var Mn="svg";Fn.animType?Mn=Fn.animType:Fn.renderer&&(Mn=Fn.renderer);var rs=getRenderer(Mn);this.renderer=new rs(this,Fn.rendererSettings),this.imagePreloader.setCacheType(Mn,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=Mn,Fn.loop===""||Fn.loop===null||Fn.loop===void 0||Fn.loop===!0?this.loop=!0:Fn.loop===!1?this.loop=!1:this.loop=parseInt(Fn.loop,10),this.autoplay="autoplay"in Fn?Fn.autoplay:!0,this.name=Fn.name?Fn.name:"",this.autoloadSegments=Object.prototype.hasOwnProperty.call(Fn,"autoloadSegments")?Fn.autoloadSegments:!0,this.assetsPath=Fn.assetsPath,this.initialSegment=Fn.initialSegment,Fn.audioFactory&&this.audioController.setAudioFactory(Fn.audioFactory),Fn.animationData?this.setupAnimation(Fn.animationData):Fn.path&&(Fn.path.lastIndexOf("\\")!==-1?this.path=Fn.path.substr(0,Fn.path.lastIndexOf("\\")+1):this.path=Fn.path.substr(0,Fn.path.lastIndexOf("/")+1),this.fileName=Fn.path.substr(Fn.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(Fn.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(Fn){dataManager.completeAnimation(Fn,this.configAnimation)},AnimationItem.prototype.setData=function(Fn,Mn){Mn&&_typeof$4(Mn)!=="object"&&(Mn=JSON.parse(Mn));var rs={wrapper:Fn,animationData:Mn},is=Fn.attributes;rs.path=is.getNamedItem("data-animation-path")?is.getNamedItem("data-animation-path").value:is.getNamedItem("data-bm-path")?is.getNamedItem("data-bm-path").value:is.getNamedItem("bm-path")?is.getNamedItem("bm-path").value:"",rs.animType=is.getNamedItem("data-anim-type")?is.getNamedItem("data-anim-type").value:is.getNamedItem("data-bm-type")?is.getNamedItem("data-bm-type").value:is.getNamedItem("bm-type")?is.getNamedItem("bm-type").value:is.getNamedItem("data-bm-renderer")?is.getNamedItem("data-bm-renderer").value:is.getNamedItem("bm-renderer")?is.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var os=is.getNamedItem("data-anim-loop")?is.getNamedItem("data-anim-loop").value:is.getNamedItem("data-bm-loop")?is.getNamedItem("data-bm-loop").value:is.getNamedItem("bm-loop")?is.getNamedItem("bm-loop").value:"";os==="false"?rs.loop=!1:os==="true"?rs.loop=!0:os!==""&&(rs.loop=parseInt(os,10));var as=is.getNamedItem("data-anim-autoplay")?is.getNamedItem("data-anim-autoplay").value:is.getNamedItem("data-bm-autoplay")?is.getNamedItem("data-bm-autoplay").value:is.getNamedItem("bm-autoplay")?is.getNamedItem("bm-autoplay").value:!0;rs.autoplay=as!=="false",rs.name=is.getNamedItem("data-name")?is.getNamedItem("data-name").value:is.getNamedItem("data-bm-name")?is.getNamedItem("data-bm-name").value:is.getNamedItem("bm-name")?is.getNamedItem("bm-name").value:"";var us=is.getNamedItem("data-anim-prerender")?is.getNamedItem("data-anim-prerender").value:is.getNamedItem("data-bm-prerender")?is.getNamedItem("data-bm-prerender").value:is.getNamedItem("bm-prerender")?is.getNamedItem("bm-prerender").value:"";us==="false"&&(rs.prerender=!1),rs.path?this.setParams(rs):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(Fn){Fn.op>this.animationData.op&&(this.animationData.op=Fn.op,this.totalFrames=Math.floor(Fn.op-this.animationData.ip));var Mn=this.animationData.layers,rs,is=Mn.length,os=Fn.layers,as,us=os.length;for(as=0;as<us;as+=1)for(rs=0;rs<is;){if(Mn[rs].id===os[as].id){Mn[rs]=os[as];break}rs+=1}if((Fn.chars||Fn.fonts)&&(this.renderer.globalData.fontManager.addChars(Fn.chars),this.renderer.globalData.fontManager.addFonts(Fn.fonts,this.renderer.globalData.defs)),Fn.assets)for(is=Fn.assets.length,rs=0;rs<is;rs+=1)this.animationData.assets.push(Fn.assets[rs]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(Fn){this.animationData=Fn;var Mn=getExpressionsPlugin();Mn&&Mn.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var Fn=this.animationData.segments;if(!Fn||Fn.length===0||!this.autoloadSegments){this.trigger("data_ready"),this.timeCompleted=this.totalFrames;return}var Mn=Fn.shift();this.timeCompleted=Mn.time*this.frameRate;var rs=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(rs,this.includeLayers.bind(this),(function(){this.trigger("data_failed")}).bind(this))},AnimationItem.prototype.loadSegments=function(){var Fn=this.animationData.segments;Fn||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(Fn){if(this.renderer)try{this.animationData=Fn,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(Fn),Fn.assets||(Fn.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(Fn.assets),this.markers=markerParser(Fn.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(Mn){this.triggerConfigError(Mn)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||this.renderer.rendererType!=="canvas")&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var Fn=getExpressionsPlugin();Fn&&Fn.initExpressions(this),this.renderer.initItems(),setTimeout((function(){this.trigger("DOMLoaded")}).bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(Fn,Mn){var rs=typeof Fn=="number"?Fn:void 0,is=typeof Mn=="number"?Mn:void 0;this.renderer.updateContainerSize(rs,is)},AnimationItem.prototype.setSubframe=function(Fn){this.isSubframeEnabled=!!Fn},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(Fn){this.triggerRenderFrameError(Fn)}},AnimationItem.prototype.play=function(Fn){Fn&&this.name!==Fn||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(Fn){Fn&&this.name!==Fn||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(Fn){Fn&&this.name!==Fn||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(Fn){Fn&&this.name!==Fn||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(Fn){for(var Mn,rs=0;rs<this.markers.length;rs+=1)if(Mn=this.markers[rs],Mn.payload&&Mn.payload.name===Fn)return Mn;return null},AnimationItem.prototype.goToAndStop=function(Fn,Mn,rs){if(!(rs&&this.name!==rs)){var is=Number(Fn);if(isNaN(is)){var os=this.getMarkerData(Fn);os&&this.goToAndStop(os.time,!0)}else Mn?this.setCurrentRawFrameValue(Fn):this.setCurrentRawFrameValue(Fn*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(Fn,Mn,rs){if(!(rs&&this.name!==rs)){var is=Number(Fn);if(isNaN(is)){var os=this.getMarkerData(Fn);os&&(os.duration?this.playSegments([os.time,os.time+os.duration],!0):this.goToAndStop(os.time,!0))}else this.goToAndStop(is,Mn,rs);this.play()}},AnimationItem.prototype.advanceTime=function(Fn){if(!(this.isPaused===!0||this.isLoaded===!1)){var Mn=this.currentRawFrame+Fn*this.frameModifier,rs=!1;Mn>=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(Mn>this.totalFrames?Mn%this.totalFrames:0)||(rs=!0,Mn=this.totalFrames-1):Mn>=this.totalFrames?(this.playCount+=1,this.checkSegments(Mn%this.totalFrames)||(this.setCurrentRawFrameValue(Mn%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(Mn):Mn<0?this.checkSegments(Mn%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+Mn%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(rs=!0,Mn=0)):this.setCurrentRawFrameValue(Mn),rs&&(this.setCurrentRawFrameValue(Mn),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(Fn,Mn){this.playCount=0,Fn[1]<Fn[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=Fn[0]-Fn[1],this.timeCompleted=this.totalFrames,this.firstFrame=Fn[1],this.setCurrentRawFrameValue(this.totalFrames-.001-Mn)):Fn[1]>Fn[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=Fn[1]-Fn[0],this.timeCompleted=this.totalFrames,this.firstFrame=Fn[0],this.setCurrentRawFrameValue(.001+Mn)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(Fn,Mn){var rs=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<Fn?rs=Fn:this.currentRawFrame+this.firstFrame>Mn&&(rs=Mn-Fn)),this.firstFrame=Fn,this.totalFrames=Mn-Fn,this.timeCompleted=this.totalFrames,rs!==-1&&this.goToAndStop(rs,!0)},AnimationItem.prototype.playSegments=function(Fn,Mn){if(Mn&&(this.segments.length=0),_typeof$4(Fn[0])==="object"){var rs,is=Fn.length;for(rs=0;rs<is;rs+=1)this.segments.push(Fn[rs])}else this.segments.push(Fn);this.segments.length&&Mn&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(Fn){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),Fn&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(Fn){return this.segments.length?(this.adjustSegment(this.segments.shift(),Fn),!0):!1},AnimationItem.prototype.destroy=function(Fn){Fn&&this.name!==Fn||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(Fn){this.currentRawFrame=Fn,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(Fn){this.playSpeed=Fn,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(Fn){this.playDirection=Fn<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(Fn){this.loop=Fn},AnimationItem.prototype.setVolume=function(Fn,Mn){Mn&&this.name!==Mn||this.audioController.setVolume(Fn)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(Fn){Fn&&this.name!==Fn||this.audioController.mute()},AnimationItem.prototype.unmute=function(Fn){Fn&&this.name!==Fn||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(Fn){var Mn="";if(Fn.e)Mn=Fn.p;else if(this.assetsPath){var rs=Fn.p;rs.indexOf("images/")!==-1&&(rs=rs.split("/")[1]),Mn=this.assetsPath+rs}else Mn=this.path,Mn+=Fn.u?Fn.u:"",Mn+=Fn.p;return Mn},AnimationItem.prototype.getAssetData=function(Fn){for(var Mn=0,rs=this.assets.length;Mn<rs;){if(Fn===this.assets[Mn].id)return this.assets[Mn];Mn+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(Fn){return Fn?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(Fn,Mn,rs){try{var is=this.renderer.getElementByPath(Fn);is.updateDocumentData(Mn,rs)}catch{}},AnimationItem.prototype.trigger=function(Fn){if(this._cbs&&this._cbs[Fn])switch(Fn){case"enterFrame":this.triggerEvent(Fn,new BMEnterFrameEvent(Fn,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(Fn,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(Fn,new BMCompleteLoopEvent(Fn,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(Fn,new BMCompleteEvent(Fn,this.frameMult));break;case"segmentStart":this.triggerEvent(Fn,new BMSegmentStartEvent(Fn,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(Fn,new BMDestroyEvent(Fn,this));break;default:this.triggerEvent(Fn)}Fn==="enterFrame"&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(Fn,this.currentFrame,this.totalFrames,this.frameMult)),Fn==="loopComplete"&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(Fn,this.loop,this.playCount,this.frameMult)),Fn==="complete"&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(Fn,this.frameMult)),Fn==="segmentStart"&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(Fn,this.firstFrame,this.totalFrames)),Fn==="destroy"&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(Fn,this))},AnimationItem.prototype.triggerRenderFrameError=function(Fn){var Mn=new BMRenderFrameErrorEvent(Fn,this.currentFrame);this.triggerEvent("error",Mn),this.onError&&this.onError.call(this,Mn)},AnimationItem.prototype.triggerConfigError=function(Fn){var Mn=new BMConfigErrorEvent(Fn,this.currentFrame);this.triggerEvent("error",Mn),this.onError&&this.onError.call(this,Mn)};var animationManager=function(){var Fn={},Mn=[],rs=0,is=0,os=0,as=!0,us=!1;function ds(Qo){for(var El=0,Xo=Qo.target;El<is;)Mn[El].animation===Xo&&(Mn.splice(El,1),El-=1,is-=1,Xo.isPaused||fo()),El+=1}function hs(Qo,El){if(!Qo)return null;for(var Xo=0;Xo<is;){if(Mn[Xo].elem===Qo&&Mn[Xo].elem!==null)return Mn[Xo].animation;Xo+=1}var Al=new AnimationItem;return mo(Al,Qo),Al.setData(Qo,El),Al}function ps(){var Qo,El=Mn.length,Xo=[];for(Qo=0;Qo<El;Qo+=1)Xo.push(Mn[Qo].animation);return Xo}function io(){os+=1,Dl()}function fo(){os-=1}function mo(Qo,El){Qo.addEventListener("destroy",ds),Qo.addEventListener("_active",io),Qo.addEventListener("_idle",fo),Mn.push({elem:El,animation:Qo}),is+=1}function Ao(Qo){var El=new AnimationItem;return mo(El,null),El.setParams(Qo),El}function $o(Qo,El){var Xo;for(Xo=0;Xo<is;Xo+=1)Mn[Xo].animation.setSpeed(Qo,El)}function Lo(Qo,El){var Xo;for(Xo=0;Xo<is;Xo+=1)Mn[Xo].animation.setDirection(Qo,El)}function Go(Qo){var El;for(El=0;El<is;El+=1)Mn[El].animation.play(Qo)}function Yo(Qo){var El=Qo-rs,Xo;for(Xo=0;Xo<is;Xo+=1)Mn[Xo].animation.advanceTime(El);rs=Qo,os&&!us?window.requestAnimationFrame(Yo):as=!0}function Wo(Qo){rs=Qo,window.requestAnimationFrame(Yo)}function Jo(Qo){var El;for(El=0;El<is;El+=1)Mn[El].animation.pause(Qo)}function xl(Qo,El,Xo){var Al;for(Al=0;Al<is;Al+=1)Mn[Al].animation.goToAndStop(Qo,El,Xo)}function _l(Qo){var El;for(El=0;El<is;El+=1)Mn[El].animation.stop(Qo)}function Tl(Qo){var El;for(El=0;El<is;El+=1)Mn[El].animation.togglePause(Qo)}function Sl(Qo){var El;for(El=is-1;El>=0;El-=1)Mn[El].animation.destroy(Qo)}function $l(Qo,El,Xo){var Al=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),wl,yl=Al.length;for(wl=0;wl<yl;wl+=1)Xo&&Al[wl].setAttribute("data-bm-type",Xo),hs(Al[wl],Qo);if(El&&yl===0){Xo||(Xo="svg");var Il=document.getElementsByTagName("body")[0];Il.innerText="";var Bl=createTag("div");Bl.style.width="100%",Bl.style.height="100%",Bl.setAttribute("data-bm-type",Xo),Il.appendChild(Bl),hs(Bl,Qo)}}function Pl(){var Qo;for(Qo=0;Qo<is;Qo+=1)Mn[Qo].animation.resize()}function Dl(){!us&&os&&as&&(window.requestAnimationFrame(Wo),as=!1)}function Ol(){us=!0}function Rl(){us=!1,Dl()}function Vo(Qo,El){var Xo;for(Xo=0;Xo<is;Xo+=1)Mn[Xo].animation.setVolume(Qo,El)}function jo(Qo){var El;for(El=0;El<is;El+=1)Mn[El].animation.mute(Qo)}function Ho(Qo){var El;for(El=0;El<is;El+=1)Mn[El].animation.unmute(Qo)}return Fn.registerAnimation=hs,Fn.loadAnimation=Ao,Fn.setSpeed=$o,Fn.setDirection=Lo,Fn.play=Go,Fn.pause=Jo,Fn.stop=_l,Fn.togglePause=Tl,Fn.searchAnimations=$l,Fn.resize=Pl,Fn.goToAndStop=xl,Fn.destroy=Sl,Fn.freeze=Ol,Fn.unfreeze=Rl,Fn.setVolume=Vo,Fn.mute=jo,Fn.unmute=Ho,Fn.getRegisteredAnimations=ps,Fn}(),BezierFactory=function(){var Fn={};Fn.getBezierEasing=rs;var Mn={};function rs(Wo,Jo,xl,_l,Tl){var Sl=Tl||("bez_"+Wo+"_"+Jo+"_"+xl+"_"+_l).replace(/\./g,"p");if(Mn[Sl])return Mn[Sl];var $l=new Yo([Wo,Jo,xl,_l]);return Mn[Sl]=$l,$l}var is=4,os=.001,as=1e-7,us=10,ds=11,hs=1/(ds-1),ps=typeof Float32Array=="function";function io(Wo,Jo){return 1-3*Jo+3*Wo}function fo(Wo,Jo){return 3*Jo-6*Wo}function mo(Wo){return 3*Wo}function Ao(Wo,Jo,xl){return((io(Jo,xl)*Wo+fo(Jo,xl))*Wo+mo(Jo))*Wo}function $o(Wo,Jo,xl){return 3*io(Jo,xl)*Wo*Wo+2*fo(Jo,xl)*Wo+mo(Jo)}function Lo(Wo,Jo,xl,_l,Tl){var Sl,$l,Pl=0;do $l=Jo+(xl-Jo)/2,Sl=Ao($l,_l,Tl)-Wo,Sl>0?xl=$l:Jo=$l;while(Math.abs(Sl)>as&&++Pl<us);return $l}function Go(Wo,Jo,xl,_l){for(var Tl=0;Tl<is;++Tl){var Sl=$o(Jo,xl,_l);if(Sl===0)return Jo;var $l=Ao(Jo,xl,_l)-Wo;Jo-=$l/Sl}return Jo}function Yo(Wo){this._p=Wo,this._mSampleValues=ps?new Float32Array(ds):new Array(ds),this._precomputed=!1,this.get=this.get.bind(this)}return Yo.prototype={get:function(Jo){var xl=this._p[0],_l=this._p[1],Tl=this._p[2],Sl=this._p[3];return this._precomputed||this._precompute(),xl===_l&&Tl===Sl?Jo:Jo===0?0:Jo===1?1:Ao(this._getTForX(Jo),_l,Sl)},_precompute:function(){var Jo=this._p[0],xl=this._p[1],_l=this._p[2],Tl=this._p[3];this._precomputed=!0,(Jo!==xl||_l!==Tl)&&this._calcSampleValues()},_calcSampleValues:function(){for(var Jo=this._p[0],xl=this._p[2],_l=0;_l<ds;++_l)this._mSampleValues[_l]=Ao(_l*hs,Jo,xl)},_getTForX:function(Jo){for(var xl=this._p[0],_l=this._p[2],Tl=this._mSampleValues,Sl=0,$l=1,Pl=ds-1;$l!==Pl&&Tl[$l]<=Jo;++$l)Sl+=hs;--$l;var Dl=(Jo-Tl[$l])/(Tl[$l+1]-Tl[$l]),Ol=Sl+Dl*hs,Rl=$o(Ol,xl,_l);return Rl>=os?Go(Jo,Ol,xl,_l):Rl===0?Ol:Lo(Jo,Sl,Sl+hs,xl,_l)}},Fn}(),pooling=function(){function Fn(Mn){return Mn.concat(createSizedArray(Mn.length))}return{double:Fn}}(),poolFactory=function(){return function(Fn,Mn,rs){var is=0,os=Fn,as=createSizedArray(os),us={newElement:ds,release:hs};function ds(){var ps;return is?(is-=1,ps=as[is]):ps=Mn(),ps}function hs(ps){is===os&&(as=pooling.double(as),os*=2),rs&&rs(ps),as[is]=ps,is+=1}return us}}(),bezierLengthPool=function(){function Fn(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,Fn)}(),segmentsLengthPool=function(){function Fn(){return{lengths:[],totalLength:0}}function Mn(rs){var is,os=rs.lengths.length;for(is=0;is<os;is+=1)bezierLengthPool.release(rs.lengths[is]);rs.lengths.length=0}return poolFactory(8,Fn,Mn)}();function bezFunction(){var Fn=Math;function Mn(mo,Ao,$o,Lo,Go,Yo){var Wo=mo*Lo+Ao*Go+$o*Yo-Go*Lo-Yo*mo-$o*Ao;return Wo>-.001&&Wo<.001}function rs(mo,Ao,$o,Lo,Go,Yo,Wo,Jo,xl){if($o===0&&Yo===0&&xl===0)return Mn(mo,Ao,Lo,Go,Wo,Jo);var _l=Fn.sqrt(Fn.pow(Lo-mo,2)+Fn.pow(Go-Ao,2)+Fn.pow(Yo-$o,2)),Tl=Fn.sqrt(Fn.pow(Wo-mo,2)+Fn.pow(Jo-Ao,2)+Fn.pow(xl-$o,2)),Sl=Fn.sqrt(Fn.pow(Wo-Lo,2)+Fn.pow(Jo-Go,2)+Fn.pow(xl-Yo,2)),$l;return _l>Tl?_l>Sl?$l=_l-Tl-Sl:$l=Sl-Tl-_l:Sl>Tl?$l=Sl-Tl-_l:$l=Tl-_l-Sl,$l>-1e-4&&$l<1e-4}var is=function(){return function(mo,Ao,$o,Lo){var Go=getDefaultCurveSegments(),Yo,Wo,Jo,xl,_l,Tl=0,Sl,$l=[],Pl=[],Dl=bezierLengthPool.newElement();for(Jo=$o.length,Yo=0;Yo<Go;Yo+=1){for(_l=Yo/(Go-1),Sl=0,Wo=0;Wo<Jo;Wo+=1)xl=bmPow(1-_l,3)*mo[Wo]+3*bmPow(1-_l,2)*_l*$o[Wo]+3*(1-_l)*bmPow(_l,2)*Lo[Wo]+bmPow(_l,3)*Ao[Wo],$l[Wo]=xl,Pl[Wo]!==null&&(Sl+=bmPow($l[Wo]-Pl[Wo],2)),Pl[Wo]=$l[Wo];Sl&&(Sl=bmSqrt(Sl),Tl+=Sl),Dl.percents[Yo]=_l,Dl.lengths[Yo]=Tl}return Dl.addedLength=Tl,Dl}}();function os(mo){var Ao=segmentsLengthPool.newElement(),$o=mo.c,Lo=mo.v,Go=mo.o,Yo=mo.i,Wo,Jo=mo._length,xl=Ao.lengths,_l=0;for(Wo=0;Wo<Jo-1;Wo+=1)xl[Wo]=is(Lo[Wo],Lo[Wo+1],Go[Wo],Yo[Wo+1]),_l+=xl[Wo].addedLength;return $o&&Jo&&(xl[Wo]=is(Lo[Wo],Lo[0],Go[Wo],Yo[0]),_l+=xl[Wo].addedLength),Ao.totalLength=_l,Ao}function as(mo){this.segmentLength=0,this.points=new Array(mo)}function us(mo,Ao){this.partialLength=mo,this.point=Ao}var ds=function(){var mo={};return function(Ao,$o,Lo,Go){var Yo=(Ao[0]+"_"+Ao[1]+"_"+$o[0]+"_"+$o[1]+"_"+Lo[0]+"_"+Lo[1]+"_"+Go[0]+"_"+Go[1]).replace(/\./g,"p");if(!mo[Yo]){var Wo=getDefaultCurveSegments(),Jo,xl,_l,Tl,Sl,$l=0,Pl,Dl,Ol=null;Ao.length===2&&(Ao[0]!==$o[0]||Ao[1]!==$o[1])&&Mn(Ao[0],Ao[1],$o[0],$o[1],Ao[0]+Lo[0],Ao[1]+Lo[1])&&Mn(Ao[0],Ao[1],$o[0],$o[1],$o[0]+Go[0],$o[1]+Go[1])&&(Wo=2);var Rl=new as(Wo);for(_l=Lo.length,Jo=0;Jo<Wo;Jo+=1){for(Dl=createSizedArray(_l),Sl=Jo/(Wo-1),Pl=0,xl=0;xl<_l;xl+=1)Tl=bmPow(1-Sl,3)*Ao[xl]+3*bmPow(1-Sl,2)*Sl*(Ao[xl]+Lo[xl])+3*(1-Sl)*bmPow(Sl,2)*($o[xl]+Go[xl])+bmPow(Sl,3)*$o[xl],Dl[xl]=Tl,Ol!==null&&(Pl+=bmPow(Dl[xl]-Ol[xl],2));Pl=bmSqrt(Pl),$l+=Pl,Rl.points[Jo]=new us(Pl,Dl),Ol=Dl}Rl.segmentLength=$l,mo[Yo]=Rl}return mo[Yo]}}();function hs(mo,Ao){var $o=Ao.percents,Lo=Ao.lengths,Go=$o.length,Yo=bmFloor((Go-1)*mo),Wo=mo*Ao.addedLength,Jo=0;if(Yo===Go-1||Yo===0||Wo===Lo[Yo])return $o[Yo];for(var xl=Lo[Yo]>Wo?-1:1,_l=!0;_l;)if(Lo[Yo]<=Wo&&Lo[Yo+1]>Wo?(Jo=(Wo-Lo[Yo])/(Lo[Yo+1]-Lo[Yo]),_l=!1):Yo+=xl,Yo<0||Yo>=Go-1){if(Yo===Go-1)return $o[Yo];_l=!1}return $o[Yo]+($o[Yo+1]-$o[Yo])*Jo}function ps(mo,Ao,$o,Lo,Go,Yo){var Wo=hs(Go,Yo),Jo=1-Wo,xl=Fn.round((Jo*Jo*Jo*mo[0]+(Wo*Jo*Jo+Jo*Wo*Jo+Jo*Jo*Wo)*$o[0]+(Wo*Wo*Jo+Jo*Wo*Wo+Wo*Jo*Wo)*Lo[0]+Wo*Wo*Wo*Ao[0])*1e3)/1e3,_l=Fn.round((Jo*Jo*Jo*mo[1]+(Wo*Jo*Jo+Jo*Wo*Jo+Jo*Jo*Wo)*$o[1]+(Wo*Wo*Jo+Jo*Wo*Wo+Wo*Jo*Wo)*Lo[1]+Wo*Wo*Wo*Ao[1])*1e3)/1e3;return[xl,_l]}var io=createTypedArray("float32",8);function fo(mo,Ao,$o,Lo,Go,Yo,Wo){Go<0?Go=0:Go>1&&(Go=1);var Jo=hs(Go,Wo);Yo=Yo>1?1:Yo;var xl=hs(Yo,Wo),_l,Tl=mo.length,Sl=1-Jo,$l=1-xl,Pl=Sl*Sl*Sl,Dl=Jo*Sl*Sl*3,Ol=Jo*Jo*Sl*3,Rl=Jo*Jo*Jo,Vo=Sl*Sl*$l,jo=Jo*Sl*$l+Sl*Jo*$l+Sl*Sl*xl,Ho=Jo*Jo*$l+Sl*Jo*xl+Jo*Sl*xl,Qo=Jo*Jo*xl,El=Sl*$l*$l,Xo=Jo*$l*$l+Sl*xl*$l+Sl*$l*xl,Al=Jo*xl*$l+Sl*xl*xl+Jo*$l*xl,wl=Jo*xl*xl,yl=$l*$l*$l,Il=xl*$l*$l+$l*xl*$l+$l*$l*xl,Bl=xl*xl*$l+$l*xl*xl+xl*$l*xl,Gl=xl*xl*xl;for(_l=0;_l<Tl;_l+=1)io[_l*4]=Fn.round((Pl*mo[_l]+Dl*$o[_l]+Ol*Lo[_l]+Rl*Ao[_l])*1e3)/1e3,io[_l*4+1]=Fn.round((Vo*mo[_l]+jo*$o[_l]+Ho*Lo[_l]+Qo*Ao[_l])*1e3)/1e3,io[_l*4+2]=Fn.round((El*mo[_l]+Xo*$o[_l]+Al*Lo[_l]+wl*Ao[_l])*1e3)/1e3,io[_l*4+3]=Fn.round((yl*mo[_l]+Il*$o[_l]+Bl*Lo[_l]+Gl*Ao[_l])*1e3)/1e3;return io}return{getSegmentsLength:os,getNewSegment:fo,getPointInSegment:ps,buildBezierData:ds,pointOnLine2D:Mn,pointOnLine3D:rs}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(Fn,Mn){var rs=this.offsetTime,is;this.propType==="multidimensional"&&(is=createTypedArray("float32",this.pv.length));for(var os=Mn.lastIndex,as=os,us=this.keyframes.length-1,ds=!0,hs,ps,io;ds;){if(hs=this.keyframes[as],ps=this.keyframes[as+1],as===us-1&&Fn>=ps.t-rs){hs.h&&(hs=ps),os=0;break}if(ps.t-rs>Fn){os=as;break}as<us-1?as+=1:(os=0,ds=!1)}io=this.keyframesMetadata[as]||{};var fo,mo,Ao,$o,Lo,Go,Yo=ps.t-rs,Wo=hs.t-rs,Jo;if(hs.to){io.bezierData||(io.bezierData=bez.buildBezierData(hs.s,ps.s||hs.e,hs.to,hs.ti));var xl=io.bezierData;if(Fn>=Yo||Fn<Wo){var _l=Fn>=Yo?xl.points.length-1:0;for(mo=xl.points[_l].point.length,fo=0;fo<mo;fo+=1)is[fo]=xl.points[_l].point[fo]}else{io.__fnct?Go=io.__fnct:(Go=BezierFactory.getBezierEasing(hs.o.x,hs.o.y,hs.i.x,hs.i.y,hs.n).get,io.__fnct=Go),Ao=Go((Fn-Wo)/(Yo-Wo));var Tl=xl.segmentLength*Ao,Sl,$l=Mn.lastFrame<Fn&&Mn._lastKeyframeIndex===as?Mn._lastAddedLength:0;for(Lo=Mn.lastFrame<Fn&&Mn._lastKeyframeIndex===as?Mn._lastPoint:0,ds=!0,$o=xl.points.length;ds;){if($l+=xl.points[Lo].partialLength,Tl===0||Ao===0||Lo===xl.points.length-1){for(mo=xl.points[Lo].point.length,fo=0;fo<mo;fo+=1)is[fo]=xl.points[Lo].point[fo];break}else if(Tl>=$l&&Tl<$l+xl.points[Lo+1].partialLength){for(Sl=(Tl-$l)/xl.points[Lo+1].partialLength,mo=xl.points[Lo].point.length,fo=0;fo<mo;fo+=1)is[fo]=xl.points[Lo].point[fo]+(xl.points[Lo+1].point[fo]-xl.points[Lo].point[fo])*Sl;break}Lo<$o-1?Lo+=1:ds=!1}Mn._lastPoint=Lo,Mn._lastAddedLength=$l-xl.points[Lo].partialLength,Mn._lastKeyframeIndex=as}}else{var Pl,Dl,Ol,Rl,Vo;if(us=hs.s.length,Jo=ps.s||hs.e,this.sh&&hs.h!==1)if(Fn>=Yo)is[0]=Jo[0],is[1]=Jo[1],is[2]=Jo[2];else if(Fn<=Wo)is[0]=hs.s[0],is[1]=hs.s[1],is[2]=hs.s[2];else{var jo=createQuaternion(hs.s),Ho=createQuaternion(Jo),Qo=(Fn-Wo)/(Yo-Wo);quaternionToEuler(is,slerp(jo,Ho,Qo))}else for(as=0;as<us;as+=1)hs.h!==1&&(Fn>=Yo?Ao=1:Fn<Wo?Ao=0:(hs.o.x.constructor===Array?(io.__fnct||(io.__fnct=[]),io.__fnct[as]?Go=io.__fnct[as]:(Pl=hs.o.x[as]===void 0?hs.o.x[0]:hs.o.x[as],Dl=hs.o.y[as]===void 0?hs.o.y[0]:hs.o.y[as],Ol=hs.i.x[as]===void 0?hs.i.x[0]:hs.i.x[as],Rl=hs.i.y[as]===void 0?hs.i.y[0]:hs.i.y[as],Go=BezierFactory.getBezierEasing(Pl,Dl,Ol,Rl).get,io.__fnct[as]=Go)):io.__fnct?Go=io.__fnct:(Pl=hs.o.x,Dl=hs.o.y,Ol=hs.i.x,Rl=hs.i.y,Go=BezierFactory.getBezierEasing(Pl,Dl,Ol,Rl).get,hs.keyframeMetadata=Go),Ao=Go((Fn-Wo)/(Yo-Wo)))),Jo=ps.s||hs.e,Vo=hs.h===1?hs.s[as]:hs.s[as]+(Jo[as]-hs.s[as])*Ao,this.propType==="multidimensional"?is[as]=Vo:is=Vo}return Mn.lastIndex=os,is}function slerp(Fn,Mn,rs){var is=[],os=Fn[0],as=Fn[1],us=Fn[2],ds=Fn[3],hs=Mn[0],ps=Mn[1],io=Mn[2],fo=Mn[3],mo,Ao,$o,Lo,Go;return Ao=os*hs+as*ps+us*io+ds*fo,Ao<0&&(Ao=-Ao,hs=-hs,ps=-ps,io=-io,fo=-fo),1-Ao>1e-6?(mo=Math.acos(Ao),$o=Math.sin(mo),Lo=Math.sin((1-rs)*mo)/$o,Go=Math.sin(rs*mo)/$o):(Lo=1-rs,Go=rs),is[0]=Lo*os+Go*hs,is[1]=Lo*as+Go*ps,is[2]=Lo*us+Go*io,is[3]=Lo*ds+Go*fo,is}function quaternionToEuler(Fn,Mn){var rs=Mn[0],is=Mn[1],os=Mn[2],as=Mn[3],us=Math.atan2(2*is*as-2*rs*os,1-2*is*is-2*os*os),ds=Math.asin(2*rs*is+2*os*as),hs=Math.atan2(2*rs*as-2*is*os,1-2*rs*rs-2*os*os);Fn[0]=us/degToRads,Fn[1]=ds/degToRads,Fn[2]=hs/degToRads}function createQuaternion(Fn){var Mn=Fn[0]*degToRads,rs=Fn[1]*degToRads,is=Fn[2]*degToRads,os=Math.cos(Mn/2),as=Math.cos(rs/2),us=Math.cos(is/2),ds=Math.sin(Mn/2),hs=Math.sin(rs/2),ps=Math.sin(is/2),io=os*as*us-ds*hs*ps,fo=ds*hs*us+os*as*ps,mo=ds*as*us+os*hs*ps,Ao=os*hs*us-ds*as*ps;return[fo,mo,Ao,io]}function getValueAtCurrentTime(){var Fn=this.comp.renderedFrame-this.offsetTime,Mn=this.keyframes[0].t-this.offsetTime,rs=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(Fn===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=rs&&Fn>=rs||this._caching.lastFrame<Mn&&Fn<Mn))){this._caching.lastFrame>=Fn&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var is=this.interpolateValue(Fn,this._caching);this.pv=is}return this._caching.lastFrame=Fn,this.pv}function setVValue(Fn){var Mn;if(this.propType==="unidimensional")Mn=Fn*this.mult,mathAbs(this.v-Mn)>1e-5&&(this.v=Mn,this._mdf=!0);else for(var rs=0,is=this.v.length;rs<is;)Mn=Fn[rs]*this.mult,mathAbs(this.v[rs]-Mn)>1e-5&&(this.v[rs]=Mn,this._mdf=!0),rs+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var Fn,Mn=this.effectsSequence.length,rs=this.kf?this.pv:this.data.k;for(Fn=0;Fn<Mn;Fn+=1)rs=this.effectsSequence[Fn](rs);this.setVValue(rs),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(Fn){this.effectsSequence.push(Fn),this.container.addDynamicProperty(this)}function ValueProperty(Fn,Mn,rs,is){this.propType="unidimensional",this.mult=rs||1,this.data=Mn,this.v=rs?Mn.k*rs:Mn.k,this.pv=Mn.k,this._mdf=!1,this.elem=Fn,this.container=is,this.comp=Fn.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(Fn,Mn,rs,is){this.propType="multidimensional",this.mult=rs||1,this.data=Mn,this._mdf=!1,this.elem=Fn,this.container=is,this.comp=Fn.comp,this.k=!1,this.kf=!1,this.frameId=-1;var os,as=Mn.k.length;for(this.v=createTypedArray("float32",as),this.pv=createTypedArray("float32",as),this.vel=createTypedArray("float32",as),os=0;os<as;os+=1)this.v[os]=Mn.k[os]*this.mult,this.pv[os]=Mn.k[os];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(Fn,Mn,rs,is){this.propType="unidimensional",this.keyframes=Mn.k,this.keyframesMetadata=[],this.offsetTime=Fn.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=Mn,this.mult=rs||1,this.elem=Fn,this.container=is,this.comp=Fn.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(Fn,Mn,rs,is){this.propType="multidimensional";var os,as=Mn.k.length,us,ds,hs,ps;for(os=0;os<as-1;os+=1)Mn.k[os].to&&Mn.k[os].s&&Mn.k[os+1]&&Mn.k[os+1].s&&(us=Mn.k[os].s,ds=Mn.k[os+1].s,hs=Mn.k[os].to,ps=Mn.k[os].ti,(us.length===2&&!(us[0]===ds[0]&&us[1]===ds[1])&&bez.pointOnLine2D(us[0],us[1],ds[0],ds[1],us[0]+hs[0],us[1]+hs[1])&&bez.pointOnLine2D(us[0],us[1],ds[0],ds[1],ds[0]+ps[0],ds[1]+ps[1])||us.length===3&&!(us[0]===ds[0]&&us[1]===ds[1]&&us[2]===ds[2])&&bez.pointOnLine3D(us[0],us[1],us[2],ds[0],ds[1],ds[2],us[0]+hs[0],us[1]+hs[1],us[2]+hs[2])&&bez.pointOnLine3D(us[0],us[1],us[2],ds[0],ds[1],ds[2],ds[0]+ps[0],ds[1]+ps[1],ds[2]+ps[2]))&&(Mn.k[os].to=null,Mn.k[os].ti=null),us[0]===ds[0]&&us[1]===ds[1]&&hs[0]===0&&hs[1]===0&&ps[0]===0&&ps[1]===0&&(us.length===2||us[2]===ds[2]&&hs[2]===0&&ps[2]===0)&&(Mn.k[os].to=null,Mn.k[os].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=Mn,this.keyframes=Mn.k,this.keyframesMetadata=[],this.offsetTime=Fn.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=rs||1,this.elem=Fn,this.container=is,this.comp=Fn.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var io=Mn.k[0].s.length;for(this.v=createTypedArray("float32",io),this.pv=createTypedArray("float32",io),os=0;os<io;os+=1)this.v[os]=initFrame,this.pv[os]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",io)},this.addEffect=addEffect}var PropertyFactory=function(){function Fn(rs,is,os,as,us){is.sid&&(is=rs.globalData.slotManager.getProp(is));var ds;if(!is.k.length)ds=new ValueProperty(rs,is,as,us);else if(typeof is.k[0]=="number")ds=new MultiDimensionalProperty(rs,is,as,us);else switch(os){case 0:ds=new KeyframedValueProperty(rs,is,as,us);break;case 1:ds=new KeyframedMultidimensionalProperty(rs,is,as,us);break}return ds.effectsSequence.length&&us.addDynamicProperty(ds),ds}var Mn={getProp:Fn};return Mn}();function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(Mn){this.dynamicProperties.indexOf(Mn)===-1&&(this.dynamicProperties.push(Mn),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){this._mdf=!1;var Mn,rs=this.dynamicProperties.length;for(Mn=0;Mn<rs;Mn+=1)this.dynamicProperties[Mn].getValue(),this.dynamicProperties[Mn]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(Mn){this.container=Mn,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=function(){function Fn(){return createTypedArray("float32",2)}return poolFactory(8,Fn)}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(Fn,Mn){this.c=Fn,this.setLength(Mn);for(var rs=0;rs<Mn;)this.v[rs]=pointPool.newElement(),this.o[rs]=pointPool.newElement(),this.i[rs]=pointPool.newElement(),rs+=1},ShapePath.prototype.setLength=function(Fn){for(;this._maxLength<Fn;)this.doubleArrayLength();this._length=Fn},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(Fn,Mn,rs,is,os){var as;switch(this._length=Math.max(this._length,is+1),this._length>=this._maxLength&&this.doubleArrayLength(),rs){case"v":as=this.v;break;case"i":as=this.i;break;case"o":as=this.o;break;default:as=[];break}(!as[is]||as[is]&&!os)&&(as[is]=pointPool.newElement()),as[is][0]=Fn,as[is][1]=Mn},ShapePath.prototype.setTripleAt=function(Fn,Mn,rs,is,os,as,us,ds){this.setXYAt(Fn,Mn,"v",us,ds),this.setXYAt(rs,is,"o",us,ds),this.setXYAt(os,as,"i",us,ds)},ShapePath.prototype.reverse=function(){var Fn=new ShapePath;Fn.setPathData(this.c,this._length);var Mn=this.v,rs=this.o,is=this.i,os=0;this.c&&(Fn.setTripleAt(Mn[0][0],Mn[0][1],is[0][0],is[0][1],rs[0][0],rs[0][1],0,!1),os=1);var as=this._length-1,us=this._length,ds;for(ds=os;ds<us;ds+=1)Fn.setTripleAt(Mn[as][0],Mn[as][1],is[as][0],is[as][1],rs[as][0],rs[as][1],ds,!1),as-=1;return Fn},ShapePath.prototype.length=function(){return this._length};var shapePool=function(){function Fn(){return new ShapePath}function Mn(os){var as=os._length,us;for(us=0;us<as;us+=1)pointPool.release(os.v[us]),pointPool.release(os.i[us]),pointPool.release(os.o[us]),os.v[us]=null,os.i[us]=null,os.o[us]=null;os._length=0,os.c=!1}function rs(os){var as=is.newElement(),us,ds=os._length===void 0?os.v.length:os._length;for(as.setLength(ds),as.c=os.c,us=0;us<ds;us+=1)as.setTripleAt(os.v[us][0],os.v[us][1],os.o[us][0],os.o[us][1],os.i[us][0],os.i[us][1],us);return as}var is=poolFactory(4,Fn,Mn);return is.clone=rs,is}();function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(Fn){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=Fn,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var Fn;for(Fn=0;Fn<this._length;Fn+=1)shapePool.release(this.shapes[Fn]);this._length=0};var shapeCollectionPool=function(){var Fn={newShapeCollection:os,release:as},Mn=0,rs=4,is=createSizedArray(rs);function os(){var us;return Mn?(Mn-=1,us=is[Mn]):us=new ShapeCollection,us}function as(us){var ds,hs=us._length;for(ds=0;ds<hs;ds+=1)shapePool.release(us.shapes[ds]);us._length=0,Mn===rs&&(is=pooling.double(is),rs*=2),is[Mn]=us,Mn+=1}return Fn}(),ShapePropertyFactory=function(){var Fn=-999999;function Mn(Yo,Wo,Jo){var xl=Jo.lastIndex,_l,Tl,Sl,$l,Pl,Dl,Ol,Rl,Vo,jo=this.keyframes;if(Yo<jo[0].t-this.offsetTime)_l=jo[0].s[0],Sl=!0,xl=0;else if(Yo>=jo[jo.length-1].t-this.offsetTime)_l=jo[jo.length-1].s?jo[jo.length-1].s[0]:jo[jo.length-2].e[0],Sl=!0;else{for(var Ho=xl,Qo=jo.length-1,El=!0,Xo,Al,wl;El&&(Xo=jo[Ho],Al=jo[Ho+1],!(Al.t-this.offsetTime>Yo));)Ho<Qo-1?Ho+=1:El=!1;if(wl=this.keyframesMetadata[Ho]||{},Sl=Xo.h===1,xl=Ho,!Sl){if(Yo>=Al.t-this.offsetTime)Rl=1;else if(Yo<Xo.t-this.offsetTime)Rl=0;else{var yl;wl.__fnct?yl=wl.__fnct:(yl=BezierFactory.getBezierEasing(Xo.o.x,Xo.o.y,Xo.i.x,Xo.i.y).get,wl.__fnct=yl),Rl=yl((Yo-(Xo.t-this.offsetTime))/(Al.t-this.offsetTime-(Xo.t-this.offsetTime)))}Tl=Al.s?Al.s[0]:Xo.e[0]}_l=Xo.s[0]}for(Dl=Wo._length,Ol=_l.i[0].length,Jo.lastIndex=xl,$l=0;$l<Dl;$l+=1)for(Pl=0;Pl<Ol;Pl+=1)Vo=Sl?_l.i[$l][Pl]:_l.i[$l][Pl]+(Tl.i[$l][Pl]-_l.i[$l][Pl])*Rl,Wo.i[$l][Pl]=Vo,Vo=Sl?_l.o[$l][Pl]:_l.o[$l][Pl]+(Tl.o[$l][Pl]-_l.o[$l][Pl])*Rl,Wo.o[$l][Pl]=Vo,Vo=Sl?_l.v[$l][Pl]:_l.v[$l][Pl]+(Tl.v[$l][Pl]-_l.v[$l][Pl])*Rl,Wo.v[$l][Pl]=Vo}function rs(){var Yo=this.comp.renderedFrame-this.offsetTime,Wo=this.keyframes[0].t-this.offsetTime,Jo=this.keyframes[this.keyframes.length-1].t-this.offsetTime,xl=this._caching.lastFrame;return xl!==Fn&&(xl<Wo&&Yo<Wo||xl>Jo&&Yo>Jo)||(this._caching.lastIndex=xl<Yo?this._caching.lastIndex:0,this.interpolateShape(Yo,this.pv,this._caching)),this._caching.lastFrame=Yo,this.pv}function is(){this.paths=this.localShapeCollection}function os(Yo,Wo){if(Yo._length!==Wo._length||Yo.c!==Wo.c)return!1;var Jo,xl=Yo._length;for(Jo=0;Jo<xl;Jo+=1)if(Yo.v[Jo][0]!==Wo.v[Jo][0]||Yo.v[Jo][1]!==Wo.v[Jo][1]||Yo.o[Jo][0]!==Wo.o[Jo][0]||Yo.o[Jo][1]!==Wo.o[Jo][1]||Yo.i[Jo][0]!==Wo.i[Jo][0]||Yo.i[Jo][1]!==Wo.i[Jo][1])return!1;return!0}function as(Yo){os(this.v,Yo)||(this.v=shapePool.clone(Yo),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function us(){if(this.elem.globalData.frameId!==this.frameId){if(!this.effectsSequence.length){this._mdf=!1;return}if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=!1;var Yo;this.kf?Yo=this.pv:this.data.ks?Yo=this.data.ks.k:Yo=this.data.pt.k;var Wo,Jo=this.effectsSequence.length;for(Wo=0;Wo<Jo;Wo+=1)Yo=this.effectsSequence[Wo](Yo);this.setVValue(Yo),this.lock=!1,this.frameId=this.elem.globalData.frameId}}function ds(Yo,Wo,Jo){this.propType="shape",this.comp=Yo.comp,this.container=Yo,this.elem=Yo,this.data=Wo,this.k=!1,this.kf=!1,this._mdf=!1;var xl=Jo===3?Wo.pt.k:Wo.ks.k;this.v=shapePool.clone(xl),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=is,this.effectsSequence=[]}function hs(Yo){this.effectsSequence.push(Yo),this.container.addDynamicProperty(this)}ds.prototype.interpolateShape=Mn,ds.prototype.getValue=us,ds.prototype.setVValue=as,ds.prototype.addEffect=hs;function ps(Yo,Wo,Jo){this.propType="shape",this.comp=Yo.comp,this.elem=Yo,this.container=Yo,this.offsetTime=Yo.data.st,this.keyframes=Jo===3?Wo.pt.k:Wo.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var xl=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,xl),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=Fn,this.reset=is,this._caching={lastFrame:Fn,lastIndex:0},this.effectsSequence=[rs.bind(this)]}ps.prototype.getValue=us,ps.prototype.interpolateShape=Mn,ps.prototype.setVValue=as,ps.prototype.addEffect=hs;var io=function(){var Yo=roundCorner;function Wo(Jo,xl){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=xl.d,this.elem=Jo,this.comp=Jo.comp,this.frameId=-1,this.initDynamicPropertyContainer(Jo),this.p=PropertyFactory.getProp(Jo,xl.p,1,0,this),this.s=PropertyFactory.getProp(Jo,xl.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return Wo.prototype={reset:is,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var xl=this.p.v[0],_l=this.p.v[1],Tl=this.s.v[0]/2,Sl=this.s.v[1]/2,$l=this.d!==3,Pl=this.v;Pl.v[0][0]=xl,Pl.v[0][1]=_l-Sl,Pl.v[1][0]=$l?xl+Tl:xl-Tl,Pl.v[1][1]=_l,Pl.v[2][0]=xl,Pl.v[2][1]=_l+Sl,Pl.v[3][0]=$l?xl-Tl:xl+Tl,Pl.v[3][1]=_l,Pl.i[0][0]=$l?xl-Tl*Yo:xl+Tl*Yo,Pl.i[0][1]=_l-Sl,Pl.i[1][0]=$l?xl+Tl:xl-Tl,Pl.i[1][1]=_l-Sl*Yo,Pl.i[2][0]=$l?xl+Tl*Yo:xl-Tl*Yo,Pl.i[2][1]=_l+Sl,Pl.i[3][0]=$l?xl-Tl:xl+Tl,Pl.i[3][1]=_l+Sl*Yo,Pl.o[0][0]=$l?xl+Tl*Yo:xl-Tl*Yo,Pl.o[0][1]=_l-Sl,Pl.o[1][0]=$l?xl+Tl:xl-Tl,Pl.o[1][1]=_l+Sl*Yo,Pl.o[2][0]=$l?xl-Tl*Yo:xl+Tl*Yo,Pl.o[2][1]=_l+Sl,Pl.o[3][0]=$l?xl-Tl:xl+Tl,Pl.o[3][1]=_l-Sl*Yo}},extendPrototype([DynamicPropertyContainer],Wo),Wo}(),fo=function(){function Yo(Wo,Jo){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=Wo,this.comp=Wo.comp,this.data=Jo,this.frameId=-1,this.d=Jo.d,this.initDynamicPropertyContainer(Wo),Jo.sy===1?(this.ir=PropertyFactory.getProp(Wo,Jo.ir,0,0,this),this.is=PropertyFactory.getProp(Wo,Jo.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(Wo,Jo.pt,0,0,this),this.p=PropertyFactory.getProp(Wo,Jo.p,1,0,this),this.r=PropertyFactory.getProp(Wo,Jo.r,0,degToRads,this),this.or=PropertyFactory.getProp(Wo,Jo.or,0,0,this),this.os=PropertyFactory.getProp(Wo,Jo.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return Yo.prototype={reset:is,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var Jo=Math.floor(this.pt.v)*2,xl=Math.PI*2/Jo,_l=!0,Tl=this.or.v,Sl=this.ir.v,$l=this.os.v,Pl=this.is.v,Dl=2*Math.PI*Tl/(Jo*2),Ol=2*Math.PI*Sl/(Jo*2),Rl,Vo,jo,Ho,Qo=-Math.PI/2;Qo+=this.r.v;var El=this.data.d===3?-1:1;for(this.v._length=0,Rl=0;Rl<Jo;Rl+=1){Vo=_l?Tl:Sl,jo=_l?$l:Pl,Ho=_l?Dl:Ol;var Xo=Vo*Math.cos(Qo),Al=Vo*Math.sin(Qo),wl=Xo===0&&Al===0?0:Al/Math.sqrt(Xo*Xo+Al*Al),yl=Xo===0&&Al===0?0:-Xo/Math.sqrt(Xo*Xo+Al*Al);Xo+=+this.p.v[0],Al+=+this.p.v[1],this.v.setTripleAt(Xo,Al,Xo-wl*Ho*jo*El,Al-yl*Ho*jo*El,Xo+wl*Ho*jo*El,Al+yl*Ho*jo*El,Rl,!0),_l=!_l,Qo+=xl*El}},convertPolygonToPath:function(){var Jo=Math.floor(this.pt.v),xl=Math.PI*2/Jo,_l=this.or.v,Tl=this.os.v,Sl=2*Math.PI*_l/(Jo*4),$l,Pl=-Math.PI*.5,Dl=this.data.d===3?-1:1;for(Pl+=this.r.v,this.v._length=0,$l=0;$l<Jo;$l+=1){var Ol=_l*Math.cos(Pl),Rl=_l*Math.sin(Pl),Vo=Ol===0&&Rl===0?0:Rl/Math.sqrt(Ol*Ol+Rl*Rl),jo=Ol===0&&Rl===0?0:-Ol/Math.sqrt(Ol*Ol+Rl*Rl);Ol+=+this.p.v[0],Rl+=+this.p.v[1],this.v.setTripleAt(Ol,Rl,Ol-Vo*Sl*Tl*Dl,Rl-jo*Sl*Tl*Dl,Ol+Vo*Sl*Tl*Dl,Rl+jo*Sl*Tl*Dl,$l,!0),Pl+=xl*Dl}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],Yo),Yo}(),mo=function(){function Yo(Wo,Jo){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=Wo,this.comp=Wo.comp,this.frameId=-1,this.d=Jo.d,this.initDynamicPropertyContainer(Wo),this.p=PropertyFactory.getProp(Wo,Jo.p,1,0,this),this.s=PropertyFactory.getProp(Wo,Jo.s,1,0,this),this.r=PropertyFactory.getProp(Wo,Jo.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return Yo.prototype={convertRectToPath:function(){var Jo=this.p.v[0],xl=this.p.v[1],_l=this.s.v[0]/2,Tl=this.s.v[1]/2,Sl=bmMin(_l,Tl,this.r.v),$l=Sl*(1-roundCorner);this.v._length=0,this.d===2||this.d===1?(this.v.setTripleAt(Jo+_l,xl-Tl+Sl,Jo+_l,xl-Tl+Sl,Jo+_l,xl-Tl+$l,0,!0),this.v.setTripleAt(Jo+_l,xl+Tl-Sl,Jo+_l,xl+Tl-$l,Jo+_l,xl+Tl-Sl,1,!0),Sl!==0?(this.v.setTripleAt(Jo+_l-Sl,xl+Tl,Jo+_l-Sl,xl+Tl,Jo+_l-$l,xl+Tl,2,!0),this.v.setTripleAt(Jo-_l+Sl,xl+Tl,Jo-_l+$l,xl+Tl,Jo-_l+Sl,xl+Tl,3,!0),this.v.setTripleAt(Jo-_l,xl+Tl-Sl,Jo-_l,xl+Tl-Sl,Jo-_l,xl+Tl-$l,4,!0),this.v.setTripleAt(Jo-_l,xl-Tl+Sl,Jo-_l,xl-Tl+$l,Jo-_l,xl-Tl+Sl,5,!0),this.v.setTripleAt(Jo-_l+Sl,xl-Tl,Jo-_l+Sl,xl-Tl,Jo-_l+$l,xl-Tl,6,!0),this.v.setTripleAt(Jo+_l-Sl,xl-Tl,Jo+_l-$l,xl-Tl,Jo+_l-Sl,xl-Tl,7,!0)):(this.v.setTripleAt(Jo-_l,xl+Tl,Jo-_l+$l,xl+Tl,Jo-_l,xl+Tl,2),this.v.setTripleAt(Jo-_l,xl-Tl,Jo-_l,xl-Tl+$l,Jo-_l,xl-Tl,3))):(this.v.setTripleAt(Jo+_l,xl-Tl+Sl,Jo+_l,xl-Tl+$l,Jo+_l,xl-Tl+Sl,0,!0),Sl!==0?(this.v.setTripleAt(Jo+_l-Sl,xl-Tl,Jo+_l-Sl,xl-Tl,Jo+_l-$l,xl-Tl,1,!0),this.v.setTripleAt(Jo-_l+Sl,xl-Tl,Jo-_l+$l,xl-Tl,Jo-_l+Sl,xl-Tl,2,!0),this.v.setTripleAt(Jo-_l,xl-Tl+Sl,Jo-_l,xl-Tl+Sl,Jo-_l,xl-Tl+$l,3,!0),this.v.setTripleAt(Jo-_l,xl+Tl-Sl,Jo-_l,xl+Tl-$l,Jo-_l,xl+Tl-Sl,4,!0),this.v.setTripleAt(Jo-_l+Sl,xl+Tl,Jo-_l+Sl,xl+Tl,Jo-_l+$l,xl+Tl,5,!0),this.v.setTripleAt(Jo+_l-Sl,xl+Tl,Jo+_l-$l,xl+Tl,Jo+_l-Sl,xl+Tl,6,!0),this.v.setTripleAt(Jo+_l,xl+Tl-Sl,Jo+_l,xl+Tl-Sl,Jo+_l,xl+Tl-$l,7,!0)):(this.v.setTripleAt(Jo-_l,xl-Tl,Jo-_l+$l,xl-Tl,Jo-_l,xl-Tl,1,!0),this.v.setTripleAt(Jo-_l,xl+Tl,Jo-_l,xl+Tl-$l,Jo-_l,xl+Tl,2,!0),this.v.setTripleAt(Jo+_l,xl+Tl,Jo+_l-$l,xl+Tl,Jo+_l,xl+Tl,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:is},extendPrototype([DynamicPropertyContainer],Yo),Yo}();function Ao(Yo,Wo,Jo){var xl;if(Jo===3||Jo===4){var _l=Jo===3?Wo.pt:Wo.ks,Tl=_l.k;Tl.length?xl=new ps(Yo,Wo,Jo):xl=new ds(Yo,Wo,Jo)}else Jo===5?xl=new mo(Yo,Wo):Jo===6?xl=new io(Yo,Wo):Jo===7&&(xl=new fo(Yo,Wo));return xl.k&&Yo.addDynamicProperty(xl),xl}function $o(){return ds}function Lo(){return ps}var Go={};return Go.getShapeProp=Ao,Go.getConstructorFunction=$o,Go.getKeyframedConstructorFunction=Lo,Go}();/*!
 Transformation Matrix v2.0
 (c) Epistemex 2014-2015
 www.epistemex.com
 By Ken Fyrstenberg
 Contributions by leeoniya.
 License: MIT, header required.
 */var Matrix=function(){var Fn=Math.cos,Mn=Math.sin,rs=Math.tan,is=Math.round;function os(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function as(Xo){if(Xo===0)return this;var Al=Fn(Xo),wl=Mn(Xo);return this._t(Al,-wl,0,0,wl,Al,0,0,0,0,1,0,0,0,0,1)}function us(Xo){if(Xo===0)return this;var Al=Fn(Xo),wl=Mn(Xo);return this._t(1,0,0,0,0,Al,-wl,0,0,wl,Al,0,0,0,0,1)}function ds(Xo){if(Xo===0)return this;var Al=Fn(Xo),wl=Mn(Xo);return this._t(Al,0,wl,0,0,1,0,0,-wl,0,Al,0,0,0,0,1)}function hs(Xo){if(Xo===0)return this;var Al=Fn(Xo),wl=Mn(Xo);return this._t(Al,-wl,0,0,wl,Al,0,0,0,0,1,0,0,0,0,1)}function ps(Xo,Al){return this._t(1,Al,Xo,1,0,0)}function io(Xo,Al){return this.shear(rs(Xo),rs(Al))}function fo(Xo,Al){var wl=Fn(Al),yl=Mn(Al);return this._t(wl,yl,0,0,-yl,wl,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,rs(Xo),1,0,0,0,0,1,0,0,0,0,1)._t(wl,-yl,0,0,yl,wl,0,0,0,0,1,0,0,0,0,1)}function mo(Xo,Al,wl){return!wl&&wl!==0&&(wl=1),Xo===1&&Al===1&&wl===1?this:this._t(Xo,0,0,0,0,Al,0,0,0,0,wl,0,0,0,0,1)}function Ao(Xo,Al,wl,yl,Il,Bl,Gl,Nl,zl,Vl,Hl,Yl,Ll,Zl,Xl,wu){return this.props[0]=Xo,this.props[1]=Al,this.props[2]=wl,this.props[3]=yl,this.props[4]=Il,this.props[5]=Bl,this.props[6]=Gl,this.props[7]=Nl,this.props[8]=zl,this.props[9]=Vl,this.props[10]=Hl,this.props[11]=Yl,this.props[12]=Ll,this.props[13]=Zl,this.props[14]=Xl,this.props[15]=wu,this}function $o(Xo,Al,wl){return wl=wl||0,Xo!==0||Al!==0||wl!==0?this._t(1,0,0,0,0,1,0,0,0,0,1,0,Xo,Al,wl,1):this}function Lo(Xo,Al,wl,yl,Il,Bl,Gl,Nl,zl,Vl,Hl,Yl,Ll,Zl,Xl,wu){var yu=this.props;if(Xo===1&&Al===0&&wl===0&&yl===0&&Il===0&&Bl===1&&Gl===0&&Nl===0&&zl===0&&Vl===0&&Hl===1&&Yl===0)return yu[12]=yu[12]*Xo+yu[15]*Ll,yu[13]=yu[13]*Bl+yu[15]*Zl,yu[14]=yu[14]*Hl+yu[15]*Xl,yu[15]*=wu,this._identityCalculated=!1,this;var rp=yu[0],dp=yu[1],up=yu[2],wp=yu[3],vp=yu[4],pp=yu[5],cp=yu[6],gp=yu[7],mp=yu[8],fp=yu[9],hp=yu[10],xp=yu[11],Kl=yu[12],Fl=yu[13],Ul=yu[14],Jl=yu[15];return yu[0]=rp*Xo+dp*Il+up*zl+wp*Ll,yu[1]=rp*Al+dp*Bl+up*Vl+wp*Zl,yu[2]=rp*wl+dp*Gl+up*Hl+wp*Xl,yu[3]=rp*yl+dp*Nl+up*Yl+wp*wu,yu[4]=vp*Xo+pp*Il+cp*zl+gp*Ll,yu[5]=vp*Al+pp*Bl+cp*Vl+gp*Zl,yu[6]=vp*wl+pp*Gl+cp*Hl+gp*Xl,yu[7]=vp*yl+pp*Nl+cp*Yl+gp*wu,yu[8]=mp*Xo+fp*Il+hp*zl+xp*Ll,yu[9]=mp*Al+fp*Bl+hp*Vl+xp*Zl,yu[10]=mp*wl+fp*Gl+hp*Hl+xp*Xl,yu[11]=mp*yl+fp*Nl+hp*Yl+xp*wu,yu[12]=Kl*Xo+Fl*Il+Ul*zl+Jl*Ll,yu[13]=Kl*Al+Fl*Bl+Ul*Vl+Jl*Zl,yu[14]=Kl*wl+Fl*Gl+Ul*Hl+Jl*Xl,yu[15]=Kl*yl+Fl*Nl+Ul*Yl+Jl*wu,this._identityCalculated=!1,this}function Go(Xo){var Al=Xo.props;return this.transform(Al[0],Al[1],Al[2],Al[3],Al[4],Al[5],Al[6],Al[7],Al[8],Al[9],Al[10],Al[11],Al[12],Al[13],Al[14],Al[15])}function Yo(){return this._identityCalculated||(this._identity=!(this.props[0]!==1||this.props[1]!==0||this.props[2]!==0||this.props[3]!==0||this.props[4]!==0||this.props[5]!==1||this.props[6]!==0||this.props[7]!==0||this.props[8]!==0||this.props[9]!==0||this.props[10]!==1||this.props[11]!==0||this.props[12]!==0||this.props[13]!==0||this.props[14]!==0||this.props[15]!==1),this._identityCalculated=!0),this._identity}function Wo(Xo){for(var Al=0;Al<16;){if(Xo.props[Al]!==this.props[Al])return!1;Al+=1}return!0}function Jo(Xo){var Al;for(Al=0;Al<16;Al+=1)Xo.props[Al]=this.props[Al];return Xo}function xl(Xo){var Al;for(Al=0;Al<16;Al+=1)this.props[Al]=Xo[Al]}function _l(Xo,Al,wl){return{x:Xo*this.props[0]+Al*this.props[4]+wl*this.props[8]+this.props[12],y:Xo*this.props[1]+Al*this.props[5]+wl*this.props[9]+this.props[13],z:Xo*this.props[2]+Al*this.props[6]+wl*this.props[10]+this.props[14]}}function Tl(Xo,Al,wl){return Xo*this.props[0]+Al*this.props[4]+wl*this.props[8]+this.props[12]}function Sl(Xo,Al,wl){return Xo*this.props[1]+Al*this.props[5]+wl*this.props[9]+this.props[13]}function $l(Xo,Al,wl){return Xo*this.props[2]+Al*this.props[6]+wl*this.props[10]+this.props[14]}function Pl(){var Xo=this.props[0]*this.props[5]-this.props[1]*this.props[4],Al=this.props[5]/Xo,wl=-this.props[1]/Xo,yl=-this.props[4]/Xo,Il=this.props[0]/Xo,Bl=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/Xo,Gl=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/Xo,Nl=new Matrix;return Nl.props[0]=Al,Nl.props[1]=wl,Nl.props[4]=yl,Nl.props[5]=Il,Nl.props[12]=Bl,Nl.props[13]=Gl,Nl}function Dl(Xo){var Al=this.getInverseMatrix();return Al.applyToPointArray(Xo[0],Xo[1],Xo[2]||0)}function Ol(Xo){var Al,wl=Xo.length,yl=[];for(Al=0;Al<wl;Al+=1)yl[Al]=Dl(Xo[Al]);return yl}function Rl(Xo,Al,wl){var yl=createTypedArray("float32",6);if(this.isIdentity())yl[0]=Xo[0],yl[1]=Xo[1],yl[2]=Al[0],yl[3]=Al[1],yl[4]=wl[0],yl[5]=wl[1];else{var Il=this.props[0],Bl=this.props[1],Gl=this.props[4],Nl=this.props[5],zl=this.props[12],Vl=this.props[13];yl[0]=Xo[0]*Il+Xo[1]*Gl+zl,yl[1]=Xo[0]*Bl+Xo[1]*Nl+Vl,yl[2]=Al[0]*Il+Al[1]*Gl+zl,yl[3]=Al[0]*Bl+Al[1]*Nl+Vl,yl[4]=wl[0]*Il+wl[1]*Gl+zl,yl[5]=wl[0]*Bl+wl[1]*Nl+Vl}return yl}function Vo(Xo,Al,wl){var yl;return this.isIdentity()?yl=[Xo,Al,wl]:yl=[Xo*this.props[0]+Al*this.props[4]+wl*this.props[8]+this.props[12],Xo*this.props[1]+Al*this.props[5]+wl*this.props[9]+this.props[13],Xo*this.props[2]+Al*this.props[6]+wl*this.props[10]+this.props[14]],yl}function jo(Xo,Al){if(this.isIdentity())return Xo+","+Al;var wl=this.props;return Math.round((Xo*wl[0]+Al*wl[4]+wl[12])*100)/100+","+Math.round((Xo*wl[1]+Al*wl[5]+wl[13])*100)/100}function Ho(){for(var Xo=0,Al=this.props,wl="matrix3d(",yl=1e4;Xo<16;)wl+=is(Al[Xo]*yl)/yl,wl+=Xo===15?")":",",Xo+=1;return wl}function Qo(Xo){var Al=1e4;return Xo<1e-6&&Xo>0||Xo>-1e-6&&Xo<0?is(Xo*Al)/Al:Xo}function El(){var Xo=this.props,Al=Qo(Xo[0]),wl=Qo(Xo[1]),yl=Qo(Xo[4]),Il=Qo(Xo[5]),Bl=Qo(Xo[12]),Gl=Qo(Xo[13]);return"matrix("+Al+","+wl+","+yl+","+Il+","+Bl+","+Gl+")"}return function(){this.reset=os,this.rotate=as,this.rotateX=us,this.rotateY=ds,this.rotateZ=hs,this.skew=io,this.skewFromAxis=fo,this.shear=ps,this.scale=mo,this.setTransform=Ao,this.translate=$o,this.transform=Lo,this.multiply=Go,this.applyToPoint=_l,this.applyToX=Tl,this.applyToY=Sl,this.applyToZ=$l,this.applyToPointArray=Vo,this.applyToTriplePoints=Rl,this.applyToPointStringified=jo,this.toCSS=Ho,this.to2dCSS=El,this.clone=Jo,this.cloneFromProps=xl,this.equals=Wo,this.inversePoints=Ol,this.inversePoint=Dl,this.getInverseMatrix=Pl,this._t=this.transform,this.isIdentity=Yo,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(Fn){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(rs){return typeof rs}:_typeof$3=function(rs){return rs&&typeof Symbol=="function"&&rs.constructor===Symbol&&rs!==Symbol.prototype?"symbol":typeof rs},_typeof$3(Fn)}var lottie={};function setLocation(Fn){setLocationHref(Fn)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(Fn){setSubframeEnabled(Fn)}function setPrefix(Fn){setIdPrefix(Fn)}function loadAnimation(Fn){return animationManager.loadAnimation(Fn)}function setQuality(Fn){if(typeof Fn=="string")switch(Fn){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else!isNaN(Fn)&&Fn>1&&setDefaultCurveSegments(Fn)}function inBrowser(){return typeof navigator<"u"}function installPlugin(Fn,Mn){Fn==="expressions"&&setExpressionsPlugin(Mn)}function getFactory(Fn){switch(Fn){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.12.2";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(Fn){for(var Mn=queryString.split("&"),rs=0;rs<Mn.length;rs+=1){var is=Mn[rs].split("=");if(decodeURIComponent(is[0])==Fn)return decodeURIComponent(is[1])}return null}var queryString="";{var scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",getQueryVariable("renderer")}var readyStateCheckInterval=setInterval(checkReady,100);try{_typeof$3(exports)!=="object"&&(window.bodymovin=lottie)}catch(Fn){}var ShapeModifiers=function(){var Fn={},Mn={};Fn.registerModifier=rs,Fn.getModifier=is;function rs(os,as){Mn[os]||(Mn[os]=as)}function is(os,as,us){return new Mn[os](as,us)}return Fn}();function ShapeModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(Fn){if(!this.closed){Fn.sh.container.addDynamicProperty(Fn.sh);var Mn={shape:Fn.sh,data:Fn,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(Mn),this.addShapeToModifier(Mn),this._isAnimated&&Fn.setAsAnimated()}},ShapeModifier.prototype.init=function(Fn,Mn){this.shapes=[],this.elem=Fn,this.initDynamicPropertyContainer(Fn),this.initModifierProperties(Fn,Mn),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier);function TrimModifier(){}extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(Fn,Mn){this.s=PropertyFactory.getProp(Fn,Mn.s,0,.01,this),this.e=PropertyFactory.getProp(Fn,Mn.e,0,.01,this),this.o=PropertyFactory.getProp(Fn,Mn.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=Mn.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(Fn){Fn.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(Fn,Mn,rs,is,os){var as=[];Mn<=1?as.push({s:Fn,e:Mn}):Fn>=1?as.push({s:Fn-1,e:Mn-1}):(as.push({s:Fn,e:1}),as.push({s:0,e:Mn-1}));var us=[],ds,hs=as.length,ps;for(ds=0;ds<hs;ds+=1)if(ps=as[ds],!(ps.e*os<is||ps.s*os>is+rs)){var io,fo;ps.s*os<=is?io=0:io=(ps.s*os-is)/rs,ps.e*os>=is+rs?fo=1:fo=(ps.e*os-is)/rs,us.push([io,fo])}return us.length||us.push([0,0]),us},TrimModifier.prototype.releasePathsData=function(Fn){var Mn,rs=Fn.length;for(Mn=0;Mn<rs;Mn+=1)segmentsLengthPool.release(Fn[Mn]);return Fn.length=0,Fn},TrimModifier.prototype.processShapes=function(Fn){var Mn,rs;if(this._mdf||Fn){var is=this.o.v%360/360;if(is<0&&(is+=1),this.s.v>1?Mn=1+is:this.s.v<0?Mn=0+is:Mn=this.s.v+is,this.e.v>1?rs=1+is:this.e.v<0?rs=0+is:rs=this.e.v+is,Mn>rs){var os=Mn;Mn=rs,rs=os}Mn=Math.round(Mn*1e4)*1e-4,rs=Math.round(rs*1e4)*1e-4,this.sValue=Mn,this.eValue=rs}else Mn=this.sValue,rs=this.eValue;var as,us,ds=this.shapes.length,hs,ps,io,fo,mo,Ao=0;if(rs===Mn)for(us=0;us<ds;us+=1)this.shapes[us].localShapeCollection.releaseShapes(),this.shapes[us].shape._mdf=!0,this.shapes[us].shape.paths=this.shapes[us].localShapeCollection,this._mdf&&(this.shapes[us].pathsData.length=0);else if(rs===1&&Mn===0||rs===0&&Mn===1){if(this._mdf)for(us=0;us<ds;us+=1)this.shapes[us].pathsData.length=0,this.shapes[us].shape._mdf=!0}else{var $o=[],Lo,Go;for(us=0;us<ds;us+=1)if(Lo=this.shapes[us],!Lo.shape._mdf&&!this._mdf&&!Fn&&this.m!==2)Lo.shape.paths=Lo.localShapeCollection;else{if(as=Lo.shape.paths,ps=as._length,mo=0,!Lo.shape._mdf&&Lo.pathsData.length)mo=Lo.totalShapeLength;else{for(io=this.releasePathsData(Lo.pathsData),hs=0;hs<ps;hs+=1)fo=bez.getSegmentsLength(as.shapes[hs]),io.push(fo),mo+=fo.totalLength;Lo.totalShapeLength=mo,Lo.pathsData=io}Ao+=mo,Lo.shape._mdf=!0}var Yo=Mn,Wo=rs,Jo=0,xl;for(us=ds-1;us>=0;us-=1)if(Lo=this.shapes[us],Lo.shape._mdf){for(Go=Lo.localShapeCollection,Go.releaseShapes(),this.m===2&&ds>1?(xl=this.calculateShapeEdges(Mn,rs,Lo.totalShapeLength,Jo,Ao),Jo+=Lo.totalShapeLength):xl=[[Yo,Wo]],ps=xl.length,hs=0;hs<ps;hs+=1){Yo=xl[hs][0],Wo=xl[hs][1],$o.length=0,Wo<=1?$o.push({s:Lo.totalShapeLength*Yo,e:Lo.totalShapeLength*Wo}):Yo>=1?$o.push({s:Lo.totalShapeLength*(Yo-1),e:Lo.totalShapeLength*(Wo-1)}):($o.push({s:Lo.totalShapeLength*Yo,e:Lo.totalShapeLength}),$o.push({s:0,e:Lo.totalShapeLength*(Wo-1)}));var _l=this.addShapes(Lo,$o[0]);if($o[0].s!==$o[0].e){if($o.length>1){var Tl=Lo.shape.paths.shapes[Lo.shape.paths._length-1];if(Tl.c){var Sl=_l.pop();this.addPaths(_l,Go),_l=this.addShapes(Lo,$o[1],Sl)}else this.addPaths(_l,Go),_l=this.addShapes(Lo,$o[1])}this.addPaths(_l,Go)}}Lo.shape.paths=Go}}},TrimModifier.prototype.addPaths=function(Fn,Mn){var rs,is=Fn.length;for(rs=0;rs<is;rs+=1)Mn.addShape(Fn[rs])},TrimModifier.prototype.addSegment=function(Fn,Mn,rs,is,os,as,us){os.setXYAt(Mn[0],Mn[1],"o",as),os.setXYAt(rs[0],rs[1],"i",as+1),us&&os.setXYAt(Fn[0],Fn[1],"v",as),os.setXYAt(is[0],is[1],"v",as+1)},TrimModifier.prototype.addSegmentFromArray=function(Fn,Mn,rs,is){Mn.setXYAt(Fn[1],Fn[5],"o",rs),Mn.setXYAt(Fn[2],Fn[6],"i",rs+1),is&&Mn.setXYAt(Fn[0],Fn[4],"v",rs),Mn.setXYAt(Fn[3],Fn[7],"v",rs+1)},TrimModifier.prototype.addShapes=function(Fn,Mn,rs){var is=Fn.pathsData,os=Fn.shape.paths.shapes,as,us=Fn.shape.paths._length,ds,hs,ps=0,io,fo,mo,Ao,$o=[],Lo,Go=!0;for(rs?(fo=rs._length,Lo=rs._length):(rs=shapePool.newElement(),fo=0,Lo=0),$o.push(rs),as=0;as<us;as+=1){for(mo=is[as].lengths,rs.c=os[as].c,hs=os[as].c?mo.length:mo.length+1,ds=1;ds<hs;ds+=1)if(io=mo[ds-1],ps+io.addedLength<Mn.s)ps+=io.addedLength,rs.c=!1;else if(ps>Mn.e){rs.c=!1;break}else Mn.s<=ps&&Mn.e>=ps+io.addedLength?(this.addSegment(os[as].v[ds-1],os[as].o[ds-1],os[as].i[ds],os[as].v[ds],rs,fo,Go),Go=!1):(Ao=bez.getNewSegment(os[as].v[ds-1],os[as].v[ds],os[as].o[ds-1],os[as].i[ds],(Mn.s-ps)/io.addedLength,(Mn.e-ps)/io.addedLength,mo[ds-1]),this.addSegmentFromArray(Ao,rs,fo,Go),Go=!1,rs.c=!1),ps+=io.addedLength,fo+=1;if(os[as].c&&mo.length){if(io=mo[ds-1],ps<=Mn.e){var Yo=mo[ds-1].addedLength;Mn.s<=ps&&Mn.e>=ps+Yo?(this.addSegment(os[as].v[ds-1],os[as].o[ds-1],os[as].i[0],os[as].v[0],rs,fo,Go),Go=!1):(Ao=bez.getNewSegment(os[as].v[ds-1],os[as].v[0],os[as].o[ds-1],os[as].i[0],(Mn.s-ps)/Yo,(Mn.e-ps)/Yo,mo[ds-1]),this.addSegmentFromArray(Ao,rs,fo,Go),Go=!1,rs.c=!1)}else rs.c=!1;ps+=io.addedLength,fo+=1}if(rs._length&&(rs.setXYAt(rs.v[Lo][0],rs.v[Lo][1],"i",Lo),rs.setXYAt(rs.v[rs._length-1][0],rs.v[rs._length-1][1],"o",rs._length-1)),ps>Mn.e)break;as<us-1&&(rs=shapePool.newElement(),Go=!0,$o.push(rs),fo=0)}return $o};function PuckerAndBloatModifier(){}extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(Fn,Mn){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(Fn,Mn.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(Fn,Mn){var rs=Mn/100,is=[0,0],os=Fn._length,as=0;for(as=0;as<os;as+=1)is[0]+=Fn.v[as][0],is[1]+=Fn.v[as][1];is[0]/=os,is[1]/=os;var us=shapePool.newElement();us.c=Fn.c;var ds,hs,ps,io,fo,mo;for(as=0;as<os;as+=1)ds=Fn.v[as][0]+(is[0]-Fn.v[as][0])*rs,hs=Fn.v[as][1]+(is[1]-Fn.v[as][1])*rs,ps=Fn.o[as][0]+(is[0]-Fn.o[as][0])*-rs,io=Fn.o[as][1]+(is[1]-Fn.o[as][1])*-rs,fo=Fn.i[as][0]+(is[0]-Fn.i[as][0])*-rs,mo=Fn.i[as][1]+(is[1]-Fn.i[as][1])*-rs,us.setTripleAt(ds,hs,ps,io,fo,mo,as);return us},PuckerAndBloatModifier.prototype.processShapes=function(Fn){var Mn,rs,is=this.shapes.length,os,as,us=this.amount.v;if(us!==0){var ds,hs;for(rs=0;rs<is;rs+=1){if(ds=this.shapes[rs],hs=ds.localShapeCollection,!(!ds.shape._mdf&&!this._mdf&&!Fn))for(hs.releaseShapes(),ds.shape._mdf=!0,Mn=ds.shape.paths.shapes,as=ds.shape.paths._length,os=0;os<as;os+=1)hs.addShape(this.processPath(Mn[os],us));ds.shape.paths=ds.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=function(){var Fn=[0,0];function Mn(hs){var ps=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||ps,this.a&&hs.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&hs.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&hs.skewFromAxis(-this.sk.v,this.sa.v),this.r?hs.rotate(-this.r.v):hs.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?hs.translate(this.px.v,this.py.v,-this.pz.v):hs.translate(this.px.v,this.py.v,0):hs.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}function rs(hs){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||hs){var ps;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var io,fo;if(ps=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(io=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/ps,0),fo=this.p.getValueAtTime(this.p.keyframes[0].t/ps,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(io=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/ps,0),fo=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/ps,0)):(io=this.p.pv,fo=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/ps,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){io=[],fo=[];var mo=this.px,Ao=this.py;mo._caching.lastFrame+mo.offsetTime<=mo.keyframes[0].t?(io[0]=mo.getValueAtTime((mo.keyframes[0].t+.01)/ps,0),io[1]=Ao.getValueAtTime((Ao.keyframes[0].t+.01)/ps,0),fo[0]=mo.getValueAtTime(mo.keyframes[0].t/ps,0),fo[1]=Ao.getValueAtTime(Ao.keyframes[0].t/ps,0)):mo._caching.lastFrame+mo.offsetTime>=mo.keyframes[mo.keyframes.length-1].t?(io[0]=mo.getValueAtTime(mo.keyframes[mo.keyframes.length-1].t/ps,0),io[1]=Ao.getValueAtTime(Ao.keyframes[Ao.keyframes.length-1].t/ps,0),fo[0]=mo.getValueAtTime((mo.keyframes[mo.keyframes.length-1].t-.01)/ps,0),fo[1]=Ao.getValueAtTime((Ao.keyframes[Ao.keyframes.length-1].t-.01)/ps,0)):(io=[mo.pv,Ao.pv],fo[0]=mo.getValueAtTime((mo._caching.lastFrame+mo.offsetTime-.01)/ps,mo.offsetTime),fo[1]=Ao.getValueAtTime((Ao._caching.lastFrame+Ao.offsetTime-.01)/ps,Ao.offsetTime))}else fo=Fn,io=fo;this.v.rotate(-Math.atan2(io[1]-fo[1],io[0]-fo[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function is(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function os(){}function as(hs){this._addDynamicProperty(hs),this.elem.addDynamicProperty(hs),this._isDirty=!0}function us(hs,ps,io){if(this.elem=hs,this.frameId=-1,this.propType="transform",this.data=ps,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(io||hs),ps.p&&ps.p.s?(this.px=PropertyFactory.getProp(hs,ps.p.x,0,0,this),this.py=PropertyFactory.getProp(hs,ps.p.y,0,0,this),ps.p.z&&(this.pz=PropertyFactory.getProp(hs,ps.p.z,0,0,this))):this.p=PropertyFactory.getProp(hs,ps.p||{k:[0,0,0]},1,0,this),ps.rx){if(this.rx=PropertyFactory.getProp(hs,ps.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(hs,ps.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(hs,ps.rz,0,degToRads,this),ps.or.k[0].ti){var fo,mo=ps.or.k.length;for(fo=0;fo<mo;fo+=1)ps.or.k[fo].to=null,ps.or.k[fo].ti=null}this.or=PropertyFactory.getProp(hs,ps.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(hs,ps.r||{k:0},0,degToRads,this);ps.sk&&(this.sk=PropertyFactory.getProp(hs,ps.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(hs,ps.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(hs,ps.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(hs,ps.s||{k:[100,100,100]},1,.01,this),ps.o?this.o=PropertyFactory.getProp(hs,ps.o,0,.01,hs):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}us.prototype={applyToMatrix:Mn,getValue:rs,precalculateMatrix:is,autoOrient:os},extendPrototype([DynamicPropertyContainer],us),us.prototype.addDynamicProperty=as,us.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty;function ds(hs,ps,io){return new us(hs,ps,io)}return{getTransformProperty:ds}}();function RepeaterModifier(){}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(Fn,Mn){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(Fn,Mn.c,0,null,this),this.o=PropertyFactory.getProp(Fn,Mn.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(Fn,Mn.tr,this),this.so=PropertyFactory.getProp(Fn,Mn.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(Fn,Mn.tr.eo,0,.01,this),this.data=Mn,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(Fn,Mn,rs,is,os,as){var us=as?-1:1,ds=is.s.v[0]+(1-is.s.v[0])*(1-os),hs=is.s.v[1]+(1-is.s.v[1])*(1-os);Fn.translate(is.p.v[0]*us*os,is.p.v[1]*us*os,is.p.v[2]),Mn.translate(-is.a.v[0],-is.a.v[1],is.a.v[2]),Mn.rotate(-is.r.v*us*os),Mn.translate(is.a.v[0],is.a.v[1],is.a.v[2]),rs.translate(-is.a.v[0],-is.a.v[1],is.a.v[2]),rs.scale(as?1/ds:ds,as?1/hs:hs),rs.translate(is.a.v[0],is.a.v[1],is.a.v[2])},RepeaterModifier.prototype.init=function(Fn,Mn,rs,is){for(this.elem=Fn,this.arr=Mn,this.pos=rs,this.elemsData=is,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(Fn),this.initModifierProperties(Fn,Mn[rs]);rs>0;)rs-=1,this._elements.unshift(Mn[rs]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(Fn){var Mn,rs=Fn.length;for(Mn=0;Mn<rs;Mn+=1)Fn[Mn]._processed=!1,Fn[Mn].ty==="gr"&&this.resetElements(Fn[Mn].it)},RepeaterModifier.prototype.cloneElements=function(Fn){var Mn=JSON.parse(JSON.stringify(Fn));return this.resetElements(Mn),Mn},RepeaterModifier.prototype.changeGroupRender=function(Fn,Mn){var rs,is=Fn.length;for(rs=0;rs<is;rs+=1)Fn[rs]._render=Mn,Fn[rs].ty==="gr"&&this.changeGroupRender(Fn[rs].it,Mn)},RepeaterModifier.prototype.processShapes=function(Fn){var Mn,rs,is,os,as,us=!1;if(this._mdf||Fn){var ds=Math.ceil(this.c.v);if(this._groups.length<ds){for(;this._groups.length<ds;){var hs={it:this.cloneElements(this._elements),ty:"gr"};hs.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,hs),this._groups.splice(0,0,hs),this._currentCopies+=1}this.elem.reloadShapes(),us=!0}as=0;var ps;for(is=0;is<=this._groups.length-1;is+=1){if(ps=as<ds,this._groups[is]._render=ps,this.changeGroupRender(this._groups[is].it,ps),!ps){var io=this.elemsData[is].it,fo=io[io.length-1];fo.transform.op.v!==0?(fo.transform.op._mdf=!0,fo.transform.op.v=0):fo.transform.op._mdf=!1}as+=1}this._currentCopies=ds;var mo=this.o.v,Ao=mo%1,$o=mo>0?Math.floor(mo):Math.ceil(mo),Lo=this.pMatrix.props,Go=this.rMatrix.props,Yo=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var Wo=0;if(mo>0){for(;Wo<$o;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),Wo+=1;Ao&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,Ao,!1),Wo+=Ao)}else if(mo<0){for(;Wo>$o;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),Wo-=1;Ao&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-Ao,!0),Wo-=Ao)}is=this.data.m===1?0:this._currentCopies-1,os=this.data.m===1?1:-1,as=this._currentCopies;for(var Jo,xl;as;){if(Mn=this.elemsData[is].it,rs=Mn[Mn.length-1].transform.mProps.v.props,xl=rs.length,Mn[Mn.length-1].transform.mProps._mdf=!0,Mn[Mn.length-1].transform.op._mdf=!0,Mn[Mn.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(is/(this._currentCopies-1)),Wo!==0){for((is!==0&&os===1||is!==this._currentCopies-1&&os===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(Go[0],Go[1],Go[2],Go[3],Go[4],Go[5],Go[6],Go[7],Go[8],Go[9],Go[10],Go[11],Go[12],Go[13],Go[14],Go[15]),this.matrix.transform(Yo[0],Yo[1],Yo[2],Yo[3],Yo[4],Yo[5],Yo[6],Yo[7],Yo[8],Yo[9],Yo[10],Yo[11],Yo[12],Yo[13],Yo[14],Yo[15]),this.matrix.transform(Lo[0],Lo[1],Lo[2],Lo[3],Lo[4],Lo[5],Lo[6],Lo[7],Lo[8],Lo[9],Lo[10],Lo[11],Lo[12],Lo[13],Lo[14],Lo[15]),Jo=0;Jo<xl;Jo+=1)rs[Jo]=this.matrix.props[Jo];this.matrix.reset()}else for(this.matrix.reset(),Jo=0;Jo<xl;Jo+=1)rs[Jo]=this.matrix.props[Jo];Wo+=1,as-=1,is+=os}}else for(as=this._currentCopies,is=0,os=1;as;)Mn=this.elemsData[is].it,rs=Mn[Mn.length-1].transform.mProps.v.props,Mn[Mn.length-1].transform.mProps._mdf=!1,Mn[Mn.length-1].transform.op._mdf=!1,as-=1,is+=os;return us},RepeaterModifier.prototype.addShape=function(){};function RoundCornersModifier(){}extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(Fn,Mn){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(Fn,Mn.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(Fn,Mn){var rs=shapePool.newElement();rs.c=Fn.c;var is,os=Fn._length,as,us,ds,hs,ps,io,fo=0,mo,Ao,$o,Lo,Go,Yo;for(is=0;is<os;is+=1)as=Fn.v[is],ds=Fn.o[is],us=Fn.i[is],as[0]===ds[0]&&as[1]===ds[1]&&as[0]===us[0]&&as[1]===us[1]?(is===0||is===os-1)&&!Fn.c?(rs.setTripleAt(as[0],as[1],ds[0],ds[1],us[0],us[1],fo),fo+=1):(is===0?hs=Fn.v[os-1]:hs=Fn.v[is-1],ps=Math.sqrt(Math.pow(as[0]-hs[0],2)+Math.pow(as[1]-hs[1],2)),io=ps?Math.min(ps/2,Mn)/ps:0,Go=as[0]+(hs[0]-as[0])*io,mo=Go,Yo=as[1]-(as[1]-hs[1])*io,Ao=Yo,$o=mo-(mo-as[0])*roundCorner,Lo=Ao-(Ao-as[1])*roundCorner,rs.setTripleAt(mo,Ao,$o,Lo,Go,Yo,fo),fo+=1,is===os-1?hs=Fn.v[0]:hs=Fn.v[is+1],ps=Math.sqrt(Math.pow(as[0]-hs[0],2)+Math.pow(as[1]-hs[1],2)),io=ps?Math.min(ps/2,Mn)/ps:0,$o=as[0]+(hs[0]-as[0])*io,mo=$o,Lo=as[1]+(hs[1]-as[1])*io,Ao=Lo,Go=mo-(mo-as[0])*roundCorner,Yo=Ao-(Ao-as[1])*roundCorner,rs.setTripleAt(mo,Ao,$o,Lo,Go,Yo,fo),fo+=1):(rs.setTripleAt(Fn.v[is][0],Fn.v[is][1],Fn.o[is][0],Fn.o[is][1],Fn.i[is][0],Fn.i[is][1],fo),fo+=1);return rs},RoundCornersModifier.prototype.processShapes=function(Fn){var Mn,rs,is=this.shapes.length,os,as,us=this.rd.v;if(us!==0){var ds,hs;for(rs=0;rs<is;rs+=1){if(ds=this.shapes[rs],hs=ds.localShapeCollection,!(!ds.shape._mdf&&!this._mdf&&!Fn))for(hs.releaseShapes(),ds.shape._mdf=!0,Mn=ds.shape.paths.shapes,as=ds.shape.paths._length,os=0;os<as;os+=1)hs.addShape(this.processPath(Mn[os],us));ds.shape.paths=ds.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function floatEqual(Fn,Mn){return Math.abs(Fn-Mn)*1e5<=Math.min(Math.abs(Fn),Math.abs(Mn))}function floatZero(Fn){return Math.abs(Fn)<=1e-5}function lerp(Fn,Mn,rs){return Fn*(1-rs)+Mn*rs}function lerpPoint(Fn,Mn,rs){return[lerp(Fn[0],Mn[0],rs),lerp(Fn[1],Mn[1],rs)]}function quadRoots(Fn,Mn,rs){if(Fn===0)return[];var is=Mn*Mn-4*Fn*rs;if(is<0)return[];var os=-Mn/(2*Fn);if(is===0)return[os];var as=Math.sqrt(is)/(2*Fn);return[os-as,os+as]}function polynomialCoefficients(Fn,Mn,rs,is){return[-Fn+3*Mn-3*rs+is,3*Fn-6*Mn+3*rs,-3*Fn+3*Mn,Fn]}function singlePoint(Fn){return new PolynomialBezier(Fn,Fn,Fn,Fn,!1)}function PolynomialBezier(Fn,Mn,rs,is,os){os&&pointEqual(Fn,Mn)&&(Mn=lerpPoint(Fn,is,1/3)),os&&pointEqual(rs,is)&&(rs=lerpPoint(Fn,is,2/3));var as=polynomialCoefficients(Fn[0],Mn[0],rs[0],is[0]),us=polynomialCoefficients(Fn[1],Mn[1],rs[1],is[1]);this.a=[as[0],us[0]],this.b=[as[1],us[1]],this.c=[as[2],us[2]],this.d=[as[3],us[3]],this.points=[Fn,Mn,rs,is]}PolynomialBezier.prototype.point=function(Fn){return[((this.a[0]*Fn+this.b[0])*Fn+this.c[0])*Fn+this.d[0],((this.a[1]*Fn+this.b[1])*Fn+this.c[1])*Fn+this.d[1]]},PolynomialBezier.prototype.derivative=function(Fn){return[(3*Fn*this.a[0]+2*this.b[0])*Fn+this.c[0],(3*Fn*this.a[1]+2*this.b[1])*Fn+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(Fn){var Mn=this.derivative(Fn);return Math.atan2(Mn[1],Mn[0])},PolynomialBezier.prototype.normalAngle=function(Fn){var Mn=this.derivative(Fn);return Math.atan2(Mn[0],Mn[1])},PolynomialBezier.prototype.inflectionPoints=function(){var Fn=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(Fn))return[];var Mn=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/Fn,rs=Mn*Mn-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/Fn;if(rs<0)return[];var is=Math.sqrt(rs);return floatZero(is)?is>0&&is<1?[Mn]:[]:[Mn-is,Mn+is].filter(function(os){return os>0&&os<1})},PolynomialBezier.prototype.split=function(Fn){if(Fn<=0)return[singlePoint(this.points[0]),this];if(Fn>=1)return[this,singlePoint(this.points[this.points.length-1])];var Mn=lerpPoint(this.points[0],this.points[1],Fn),rs=lerpPoint(this.points[1],this.points[2],Fn),is=lerpPoint(this.points[2],this.points[3],Fn),os=lerpPoint(Mn,rs,Fn),as=lerpPoint(rs,is,Fn),us=lerpPoint(os,as,Fn);return[new PolynomialBezier(this.points[0],Mn,os,us,!0),new PolynomialBezier(us,as,is,this.points[3],!0)]};function extrema(Fn,Mn){var rs=Fn.points[0][Mn],is=Fn.points[Fn.points.length-1][Mn];if(rs>is){var os=is;is=rs,rs=os}for(var as=quadRoots(3*Fn.a[Mn],2*Fn.b[Mn],Fn.c[Mn]),us=0;us<as.length;us+=1)if(as[us]>0&&as[us]<1){var ds=Fn.point(as[us])[Mn];ds<rs?rs=ds:ds>is&&(is=ds)}return{min:rs,max:is}}PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var Fn=this.bounds();return{left:Fn.x.min,right:Fn.x.max,top:Fn.y.min,bottom:Fn.y.max,width:Fn.x.max-Fn.x.min,height:Fn.y.max-Fn.y.min,cx:(Fn.x.max+Fn.x.min)/2,cy:(Fn.y.max+Fn.y.min)/2}};function intersectData(Fn,Mn,rs){var is=Fn.boundingBox();return{cx:is.cx,cy:is.cy,width:is.width,height:is.height,bez:Fn,t:(Mn+rs)/2,t1:Mn,t2:rs}}function splitData(Fn){var Mn=Fn.bez.split(.5);return[intersectData(Mn[0],Fn.t1,Fn.t),intersectData(Mn[1],Fn.t,Fn.t2)]}function boxIntersect(Fn,Mn){return Math.abs(Fn.cx-Mn.cx)*2<Fn.width+Mn.width&&Math.abs(Fn.cy-Mn.cy)*2<Fn.height+Mn.height}function intersectsImpl(Fn,Mn,rs,is,os,as){if(boxIntersect(Fn,Mn)){if(rs>=as||Fn.width<=is&&Fn.height<=is&&Mn.width<=is&&Mn.height<=is){os.push([Fn.t,Mn.t]);return}var us=splitData(Fn),ds=splitData(Mn);intersectsImpl(us[0],ds[0],rs+1,is,os,as),intersectsImpl(us[0],ds[1],rs+1,is,os,as),intersectsImpl(us[1],ds[0],rs+1,is,os,as),intersectsImpl(us[1],ds[1],rs+1,is,os,as)}}PolynomialBezier.prototype.intersections=function(Fn,Mn,rs){Mn===void 0&&(Mn=2),rs===void 0&&(rs=7);var is=[];return intersectsImpl(intersectData(this,0,1),intersectData(Fn,0,1),0,Mn,is,rs),is},PolynomialBezier.shapeSegment=function(Fn,Mn){var rs=(Mn+1)%Fn.length();return new PolynomialBezier(Fn.v[Mn],Fn.o[Mn],Fn.i[rs],Fn.v[rs],!0)},PolynomialBezier.shapeSegmentInverted=function(Fn,Mn){var rs=(Mn+1)%Fn.length();return new PolynomialBezier(Fn.v[rs],Fn.i[rs],Fn.o[Mn],Fn.v[Mn],!0)};function crossProduct(Fn,Mn){return[Fn[1]*Mn[2]-Fn[2]*Mn[1],Fn[2]*Mn[0]-Fn[0]*Mn[2],Fn[0]*Mn[1]-Fn[1]*Mn[0]]}function lineIntersection(Fn,Mn,rs,is){var os=[Fn[0],Fn[1],1],as=[Mn[0],Mn[1],1],us=[rs[0],rs[1],1],ds=[is[0],is[1],1],hs=crossProduct(crossProduct(os,as),crossProduct(us,ds));return floatZero(hs[2])?null:[hs[0]/hs[2],hs[1]/hs[2]]}function polarOffset(Fn,Mn,rs){return[Fn[0]+Math.cos(Mn)*rs,Fn[1]-Math.sin(Mn)*rs]}function pointDistance(Fn,Mn){return Math.hypot(Fn[0]-Mn[0],Fn[1]-Mn[1])}function pointEqual(Fn,Mn){return floatEqual(Fn[0],Mn[0])&&floatEqual(Fn[1],Mn[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(Fn,Mn){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(Fn,Mn.s,0,null,this),this.frequency=PropertyFactory.getProp(Fn,Mn.r,0,null,this),this.pointsType=PropertyFactory.getProp(Fn,Mn.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function setPoint(Fn,Mn,rs,is,os,as,us){var ds=rs-Math.PI/2,hs=rs+Math.PI/2,ps=Mn[0]+Math.cos(rs)*is*os,io=Mn[1]-Math.sin(rs)*is*os;Fn.setTripleAt(ps,io,ps+Math.cos(ds)*as,io-Math.sin(ds)*as,ps+Math.cos(hs)*us,io-Math.sin(hs)*us,Fn.length())}function getPerpendicularVector(Fn,Mn){var rs=[Mn[0]-Fn[0],Mn[1]-Fn[1]],is=-Math.PI*.5,os=[Math.cos(is)*rs[0]-Math.sin(is)*rs[1],Math.sin(is)*rs[0]+Math.cos(is)*rs[1]];return os}function getProjectingAngle(Fn,Mn){var rs=Mn===0?Fn.length()-1:Mn-1,is=(Mn+1)%Fn.length(),os=Fn.v[rs],as=Fn.v[is],us=getPerpendicularVector(os,as);return Math.atan2(0,1)-Math.atan2(us[1],us[0])}function zigZagCorner(Fn,Mn,rs,is,os,as,us){var ds=getProjectingAngle(Mn,rs),hs=Mn.v[rs%Mn._length],ps=Mn.v[rs===0?Mn._length-1:rs-1],io=Mn.v[(rs+1)%Mn._length],fo=as===2?Math.sqrt(Math.pow(hs[0]-ps[0],2)+Math.pow(hs[1]-ps[1],2)):0,mo=as===2?Math.sqrt(Math.pow(hs[0]-io[0],2)+Math.pow(hs[1]-io[1],2)):0;setPoint(Fn,Mn.v[rs%Mn._length],ds,us,is,mo/((os+1)*2),fo/((os+1)*2))}function zigZagSegment(Fn,Mn,rs,is,os,as){for(var us=0;us<is;us+=1){var ds=(us+1)/(is+1),hs=os===2?Math.sqrt(Math.pow(Mn.points[3][0]-Mn.points[0][0],2)+Math.pow(Mn.points[3][1]-Mn.points[0][1],2)):0,ps=Mn.normalAngle(ds),io=Mn.point(ds);setPoint(Fn,io,ps,as,rs,hs/((is+1)*2),hs/((is+1)*2)),as=-as}return as}ZigZagModifier.prototype.processPath=function(Fn,Mn,rs,is){var os=Fn._length,as=shapePool.newElement();if(as.c=Fn.c,Fn.c||(os-=1),os===0)return as;var us=-1,ds=PolynomialBezier.shapeSegment(Fn,0);zigZagCorner(as,Fn,0,Mn,rs,is,us);for(var hs=0;hs<os;hs+=1)us=zigZagSegment(as,ds,Mn,rs,is,-us),hs===os-1&&!Fn.c?ds=null:ds=PolynomialBezier.shapeSegment(Fn,(hs+1)%os),zigZagCorner(as,Fn,hs+1,Mn,rs,is,us);return as},ZigZagModifier.prototype.processShapes=function(Fn){var Mn,rs,is=this.shapes.length,os,as,us=this.amplitude.v,ds=Math.max(0,Math.round(this.frequency.v)),hs=this.pointsType.v;if(us!==0){var ps,io;for(rs=0;rs<is;rs+=1){if(ps=this.shapes[rs],io=ps.localShapeCollection,!(!ps.shape._mdf&&!this._mdf&&!Fn))for(io.releaseShapes(),ps.shape._mdf=!0,Mn=ps.shape.paths.shapes,as=ps.shape.paths._length,os=0;os<as;os+=1)io.addShape(this.processPath(Mn[os],us,ds,hs));ps.shape.paths=ps.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function linearOffset(Fn,Mn,rs){var is=Math.atan2(Mn[0]-Fn[0],Mn[1]-Fn[1]);return[polarOffset(Fn,is,rs),polarOffset(Mn,is,rs)]}function offsetSegment(Fn,Mn){var rs,is,os,as,us,ds,hs;hs=linearOffset(Fn.points[0],Fn.points[1],Mn),rs=hs[0],is=hs[1],hs=linearOffset(Fn.points[1],Fn.points[2],Mn),os=hs[0],as=hs[1],hs=linearOffset(Fn.points[2],Fn.points[3],Mn),us=hs[0],ds=hs[1];var ps=lineIntersection(rs,is,os,as);ps===null&&(ps=is);var io=lineIntersection(us,ds,os,as);return io===null&&(io=us),new PolynomialBezier(rs,ps,io,ds)}function joinLines(Fn,Mn,rs,is,os){var as=Mn.points[3],us=rs.points[0];if(is===3||pointEqual(as,us))return as;if(is===2){var ds=-Mn.tangentAngle(1),hs=-rs.tangentAngle(0)+Math.PI,ps=lineIntersection(as,polarOffset(as,ds+Math.PI/2,100),us,polarOffset(us,ds+Math.PI/2,100)),io=ps?pointDistance(ps,as):pointDistance(as,us)/2,fo=polarOffset(as,ds,2*io*roundCorner);return Fn.setXYAt(fo[0],fo[1],"o",Fn.length()-1),fo=polarOffset(us,hs,2*io*roundCorner),Fn.setTripleAt(us[0],us[1],us[0],us[1],fo[0],fo[1],Fn.length()),us}var mo=pointEqual(as,Mn.points[2])?Mn.points[0]:Mn.points[2],Ao=pointEqual(us,rs.points[1])?rs.points[3]:rs.points[1],$o=lineIntersection(mo,as,us,Ao);return $o&&pointDistance($o,as)<os?(Fn.setTripleAt($o[0],$o[1],$o[0],$o[1],$o[0],$o[1],Fn.length()),$o):as}function getIntersection(Fn,Mn){var rs=Fn.intersections(Mn);return rs.length&&floatEqual(rs[0][0],1)&&rs.shift(),rs.length?rs[0]:null}function pruneSegmentIntersection(Fn,Mn){var rs=Fn.slice(),is=Mn.slice(),os=getIntersection(Fn[Fn.length-1],Mn[0]);return os&&(rs[Fn.length-1]=Fn[Fn.length-1].split(os[0])[0],is[0]=Mn[0].split(os[1])[1]),Fn.length>1&&Mn.length>1&&(os=getIntersection(Fn[0],Mn[Mn.length-1]),os)?[[Fn[0].split(os[0])[0]],[Mn[Mn.length-1].split(os[1])[1]]]:[rs,is]}function pruneIntersections(Fn){for(var Mn,rs=1;rs<Fn.length;rs+=1)Mn=pruneSegmentIntersection(Fn[rs-1],Fn[rs]),Fn[rs-1]=Mn[0],Fn[rs]=Mn[1];return Fn.length>1&&(Mn=pruneSegmentIntersection(Fn[Fn.length-1],Fn[0]),Fn[Fn.length-1]=Mn[0],Fn[0]=Mn[1]),Fn}function offsetSegmentSplit(Fn,Mn){var rs=Fn.inflectionPoints(),is,os,as,us;if(rs.length===0)return[offsetSegment(Fn,Mn)];if(rs.length===1||floatEqual(rs[1],1))return as=Fn.split(rs[0]),is=as[0],os=as[1],[offsetSegment(is,Mn),offsetSegment(os,Mn)];as=Fn.split(rs[0]),is=as[0];var ds=(rs[1]-rs[0])/(1-rs[0]);return as=as[1].split(ds),us=as[0],os=as[1],[offsetSegment(is,Mn),offsetSegment(us,Mn),offsetSegment(os,Mn)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(Fn,Mn){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(Fn,Mn.a,0,null,this),this.miterLimit=PropertyFactory.getProp(Fn,Mn.ml,0,null,this),this.lineJoin=Mn.lj,this._isAnimated=this.amount.effectsSequence.length!==0},OffsetPathModifier.prototype.processPath=function(Fn,Mn,rs,is){var os=shapePool.newElement();os.c=Fn.c;var as=Fn.length();Fn.c||(as-=1);var us,ds,hs,ps=[];for(us=0;us<as;us+=1)hs=PolynomialBezier.shapeSegment(Fn,us),ps.push(offsetSegmentSplit(hs,Mn));if(!Fn.c)for(us=as-1;us>=0;us-=1)hs=PolynomialBezier.shapeSegmentInverted(Fn,us),ps.push(offsetSegmentSplit(hs,Mn));ps=pruneIntersections(ps);var io=null,fo=null;for(us=0;us<ps.length;us+=1){var mo=ps[us];for(fo&&(io=joinLines(os,fo,mo[0],rs,is)),fo=mo[mo.length-1],ds=0;ds<mo.length;ds+=1)hs=mo[ds],io&&pointEqual(hs.points[0],io)?os.setXYAt(hs.points[1][0],hs.points[1][1],"o",os.length()-1):os.setTripleAt(hs.points[0][0],hs.points[0][1],hs.points[1][0],hs.points[1][1],hs.points[0][0],hs.points[0][1],os.length()),os.setTripleAt(hs.points[3][0],hs.points[3][1],hs.points[3][0],hs.points[3][1],hs.points[2][0],hs.points[2][1],os.length()),io=hs.points[3]}return ps.length&&joinLines(os,fo,ps[0][0],rs,is),os},OffsetPathModifier.prototype.processShapes=function(Fn){var Mn,rs,is=this.shapes.length,os,as,us=this.amount.v,ds=this.miterLimit.v,hs=this.lineJoin;if(us!==0){var ps,io;for(rs=0;rs<is;rs+=1){if(ps=this.shapes[rs],io=ps.localShapeCollection,!(!ps.shape._mdf&&!this._mdf&&!Fn))for(io.releaseShapes(),ps.shape._mdf=!0,Mn=ps.shape.paths.shapes,as=ps.shape.paths._length,os=0;os<as;os+=1)io.addShape(this.processPath(Mn[os],us,hs,ds));ps.shape.paths=ps.localShapeCollection}}this.dynamicProperties.length||(this._mdf=!1)};function getFontProperties(Fn){for(var Mn=Fn.fStyle?Fn.fStyle.split(" "):[],rs="normal",is="normal",os=Mn.length,as,us=0;us<os;us+=1)switch(as=Mn[us].toLowerCase(),as){case"italic":is="italic";break;case"bold":rs="700";break;case"black":rs="900";break;case"medium":rs="500";break;case"regular":case"normal":rs="400";break;case"light":case"thin":rs="200";break}return{style:is,weight:Fn.fWeight||rs}}var FontManager=function(){var Fn=5e3,Mn={w:0,size:0,shapes:[],data:{shapes:[]}},rs=[];rs=rs.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var is=127988,os=917631,as=917601,us=917626,ds=65039,hs=8205,ps=127462,io=127487,fo=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function mo(Qo){var El=Qo.split(","),Xo,Al=El.length,wl=[];for(Xo=0;Xo<Al;Xo+=1)El[Xo]!=="sans-serif"&&El[Xo]!=="monospace"&&wl.push(El[Xo]);return wl.join(",")}function Ao(Qo,El){var Xo=createTag("span");Xo.setAttribute("aria-hidden",!0),Xo.style.fontFamily=El;var Al=createTag("span");Al.innerText="giItT1WQy@!-/#",Xo.style.position="absolute",Xo.style.left="-10000px",Xo.style.top="-10000px",Xo.style.fontSize="300px",Xo.style.fontVariant="normal",Xo.style.fontStyle="normal",Xo.style.fontWeight="normal",Xo.style.letterSpacing="0",Xo.appendChild(Al),document.body.appendChild(Xo);var wl=Al.offsetWidth;return Al.style.fontFamily=mo(Qo)+", "+El,{node:Al,w:wl,parent:Xo}}function $o(){var Qo,El=this.fonts.length,Xo,Al,wl=El;for(Qo=0;Qo<El;Qo+=1)this.fonts[Qo].loaded?wl-=1:this.fonts[Qo].fOrigin==="n"||this.fonts[Qo].origin===0?this.fonts[Qo].loaded=!0:(Xo=this.fonts[Qo].monoCase.node,Al=this.fonts[Qo].monoCase.w,Xo.offsetWidth!==Al?(wl-=1,this.fonts[Qo].loaded=!0):(Xo=this.fonts[Qo].sansCase.node,Al=this.fonts[Qo].sansCase.w,Xo.offsetWidth!==Al&&(wl-=1,this.fonts[Qo].loaded=!0)),this.fonts[Qo].loaded&&(this.fonts[Qo].sansCase.parent.parentNode.removeChild(this.fonts[Qo].sansCase.parent),this.fonts[Qo].monoCase.parent.parentNode.removeChild(this.fonts[Qo].monoCase.parent)));wl!==0&&Date.now()-this.initTime<Fn?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)}function Lo(Qo,El){var Xo=document.body&&El?"svg":"canvas",Al,wl=getFontProperties(Qo);if(Xo==="svg"){var yl=createNS("text");yl.style.fontSize="100px",yl.setAttribute("font-family",Qo.fFamily),yl.setAttribute("font-style",wl.style),yl.setAttribute("font-weight",wl.weight),yl.textContent="1",Qo.fClass?(yl.style.fontFamily="inherit",yl.setAttribute("class",Qo.fClass)):yl.style.fontFamily=Qo.fFamily,El.appendChild(yl),Al=yl}else{var Il=new OffscreenCanvas(500,500).getContext("2d");Il.font=wl.style+" "+wl.weight+" 100px "+Qo.fFamily,Al=Il}function Bl(Gl){return Xo==="svg"?(Al.textContent=Gl,Al.getComputedTextLength()):Al.measureText(Gl).width}return{measureText:Bl}}function Go(Qo,El){if(!Qo){this.isLoaded=!0;return}if(this.chars){this.isLoaded=!0,this.fonts=Qo.list;return}if(!document.body){this.isLoaded=!0,Qo.list.forEach(function(Hl){Hl.helper=Lo(Hl),Hl.cache={}}),this.fonts=Qo.list;return}var Xo=Qo.list,Al,wl=Xo.length,yl=wl;for(Al=0;Al<wl;Al+=1){var Il=!0,Bl,Gl;if(Xo[Al].loaded=!1,Xo[Al].monoCase=Ao(Xo[Al].fFamily,"monospace"),Xo[Al].sansCase=Ao(Xo[Al].fFamily,"sans-serif"),!Xo[Al].fPath)Xo[Al].loaded=!0,yl-=1;else if(Xo[Al].fOrigin==="p"||Xo[Al].origin===3){if(Bl=document.querySelectorAll('style[f-forigin="p"][f-family="'+Xo[Al].fFamily+'"], style[f-origin="3"][f-family="'+Xo[Al].fFamily+'"]'),Bl.length>0&&(Il=!1),Il){var Nl=createTag("style");Nl.setAttribute("f-forigin",Xo[Al].fOrigin),Nl.setAttribute("f-origin",Xo[Al].origin),Nl.setAttribute("f-family",Xo[Al].fFamily),Nl.type="text/css",Nl.innerText="@font-face {font-family: "+Xo[Al].fFamily+"; font-style: normal; src: url('"+Xo[Al].fPath+"');}",El.appendChild(Nl)}}else if(Xo[Al].fOrigin==="g"||Xo[Al].origin===1){for(Bl=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),Gl=0;Gl<Bl.length;Gl+=1)Bl[Gl].href.indexOf(Xo[Al].fPath)!==-1&&(Il=!1);if(Il){var zl=createTag("link");zl.setAttribute("f-forigin",Xo[Al].fOrigin),zl.setAttribute("f-origin",Xo[Al].origin),zl.type="text/css",zl.rel="stylesheet",zl.href=Xo[Al].fPath,document.body.appendChild(zl)}}else if(Xo[Al].fOrigin==="t"||Xo[Al].origin===2){for(Bl=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),Gl=0;Gl<Bl.length;Gl+=1)Xo[Al].fPath===Bl[Gl].src&&(Il=!1);if(Il){var Vl=createTag("link");Vl.setAttribute("f-forigin",Xo[Al].fOrigin),Vl.setAttribute("f-origin",Xo[Al].origin),Vl.setAttribute("rel","stylesheet"),Vl.setAttribute("href",Xo[Al].fPath),El.appendChild(Vl)}}Xo[Al].helper=Lo(Xo[Al],El),Xo[Al].cache={},this.fonts.push(Xo[Al])}yl===0?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}function Yo(Qo){if(Qo){this.chars||(this.chars=[]);var El,Xo=Qo.length,Al,wl=this.chars.length,yl;for(El=0;El<Xo;El+=1){for(Al=0,yl=!1;Al<wl;)this.chars[Al].style===Qo[El].style&&this.chars[Al].fFamily===Qo[El].fFamily&&this.chars[Al].ch===Qo[El].ch&&(yl=!0),Al+=1;yl||(this.chars.push(Qo[El]),wl+=1)}}}function Wo(Qo,El,Xo){for(var Al=0,wl=this.chars.length;Al<wl;){if(this.chars[Al].ch===Qo&&this.chars[Al].style===El&&this.chars[Al].fFamily===Xo)return this.chars[Al];Al+=1}return(typeof Qo=="string"&&Qo.charCodeAt(0)!==13||!Qo)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",Qo,El,Xo)),Mn}function Jo(Qo,El,Xo){var Al=this.getFontByName(El),wl=Qo;if(!Al.cache[wl]){var yl=Al.helper;if(Qo===" "){var Il=yl.measureText("|"+Qo+"|"),Bl=yl.measureText("||");Al.cache[wl]=(Il-Bl)/100}else Al.cache[wl]=yl.measureText(Qo)/100}return Al.cache[wl]*Xo}function xl(Qo){for(var El=0,Xo=this.fonts.length;El<Xo;){if(this.fonts[El].fName===Qo)return this.fonts[El];El+=1}return this.fonts[0]}function _l(Qo){var El=0,Xo=Qo.charCodeAt(0);if(Xo>=55296&&Xo<=56319){var Al=Qo.charCodeAt(1);Al>=56320&&Al<=57343&&(El=(Xo-55296)*1024+Al-56320+65536)}return El}function Tl(Qo,El){var Xo=Qo.toString(16)+El.toString(16);return fo.indexOf(Xo)!==-1}function Sl(Qo){return Qo===hs}function $l(Qo){return Qo===ds}function Pl(Qo){var El=_l(Qo);return El>=ps&&El<=io}function Dl(Qo){return Pl(Qo.substr(0,2))&&Pl(Qo.substr(2,2))}function Ol(Qo){return rs.indexOf(Qo)!==-1}function Rl(Qo,El){var Xo=_l(Qo.substr(El,2));if(Xo!==is)return!1;var Al=0;for(El+=2;Al<5;){if(Xo=_l(Qo.substr(El,2)),Xo<as||Xo>us)return!1;Al+=1,El+=2}return _l(Qo.substr(El,2))===os}function Vo(){this.isLoaded=!0}var jo=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};jo.isModifier=Tl,jo.isZeroWidthJoiner=Sl,jo.isFlagEmoji=Dl,jo.isRegionalCode=Pl,jo.isCombinedCharacter=Ol,jo.isRegionalFlag=Rl,jo.isVariationSelector=$l,jo.BLACK_FLAG_CODE_POINT=is;var Ho={addChars:Yo,addFonts:Go,getCharData:Wo,getFontByName:xl,measureText:Jo,checkLoadedFonts:$o,setIsLoaded:Vo};return jo.prototype=Ho,jo}();function SlotManager(Fn){this.animationData=Fn}SlotManager.prototype.getProp=function(Fn){return this.animationData.slots&&this.animationData.slots[Fn.sid]?Object.assign(Fn,this.animationData.slots[Fn.sid].p):Fn};function slotFactory(Fn){return new SlotManager(Fn)}function RenderableElement(){}RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(Mn){this.renderableComponents.indexOf(Mn)===-1&&this.renderableComponents.push(Mn)},removeRenderableComponent:function(Mn){this.renderableComponents.indexOf(Mn)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(Mn),1)},prepareRenderableFrame:function(Mn){this.checkLayerLimits(Mn)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(Mn){this.data.ip-this.data.st<=Mn&&this.data.op-this.data.st>Mn?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var Mn,rs=this.renderableComponents.length;for(Mn=0;Mn<rs;Mn+=1)this.renderableComponents[Mn].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return this.data.ty===5?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=function(){var Fn={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"};return function(Mn){return Fn[Mn]||""}}();function SliderEffect(Fn,Mn,rs){this.p=PropertyFactory.getProp(Mn,Fn.v,0,0,rs)}function AngleEffect(Fn,Mn,rs){this.p=PropertyFactory.getProp(Mn,Fn.v,0,0,rs)}function ColorEffect(Fn,Mn,rs){this.p=PropertyFactory.getProp(Mn,Fn.v,1,0,rs)}function PointEffect(Fn,Mn,rs){this.p=PropertyFactory.getProp(Mn,Fn.v,1,0,rs)}function LayerIndexEffect(Fn,Mn,rs){this.p=PropertyFactory.getProp(Mn,Fn.v,0,0,rs)}function MaskIndexEffect(Fn,Mn,rs){this.p=PropertyFactory.getProp(Mn,Fn.v,0,0,rs)}function CheckboxEffect(Fn,Mn,rs){this.p=PropertyFactory.getProp(Mn,Fn.v,0,0,rs)}function NoValueEffect(){this.p={}}function EffectsManager(Fn,Mn){var rs=Fn.ef||[];this.effectElements=[];var is,os=rs.length,as;for(is=0;is<os;is+=1)as=new GroupEffect(rs[is],Mn),this.effectElements.push(as)}function GroupEffect(Fn,Mn){this.init(Fn,Mn)}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(Fn,Mn){this.data=Fn,this.effectElements=[],this.initDynamicPropertyContainer(Mn);var rs,is=this.data.ef.length,os,as=this.data.ef;for(rs=0;rs<is;rs+=1){switch(os=null,as[rs].ty){case 0:os=new SliderEffect(as[rs],Mn,this);break;case 1:os=new AngleEffect(as[rs],Mn,this);break;case 2:os=new ColorEffect(as[rs],Mn,this);break;case 3:os=new PointEffect(as[rs],Mn,this);break;case 4:case 7:os=new CheckboxEffect(as[rs],Mn,this);break;case 10:os=new LayerIndexEffect(as[rs],Mn,this);break;case 11:os=new MaskIndexEffect(as[rs],Mn,this);break;case 5:os=new EffectsManager(as[rs],Mn);break;default:os=new NoValueEffect(as[rs]);break}os&&this.effectElements.push(os)}};function BaseElement(){}BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var Mn=0,rs=this.data.masksProperties.length;Mn<rs;){if(this.data.masksProperties[Mn].mode!=="n"&&this.data.masksProperties[Mn].cl!==!1)return!0;Mn+=1}return!1},initExpressions:function(){var Mn=getExpressionInterfaces();if(Mn){var rs=Mn("layer"),is=Mn("effects"),os=Mn("shape"),as=Mn("text"),us=Mn("comp");this.layerInterface=rs(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var ds=is.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(ds),this.data.ty===0||this.data.xt?this.compInterface=us(this):this.data.ty===4?(this.layerInterface.shapeInterface=os(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):this.data.ty===5&&(this.layerInterface.textInterface=as(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function(){var Mn=getBlendMode(this.data.bm),rs=this.baseElement||this.layerElement;rs.style["mix-blend-mode"]=Mn},initBaseData:function(Mn,rs,is){this.globalData=rs,this.comp=is,this.data=Mn,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}};function FrameElement(){}FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(Mn,rs){var is,os=this.dynamicProperties.length;for(is=0;is<os;is+=1)(rs||this._isParent&&this.dynamicProperties[is].propType==="transform")&&(this.dynamicProperties[is].getValue(),this.dynamicProperties[is]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(Mn){this.dynamicProperties.indexOf(Mn)===-1&&this.dynamicProperties.push(Mn)}};function FootageElement(Fn,Mn,rs){this.initFrame(),this.initRenderable(),this.assetData=Mn.getAssetData(Fn.refId),this.footageData=Mn.imageLoader.getAsset(this.assetData),this.initBaseData(Fn,Mn,rs)}FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var Fn=getExpressionInterfaces();if(Fn){var Mn=Fn("footage");this.layerInterface=Mn(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData};function AudioElement(Fn,Mn,rs){this.initFrame(),this.initRenderable(),this.assetData=Mn.getAssetData(Fn.refId),this.initBaseData(Fn,Mn,rs),this._isPlaying=!1,this._canPlay=!1;var is=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(is),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=Fn.tm?PropertyFactory.getProp(this,Fn.tm,0,Mn.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,Fn.au&&Fn.au.lv?Fn.au.lv:{k:[100]},1,.01,this)}AudioElement.prototype.prepareFrame=function(Fn){if(this.prepareRenderableFrame(Fn,!0),this.prepareProperties(Fn,!0),this.tm._placeholder)this._currentTime=Fn/this.data.sr;else{var Mn=this.tm.v;this._currentTime=Mn}this._volume=this.lv.v[0];var rs=this._volume*this._volumeMultiplier;this._previousVolume!==rs&&(this._previousVolume=rs,this.audio.volume(rs))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(Fn){this.audio.rate(Fn)},AudioElement.prototype.volume=function(Fn){this._volumeMultiplier=Fn,this._previousVolume=Fn*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(Fn){var Mn,rs=this.layers.length,is;for(this.completeLayers=!0,Mn=rs-1;Mn>=0;Mn-=1)this.elements[Mn]||(is=this.layers[Mn],is.ip-is.st<=Fn-this.layers[Mn].st&&is.op-is.st>Fn-this.layers[Mn].st&&this.buildItem(Mn)),this.completeLayers=this.elements[Mn]?this.completeLayers:!1;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(Fn){switch(Fn.ty){case 2:return this.createImage(Fn);case 0:return this.createComp(Fn);case 1:return this.createSolid(Fn);case 3:return this.createNull(Fn);case 4:return this.createShape(Fn);case 5:return this.createText(Fn);case 6:return this.createAudio(Fn);case 13:return this.createCamera(Fn);case 15:return this.createFootage(Fn);default:return this.createNull(Fn)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(Fn){return new AudioElement(Fn,this.globalData,this)},BaseRenderer.prototype.createFootage=function(Fn){return new FootageElement(Fn,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var Fn,Mn=this.layers.length;for(Fn=0;Fn<Mn;Fn+=1)this.buildItem(Fn);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(Fn){this.completeLayers=!1;var Mn,rs=Fn.length,is,os=this.layers.length;for(Mn=0;Mn<rs;Mn+=1)for(is=0;is<os;){if(this.layers[is].id===Fn[Mn].id){this.layers[is]=Fn[Mn];break}is+=1}},BaseRenderer.prototype.setProjectInterface=function(Fn){this.globalData.projectInterface=Fn},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(Fn,Mn,rs){for(var is=this.elements,os=this.layers,as=0,us=os.length;as<us;)os[as].ind==Mn&&(!is[as]||is[as]===!0?(this.buildItem(as),this.addPendingElement(Fn)):(rs.push(is[as]),is[as].setAsParent(),os[as].parent!==void 0?this.buildElementParenting(Fn,os[as].parent,rs):Fn.setHierarchy(rs))),as+=1},BaseRenderer.prototype.addPendingElement=function(Fn){this.pendingElements.push(Fn)},BaseRenderer.prototype.searchExtraCompositions=function(Fn){var Mn,rs=Fn.length;for(Mn=0;Mn<rs;Mn+=1)if(Fn[Mn].xt){var is=this.createComp(Fn[Mn]);is.initExpressions(),this.globalData.projectInterface.registerComposition(is)}},BaseRenderer.prototype.getElementById=function(Fn){var Mn,rs=this.elements.length;for(Mn=0;Mn<rs;Mn+=1)if(this.elements[Mn].data.ind===Fn)return this.elements[Mn];return null},BaseRenderer.prototype.getElementByPath=function(Fn){var Mn=Fn.shift(),rs;if(typeof Mn=="number")rs=this.elements[Mn];else{var is,os=this.elements.length;for(is=0;is<os;is+=1)if(this.elements[is].data.nm===Mn){rs=this.elements[is];break}}return Fn.length===0?rs:rs.getElementByPath(Fn)},BaseRenderer.prototype.setupGlobalData=function(Fn,Mn){this.globalData.fontManager=new FontManager,this.globalData.slotManager=slotFactory(Fn),this.globalData.fontManager.addChars(Fn.chars),this.globalData.fontManager.addFonts(Fn.fonts,Mn),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=Fn.fr,this.globalData.nm=Fn.nm,this.globalData.compSize={w:Fn.w,h:Fn.h}};var effectTypes={TRANSFORM_EFFECT:"transformEFfect"};function TransformElement(){}TransformElement.prototype={initTransform:function(){var Mn=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:Mn,localMat:Mn,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var Mn,rs=this.finalTransform.mat,is=0,os=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;is<os;){if(this.hierarchy[is].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}is+=1}if(this.finalTransform._matMdf)for(Mn=this.finalTransform.mProp.v.props,rs.cloneFromProps(Mn),is=0;is<os;is+=1)rs.multiply(this.hierarchy[is].finalTransform.mProp.v)}this.finalTransform._matMdf&&(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var Mn=0,rs=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;Mn<rs;)this.localTransforms[Mn]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[Mn]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),Mn+=1;if(this.finalTransform._localMatMdf){var is=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(is),Mn=1;Mn<rs;Mn+=1){var os=this.localTransforms[Mn].matrix;is.multiply(os)}is.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var as=this.finalTransform.localOpacity;for(Mn=0;Mn<rs;Mn+=1)as*=this.localTransforms[Mn].opacity*.01;this.finalTransform.localOpacity=as}}},searchEffectTransforms:function(){if(this.renderableEffectsManager){var Mn=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);if(Mn.length){this.localTransforms=[],this.finalTransform.localMat=new Matrix;var rs=0,is=Mn.length;for(rs=0;rs<is;rs+=1)this.localTransforms.push(Mn[rs])}}},globalToLocal:function(Mn){var rs=[];rs.push(this.finalTransform);for(var is=!0,os=this.comp;is;)os.finalTransform?(os.data.hasMask&&rs.splice(0,0,os.finalTransform),os=os.comp):is=!1;var as,us=rs.length,ds;for(as=0;as<us;as+=1)ds=rs[as].mat.applyToPointArray(0,0,0),Mn=[Mn[0]-ds[0],Mn[1]-ds[1],0];return Mn},mHelper:new Matrix};function MaskElement(Fn,Mn,rs){this.data=Fn,this.element=Mn,this.globalData=rs,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var is=this.globalData.defs,os,as=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(as),this.solidPath="";var us,ds=this.masksProperties,hs=0,ps=[],io,fo,mo=createElementID(),Ao,$o,Lo,Go,Yo="clipPath",Wo="clip-path";for(os=0;os<as;os+=1)if((ds[os].mode!=="a"&&ds[os].mode!=="n"||ds[os].inv||ds[os].o.k!==100||ds[os].o.x)&&(Yo="mask",Wo="mask"),(ds[os].mode==="s"||ds[os].mode==="i")&&hs===0?(Ao=createNS("rect"),Ao.setAttribute("fill","#ffffff"),Ao.setAttribute("width",this.element.comp.data.w||0),Ao.setAttribute("height",this.element.comp.data.h||0),ps.push(Ao)):Ao=null,us=createNS("path"),ds[os].mode==="n")this.viewData[os]={op:PropertyFactory.getProp(this.element,ds[os].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,ds[os],3),elem:us,lastPath:""},is.appendChild(us);else{hs+=1,us.setAttribute("fill",ds[os].mode==="s"?"#000000":"#ffffff"),us.setAttribute("clip-rule","nonzero");var Jo;if(ds[os].x.k!==0?(Yo="mask",Wo="mask",Go=PropertyFactory.getProp(this.element,ds[os].x,0,null,this.element),Jo=createElementID(),$o=createNS("filter"),$o.setAttribute("id",Jo),Lo=createNS("feMorphology"),Lo.setAttribute("operator","erode"),Lo.setAttribute("in","SourceGraphic"),Lo.setAttribute("radius","0"),$o.appendChild(Lo),is.appendChild($o),us.setAttribute("stroke",ds[os].mode==="s"?"#000000":"#ffffff")):(Lo=null,Go=null),this.storedData[os]={elem:us,x:Go,expan:Lo,lastPath:"",lastOperator:"",filterId:Jo,lastRadius:0},ds[os].mode==="i"){fo=ps.length;var xl=createNS("g");for(io=0;io<fo;io+=1)xl.appendChild(ps[io]);var _l=createNS("mask");_l.setAttribute("mask-type","alpha"),_l.setAttribute("id",mo+"_"+hs),_l.appendChild(us),is.appendChild(_l),xl.setAttribute("mask","url("+getLocationHref()+"#"+mo+"_"+hs+")"),ps.length=0,ps.push(xl)}else ps.push(us);ds[os].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[os]={elem:us,lastPath:"",op:PropertyFactory.getProp(this.element,ds[os].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,ds[os],3),invRect:Ao},this.viewData[os].prop.k||this.drawPath(ds[os],this.viewData[os].prop.v,this.viewData[os])}for(this.maskElement=createNS(Yo),as=ps.length,os=0;os<as;os+=1)this.maskElement.appendChild(ps[os]);hs>0&&(this.maskElement.setAttribute("id",mo),this.element.maskedElement.setAttribute(Wo,"url("+getLocationHref()+"#"+mo+")"),is.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}MaskElement.prototype.getMaskProperty=function(Fn){return this.viewData[Fn].prop},MaskElement.prototype.renderFrame=function(Fn){var Mn=this.element.finalTransform.mat,rs,is=this.masksProperties.length;for(rs=0;rs<is;rs+=1)if((this.viewData[rs].prop._mdf||Fn)&&this.drawPath(this.masksProperties[rs],this.viewData[rs].prop.v,this.viewData[rs]),(this.viewData[rs].op._mdf||Fn)&&this.viewData[rs].elem.setAttribute("fill-opacity",this.viewData[rs].op.v),this.masksProperties[rs].mode!=="n"&&(this.viewData[rs].invRect&&(this.element.finalTransform.mProp._mdf||Fn)&&this.viewData[rs].invRect.setAttribute("transform",Mn.getInverseMatrix().to2dCSS()),this.storedData[rs].x&&(this.storedData[rs].x._mdf||Fn))){var os=this.storedData[rs].expan;this.storedData[rs].x.v<0?(this.storedData[rs].lastOperator!=="erode"&&(this.storedData[rs].lastOperator="erode",this.storedData[rs].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[rs].filterId+")")),os.setAttribute("radius",-this.storedData[rs].x.v)):(this.storedData[rs].lastOperator!=="dilate"&&(this.storedData[rs].lastOperator="dilate",this.storedData[rs].elem.setAttribute("filter",null)),this.storedData[rs].elem.setAttribute("stroke-width",this.storedData[rs].x.v*2))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var Fn="M0,0 ";return Fn+=" h"+this.globalData.compSize.w,Fn+=" v"+this.globalData.compSize.h,Fn+=" h-"+this.globalData.compSize.w,Fn+=" v-"+this.globalData.compSize.h+" ",Fn},MaskElement.prototype.drawPath=function(Fn,Mn,rs){var is=" M"+Mn.v[0][0]+","+Mn.v[0][1],os,as;for(as=Mn._length,os=1;os<as;os+=1)is+=" C"+Mn.o[os-1][0]+","+Mn.o[os-1][1]+" "+Mn.i[os][0]+","+Mn.i[os][1]+" "+Mn.v[os][0]+","+Mn.v[os][1];if(Mn.c&&as>1&&(is+=" C"+Mn.o[os-1][0]+","+Mn.o[os-1][1]+" "+Mn.i[0][0]+","+Mn.i[0][1]+" "+Mn.v[0][0]+","+Mn.v[0][1]),rs.lastPath!==is){var us="";rs.elem&&(Mn.c&&(us=Fn.inv?this.solidPath+is:is),rs.elem.setAttribute("d",us)),rs.lastPath=is}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var Fn={};Fn.createFilter=Mn,Fn.createAlphaToLuminanceFilter=rs;function Mn(is,os){var as=createNS("filter");return as.setAttribute("id",is),os!==!0&&(as.setAttribute("filterUnits","objectBoundingBox"),as.setAttribute("x","0%"),as.setAttribute("y","0%"),as.setAttribute("width","100%"),as.setAttribute("height","100%")),as}function rs(){var is=createNS("feColorMatrix");return is.setAttribute("type","matrix"),is.setAttribute("color-interpolation-filters","sRGB"),is.setAttribute("values","0 0 0 1 0  0 0 0 1 0  0 0 0 1 0  0 0 0 1 1"),is}return Fn}(),featureSupport=function(){var Fn={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(Fn.maskType=!1),/firefox/i.test(navigator.userAgent)&&(Fn.svgLumaHidden=!1),Fn}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(Fn){var Mn,rs="SourceGraphic",is=Fn.data.ef?Fn.data.ef.length:0,os=createElementID(),as=filtersFactory.createFilter(os,!0),us=0;this.filters=[];var ds;for(Mn=0;Mn<is;Mn+=1){ds=null;var hs=Fn.data.ef[Mn].ty;if(registeredEffects$1[hs]){var ps=registeredEffects$1[hs].effect;ds=new ps(as,Fn.effectsManager.effectElements[Mn],Fn,idPrefix+us,rs),rs=idPrefix+us,registeredEffects$1[hs].countsAsEffect&&(us+=1)}ds&&this.filters.push(ds)}us&&(Fn.globalData.defs.appendChild(as),Fn.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+os+")")),this.filters.length&&Fn.addRenderableComponent(this)}SVGEffects.prototype.renderFrame=function(Fn){var Mn,rs=this.filters.length;for(Mn=0;Mn<rs;Mn+=1)this.filters[Mn].renderFrame(Fn)},SVGEffects.prototype.getEffects=function(Fn){var Mn,rs=this.filters.length,is=[];for(Mn=0;Mn<rs;Mn+=1)this.filters[Mn].type===Fn&&is.push(this.filters[Mn]);return is};function registerEffect$1(Fn,Mn,rs){registeredEffects$1[Fn]={effect:Mn,countsAsEffect:rs}}function SVGBaseElement(){}SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var Mn=null;if(this.data.td){this.matteMasks={};var rs=createNS("g");rs.setAttribute("id",this.layerId),rs.appendChild(this.layerElement),Mn=rs,this.globalData.defs.appendChild(rs)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),Mn=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.ty===0&&!this.data.hd){var is=createNS("clipPath"),os=createNS("path");os.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var as=createElementID();if(is.setAttribute("id",as),is.appendChild(os),this.globalData.defs.appendChild(is),this.checkMasks()){var us=createNS("g");us.setAttribute("clip-path","url("+getLocationHref()+"#"+as+")"),us.appendChild(this.layerElement),this.transformedElement=us,Mn?Mn.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+as+")")}this.data.bm!==0&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this),this.searchEffectTransforms()},getMatte:function(Mn){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[Mn]){var rs=this.layerId+"_"+Mn,is,os,as,us;if(Mn===1||Mn===3){var ds=createNS("mask");ds.setAttribute("id",rs),ds.setAttribute("mask-type",Mn===3?"luminance":"alpha"),as=createNS("use"),as.setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),ds.appendChild(as),this.globalData.defs.appendChild(ds),!featureSupport.maskType&&Mn===1&&(ds.setAttribute("mask-type","luminance"),is=createElementID(),os=filtersFactory.createFilter(is),this.globalData.defs.appendChild(os),os.appendChild(filtersFactory.createAlphaToLuminanceFilter()),us=createNS("g"),us.appendChild(as),ds.appendChild(us),us.setAttribute("filter","url("+getLocationHref()+"#"+is+")"))}else if(Mn===2){var hs=createNS("mask");hs.setAttribute("id",rs),hs.setAttribute("mask-type","alpha");var ps=createNS("g");hs.appendChild(ps),is=createElementID(),os=filtersFactory.createFilter(is);var io=createNS("feComponentTransfer");io.setAttribute("in","SourceGraphic"),os.appendChild(io);var fo=createNS("feFuncA");fo.setAttribute("type","table"),fo.setAttribute("tableValues","1.0 0.0"),io.appendChild(fo),this.globalData.defs.appendChild(os);var mo=createNS("rect");mo.setAttribute("width",this.comp.data.w),mo.setAttribute("height",this.comp.data.h),mo.setAttribute("x","0"),mo.setAttribute("y","0"),mo.setAttribute("fill","#ffffff"),mo.setAttribute("opacity","0"),ps.setAttribute("filter","url("+getLocationHref()+"#"+is+")"),ps.appendChild(mo),as=createNS("use"),as.setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),ps.appendChild(as),featureSupport.maskType||(hs.setAttribute("mask-type","luminance"),os.appendChild(filtersFactory.createAlphaToLuminanceFilter()),us=createNS("g"),ps.appendChild(mo),us.appendChild(this.layerElement),ps.appendChild(us)),this.globalData.defs.appendChild(hs)}this.matteMasks[Mn]=rs}return this.matteMasks[Mn]},setMatte:function(Mn){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+Mn+")")}};function HierarchyElement(){}HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(Mn){this.hierarchy=Mn},setAsParent:function(){this._isParent=!0},checkParenting:function(){this.data.parent!==void 0&&this.comp.buildElementParenting(this,this.data.parent,[])}};function RenderableDOMElement(){}(function(){var Fn={initElement:function(rs,is,os){this.initFrame(),this.initBaseData(rs,is,os),this.initTransform(rs,is,os),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){if(!this.hidden&&(!this.isInRange||this.isTransparent)){var rs=this.baseElement||this.layerElement;rs.style.display="none",this.hidden=!0}},show:function(){if(this.isInRange&&!this.isTransparent){if(!this.data.hd){var rs=this.baseElement||this.layerElement;rs.style.display="block"}this.hidden=!1,this._isFirstFrame=!0}},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(rs){this._mdf=!1,this.prepareRenderableFrame(rs),this.prepareProperties(rs,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}};extendPrototype([RenderableElement,createProxyFunction(Fn)],RenderableDOMElement)})();function IImageElement(Fn,Mn,rs){this.assetData=Mn.getAssetData(Fn.refId),this.assetData&&this.assetData.sid&&(this.assetData=Mn.slotManager.getProp(this.assetData)),this.initElement(Fn,Mn,rs),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var Fn=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",Fn),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect};function ProcessedElement(Fn,Mn){this.elem=Fn,this.pos=Mn}function IShapeElement(){}IShapeElement.prototype={addShapeToModifiers:function(Mn){var rs,is=this.shapeModifiers.length;for(rs=0;rs<is;rs+=1)this.shapeModifiers[rs].addShape(Mn)},isShapeInAnimatedModifiers:function(Mn){for(var rs=0,is=this.shapeModifiers.length;rs<is;)if(this.shapeModifiers[rs].isAnimatedWithShape(Mn))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var Mn,rs=this.shapes.length;for(Mn=0;Mn<rs;Mn+=1)this.shapes[Mn].sh.reset();rs=this.shapeModifiers.length;var is;for(Mn=rs-1;Mn>=0&&(is=this.shapeModifiers[Mn].processShapes(this._isFirstFrame),!is);Mn-=1);}},searchProcessedElement:function(Mn){for(var rs=this.processedElements,is=0,os=rs.length;is<os;){if(rs[is].elem===Mn)return rs[is].pos;is+=1}return 0},addProcessedElement:function(Mn,rs){for(var is=this.processedElements,os=is.length;os;)if(os-=1,is[os].elem===Mn){is[os].pos=rs;return}is.push(new ProcessedElement(Mn,rs))},prepareFrame:function(Mn){this.prepareRenderableFrame(Mn),this.prepareProperties(Mn,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(Fn,Mn,rs){this.caches=[],this.styles=[],this.transformers=Fn,this.lStr="",this.sh=rs,this.lvl=Mn,this._isAnimated=!!rs.k;for(var is=0,os=Fn.length;is<os;){if(Fn[is].mProps.dynamicProperties.length){this._isAnimated=!0;break}is+=1}}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0};function SVGStyleData(Fn,Mn){this.data=Fn,this.type=Fn.ty,this.d="",this.lvl=Mn,this._mdf=!1,this.closed=Fn.hd===!0,this.pElem=createNS("path"),this.msElem=null}SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1};function DashProperty(Fn,Mn,rs,is){this.elem=Fn,this.frameId=-1,this.dataProps=createSizedArray(Mn.length),this.renderer=rs,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",Mn.length?Mn.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(is);var os,as=Mn.length||0,us;for(os=0;os<as;os+=1)us=PropertyFactory.getProp(Fn,Mn[os].v,0,0,this),this.k=us.k||this.k,this.dataProps[os]={n:Mn[os].n,p:us};this.k||this.getValue(!0),this._isAnimated=this.k}DashProperty.prototype.getValue=function(Fn){if(!(this.elem.globalData.frameId===this.frameId&&!Fn)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||Fn,this._mdf)){var Mn=0,rs=this.dataProps.length;for(this.renderer==="svg"&&(this.dashStr=""),Mn=0;Mn<rs;Mn+=1)this.dataProps[Mn].n!=="o"?this.renderer==="svg"?this.dashStr+=" "+this.dataProps[Mn].p.v:this.dashArray[Mn]=this.dataProps[Mn].p.v:this.dashoffset[0]=this.dataProps[Mn].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty);function SVGStrokeStyleData(Fn,Mn,rs){this.initDynamicPropertyContainer(Fn),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(Fn,Mn.o,0,.01,this),this.w=PropertyFactory.getProp(Fn,Mn.w,0,null,this),this.d=new DashProperty(Fn,Mn.d||{},"svg",this),this.c=PropertyFactory.getProp(Fn,Mn.c,1,255,this),this.style=rs,this._isAnimated=!!this._isAnimated}extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData);function SVGFillStyleData(Fn,Mn,rs){this.initDynamicPropertyContainer(Fn),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(Fn,Mn.o,0,.01,this),this.c=PropertyFactory.getProp(Fn,Mn.c,1,255,this),this.style=rs}extendPrototype([DynamicPropertyContainer],SVGFillStyleData);function SVGNoStyleData(Fn,Mn,rs){this.initDynamicPropertyContainer(Fn),this.getValue=this.iterateDynamicProperties,this.style=rs}extendPrototype([DynamicPropertyContainer],SVGNoStyleData);function GradientProperty(Fn,Mn,rs){this.data=Mn,this.c=createTypedArray("uint8c",Mn.p*4);var is=Mn.k.k[0].s?Mn.k.k[0].s.length-Mn.p*4:Mn.k.k.length-Mn.p*4;this.o=createTypedArray("float32",is),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=is,this.initDynamicPropertyContainer(rs),this.prop=PropertyFactory.getProp(Fn,Mn.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}GradientProperty.prototype.comparePoints=function(Fn,Mn){for(var rs=0,is=this.o.length/2,os;rs<is;){if(os=Math.abs(Fn[rs*4]-Fn[Mn*4+rs*2]),os>.01)return!1;rs+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var Fn=0,Mn=this.data.k.k.length;Fn<Mn;){if(!this.comparePoints(this.data.k.k[Fn].s,this.data.p))return!1;Fn+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(Fn){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||Fn){var Mn,rs=this.data.p*4,is,os;for(Mn=0;Mn<rs;Mn+=1)is=Mn%4===0?100:255,os=Math.round(this.prop.v[Mn]*is),this.c[Mn]!==os&&(this.c[Mn]=os,this._cmdf=!Fn);if(this.o.length)for(rs=this.prop.v.length,Mn=this.data.p*4;Mn<rs;Mn+=1)is=Mn%2===0?100:1,os=Mn%2===0?Math.round(this.prop.v[Mn]*100):this.prop.v[Mn],this.o[Mn-this.data.p*4]!==os&&(this.o[Mn-this.data.p*4]=os,this._omdf=!Fn);this._mdf=!Fn}},extendPrototype([DynamicPropertyContainer],GradientProperty);function SVGGradientFillStyleData(Fn,Mn,rs){this.initDynamicPropertyContainer(Fn),this.getValue=this.iterateDynamicProperties,this.initGradientData(Fn,Mn,rs)}SVGGradientFillStyleData.prototype.initGradientData=function(Fn,Mn,rs){this.o=PropertyFactory.getProp(Fn,Mn.o,0,.01,this),this.s=PropertyFactory.getProp(Fn,Mn.s,1,null,this),this.e=PropertyFactory.getProp(Fn,Mn.e,1,null,this),this.h=PropertyFactory.getProp(Fn,Mn.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(Fn,Mn.a||{k:0},0,degToRads,this),this.g=new GradientProperty(Fn,Mn.g,this),this.style=rs,this.stops=[],this.setGradientData(rs.pElem,Mn),this.setGradientOpacity(Mn,rs),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(Fn,Mn){var rs=createElementID(),is=createNS(Mn.t===1?"linearGradient":"radialGradient");is.setAttribute("id",rs),is.setAttribute("spreadMethod","pad"),is.setAttribute("gradientUnits","userSpaceOnUse");var os=[],as,us,ds;for(ds=Mn.g.p*4,us=0;us<ds;us+=4)as=createNS("stop"),is.appendChild(as),os.push(as);Fn.setAttribute(Mn.ty==="gf"?"fill":"stroke","url("+getLocationHref()+"#"+rs+")"),this.gf=is,this.cst=os},SVGGradientFillStyleData.prototype.setGradientOpacity=function(Fn,Mn){if(this.g._hasOpacity&&!this.g._collapsable){var rs,is,os,as=createNS("mask"),us=createNS("path");as.appendChild(us);var ds=createElementID(),hs=createElementID();as.setAttribute("id",hs);var ps=createNS(Fn.t===1?"linearGradient":"radialGradient");ps.setAttribute("id",ds),ps.setAttribute("spreadMethod","pad"),ps.setAttribute("gradientUnits","userSpaceOnUse"),os=Fn.g.k.k[0].s?Fn.g.k.k[0].s.length:Fn.g.k.k.length;var io=this.stops;for(is=Fn.g.p*4;is<os;is+=2)rs=createNS("stop"),rs.setAttribute("stop-color","rgb(255,255,255)"),ps.appendChild(rs),io.push(rs);us.setAttribute(Fn.ty==="gf"?"fill":"stroke","url("+getLocationHref()+"#"+ds+")"),Fn.ty==="gs"&&(us.setAttribute("stroke-linecap",lineCapEnum[Fn.lc||2]),us.setAttribute("stroke-linejoin",lineJoinEnum[Fn.lj||2]),Fn.lj===1&&us.setAttribute("stroke-miterlimit",Fn.ml)),this.of=ps,this.ms=as,this.ost=io,this.maskId=hs,Mn.msElem=us}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData);function SVGGradientStrokeStyleData(Fn,Mn,rs){this.initDynamicPropertyContainer(Fn),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(Fn,Mn.w,0,null,this),this.d=new DashProperty(Fn,Mn.d||{},"svg",this),this.initGradientData(Fn,Mn,rs),this._isAnimated=!!this._isAnimated}extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(Fn,Mn,rs){this.transform={mProps:Fn,op:Mn,container:rs},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}var buildShapeString=function(Mn,rs,is,os){if(rs===0)return"";var as=Mn.o,us=Mn.i,ds=Mn.v,hs,ps=" M"+os.applyToPointStringified(ds[0][0],ds[0][1]);for(hs=1;hs<rs;hs+=1)ps+=" C"+os.applyToPointStringified(as[hs-1][0],as[hs-1][1])+" "+os.applyToPointStringified(us[hs][0],us[hs][1])+" "+os.applyToPointStringified(ds[hs][0],ds[hs][1]);return is&&rs&&(ps+=" C"+os.applyToPointStringified(as[hs-1][0],as[hs-1][1])+" "+os.applyToPointStringified(us[0][0],us[0][1])+" "+os.applyToPointStringified(ds[0][0],ds[0][1]),ps+="z"),ps},SVGElementsRenderer=function(){var Fn=new Matrix,Mn=new Matrix,rs={createRenderFunction:is};function is(fo){switch(fo.ty){case"fl":return ds;case"gf":return ps;case"gs":return hs;case"st":return io;case"sh":case"el":case"rc":case"sr":return us;case"tr":return os;case"no":return as;default:return null}}function os(fo,mo,Ao){(Ao||mo.transform.op._mdf)&&mo.transform.container.setAttribute("opacity",mo.transform.op.v),(Ao||mo.transform.mProps._mdf)&&mo.transform.container.setAttribute("transform",mo.transform.mProps.v.to2dCSS())}function as(){}function us(fo,mo,Ao){var $o,Lo,Go,Yo,Wo,Jo,xl=mo.styles.length,_l=mo.lvl,Tl,Sl,$l,Pl;for(Jo=0;Jo<xl;Jo+=1){if(Yo=mo.sh._mdf||Ao,mo.styles[Jo].lvl<_l){for(Sl=Mn.reset(),$l=_l-mo.styles[Jo].lvl,Pl=mo.transformers.length-1;!Yo&&$l>0;)Yo=mo.transformers[Pl].mProps._mdf||Yo,$l-=1,Pl-=1;if(Yo)for($l=_l-mo.styles[Jo].lvl,Pl=mo.transformers.length-1;$l>0;)Sl.multiply(mo.transformers[Pl].mProps.v),$l-=1,Pl-=1}else Sl=Fn;if(Tl=mo.sh.paths,Lo=Tl._length,Yo){for(Go="",$o=0;$o<Lo;$o+=1)Wo=Tl.shapes[$o],Wo&&Wo._length&&(Go+=buildShapeString(Wo,Wo._length,Wo.c,Sl));mo.caches[Jo]=Go}else Go=mo.caches[Jo];mo.styles[Jo].d+=fo.hd===!0?"":Go,mo.styles[Jo]._mdf=Yo||mo.styles[Jo]._mdf}}function ds(fo,mo,Ao){var $o=mo.style;(mo.c._mdf||Ao)&&$o.pElem.setAttribute("fill","rgb("+bmFloor(mo.c.v[0])+","+bmFloor(mo.c.v[1])+","+bmFloor(mo.c.v[2])+")"),(mo.o._mdf||Ao)&&$o.pElem.setAttribute("fill-opacity",mo.o.v)}function hs(fo,mo,Ao){ps(fo,mo,Ao),io(fo,mo,Ao)}function ps(fo,mo,Ao){var $o=mo.gf,Lo=mo.g._hasOpacity,Go=mo.s.v,Yo=mo.e.v;if(mo.o._mdf||Ao){var Wo=fo.ty==="gf"?"fill-opacity":"stroke-opacity";mo.style.pElem.setAttribute(Wo,mo.o.v)}if(mo.s._mdf||Ao){var Jo=fo.t===1?"x1":"cx",xl=Jo==="x1"?"y1":"cy";$o.setAttribute(Jo,Go[0]),$o.setAttribute(xl,Go[1]),Lo&&!mo.g._collapsable&&(mo.of.setAttribute(Jo,Go[0]),mo.of.setAttribute(xl,Go[1]))}var _l,Tl,Sl,$l;if(mo.g._cmdf||Ao){_l=mo.cst;var Pl=mo.g.c;for(Sl=_l.length,Tl=0;Tl<Sl;Tl+=1)$l=_l[Tl],$l.setAttribute("offset",Pl[Tl*4]+"%"),$l.setAttribute("stop-color","rgb("+Pl[Tl*4+1]+","+Pl[Tl*4+2]+","+Pl[Tl*4+3]+")")}if(Lo&&(mo.g._omdf||Ao)){var Dl=mo.g.o;for(mo.g._collapsable?_l=mo.cst:_l=mo.ost,Sl=_l.length,Tl=0;Tl<Sl;Tl+=1)$l=_l[Tl],mo.g._collapsable||$l.setAttribute("offset",Dl[Tl*2]+"%"),$l.setAttribute("stop-opacity",Dl[Tl*2+1])}if(fo.t===1)(mo.e._mdf||Ao)&&($o.setAttribute("x2",Yo[0]),$o.setAttribute("y2",Yo[1]),Lo&&!mo.g._collapsable&&(mo.of.setAttribute("x2",Yo[0]),mo.of.setAttribute("y2",Yo[1])));else{var Ol;if((mo.s._mdf||mo.e._mdf||Ao)&&(Ol=Math.sqrt(Math.pow(Go[0]-Yo[0],2)+Math.pow(Go[1]-Yo[1],2)),$o.setAttribute("r",Ol),Lo&&!mo.g._collapsable&&mo.of.setAttribute("r",Ol)),mo.e._mdf||mo.h._mdf||mo.a._mdf||Ao){Ol||(Ol=Math.sqrt(Math.pow(Go[0]-Yo[0],2)+Math.pow(Go[1]-Yo[1],2)));var Rl=Math.atan2(Yo[1]-Go[1],Yo[0]-Go[0]),Vo=mo.h.v;Vo>=1?Vo=.99:Vo<=-1&&(Vo=-.99);var jo=Ol*Vo,Ho=Math.cos(Rl+mo.a.v)*jo+Go[0],Qo=Math.sin(Rl+mo.a.v)*jo+Go[1];$o.setAttribute("fx",Ho),$o.setAttribute("fy",Qo),Lo&&!mo.g._collapsable&&(mo.of.setAttribute("fx",Ho),mo.of.setAttribute("fy",Qo))}}}function io(fo,mo,Ao){var $o=mo.style,Lo=mo.d;Lo&&(Lo._mdf||Ao)&&Lo.dashStr&&($o.pElem.setAttribute("stroke-dasharray",Lo.dashStr),$o.pElem.setAttribute("stroke-dashoffset",Lo.dashoffset[0])),mo.c&&(mo.c._mdf||Ao)&&$o.pElem.setAttribute("stroke","rgb("+bmFloor(mo.c.v[0])+","+bmFloor(mo.c.v[1])+","+bmFloor(mo.c.v[2])+")"),(mo.o._mdf||Ao)&&$o.pElem.setAttribute("stroke-opacity",mo.o.v),(mo.w._mdf||Ao)&&($o.pElem.setAttribute("stroke-width",mo.w.v),$o.msElem&&$o.msElem.setAttribute("stroke-width",mo.w.v))}return rs}();function SVGShapeElement(Fn,Mn,rs){this.shapes=[],this.shapesData=Fn.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(Fn,Mn,rs),this.prevViewData=[]}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var Fn,Mn=this.shapes.length,rs,is,os=this.stylesList.length,as,us=[],ds=!1;for(is=0;is<os;is+=1){for(as=this.stylesList[is],ds=!1,us.length=0,Fn=0;Fn<Mn;Fn+=1)rs=this.shapes[Fn],rs.styles.indexOf(as)!==-1&&(us.push(rs),ds=rs._isAnimated||ds);us.length>1&&ds&&this.setShapesAsAnimated(us)}},SVGShapeElement.prototype.setShapesAsAnimated=function(Fn){var Mn,rs=Fn.length;for(Mn=0;Mn<rs;Mn+=1)Fn[Mn].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(Fn,Mn){var rs,is=new SVGStyleData(Fn,Mn),os=is.pElem;if(Fn.ty==="st")rs=new SVGStrokeStyleData(this,Fn,is);else if(Fn.ty==="fl")rs=new SVGFillStyleData(this,Fn,is);else if(Fn.ty==="gf"||Fn.ty==="gs"){var as=Fn.ty==="gf"?SVGGradientFillStyleData:SVGGradientStrokeStyleData;rs=new as(this,Fn,is),this.globalData.defs.appendChild(rs.gf),rs.maskId&&(this.globalData.defs.appendChild(rs.ms),this.globalData.defs.appendChild(rs.of),os.setAttribute("mask","url("+getLocationHref()+"#"+rs.maskId+")"))}else Fn.ty==="no"&&(rs=new SVGNoStyleData(this,Fn,is));return(Fn.ty==="st"||Fn.ty==="gs")&&(os.setAttribute("stroke-linecap",lineCapEnum[Fn.lc||2]),os.setAttribute("stroke-linejoin",lineJoinEnum[Fn.lj||2]),os.setAttribute("fill-opacity","0"),Fn.lj===1&&os.setAttribute("stroke-miterlimit",Fn.ml)),Fn.r===2&&os.setAttribute("fill-rule","evenodd"),Fn.ln&&os.setAttribute("id",Fn.ln),Fn.cl&&os.setAttribute("class",Fn.cl),Fn.bm&&(os.style["mix-blend-mode"]=getBlendMode(Fn.bm)),this.stylesList.push(is),this.addToAnimatedContents(Fn,rs),rs},SVGShapeElement.prototype.createGroupElement=function(Fn){var Mn=new ShapeGroupData;return Fn.ln&&Mn.gr.setAttribute("id",Fn.ln),Fn.cl&&Mn.gr.setAttribute("class",Fn.cl),Fn.bm&&(Mn.gr.style["mix-blend-mode"]=getBlendMode(Fn.bm)),Mn},SVGShapeElement.prototype.createTransformElement=function(Fn,Mn){var rs=TransformPropertyFactory.getTransformProperty(this,Fn,this),is=new SVGTransformData(rs,rs.o,Mn);return this.addToAnimatedContents(Fn,is),is},SVGShapeElement.prototype.createShapeElement=function(Fn,Mn,rs){var is=4;Fn.ty==="rc"?is=5:Fn.ty==="el"?is=6:Fn.ty==="sr"&&(is=7);var os=ShapePropertyFactory.getShapeProp(this,Fn,is,this),as=new SVGShapeData(Mn,rs,os);return this.shapes.push(as),this.addShapeToModifiers(as),this.addToAnimatedContents(Fn,as),as},SVGShapeElement.prototype.addToAnimatedContents=function(Fn,Mn){for(var rs=0,is=this.animatedContents.length;rs<is;){if(this.animatedContents[rs].element===Mn)return;rs+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(Fn),element:Mn,data:Fn})},SVGShapeElement.prototype.setElementStyles=function(Fn){var Mn=Fn.styles,rs,is=this.stylesList.length;for(rs=0;rs<is;rs+=1)this.stylesList[rs].closed||Mn.push(this.stylesList[rs])},SVGShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var Fn,Mn=this.itemsData.length;for(Fn=0;Fn<Mn;Fn+=1)this.prevViewData[Fn]=this.itemsData[Fn];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),Mn=this.dynamicProperties.length,Fn=0;Fn<Mn;Fn+=1)this.dynamicProperties[Fn].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(Fn,Mn,rs,is,os,as,us){var ds=[].concat(as),hs,ps=Fn.length-1,io,fo,mo=[],Ao=[],$o,Lo,Go;for(hs=ps;hs>=0;hs-=1){if(Go=this.searchProcessedElement(Fn[hs]),Go?Mn[hs]=rs[Go-1]:Fn[hs]._render=us,Fn[hs].ty==="fl"||Fn[hs].ty==="st"||Fn[hs].ty==="gf"||Fn[hs].ty==="gs"||Fn[hs].ty==="no")Go?Mn[hs].style.closed=!1:Mn[hs]=this.createStyleElement(Fn[hs],os),Fn[hs]._render&&Mn[hs].style.pElem.parentNode!==is&&is.appendChild(Mn[hs].style.pElem),mo.push(Mn[hs].style);else if(Fn[hs].ty==="gr"){if(!Go)Mn[hs]=this.createGroupElement(Fn[hs]);else for(fo=Mn[hs].it.length,io=0;io<fo;io+=1)Mn[hs].prevViewData[io]=Mn[hs].it[io];this.searchShapes(Fn[hs].it,Mn[hs].it,Mn[hs].prevViewData,Mn[hs].gr,os+1,ds,us),Fn[hs]._render&&Mn[hs].gr.parentNode!==is&&is.appendChild(Mn[hs].gr)}else Fn[hs].ty==="tr"?(Go||(Mn[hs]=this.createTransformElement(Fn[hs],is)),$o=Mn[hs].transform,ds.push($o)):Fn[hs].ty==="sh"||Fn[hs].ty==="rc"||Fn[hs].ty==="el"||Fn[hs].ty==="sr"?(Go||(Mn[hs]=this.createShapeElement(Fn[hs],ds,os)),this.setElementStyles(Mn[hs])):Fn[hs].ty==="tm"||Fn[hs].ty==="rd"||Fn[hs].ty==="ms"||Fn[hs].ty==="pb"||Fn[hs].ty==="zz"||Fn[hs].ty==="op"?(Go?(Lo=Mn[hs],Lo.closed=!1):(Lo=ShapeModifiers.getModifier(Fn[hs].ty),Lo.init(this,Fn[hs]),Mn[hs]=Lo,this.shapeModifiers.push(Lo)),Ao.push(Lo)):Fn[hs].ty==="rp"&&(Go?(Lo=Mn[hs],Lo.closed=!0):(Lo=ShapeModifiers.getModifier(Fn[hs].ty),Mn[hs]=Lo,Lo.init(this,Fn,hs,Mn),this.shapeModifiers.push(Lo),us=!1),Ao.push(Lo));this.addProcessedElement(Fn[hs],hs+1)}for(ps=mo.length,hs=0;hs<ps;hs+=1)mo[hs].closed=!0;for(ps=Ao.length,hs=0;hs<ps;hs+=1)Ao[hs].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){this.renderModifiers();var Fn,Mn=this.stylesList.length;for(Fn=0;Fn<Mn;Fn+=1)this.stylesList[Fn].reset();for(this.renderShape(),Fn=0;Fn<Mn;Fn+=1)(this.stylesList[Fn]._mdf||this._isFirstFrame)&&(this.stylesList[Fn].msElem&&(this.stylesList[Fn].msElem.setAttribute("d",this.stylesList[Fn].d),this.stylesList[Fn].d="M0 0"+this.stylesList[Fn].d),this.stylesList[Fn].pElem.setAttribute("d",this.stylesList[Fn].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var Fn,Mn=this.animatedContents.length,rs;for(Fn=0;Fn<Mn;Fn+=1)rs=this.animatedContents[Fn],(this._isFirstFrame||rs.element._isAnimated)&&rs.data!==!0&&rs.fn(rs.data,rs.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null};function LetterProps(Fn,Mn,rs,is,os,as){this.o=Fn,this.sw=Mn,this.sc=rs,this.fc=is,this.m=os,this.p=as,this._mdf={o:!0,sw:!!Mn,sc:!!rs,fc:!!is,m:!0,p:!0}}LetterProps.prototype.update=function(Fn,Mn,rs,is,os,as){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var us=!1;return this.o!==Fn&&(this.o=Fn,this._mdf.o=!0,us=!0),this.sw!==Mn&&(this.sw=Mn,this._mdf.sw=!0,us=!0),this.sc!==rs&&(this.sc=rs,this._mdf.sc=!0,us=!0),this.fc!==is&&(this.fc=is,this._mdf.fc=!0,us=!0),this.m!==os&&(this.m=os,this._mdf.m=!0,us=!0),as.length&&(this.p[0]!==as[0]||this.p[1]!==as[1]||this.p[4]!==as[4]||this.p[5]!==as[5]||this.p[12]!==as[12]||this.p[13]!==as[13])&&(this.p=as,this._mdf.p=!0,us=!0),us};function TextProperty(Fn,Mn){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,Mn.d&&Mn.d.sid&&(Mn.d=Fn.globalData.slotManager.getProp(Mn.d)),this.data=Mn,this.elem=Fn,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(Fn,Mn){for(var rs in Mn)Object.prototype.hasOwnProperty.call(Mn,rs)&&(Fn[rs]=Mn[rs]);return Fn},TextProperty.prototype.setCurrentData=function(Fn){Fn.__complete||this.completeTextData(Fn),this.currentData=Fn,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(Fn){this.effectsSequence.push(Fn),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(Fn){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!Fn)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var Mn=this.currentData,rs=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var is,os=this.effectsSequence.length,as=Fn||this.data.d.k[this.keysIndex].s;for(is=0;is<os;is+=1)rs!==this.keysIndex?as=this.effectsSequence[is](as,as.t):as=this.effectsSequence[is](this.currentData,as.t);Mn!==as&&this.setCurrentData(as),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}},TextProperty.prototype.getKeyframeValue=function(){for(var Fn=this.data.d.k,Mn=this.elem.comp.renderedFrame,rs=0,is=Fn.length;rs<=is-1&&!(rs===is-1||Fn[rs+1].t>Mn);)rs+=1;return this.keysIndex!==rs&&(this.keysIndex=rs),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(Fn){for(var Mn=[],rs=0,is=Fn.length,os,as,us=!1,ds=!1,hs="";rs<is;)us=ds,ds=!1,os=Fn.charCodeAt(rs),hs=Fn.charAt(rs),FontManager.isCombinedCharacter(os)?us=!0:os>=55296&&os<=56319?FontManager.isRegionalFlag(Fn,rs)?hs=Fn.substr(rs,14):(as=Fn.charCodeAt(rs+1),as>=56320&&as<=57343&&(FontManager.isModifier(os,as)?(hs=Fn.substr(rs,2),us=!0):FontManager.isFlagEmoji(Fn.substr(rs,4))?hs=Fn.substr(rs,4):hs=Fn.substr(rs,2))):os>56319?(as=Fn.charCodeAt(rs+1),FontManager.isVariationSelector(os)&&(us=!0)):FontManager.isZeroWidthJoiner(os)&&(us=!0,ds=!0),us?(Mn[Mn.length-1]+=hs,us=!1):Mn.push(hs),rs+=hs.length;return Mn},TextProperty.prototype.completeTextData=function(Fn){Fn.__complete=!0;var Mn=this.elem.globalData.fontManager,rs=this.data,is=[],os,as,us,ds=0,hs,ps=rs.m.g,io=0,fo=0,mo=0,Ao=[],$o=0,Lo=0,Go,Yo,Wo=Mn.getFontByName(Fn.f),Jo,xl=0,_l=getFontProperties(Wo);Fn.fWeight=_l.weight,Fn.fStyle=_l.style,Fn.finalSize=Fn.s,Fn.finalText=this.buildFinalText(Fn.t),as=Fn.finalText.length,Fn.finalLineHeight=Fn.lh;var Tl=Fn.tr/1e3*Fn.finalSize,Sl;if(Fn.sz)for(var $l=!0,Pl=Fn.sz[0],Dl=Fn.sz[1],Ol,Rl;$l;){Rl=this.buildFinalText(Fn.t),Ol=0,$o=0,as=Rl.length,Tl=Fn.tr/1e3*Fn.finalSize;var Vo=-1;for(os=0;os<as;os+=1)Sl=Rl[os].charCodeAt(0),us=!1,Rl[os]===" "?Vo=os:(Sl===13||Sl===3)&&($o=0,us=!0,Ol+=Fn.finalLineHeight||Fn.finalSize*1.2),Mn.chars?(Jo=Mn.getCharData(Rl[os],Wo.fStyle,Wo.fFamily),xl=us?0:Jo.w*Fn.finalSize/100):xl=Mn.measureText(Rl[os],Fn.f,Fn.finalSize),$o+xl>Pl&&Rl[os]!==" "?(Vo===-1?as+=1:os=Vo,Ol+=Fn.finalLineHeight||Fn.finalSize*1.2,Rl.splice(os,Vo===os?1:0,"\r"),Vo=-1,$o=0):($o+=xl,$o+=Tl);Ol+=Wo.ascent*Fn.finalSize/100,this.canResize&&Fn.finalSize>this.minimumFontSize&&Dl<Ol?(Fn.finalSize-=1,Fn.finalLineHeight=Fn.finalSize*Fn.lh/Fn.s):(Fn.finalText=Rl,as=Fn.finalText.length,$l=!1)}$o=-Tl,xl=0;var jo=0,Ho;for(os=0;os<as;os+=1)if(us=!1,Ho=Fn.finalText[os],Sl=Ho.charCodeAt(0),Sl===13||Sl===3?(jo=0,Ao.push($o),Lo=$o>Lo?$o:Lo,$o=-2*Tl,hs="",us=!0,mo+=1):hs=Ho,Mn.chars?(Jo=Mn.getCharData(Ho,Wo.fStyle,Mn.getFontByName(Fn.f).fFamily),xl=us?0:Jo.w*Fn.finalSize/100):xl=Mn.measureText(hs,Fn.f,Fn.finalSize),Ho===" "?jo+=xl+Tl:($o+=xl+Tl+jo,jo=0),is.push({l:xl,an:xl,add:io,n:us,anIndexes:[],val:hs,line:mo,animatorJustifyOffset:0}),ps==2){if(io+=xl,hs===""||hs===" "||os===as-1){for((hs===""||hs===" ")&&(io-=xl);fo<=os;)is[fo].an=io,is[fo].ind=ds,is[fo].extra=xl,fo+=1;ds+=1,io=0}}else if(ps==3){if(io+=xl,hs===""||os===as-1){for(hs===""&&(io-=xl);fo<=os;)is[fo].an=io,is[fo].ind=ds,is[fo].extra=xl,fo+=1;io=0,ds+=1}}else is[ds].ind=ds,is[ds].extra=0,ds+=1;if(Fn.l=is,Lo=$o>Lo?$o:Lo,Ao.push($o),Fn.sz)Fn.boxWidth=Fn.sz[0],Fn.justifyOffset=0;else switch(Fn.boxWidth=Lo,Fn.j){case 1:Fn.justifyOffset=-Fn.boxWidth;break;case 2:Fn.justifyOffset=-Fn.boxWidth/2;break;default:Fn.justifyOffset=0}Fn.lineWidths=Ao;var Qo=rs.a,El,Xo;Yo=Qo.length;var Al,wl,yl=[];for(Go=0;Go<Yo;Go+=1){for(El=Qo[Go],El.a.sc&&(Fn.strokeColorAnim=!0),El.a.sw&&(Fn.strokeWidthAnim=!0),(El.a.fc||El.a.fh||El.a.fs||El.a.fb)&&(Fn.fillColorAnim=!0),wl=0,Al=El.s.b,os=0;os<as;os+=1)Xo=is[os],Xo.anIndexes[Go]=wl,(Al==1&&Xo.val!==""||Al==2&&Xo.val!==""&&Xo.val!==" "||Al==3&&(Xo.n||Xo.val==" "||os==as-1)||Al==4&&(Xo.n||os==as-1))&&(El.s.rn===1&&yl.push(wl),wl+=1);rs.a[Go].s.totalChars=wl;var Il=-1,Bl;if(El.s.rn===1)for(os=0;os<as;os+=1)Xo=is[os],Il!=Xo.anIndexes[Go]&&(Il=Xo.anIndexes[Go],Bl=yl.splice(Math.floor(Math.random()*yl.length),1)[0]),Xo.anIndexes[Go]=Bl}Fn.yOffset=Fn.finalLineHeight||Fn.finalSize*1.2,Fn.ls=Fn.ls||0,Fn.ascent=Wo.ascent*Fn.finalSize/100},TextProperty.prototype.updateDocumentData=function(Fn,Mn){Mn=Mn===void 0?this.keysIndex:Mn;var rs=this.copyData({},this.data.d.k[Mn].s);rs=this.copyData(rs,Fn),this.data.d.k[Mn].s=rs,this.recalculate(Mn),this.setCurrentData(rs),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(Fn){var Mn=this.data.d.k[Fn].s;Mn.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(Mn)},TextProperty.prototype.canResizeFont=function(Fn){this.canResize=Fn,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(Fn){this.minimumFontSize=Math.floor(Fn)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var Fn=Math.max,Mn=Math.min,rs=Math.floor;function is(as,us){this._currentTextLength=-1,this.k=!1,this.data=us,this.elem=as,this.comp=as.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(as),this.s=PropertyFactory.getProp(as,us.s||{k:0},0,0,this),"e"in us?this.e=PropertyFactory.getProp(as,us.e,0,0,this):this.e={v:100},this.o=PropertyFactory.getProp(as,us.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(as,us.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(as,us.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(as,us.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(as,us.a,0,.01,this),this.dynamicProperties.length||this.getValue()}is.prototype={getMult:function(us){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var ds=0,hs=0,ps=1,io=1;this.ne.v>0?ds=this.ne.v/100:hs=-this.ne.v/100,this.xe.v>0?ps=1-this.xe.v/100:io=1+this.xe.v/100;var fo=BezierFactory.getBezierEasing(ds,hs,ps,io).get,mo=0,Ao=this.finalS,$o=this.finalE,Lo=this.data.sh;if(Lo===2)$o===Ao?mo=us>=$o?1:0:mo=Fn(0,Mn(.5/($o-Ao)+(us-Ao)/($o-Ao),1)),mo=fo(mo);else if(Lo===3)$o===Ao?mo=us>=$o?0:1:mo=1-Fn(0,Mn(.5/($o-Ao)+(us-Ao)/($o-Ao),1)),mo=fo(mo);else if(Lo===4)$o===Ao?mo=0:(mo=Fn(0,Mn(.5/($o-Ao)+(us-Ao)/($o-Ao),1)),mo<.5?mo*=2:mo=1-2*(mo-.5)),mo=fo(mo);else if(Lo===5){if($o===Ao)mo=0;else{var Go=$o-Ao;us=Mn(Fn(0,us+.5-Ao),$o-Ao);var Yo=-Go/2+us,Wo=Go/2;mo=Math.sqrt(1-Yo*Yo/(Wo*Wo))}mo=fo(mo)}else Lo===6?($o===Ao?mo=0:(us=Mn(Fn(0,us+.5-Ao),$o-Ao),mo=(1+Math.cos(Math.PI+Math.PI*2*us/($o-Ao)))/2),mo=fo(mo)):(us>=rs(Ao)&&(us-Ao<0?mo=Fn(0,Mn(Mn($o,1)-(Ao-us),1)):mo=Fn(0,Mn($o-us,1))),mo=fo(mo));if(this.sm.v!==100){var Jo=this.sm.v*.01;Jo===0&&(Jo=1e-8);var xl=.5-Jo*.5;mo<xl?mo=0:(mo=(mo-xl)/Jo,mo>1&&(mo=1))}return mo*this.a.v},getValue:function(us){this.iterateDynamicProperties(),this._mdf=us||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,us&&this.data.r===2&&(this.e.v=this._currentTextLength);var ds=this.data.r===2?1:100/this.data.totalChars,hs=this.o.v/ds,ps=this.s.v/ds+hs,io=this.e.v/ds+hs;if(ps>io){var fo=ps;ps=io,io=fo}this.finalS=ps,this.finalE=io}},extendPrototype([DynamicPropertyContainer],is);function os(as,us,ds){return new is(as,us)}return{getTextSelectorProp:os}}();function TextAnimatorDataProperty(Fn,Mn,rs){var is={propType:!1},os=PropertyFactory.getProp,as=Mn.a;this.a={r:as.r?os(Fn,as.r,0,degToRads,rs):is,rx:as.rx?os(Fn,as.rx,0,degToRads,rs):is,ry:as.ry?os(Fn,as.ry,0,degToRads,rs):is,sk:as.sk?os(Fn,as.sk,0,degToRads,rs):is,sa:as.sa?os(Fn,as.sa,0,degToRads,rs):is,s:as.s?os(Fn,as.s,1,.01,rs):is,a:as.a?os(Fn,as.a,1,0,rs):is,o:as.o?os(Fn,as.o,0,.01,rs):is,p:as.p?os(Fn,as.p,1,0,rs):is,sw:as.sw?os(Fn,as.sw,0,0,rs):is,sc:as.sc?os(Fn,as.sc,1,0,rs):is,fc:as.fc?os(Fn,as.fc,1,0,rs):is,fh:as.fh?os(Fn,as.fh,0,0,rs):is,fs:as.fs?os(Fn,as.fs,0,.01,rs):is,fb:as.fb?os(Fn,as.fb,0,.01,rs):is,t:as.t?os(Fn,as.t,0,0,rs):is},this.s=TextSelectorProp.getTextSelectorProp(Fn,Mn.s,rs),this.s.t=Mn.s.t}function TextAnimatorProperty(Fn,Mn,rs){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=Fn,this._renderType=Mn,this._elem=rs,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(rs)}TextAnimatorProperty.prototype.searchProperties=function(){var Fn,Mn=this._textData.a.length,rs,is=PropertyFactory.getProp;for(Fn=0;Fn<Mn;Fn+=1)rs=this._textData.a[Fn],this._animatorsData[Fn]=new TextAnimatorDataProperty(this._elem,rs,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:is(this._elem,this._textData.p.a,0,0,this),f:is(this._elem,this._textData.p.f,0,0,this),l:is(this._elem,this._textData.p.l,0,0,this),r:is(this._elem,this._textData.p.r,0,0,this),p:is(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=is(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(Fn,Mn){if(this.lettersChangedFlag=Mn,!(!this._mdf&&!this._isFirstFrame&&!Mn&&(!this._hasMaskedPath||!this._pathData.m._mdf))){this._isFirstFrame=!1;var rs=this._moreOptions.alignment.v,is=this._animatorsData,os=this._textData,as=this.mHelper,us=this._renderType,ds=this.renderedLetters.length,hs,ps,io,fo,mo=Fn.l,Ao,$o,Lo,Go,Yo,Wo,Jo,xl,_l,Tl,Sl,$l,Pl,Dl,Ol;if(this._hasMaskedPath){if(Ol=this._pathData.m,!this._pathData.n||this._pathData._mdf){var Rl=Ol.v;this._pathData.r.v&&(Rl=Rl.reverse()),Ao={tLength:0,segments:[]},fo=Rl._length-1;var Vo;for($l=0,io=0;io<fo;io+=1)Vo=bez.buildBezierData(Rl.v[io],Rl.v[io+1],[Rl.o[io][0]-Rl.v[io][0],Rl.o[io][1]-Rl.v[io][1]],[Rl.i[io+1][0]-Rl.v[io+1][0],Rl.i[io+1][1]-Rl.v[io+1][1]]),Ao.tLength+=Vo.segmentLength,Ao.segments.push(Vo),$l+=Vo.segmentLength;io=fo,Ol.v.c&&(Vo=bez.buildBezierData(Rl.v[io],Rl.v[0],[Rl.o[io][0]-Rl.v[io][0],Rl.o[io][1]-Rl.v[io][1]],[Rl.i[0][0]-Rl.v[0][0],Rl.i[0][1]-Rl.v[0][1]]),Ao.tLength+=Vo.segmentLength,Ao.segments.push(Vo),$l+=Vo.segmentLength),this._pathData.pi=Ao}if(Ao=this._pathData.pi,$o=this._pathData.f.v,Jo=0,Wo=1,Go=0,Yo=!0,Tl=Ao.segments,$o<0&&Ol.v.c)for(Ao.tLength<Math.abs($o)&&($o=-Math.abs($o)%Ao.tLength),Jo=Tl.length-1,_l=Tl[Jo].points,Wo=_l.length-1;$o<0;)$o+=_l[Wo].partialLength,Wo-=1,Wo<0&&(Jo-=1,_l=Tl[Jo].points,Wo=_l.length-1);_l=Tl[Jo].points,xl=_l[Wo-1],Lo=_l[Wo],Sl=Lo.partialLength}fo=mo.length,hs=0,ps=0;var jo=Fn.finalSize*1.2*.714,Ho=!0,Qo,El,Xo,Al,wl;Al=is.length;var yl,Il=-1,Bl,Gl,Nl,zl=$o,Vl=Jo,Hl=Wo,Yl=-1,Ll,Zl,Xl,wu,yu,rp,dp,up,wp="",vp=this.defaultPropsArray,pp;if(Fn.j===2||Fn.j===1){var cp=0,gp=0,mp=Fn.j===2?-.5:-1,fp=0,hp=!0;for(io=0;io<fo;io+=1)if(mo[io].n){for(cp&&(cp+=gp);fp<io;)mo[fp].animatorJustifyOffset=cp,fp+=1;cp=0,hp=!0}else{for(Xo=0;Xo<Al;Xo+=1)Qo=is[Xo].a,Qo.t.propType&&(hp&&Fn.j===2&&(gp+=Qo.t.v*mp),El=is[Xo].s,yl=El.getMult(mo[io].anIndexes[Xo],os.a[Xo].s.totalChars),yl.length?cp+=Qo.t.v*yl[0]*mp:cp+=Qo.t.v*yl*mp);hp=!1}for(cp&&(cp+=gp);fp<io;)mo[fp].animatorJustifyOffset=cp,fp+=1}for(io=0;io<fo;io+=1){if(as.reset(),Ll=1,mo[io].n)hs=0,ps+=Fn.yOffset,ps+=Ho?1:0,$o=zl,Ho=!1,this._hasMaskedPath&&(Jo=Vl,Wo=Hl,_l=Tl[Jo].points,xl=_l[Wo-1],Lo=_l[Wo],Sl=Lo.partialLength,Go=0),wp="",up="",rp="",pp="",vp=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Yl!==mo[io].line){switch(Fn.j){case 1:$o+=$l-Fn.lineWidths[mo[io].line];break;case 2:$o+=($l-Fn.lineWidths[mo[io].line])/2;break}Yl=mo[io].line}Il!==mo[io].ind&&(mo[Il]&&($o+=mo[Il].extra),$o+=mo[io].an/2,Il=mo[io].ind),$o+=rs[0]*mo[io].an*.005;var xp=0;for(Xo=0;Xo<Al;Xo+=1)Qo=is[Xo].a,Qo.p.propType&&(El=is[Xo].s,yl=El.getMult(mo[io].anIndexes[Xo],os.a[Xo].s.totalChars),yl.length?xp+=Qo.p.v[0]*yl[0]:xp+=Qo.p.v[0]*yl),Qo.a.propType&&(El=is[Xo].s,yl=El.getMult(mo[io].anIndexes[Xo],os.a[Xo].s.totalChars),yl.length?xp+=Qo.a.v[0]*yl[0]:xp+=Qo.a.v[0]*yl);for(Yo=!0,this._pathData.a.v&&($o=mo[0].an*.5+($l-this._pathData.f.v-mo[0].an*.5-mo[mo.length-1].an*.5)*Il/(fo-1),$o+=this._pathData.f.v);Yo;)Go+Sl>=$o+xp||!_l?(Pl=($o+xp-Go)/Lo.partialLength,Gl=xl.point[0]+(Lo.point[0]-xl.point[0])*Pl,Nl=xl.point[1]+(Lo.point[1]-xl.point[1])*Pl,as.translate(-rs[0]*mo[io].an*.005,-(rs[1]*jo)*.01),Yo=!1):_l&&(Go+=Lo.partialLength,Wo+=1,Wo>=_l.length&&(Wo=0,Jo+=1,Tl[Jo]?_l=Tl[Jo].points:Ol.v.c?(Wo=0,Jo=0,_l=Tl[Jo].points):(Go-=Lo.partialLength,_l=null)),_l&&(xl=Lo,Lo=_l[Wo],Sl=Lo.partialLength));Bl=mo[io].an/2-mo[io].add,as.translate(-Bl,0,0)}else Bl=mo[io].an/2-mo[io].add,as.translate(-Bl,0,0),as.translate(-rs[0]*mo[io].an*.005,-rs[1]*jo*.01,0);for(Xo=0;Xo<Al;Xo+=1)Qo=is[Xo].a,Qo.t.propType&&(El=is[Xo].s,yl=El.getMult(mo[io].anIndexes[Xo],os.a[Xo].s.totalChars),(hs!==0||Fn.j!==0)&&(this._hasMaskedPath?yl.length?$o+=Qo.t.v*yl[0]:$o+=Qo.t.v*yl:yl.length?hs+=Qo.t.v*yl[0]:hs+=Qo.t.v*yl));for(Fn.strokeWidthAnim&&(Xl=Fn.sw||0),Fn.strokeColorAnim&&(Fn.sc?Zl=[Fn.sc[0],Fn.sc[1],Fn.sc[2]]:Zl=[0,0,0]),Fn.fillColorAnim&&Fn.fc&&(wu=[Fn.fc[0],Fn.fc[1],Fn.fc[2]]),Xo=0;Xo<Al;Xo+=1)Qo=is[Xo].a,Qo.a.propType&&(El=is[Xo].s,yl=El.getMult(mo[io].anIndexes[Xo],os.a[Xo].s.totalChars),yl.length?as.translate(-Qo.a.v[0]*yl[0],-Qo.a.v[1]*yl[1],Qo.a.v[2]*yl[2]):as.translate(-Qo.a.v[0]*yl,-Qo.a.v[1]*yl,Qo.a.v[2]*yl));for(Xo=0;Xo<Al;Xo+=1)Qo=is[Xo].a,Qo.s.propType&&(El=is[Xo].s,yl=El.getMult(mo[io].anIndexes[Xo],os.a[Xo].s.totalChars),yl.length?as.scale(1+(Qo.s.v[0]-1)*yl[0],1+(Qo.s.v[1]-1)*yl[1],1):as.scale(1+(Qo.s.v[0]-1)*yl,1+(Qo.s.v[1]-1)*yl,1));for(Xo=0;Xo<Al;Xo+=1){if(Qo=is[Xo].a,El=is[Xo].s,yl=El.getMult(mo[io].anIndexes[Xo],os.a[Xo].s.totalChars),Qo.sk.propType&&(yl.length?as.skewFromAxis(-Qo.sk.v*yl[0],Qo.sa.v*yl[1]):as.skewFromAxis(-Qo.sk.v*yl,Qo.sa.v*yl)),Qo.r.propType&&(yl.length?as.rotateZ(-Qo.r.v*yl[2]):as.rotateZ(-Qo.r.v*yl)),Qo.ry.propType&&(yl.length?as.rotateY(Qo.ry.v*yl[1]):as.rotateY(Qo.ry.v*yl)),Qo.rx.propType&&(yl.length?as.rotateX(Qo.rx.v*yl[0]):as.rotateX(Qo.rx.v*yl)),Qo.o.propType&&(yl.length?Ll+=(Qo.o.v*yl[0]-Ll)*yl[0]:Ll+=(Qo.o.v*yl-Ll)*yl),Fn.strokeWidthAnim&&Qo.sw.propType&&(yl.length?Xl+=Qo.sw.v*yl[0]:Xl+=Qo.sw.v*yl),Fn.strokeColorAnim&&Qo.sc.propType)for(yu=0;yu<3;yu+=1)yl.length?Zl[yu]+=(Qo.sc.v[yu]-Zl[yu])*yl[0]:Zl[yu]+=(Qo.sc.v[yu]-Zl[yu])*yl;if(Fn.fillColorAnim&&Fn.fc){if(Qo.fc.propType)for(yu=0;yu<3;yu+=1)yl.length?wu[yu]+=(Qo.fc.v[yu]-wu[yu])*yl[0]:wu[yu]+=(Qo.fc.v[yu]-wu[yu])*yl;Qo.fh.propType&&(yl.length?wu=addHueToRGB(wu,Qo.fh.v*yl[0]):wu=addHueToRGB(wu,Qo.fh.v*yl)),Qo.fs.propType&&(yl.length?wu=addSaturationToRGB(wu,Qo.fs.v*yl[0]):wu=addSaturationToRGB(wu,Qo.fs.v*yl)),Qo.fb.propType&&(yl.length?wu=addBrightnessToRGB(wu,Qo.fb.v*yl[0]):wu=addBrightnessToRGB(wu,Qo.fb.v*yl))}}for(Xo=0;Xo<Al;Xo+=1)Qo=is[Xo].a,Qo.p.propType&&(El=is[Xo].s,yl=El.getMult(mo[io].anIndexes[Xo],os.a[Xo].s.totalChars),this._hasMaskedPath?yl.length?as.translate(0,Qo.p.v[1]*yl[0],-Qo.p.v[2]*yl[1]):as.translate(0,Qo.p.v[1]*yl,-Qo.p.v[2]*yl):yl.length?as.translate(Qo.p.v[0]*yl[0],Qo.p.v[1]*yl[1],-Qo.p.v[2]*yl[2]):as.translate(Qo.p.v[0]*yl,Qo.p.v[1]*yl,-Qo.p.v[2]*yl));if(Fn.strokeWidthAnim&&(rp=Xl<0?0:Xl),Fn.strokeColorAnim&&(dp="rgb("+Math.round(Zl[0]*255)+","+Math.round(Zl[1]*255)+","+Math.round(Zl[2]*255)+")"),Fn.fillColorAnim&&Fn.fc&&(up="rgb("+Math.round(wu[0]*255)+","+Math.round(wu[1]*255)+","+Math.round(wu[2]*255)+")"),this._hasMaskedPath){if(as.translate(0,-Fn.ls),as.translate(0,rs[1]*jo*.01+ps,0),this._pathData.p.v){Dl=(Lo.point[1]-xl.point[1])/(Lo.point[0]-xl.point[0]);var Kl=Math.atan(Dl)*180/Math.PI;Lo.point[0]<xl.point[0]&&(Kl+=180),as.rotate(-Kl*Math.PI/180)}as.translate(Gl,Nl,0),$o-=rs[0]*mo[io].an*.005,mo[io+1]&&Il!==mo[io+1].ind&&($o+=mo[io].an/2,$o+=Fn.tr*.001*Fn.finalSize)}else{switch(as.translate(hs,ps,0),Fn.ps&&as.translate(Fn.ps[0],Fn.ps[1]+Fn.ascent,0),Fn.j){case 1:as.translate(mo[io].animatorJustifyOffset+Fn.justifyOffset+(Fn.boxWidth-Fn.lineWidths[mo[io].line]),0,0);break;case 2:as.translate(mo[io].animatorJustifyOffset+Fn.justifyOffset+(Fn.boxWidth-Fn.lineWidths[mo[io].line])/2,0,0);break}as.translate(0,-Fn.ls),as.translate(Bl,0,0),as.translate(rs[0]*mo[io].an*.005,rs[1]*jo*.01,0),hs+=mo[io].l+Fn.tr*.001*Fn.finalSize}us==="html"?wp=as.toCSS():us==="svg"?wp=as.to2dCSS():vp=[as.props[0],as.props[1],as.props[2],as.props[3],as.props[4],as.props[5],as.props[6],as.props[7],as.props[8],as.props[9],as.props[10],as.props[11],as.props[12],as.props[13],as.props[14],as.props[15]],pp=Ll}ds<=io?(wl=new LetterProps(pp,rp,dp,up,wp,vp),this.renderedLetters.push(wl),ds+=1,this.lettersChangedFlag=!0):(wl=this.renderedLetters[io],this.lettersChangedFlag=wl.update(pp,rp,dp,up,wp,vp)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty);function ITextElement(){}ITextElement.prototype.initElement=function(Fn,Mn,rs){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(Fn,Mn,rs),this.textProperty=new TextProperty(this,Fn.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(Fn.t,this.renderType,this),this.initTransform(Fn,Mn,rs),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(Fn){this._mdf=!1,this.prepareRenderableFrame(Fn),this.prepareProperties(Fn,this.isInRange)},ITextElement.prototype.createPathShape=function(Fn,Mn){var rs,is=Mn.length,os,as="";for(rs=0;rs<is;rs+=1)Mn[rs].ty==="sh"&&(os=Mn[rs].ks.k,as+=buildShapeString(os,os.i.length,!0,Fn));return as},ITextElement.prototype.updateDocumentData=function(Fn,Mn){this.textProperty.updateDocumentData(Fn,Mn)},ITextElement.prototype.canResizeFont=function(Fn){this.textProperty.canResizeFont(Fn)},ITextElement.prototype.setMinimumFontSize=function(Fn){this.textProperty.setMinimumFontSize(Fn)},ITextElement.prototype.applyTextPropertiesToMatrix=function(Fn,Mn,rs,is,os){switch(Fn.ps&&Mn.translate(Fn.ps[0],Fn.ps[1]+Fn.ascent,0),Mn.translate(0,-Fn.ls,0),Fn.j){case 1:Mn.translate(Fn.justifyOffset+(Fn.boxWidth-Fn.lineWidths[rs]),0,0);break;case 2:Mn.translate(Fn.justifyOffset+(Fn.boxWidth-Fn.lineWidths[rs])/2,0,0);break}Mn.translate(is,os,0)},ITextElement.prototype.buildColor=function(Fn){return"rgb("+Math.round(Fn[0]*255)+","+Math.round(Fn[1]*255)+","+Math.round(Fn[2]*255)+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},ITextElement.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var emptyShapeData={shapes:[]};function SVGTextLottieElement(Fn,Mn,rs){this.textSpans=[],this.renderType="svg",this.initElement(Fn,Mn,rs)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(Fn){for(var Mn=0,rs=Fn.length,is=[],os="";Mn<rs;)Fn[Mn]==="\r"||Fn[Mn]===""?(is.push(os),os=""):os+=Fn[Mn],Mn+=1;return is.push(os),is},SVGTextLottieElement.prototype.buildShapeData=function(Fn,Mn){if(Fn.shapes&&Fn.shapes.length){var rs=Fn.shapes[0];if(rs.it){var is=rs.it[rs.it.length-1];is.s&&(is.s.k[0]=Mn,is.s.k[1]=Mn)}}return Fn},SVGTextLottieElement.prototype.buildNewText=function(){this.addDynamicProperty(this);var Fn,Mn,rs=this.textProperty.currentData;this.renderedLetters=createSizedArray(rs?rs.l.length:0),rs.fc?this.layerElement.setAttribute("fill",this.buildColor(rs.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),rs.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(rs.sc)),this.layerElement.setAttribute("stroke-width",rs.sw)),this.layerElement.setAttribute("font-size",rs.finalSize);var is=this.globalData.fontManager.getFontByName(rs.f);if(is.fClass)this.layerElement.setAttribute("class",is.fClass);else{this.layerElement.setAttribute("font-family",is.fFamily);var os=rs.fWeight,as=rs.fStyle;this.layerElement.setAttribute("font-style",as),this.layerElement.setAttribute("font-weight",os)}this.layerElement.setAttribute("aria-label",rs.t);var us=rs.l||[],ds=!!this.globalData.fontManager.chars;Mn=us.length;var hs,ps=this.mHelper,io="",fo=this.data.singleShape,mo=0,Ao=0,$o=!0,Lo=rs.tr*.001*rs.finalSize;if(fo&&!ds&&!rs.sz){var Go=this.textContainer,Yo="start";switch(rs.j){case 1:Yo="end";break;case 2:Yo="middle";break;default:Yo="start";break}Go.setAttribute("text-anchor",Yo),Go.setAttribute("letter-spacing",Lo);var Wo=this.buildTextContents(rs.finalText);for(Mn=Wo.length,Ao=rs.ps?rs.ps[1]+rs.ascent:0,Fn=0;Fn<Mn;Fn+=1)hs=this.textSpans[Fn].span||createNS("tspan"),hs.textContent=Wo[Fn],hs.setAttribute("x",0),hs.setAttribute("y",Ao),hs.style.display="inherit",Go.appendChild(hs),this.textSpans[Fn]||(this.textSpans[Fn]={span:null,glyph:null}),this.textSpans[Fn].span=hs,Ao+=rs.finalLineHeight;this.layerElement.appendChild(Go)}else{var Jo=this.textSpans.length,xl;for(Fn=0;Fn<Mn;Fn+=1){if(this.textSpans[Fn]||(this.textSpans[Fn]={span:null,childSpan:null,glyph:null}),!ds||!fo||Fn===0){if(hs=Jo>Fn?this.textSpans[Fn].span:createNS(ds?"g":"text"),Jo<=Fn){if(hs.setAttribute("stroke-linecap","butt"),hs.setAttribute("stroke-linejoin","round"),hs.setAttribute("stroke-miterlimit","4"),this.textSpans[Fn].span=hs,ds){var _l=createNS("g");hs.appendChild(_l),this.textSpans[Fn].childSpan=_l}this.textSpans[Fn].span=hs,this.layerElement.appendChild(hs)}hs.style.display="inherit"}if(ps.reset(),fo&&(us[Fn].n&&(mo=-Lo,Ao+=rs.yOffset,Ao+=$o?1:0,$o=!1),this.applyTextPropertiesToMatrix(rs,ps,us[Fn].line,mo,Ao),mo+=us[Fn].l||0,mo+=Lo),ds){xl=this.globalData.fontManager.getCharData(rs.finalText[Fn],is.fStyle,this.globalData.fontManager.getFontByName(rs.f).fFamily);var Tl;if(xl.t===1)Tl=new SVGCompElement(xl.data,this.globalData,this);else{var Sl=emptyShapeData;xl.data&&xl.data.shapes&&(Sl=this.buildShapeData(xl.data,rs.finalSize)),Tl=new SVGShapeElement(Sl,this.globalData,this)}if(this.textSpans[Fn].glyph){var $l=this.textSpans[Fn].glyph;this.textSpans[Fn].childSpan.removeChild($l.layerElement),$l.destroy()}this.textSpans[Fn].glyph=Tl,Tl._debug=!0,Tl.prepareFrame(0),Tl.renderFrame(),this.textSpans[Fn].childSpan.appendChild(Tl.layerElement),xl.t===1&&this.textSpans[Fn].childSpan.setAttribute("transform","scale("+rs.finalSize/100+","+rs.finalSize/100+")")}else fo&&hs.setAttribute("transform","translate("+ps.props[12]+","+ps.props[13]+")"),hs.textContent=us[Fn].val,hs.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}fo&&hs&&hs.setAttribute("d",io)}for(;Fn<this.textSpans.length;)this.textSpans[Fn].span.style.display="none",Fn+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var Fn=this.layerElement.getBBox();this.bbox={top:Fn.y,left:Fn.x,width:Fn.width,height:Fn.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var Fn,Mn=this.textSpans.length,rs;for(this.renderedFrame=this.comp.renderedFrame,Fn=0;Fn<Mn;Fn+=1)rs=this.textSpans[Fn].glyph,rs&&(rs.prepareFrame(this.comp.renderedFrame-this.data.st),rs._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){this._sizeChanged=!0;var Fn,Mn,rs=this.textAnimator.renderedLetters,is=this.textProperty.currentData.l;Mn=is.length;var os,as,us;for(Fn=0;Fn<Mn;Fn+=1)is[Fn].n||(os=rs[Fn],as=this.textSpans[Fn].span,us=this.textSpans[Fn].glyph,us&&us.renderFrame(),os._mdf.m&&as.setAttribute("transform",os.m),os._mdf.o&&as.setAttribute("opacity",os.o),os._mdf.sw&&as.setAttribute("stroke-width",os.sw),os._mdf.sc&&as.setAttribute("stroke",os.sc),os._mdf.fc&&as.setAttribute("fill",os.fc))}};function ISolidElement(Fn,Mn,rs){this.initElement(Fn,Mn,rs)}extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var Fn=createNS("rect");Fn.setAttribute("width",this.data.sw),Fn.setAttribute("height",this.data.sh),Fn.setAttribute("fill",this.data.sc),this.layerElement.appendChild(Fn)};function NullElement(Fn,Mn,rs){this.initFrame(),this.initBaseData(Fn,Mn,rs),this.initFrame(),this.initTransform(Fn,Mn,rs),this.initHierarchy()}NullElement.prototype.prepareFrame=function(Fn){this.prepareProperties(Fn,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement);function SVGRendererBase(){}extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(Fn){return new NullElement(Fn,this.globalData,this)},SVGRendererBase.prototype.createShape=function(Fn){return new SVGShapeElement(Fn,this.globalData,this)},SVGRendererBase.prototype.createText=function(Fn){return new SVGTextLottieElement(Fn,this.globalData,this)},SVGRendererBase.prototype.createImage=function(Fn){return new IImageElement(Fn,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(Fn){return new ISolidElement(Fn,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(Fn){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+Fn.w+" "+Fn.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",Fn.w),this.svgElement.setAttribute("height",Fn.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),this.renderConfig.focusable!==void 0&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var Mn=this.globalData.defs;this.setupGlobalData(Fn,Mn),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=Fn;var rs=createNS("clipPath"),is=createNS("rect");is.setAttribute("width",Fn.w),is.setAttribute("height",Fn.h),is.setAttribute("x",0),is.setAttribute("y",0);var os=createElementID();rs.setAttribute("id",os),rs.appendChild(is),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+os+")"),Mn.appendChild(rs),this.layers=Fn.layers,this.elements=createSizedArray(Fn.layers.length)},SVGRendererBase.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var Fn,Mn=this.layers?this.layers.length:0;for(Fn=0;Fn<Mn;Fn+=1)this.elements[Fn]&&this.elements[Fn].destroy&&this.elements[Fn].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(Fn){var Mn=0,rs=this.layers.length;for(Mn=0;Mn<rs;Mn+=1)if(this.layers[Mn].ind===Fn)return Mn;return-1},SVGRendererBase.prototype.buildItem=function(Fn){var Mn=this.elements;if(!(Mn[Fn]||this.layers[Fn].ty===99)){Mn[Fn]=!0;var rs=this.createItem(this.layers[Fn]);if(Mn[Fn]=rs,getExpressionsPlugin()&&(this.layers[Fn].ty===0&&this.globalData.projectInterface.registerComposition(rs),rs.initExpressions()),this.appendElementInPos(rs,Fn),this.layers[Fn].tt){var is="tp"in this.layers[Fn]?this.findIndexByInd(this.layers[Fn].tp):Fn-1;if(is===-1)return;if(!this.elements[is]||this.elements[is]===!0)this.buildItem(is),this.addPendingElement(rs);else{var os=Mn[is],as=os.getMatte(this.layers[Fn].tt);rs.setMatte(as)}}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var Fn=this.pendingElements.pop();if(Fn.checkParenting(),Fn.data.tt)for(var Mn=0,rs=this.elements.length;Mn<rs;){if(this.elements[Mn]===Fn){var is="tp"in Fn.data?this.findIndexByInd(Fn.data.tp):Mn-1,os=this.elements[is],as=os.getMatte(this.layers[Mn].tt);Fn.setMatte(as);break}Mn+=1}}},SVGRendererBase.prototype.renderFrame=function(Fn){if(!(this.renderedFrame===Fn||this.destroyed)){Fn===null?Fn=this.renderedFrame:this.renderedFrame=Fn,this.globalData.frameNum=Fn,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=Fn,this.globalData._mdf=!1;var Mn,rs=this.layers.length;for(this.completeLayers||this.checkLayers(Fn),Mn=rs-1;Mn>=0;Mn-=1)(this.completeLayers||this.elements[Mn])&&this.elements[Mn].prepareFrame(Fn-this.layers[Mn].st);if(this.globalData._mdf)for(Mn=0;Mn<rs;Mn+=1)(this.completeLayers||this.elements[Mn])&&this.elements[Mn].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(Fn,Mn){var rs=Fn.getBaseElement();if(rs){for(var is=0,os;is<Mn;)this.elements[is]&&this.elements[is]!==!0&&this.elements[is].getBaseElement()&&(os=this.elements[is].getBaseElement()),is+=1;os?this.layerElement.insertBefore(rs,os):this.layerElement.appendChild(rs)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"};function ICompElement(){}extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(Fn,Mn,rs){this.initFrame(),this.initBaseData(Fn,Mn,rs),this.initTransform(Fn,Mn,rs),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),(this.data.xt||!Mn.progressiveLoad)&&this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(Fn){if(this._mdf=!1,this.prepareRenderableFrame(Fn),this.prepareProperties(Fn,this.isInRange),!(!this.isInRange&&!this.data.xt)){if(this.tm._placeholder)this.renderedFrame=Fn/this.data.sr;else{var Mn=this.tm.v;Mn===this.data.op&&(Mn=this.data.op-1),this.renderedFrame=Mn}var rs,is=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),rs=is-1;rs>=0;rs-=1)(this.completeLayers||this.elements[rs])&&(this.elements[rs].prepareFrame(this.renderedFrame-this.layers[rs].st),this.elements[rs]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var Fn,Mn=this.layers.length;for(Fn=0;Fn<Mn;Fn+=1)(this.completeLayers||this.elements[Fn])&&this.elements[Fn].renderFrame()},ICompElement.prototype.setElements=function(Fn){this.elements=Fn},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var Fn,Mn=this.layers.length;for(Fn=0;Fn<Mn;Fn+=1)this.elements[Fn]&&this.elements[Fn].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()};function SVGCompElement(Fn,Mn,rs){this.layers=Fn.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(Fn,Mn,rs),this.tm=Fn.tm?PropertyFactory.getProp(this,Fn.tm,0,Mn.frameRate,this):{_placeholder:!0}}extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(Fn){return new SVGCompElement(Fn,this.globalData,this)};function SVGRenderer(Fn,Mn){this.animationItem=Fn,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var rs="";if(Mn&&Mn.title){var is=createNS("title"),os=createElementID();is.setAttribute("id",os),is.textContent=Mn.title,this.svgElement.appendChild(is),rs+=os}if(Mn&&Mn.description){var as=createNS("desc"),us=createElementID();as.setAttribute("id",us),as.textContent=Mn.description,this.svgElement.appendChild(as),rs+=" "+us}rs&&this.svgElement.setAttribute("aria-labelledby",rs);var ds=createNS("defs");this.svgElement.appendChild(ds);var hs=createNS("g");this.svgElement.appendChild(hs),this.layerElement=hs,this.renderConfig={preserveAspectRatio:Mn&&Mn.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:Mn&&Mn.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:Mn&&Mn.contentVisibility||"visible",progressiveLoad:Mn&&Mn.progressiveLoad||!1,hideOnTransparent:!(Mn&&Mn.hideOnTransparent===!1),viewBoxOnly:Mn&&Mn.viewBoxOnly||!1,viewBoxSize:Mn&&Mn.viewBoxSize||!1,className:Mn&&Mn.className||"",id:Mn&&Mn.id||"",focusable:Mn&&Mn.focusable,filterSize:{width:Mn&&Mn.filterSize&&Mn.filterSize.width||"100%",height:Mn&&Mn.filterSize&&Mn.filterSize.height||"100%",x:Mn&&Mn.filterSize&&Mn.filterSize.x||"0%",y:Mn&&Mn.filterSize&&Mn.filterSize.y||"0%"},width:Mn&&Mn.width,height:Mn&&Mn.height,runExpressions:!Mn||Mn.runExpressions===void 0||Mn.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:ds,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(Fn){return new SVGCompElement(Fn,this.globalData,this)};function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}ShapeTransformManager.prototype={addTransformSequence:function(Mn){var rs,is=Mn.length,os="_";for(rs=0;rs<is;rs+=1)os+=Mn[rs].transform.key+"_";var as=this.sequences[os];return as||(as={transforms:[].concat(Mn),finalTransform:new Matrix,_mdf:!1},this.sequences[os]=as,this.sequenceList.push(as)),as},processSequence:function(Mn,rs){for(var is=0,os=Mn.transforms.length,as=rs;is<os&&!rs;){if(Mn.transforms[is].transform.mProps._mdf){as=!0;break}is+=1}if(as)for(Mn.finalTransform.reset(),is=os-1;is>=0;is-=1)Mn.finalTransform.multiply(Mn.transforms[is].transform.mProps.v);Mn._mdf=as},processSequences:function(Mn){var rs,is=this.sequenceList.length;for(rs=0;rs<is;rs+=1)this.processSequence(this.sequenceList[rs],Mn)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function(){var Mn="__lottie_element_luma_buffer",rs=null,is=null,os=null;function as(){var hs=createNS("svg"),ps=createNS("filter"),io=createNS("feColorMatrix");return ps.setAttribute("id",Mn),io.setAttribute("type","matrix"),io.setAttribute("color-interpolation-filters","sRGB"),io.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),ps.appendChild(io),hs.appendChild(ps),hs.setAttribute("id",Mn+"_svg"),featureSupport.svgLumaHidden&&(hs.style.display="none"),hs}function us(){rs||(os=as(),document.body.appendChild(os),rs=createTag("canvas"),is=rs.getContext("2d"),is.filter="url(#"+Mn+")",is.fillStyle="rgba(0,0,0,0)",is.fillRect(0,0,1,1))}function ds(hs){return rs||us(),rs.width=hs.width,rs.height=hs.height,is.filter="url(#"+Mn+")",rs}return{load:us,get:ds}};function createCanvas(Fn,Mn){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(Fn,Mn);var rs=createTag("canvas");return rs.width=Fn,rs.height=Mn,rs}var assetLoader=function(){return{loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas}}(),registeredEffects={};function CVEffects(Fn){var Mn,rs=Fn.data.ef?Fn.data.ef.length:0;this.filters=[];var is;for(Mn=0;Mn<rs;Mn+=1){is=null;var os=Fn.data.ef[Mn].ty;if(registeredEffects[os]){var as=registeredEffects[os].effect;is=new as(Fn.effectsManager.effectElements[Mn],Fn)}is&&this.filters.push(is)}this.filters.length&&Fn.addRenderableComponent(this)}CVEffects.prototype.renderFrame=function(Fn){var Mn,rs=this.filters.length;for(Mn=0;Mn<rs;Mn+=1)this.filters[Mn].renderFrame(Fn)},CVEffects.prototype.getEffects=function(Fn){var Mn,rs=this.filters.length,is=[];for(Mn=0;Mn<rs;Mn+=1)this.filters[Mn].type===Fn&&is.push(this.filters[Mn]);return is};function registerEffect(Fn,Mn){registeredEffects[Fn]={effect:Mn}}function CVMaskElement(Fn,Mn){this.data=Fn,this.element=Mn,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var rs,is=this.masksProperties.length,os=!1;for(rs=0;rs<is;rs+=1)this.masksProperties[rs].mode!=="n"&&(os=!0),this.viewData[rs]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[rs],3);this.hasMasks=os,os&&this.element.addRenderableComponent(this)}CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var Fn=this.element.finalTransform.mat,Mn=this.element.canvasContext,rs,is=this.masksProperties.length,os,as,us;for(Mn.beginPath(),rs=0;rs<is;rs+=1)if(this.masksProperties[rs].mode!=="n"){this.masksProperties[rs].inv&&(Mn.moveTo(0,0),Mn.lineTo(this.element.globalData.compSize.w,0),Mn.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),Mn.lineTo(0,this.element.globalData.compSize.h),Mn.lineTo(0,0)),us=this.viewData[rs].v,os=Fn.applyToPointArray(us.v[0][0],us.v[0][1],0),Mn.moveTo(os[0],os[1]);var ds,hs=us._length;for(ds=1;ds<hs;ds+=1)as=Fn.applyToTriplePoints(us.o[ds-1],us.i[ds],us.v[ds]),Mn.bezierCurveTo(as[0],as[1],as[2],as[3],as[4],as[5]);as=Fn.applyToTriplePoints(us.o[ds-1],us.i[0],us.v[0]),Mn.bezierCurveTo(as[0],as[1],as[2],as[3],as[4],as[5])}this.element.globalData.renderer.save(!0),Mn.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};function CVBaseElement(){}var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){if(this.data.tt>=1){this.buffers=[];var Mn=this.globalData.canvasContext,rs=assetLoader.createCanvas(Mn.canvas.width,Mn.canvas.height);this.buffers.push(rs);var is=assetLoader.createCanvas(Mn.canvas.width,Mn.canvas.height);this.buffers.push(is),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var Mn=this.globalData;if(Mn.blendMode!==this.data.bm){Mn.blendMode=this.data.bm;var rs=getBlendMode(this.data.bm);Mn.canvasContext.globalCompositeOperation=rs}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(Mn){Mn.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var Mn=this.buffers[0],rs=Mn.getContext("2d");this.clearCanvas(rs),rs.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var Mn=this.buffers[1],rs=Mn.getContext("2d");this.clearCanvas(rs),rs.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var is=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(is.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var os=assetLoader.getLumaCanvas(this.canvasContext.canvas),as=os.getContext("2d");as.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(os,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(Mn,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(Mn){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!Mn)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var rs=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(rs),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(rs),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(Fn,Mn,rs,is){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var os=4;Mn.ty==="rc"?os=5:Mn.ty==="el"?os=6:Mn.ty==="sr"&&(os=7),this.sh=ShapePropertyFactory.getShapeProp(Fn,Mn,os,Fn);var as,us=rs.length,ds;for(as=0;as<us;as+=1)rs[as].closed||(ds={transforms:is.addTransformSequence(rs[as].transforms),trNodes:[]},this.styledShapes.push(ds),rs[as].elements.push(ds))}CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated;function CVShapeElement(Fn,Mn,rs){this.shapes=[],this.shapesData=Fn.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(Fn,Mn,rs)}extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(Fn,Mn){var rs={data:Fn,type:Fn.ty,preTransforms:this.transformsManager.addTransformSequence(Mn),transforms:[],elements:[],closed:Fn.hd===!0},is={};if(Fn.ty==="fl"||Fn.ty==="st"?(is.c=PropertyFactory.getProp(this,Fn.c,1,255,this),is.c.k||(rs.co="rgb("+bmFloor(is.c.v[0])+","+bmFloor(is.c.v[1])+","+bmFloor(is.c.v[2])+")")):(Fn.ty==="gf"||Fn.ty==="gs")&&(is.s=PropertyFactory.getProp(this,Fn.s,1,null,this),is.e=PropertyFactory.getProp(this,Fn.e,1,null,this),is.h=PropertyFactory.getProp(this,Fn.h||{k:0},0,.01,this),is.a=PropertyFactory.getProp(this,Fn.a||{k:0},0,degToRads,this),is.g=new GradientProperty(this,Fn.g,this)),is.o=PropertyFactory.getProp(this,Fn.o,0,.01,this),Fn.ty==="st"||Fn.ty==="gs"){if(rs.lc=lineCapEnum[Fn.lc||2],rs.lj=lineJoinEnum[Fn.lj||2],Fn.lj==1&&(rs.ml=Fn.ml),is.w=PropertyFactory.getProp(this,Fn.w,0,null,this),is.w.k||(rs.wi=is.w.v),Fn.d){var os=new DashProperty(this,Fn.d,"canvas",this);is.d=os,is.d.k||(rs.da=is.d.dashArray,rs.do=is.d.dashoffset[0])}}else rs.r=Fn.r===2?"evenodd":"nonzero";return this.stylesList.push(rs),is.style=rs,is},CVShapeElement.prototype.createGroupElement=function(){var Fn={it:[],prevViewData:[]};return Fn},CVShapeElement.prototype.createTransformElement=function(Fn){var Mn={transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,Fn.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,Fn,this)}};return Mn},CVShapeElement.prototype.createShapeElement=function(Fn){var Mn=new CVShapeData(this,Fn,this.stylesList,this.transformsManager);return this.shapes.push(Mn),this.addShapeToModifiers(Mn),Mn},CVShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var Fn,Mn=this.itemsData.length;for(Fn=0;Fn<Mn;Fn+=1)this.prevViewData[Fn]=this.itemsData[Fn];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),Mn=this.dynamicProperties.length,Fn=0;Fn<Mn;Fn+=1)this.dynamicProperties[Fn].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(Fn){var Mn,rs=this.stylesList.length;for(Mn=0;Mn<rs;Mn+=1)this.stylesList[Mn].closed||this.stylesList[Mn].transforms.push(Fn)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var Fn,Mn=this.stylesList.length;for(Fn=0;Fn<Mn;Fn+=1)this.stylesList[Fn].closed||this.stylesList[Fn].transforms.pop()},CVShapeElement.prototype.closeStyles=function(Fn){var Mn,rs=Fn.length;for(Mn=0;Mn<rs;Mn+=1)Fn[Mn].closed=!0},CVShapeElement.prototype.searchShapes=function(Fn,Mn,rs,is,os){var as,us=Fn.length-1,ds,hs,ps=[],io=[],fo,mo,Ao,$o=[].concat(os);for(as=us;as>=0;as-=1){if(fo=this.searchProcessedElement(Fn[as]),fo?Mn[as]=rs[fo-1]:Fn[as]._shouldRender=is,Fn[as].ty==="fl"||Fn[as].ty==="st"||Fn[as].ty==="gf"||Fn[as].ty==="gs")fo?Mn[as].style.closed=!1:Mn[as]=this.createStyleElement(Fn[as],$o),ps.push(Mn[as].style);else if(Fn[as].ty==="gr"){if(!fo)Mn[as]=this.createGroupElement(Fn[as]);else for(hs=Mn[as].it.length,ds=0;ds<hs;ds+=1)Mn[as].prevViewData[ds]=Mn[as].it[ds];this.searchShapes(Fn[as].it,Mn[as].it,Mn[as].prevViewData,is,$o)}else Fn[as].ty==="tr"?(fo||(Ao=this.createTransformElement(Fn[as]),Mn[as]=Ao),$o.push(Mn[as]),this.addTransformToStyleList(Mn[as])):Fn[as].ty==="sh"||Fn[as].ty==="rc"||Fn[as].ty==="el"||Fn[as].ty==="sr"?fo||(Mn[as]=this.createShapeElement(Fn[as])):Fn[as].ty==="tm"||Fn[as].ty==="rd"||Fn[as].ty==="pb"||Fn[as].ty==="zz"||Fn[as].ty==="op"?(fo?(mo=Mn[as],mo.closed=!1):(mo=ShapeModifiers.getModifier(Fn[as].ty),mo.init(this,Fn[as]),Mn[as]=mo,this.shapeModifiers.push(mo)),io.push(mo)):Fn[as].ty==="rp"&&(fo?(mo=Mn[as],mo.closed=!0):(mo=ShapeModifiers.getModifier(Fn[as].ty),Mn[as]=mo,mo.init(this,Fn,as,Mn),this.shapeModifiers.push(mo),is=!1),io.push(mo));this.addProcessedElement(Fn[as],as+1)}for(this.removeTransformFromStyleList(),this.closeStyles(ps),us=io.length,as=0;as<us;as+=1)io[as].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(Fn,Mn){(Fn._opMdf||Mn.op._mdf||this._isFirstFrame)&&(Mn.opacity=Fn.opacity,Mn.opacity*=Mn.op.v,Mn._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var Fn,Mn=this.stylesList.length,rs,is,os,as,us,ds,hs=this.globalData.renderer,ps=this.globalData.canvasContext,io,fo;for(Fn=0;Fn<Mn;Fn+=1)if(fo=this.stylesList[Fn],io=fo.type,!((io==="st"||io==="gs")&&fo.wi===0||!fo.data._shouldRender||fo.coOp===0||this.globalData.currentGlobalAlpha===0)){for(hs.save(),us=fo.elements,io==="st"||io==="gs"?(hs.ctxStrokeStyle(io==="st"?fo.co:fo.grd),hs.ctxLineWidth(fo.wi),hs.ctxLineCap(fo.lc),hs.ctxLineJoin(fo.lj),hs.ctxMiterLimit(fo.ml||0)):hs.ctxFillStyle(io==="fl"?fo.co:fo.grd),hs.ctxOpacity(fo.coOp),io!=="st"&&io!=="gs"&&ps.beginPath(),hs.ctxTransform(fo.preTransforms.finalTransform.props),is=us.length,rs=0;rs<is;rs+=1){for((io==="st"||io==="gs")&&(ps.beginPath(),fo.da&&(ps.setLineDash(fo.da),ps.lineDashOffset=fo.do)),ds=us[rs].trNodes,as=ds.length,os=0;os<as;os+=1)ds[os].t==="m"?ps.moveTo(ds[os].p[0],ds[os].p[1]):ds[os].t==="c"?ps.bezierCurveTo(ds[os].pts[0],ds[os].pts[1],ds[os].pts[2],ds[os].pts[3],ds[os].pts[4],ds[os].pts[5]):ps.closePath();(io==="st"||io==="gs")&&(hs.ctxStroke(),fo.da&&ps.setLineDash(this.dashResetter))}io!=="st"&&io!=="gs"&&this.globalData.renderer.ctxFill(fo.r),hs.restore()}},CVShapeElement.prototype.renderShape=function(Fn,Mn,rs,is){var os,as=Mn.length-1,us;for(us=Fn,os=as;os>=0;os-=1)Mn[os].ty==="tr"?(us=rs[os].transform,this.renderShapeTransform(Fn,us)):Mn[os].ty==="sh"||Mn[os].ty==="el"||Mn[os].ty==="rc"||Mn[os].ty==="sr"?this.renderPath(Mn[os],rs[os]):Mn[os].ty==="fl"?this.renderFill(Mn[os],rs[os],us):Mn[os].ty==="st"?this.renderStroke(Mn[os],rs[os],us):Mn[os].ty==="gf"||Mn[os].ty==="gs"?this.renderGradientFill(Mn[os],rs[os],us):Mn[os].ty==="gr"?this.renderShape(us,Mn[os].it,rs[os].it):Mn[os].ty;is&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(Fn,Mn){if(this._isFirstFrame||Mn._mdf||Fn.transforms._mdf){var rs=Fn.trNodes,is=Mn.paths,os,as,us,ds=is._length;rs.length=0;var hs=Fn.transforms.finalTransform;for(us=0;us<ds;us+=1){var ps=is.shapes[us];if(ps&&ps.v){for(as=ps._length,os=1;os<as;os+=1)os===1&&rs.push({t:"m",p:hs.applyToPointArray(ps.v[0][0],ps.v[0][1],0)}),rs.push({t:"c",pts:hs.applyToTriplePoints(ps.o[os-1],ps.i[os],ps.v[os])});as===1&&rs.push({t:"m",p:hs.applyToPointArray(ps.v[0][0],ps.v[0][1],0)}),ps.c&&as&&(rs.push({t:"c",pts:hs.applyToTriplePoints(ps.o[os-1],ps.i[0],ps.v[0])}),rs.push({t:"z"}))}}Fn.trNodes=rs}},CVShapeElement.prototype.renderPath=function(Fn,Mn){if(Fn.hd!==!0&&Fn._shouldRender){var rs,is=Mn.styledShapes.length;for(rs=0;rs<is;rs+=1)this.renderStyledShape(Mn.styledShapes[rs],Mn.sh)}},CVShapeElement.prototype.renderFill=function(Fn,Mn,rs){var is=Mn.style;(Mn.c._mdf||this._isFirstFrame)&&(is.co="rgb("+bmFloor(Mn.c.v[0])+","+bmFloor(Mn.c.v[1])+","+bmFloor(Mn.c.v[2])+")"),(Mn.o._mdf||rs._opMdf||this._isFirstFrame)&&(is.coOp=Mn.o.v*rs.opacity)},CVShapeElement.prototype.renderGradientFill=function(Fn,Mn,rs){var is=Mn.style,os;if(!is.grd||Mn.g._mdf||Mn.s._mdf||Mn.e._mdf||Fn.t!==1&&(Mn.h._mdf||Mn.a._mdf)){var as=this.globalData.canvasContext,us=Mn.s.v,ds=Mn.e.v;if(Fn.t===1)os=as.createLinearGradient(us[0],us[1],ds[0],ds[1]);else{var hs=Math.sqrt(Math.pow(us[0]-ds[0],2)+Math.pow(us[1]-ds[1],2)),ps=Math.atan2(ds[1]-us[1],ds[0]-us[0]),io=Mn.h.v;io>=1?io=.99:io<=-1&&(io=-.99);var fo=hs*io,mo=Math.cos(ps+Mn.a.v)*fo+us[0],Ao=Math.sin(ps+Mn.a.v)*fo+us[1];os=as.createRadialGradient(mo,Ao,0,us[0],us[1],hs)}var $o,Lo=Fn.g.p,Go=Mn.g.c,Yo=1;for($o=0;$o<Lo;$o+=1)Mn.g._hasOpacity&&Mn.g._collapsable&&(Yo=Mn.g.o[$o*2+1]),os.addColorStop(Go[$o*4]/100,"rgba("+Go[$o*4+1]+","+Go[$o*4+2]+","+Go[$o*4+3]+","+Yo+")");is.grd=os}is.coOp=Mn.o.v*rs.opacity},CVShapeElement.prototype.renderStroke=function(Fn,Mn,rs){var is=Mn.style,os=Mn.d;os&&(os._mdf||this._isFirstFrame)&&(is.da=os.dashArray,is.do=os.dashoffset[0]),(Mn.c._mdf||this._isFirstFrame)&&(is.co="rgb("+bmFloor(Mn.c.v[0])+","+bmFloor(Mn.c.v[1])+","+bmFloor(Mn.c.v[2])+")"),(Mn.o._mdf||rs._opMdf||this._isFirstFrame)&&(is.coOp=Mn.o.v*rs.opacity),(Mn.w._mdf||this._isFirstFrame)&&(is.wi=Mn.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0};function CVTextElement(Fn,Mn,rs){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(Fn,Mn,rs)}extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var Fn=this.textProperty.currentData;this.renderedLetters=createSizedArray(Fn.l?Fn.l.length:0);var Mn=!1;Fn.fc?(Mn=!0,this.values.fill=this.buildColor(Fn.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=Mn;var rs=!1;Fn.sc&&(rs=!0,this.values.stroke=this.buildColor(Fn.sc),this.values.sWidth=Fn.sw);var is=this.globalData.fontManager.getFontByName(Fn.f),os,as,us=Fn.l,ds=this.mHelper;this.stroke=rs,this.values.fValue=Fn.finalSize+"px "+this.globalData.fontManager.getFontByName(Fn.f).fFamily,as=Fn.finalText.length;var hs,ps,io,fo,mo,Ao,$o,Lo,Go,Yo,Wo=this.data.singleShape,Jo=Fn.tr*.001*Fn.finalSize,xl=0,_l=0,Tl=!0,Sl=0;for(os=0;os<as;os+=1){hs=this.globalData.fontManager.getCharData(Fn.finalText[os],is.fStyle,this.globalData.fontManager.getFontByName(Fn.f).fFamily),ps=hs&&hs.data||{},ds.reset(),Wo&&us[os].n&&(xl=-Jo,_l+=Fn.yOffset,_l+=Tl?1:0,Tl=!1),mo=ps.shapes?ps.shapes[0].it:[],$o=mo.length,ds.scale(Fn.finalSize/100,Fn.finalSize/100),Wo&&this.applyTextPropertiesToMatrix(Fn,ds,us[os].line,xl,_l),Go=createSizedArray($o-1);var $l=0;for(Ao=0;Ao<$o;Ao+=1)if(mo[Ao].ty==="sh"){for(fo=mo[Ao].ks.k.i.length,Lo=mo[Ao].ks.k,Yo=[],io=1;io<fo;io+=1)io===1&&Yo.push(ds.applyToX(Lo.v[0][0],Lo.v[0][1],0),ds.applyToY(Lo.v[0][0],Lo.v[0][1],0)),Yo.push(ds.applyToX(Lo.o[io-1][0],Lo.o[io-1][1],0),ds.applyToY(Lo.o[io-1][0],Lo.o[io-1][1],0),ds.applyToX(Lo.i[io][0],Lo.i[io][1],0),ds.applyToY(Lo.i[io][0],Lo.i[io][1],0),ds.applyToX(Lo.v[io][0],Lo.v[io][1],0),ds.applyToY(Lo.v[io][0],Lo.v[io][1],0));Yo.push(ds.applyToX(Lo.o[io-1][0],Lo.o[io-1][1],0),ds.applyToY(Lo.o[io-1][0],Lo.o[io-1][1],0),ds.applyToX(Lo.i[0][0],Lo.i[0][1],0),ds.applyToY(Lo.i[0][0],Lo.i[0][1],0),ds.applyToX(Lo.v[0][0],Lo.v[0][1],0),ds.applyToY(Lo.v[0][0],Lo.v[0][1],0)),Go[$l]=Yo,$l+=1}Wo&&(xl+=us[os].l,xl+=Jo),this.textSpans[Sl]?this.textSpans[Sl].elem=Go:this.textSpans[Sl]={elem:Go},Sl+=1}},CVTextElement.prototype.renderInnerContent=function(){this.validateText();var Fn=this.canvasContext;Fn.font=this.values.fValue,this.globalData.renderer.ctxLineCap("butt"),this.globalData.renderer.ctxLineJoin("miter"),this.globalData.renderer.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var Mn,rs,is,os,as,us,ds=this.textAnimator.renderedLetters,hs=this.textProperty.currentData.l;rs=hs.length;var ps,io=null,fo=null,mo=null,Ao,$o,Lo=this.globalData.renderer;for(Mn=0;Mn<rs;Mn+=1)if(!hs[Mn].n){if(ps=ds[Mn],ps&&(Lo.save(),Lo.ctxTransform(ps.p),Lo.ctxOpacity(ps.o)),this.fill){for(ps&&ps.fc?io!==ps.fc&&(Lo.ctxFillStyle(ps.fc),io=ps.fc):io!==this.values.fill&&(io=this.values.fill,Lo.ctxFillStyle(this.values.fill)),Ao=this.textSpans[Mn].elem,os=Ao.length,this.globalData.canvasContext.beginPath(),is=0;is<os;is+=1)for($o=Ao[is],us=$o.length,this.globalData.canvasContext.moveTo($o[0],$o[1]),as=2;as<us;as+=6)this.globalData.canvasContext.bezierCurveTo($o[as],$o[as+1],$o[as+2],$o[as+3],$o[as+4],$o[as+5]);this.globalData.canvasContext.closePath(),Lo.ctxFill()}if(this.stroke){for(ps&&ps.sw?mo!==ps.sw&&(mo=ps.sw,Lo.ctxLineWidth(ps.sw)):mo!==this.values.sWidth&&(mo=this.values.sWidth,Lo.ctxLineWidth(this.values.sWidth)),ps&&ps.sc?fo!==ps.sc&&(fo=ps.sc,Lo.ctxStrokeStyle(ps.sc)):fo!==this.values.stroke&&(fo=this.values.stroke,Lo.ctxStrokeStyle(this.values.stroke)),Ao=this.textSpans[Mn].elem,os=Ao.length,this.globalData.canvasContext.beginPath(),is=0;is<os;is+=1)for($o=Ao[is],us=$o.length,this.globalData.canvasContext.moveTo($o[0],$o[1]),as=2;as<us;as+=6)this.globalData.canvasContext.bezierCurveTo($o[as],$o[as+1],$o[as+2],$o[as+3],$o[as+4],$o[as+5]);this.globalData.canvasContext.closePath(),Lo.ctxStroke()}ps&&this.globalData.renderer.restore()}};function CVImageElement(Fn,Mn,rs){this.assetData=Mn.getAssetData(Fn.refId),this.img=Mn.imageLoader.getAsset(this.assetData),this.initElement(Fn,Mn,rs)}extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var Fn=createTag("canvas");Fn.width=this.assetData.w,Fn.height=this.assetData.h;var Mn=Fn.getContext("2d"),rs=this.img.width,is=this.img.height,os=rs/is,as=this.assetData.w/this.assetData.h,us,ds,hs=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;os>as&&hs==="xMidYMid slice"||os<as&&hs!=="xMidYMid slice"?(ds=is,us=ds*as):(us=rs,ds=us/as),Mn.drawImage(this.img,(rs-us)/2,(is-ds)/2,us,ds,0,0,this.assetData.w,this.assetData.h),this.img=Fn}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null};function CVSolidElement(Fn,Mn,rs){this.initElement(Fn,Mn,rs)}extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw,this.data.sh)};function CanvasRendererBase(){}extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(Fn){return new CVShapeElement(Fn,this.globalData,this)},CanvasRendererBase.prototype.createText=function(Fn){return new CVTextElement(Fn,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(Fn){return new CVImageElement(Fn,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(Fn){return new CVSolidElement(Fn,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(Fn){Fn[0]===1&&Fn[1]===0&&Fn[4]===0&&Fn[5]===1&&Fn[12]===0&&Fn[13]===0||this.canvasContext.transform(Fn[0],Fn[1],Fn[4],Fn[5],Fn[12],Fn[13])},CanvasRendererBase.prototype.ctxOpacity=function(Fn){this.canvasContext.globalAlpha*=Fn<0?0:Fn},CanvasRendererBase.prototype.ctxFillStyle=function(Fn){this.canvasContext.fillStyle=Fn},CanvasRendererBase.prototype.ctxStrokeStyle=function(Fn){this.canvasContext.strokeStyle=Fn},CanvasRendererBase.prototype.ctxLineWidth=function(Fn){this.canvasContext.lineWidth=Fn},CanvasRendererBase.prototype.ctxLineCap=function(Fn){this.canvasContext.lineCap=Fn},CanvasRendererBase.prototype.ctxLineJoin=function(Fn){this.canvasContext.lineJoin=Fn},CanvasRendererBase.prototype.ctxMiterLimit=function(Fn){this.canvasContext.miterLimit=Fn},CanvasRendererBase.prototype.ctxFill=function(Fn){this.canvasContext.fill(Fn)},CanvasRendererBase.prototype.ctxFillRect=function(Fn,Mn,rs,is){this.canvasContext.fillRect(Fn,Mn,rs,is)},CanvasRendererBase.prototype.ctxStroke=function(){this.canvasContext.stroke()},CanvasRendererBase.prototype.reset=function(){if(!this.renderConfig.clearCanvas){this.canvasContext.restore();return}this.contextData.reset()},CanvasRendererBase.prototype.save=function(){this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(Fn){if(!this.renderConfig.clearCanvas){this.canvasContext.restore();return}Fn&&(this.globalData.blendMode="source-over"),this.contextData.restore(Fn)},CanvasRendererBase.prototype.configAnimation=function(Fn){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var Mn=this.animationItem.container.style;Mn.width="100%",Mn.height="100%";var rs="0px 0px 0px";Mn.transformOrigin=rs,Mn.mozTransformOrigin=rs,Mn.webkitTransformOrigin=rs,Mn["-webkit-transform"]=rs,Mn.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.contextData.setContext(this.canvasContext),this.data=Fn,this.layers=Fn.layers,this.transformCanvas={w:Fn.w,h:Fn.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(Fn,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(Fn.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(Fn,Mn){this.reset();var rs,is;Fn?(rs=Fn,is=Mn,this.canvasContext.canvas.width=rs,this.canvasContext.canvas.height=is):(this.animationItem.wrapper&&this.animationItem.container?(rs=this.animationItem.wrapper.offsetWidth,is=this.animationItem.wrapper.offsetHeight):(rs=this.canvasContext.canvas.width,is=this.canvasContext.canvas.height),this.canvasContext.canvas.width=rs*this.renderConfig.dpr,this.canvasContext.canvas.height=is*this.renderConfig.dpr);var os,as;if(this.renderConfig.preserveAspectRatio.indexOf("meet")!==-1||this.renderConfig.preserveAspectRatio.indexOf("slice")!==-1){var us=this.renderConfig.preserveAspectRatio.split(" "),ds=us[1]||"meet",hs=us[0]||"xMidYMid",ps=hs.substr(0,4),io=hs.substr(4);os=rs/is,as=this.transformCanvas.w/this.transformCanvas.h,as>os&&ds==="meet"||as<os&&ds==="slice"?(this.transformCanvas.sx=rs/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=rs/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=is/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=is/(this.transformCanvas.h/this.renderConfig.dpr)),ps==="xMid"&&(as<os&&ds==="meet"||as>os&&ds==="slice")?this.transformCanvas.tx=(rs-this.transformCanvas.w*(is/this.transformCanvas.h))/2*this.renderConfig.dpr:ps==="xMax"&&(as<os&&ds==="meet"||as>os&&ds==="slice")?this.transformCanvas.tx=(rs-this.transformCanvas.w*(is/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,io==="YMid"&&(as>os&&ds==="meet"||as<os&&ds==="slice")?this.transformCanvas.ty=(is-this.transformCanvas.h*(rs/this.transformCanvas.w))/2*this.renderConfig.dpr:io==="YMax"&&(as>os&&ds==="meet"||as<os&&ds==="slice")?this.transformCanvas.ty=(is-this.transformCanvas.h*(rs/this.transformCanvas.w))*this.renderConfig.dpr:this.transformCanvas.ty=0}else this.renderConfig.preserveAspectRatio==="none"?(this.transformCanvas.sx=rs/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=is/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText="");var Fn,Mn=this.layers?this.layers.length:0;for(Fn=Mn-1;Fn>=0;Fn-=1)this.elements[Fn]&&this.elements[Fn].destroy&&this.elements[Fn].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(Fn,Mn){if(!(this.renderedFrame===Fn&&this.renderConfig.clearCanvas===!0&&!Mn||this.destroyed||Fn===-1)){this.renderedFrame=Fn,this.globalData.frameNum=Fn-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||Mn,this.globalData.projectInterface.currentFrame=Fn;var rs,is=this.layers.length;for(this.completeLayers||this.checkLayers(Fn),rs=is-1;rs>=0;rs-=1)(this.completeLayers||this.elements[rs])&&this.elements[rs].prepareFrame(Fn-this.layers[rs].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),rs=is-1;rs>=0;rs-=1)(this.completeLayers||this.elements[rs])&&this.elements[rs].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(Fn){var Mn=this.elements;if(!(Mn[Fn]||this.layers[Fn].ty===99)){var rs=this.createItem(this.layers[Fn],this,this.globalData);Mn[Fn]=rs,rs.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var Fn=this.pendingElements.pop();Fn.checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"};function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){this.stack=[],this.cArrPos=0,this.cTr=new Matrix;var Fn,Mn=15;for(Fn=0;Fn<Mn;Fn+=1){var rs=new CanvasContext;this.stack[Fn]=rs}this._length=Mn,this.nativeContext=null,this.transformMat=new Matrix,this.currentOpacity=1,this.currentFillStyle="",this.appliedFillStyle="",this.currentStrokeStyle="",this.appliedStrokeStyle="",this.currentLineWidth="",this.appliedLineWidth="",this.currentLineCap="",this.appliedLineCap="",this.currentLineJoin="",this.appliedLineJoin="",this.appliedMiterLimit="",this.currentMiterLimit=""}CVContextData.prototype.duplicate=function(){var Fn=this._length*2,Mn=0;for(Mn=this._length;Mn<Fn;Mn+=1)this.stack[Mn]=new CanvasContext;this._length=Fn},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.stack[this.cArrPos].opacity=1},CVContextData.prototype.restore=function(Fn){this.cArrPos-=1;var Mn=this.stack[this.cArrPos],rs=Mn.transform,is,os=this.cTr.props;for(is=0;is<16;is+=1)os[is]=rs[is];if(Fn){this.nativeContext.restore();var as=this.stack[this.cArrPos+1];this.appliedFillStyle=as.fillStyle,this.appliedStrokeStyle=as.strokeStyle,this.appliedLineWidth=as.lineWidth,this.appliedLineCap=as.lineCap,this.appliedLineJoin=as.lineJoin,this.appliedMiterLimit=as.miterLimit}this.nativeContext.setTransform(rs[0],rs[1],rs[4],rs[5],rs[12],rs[13]),(Fn||Mn.opacity!==-1&&this.currentOpacity!==Mn.opacity)&&(this.nativeContext.globalAlpha=Mn.opacity,this.currentOpacity=Mn.opacity),this.currentFillStyle=Mn.fillStyle,this.currentStrokeStyle=Mn.strokeStyle,this.currentLineWidth=Mn.lineWidth,this.currentLineCap=Mn.lineCap,this.currentLineJoin=Mn.lineJoin,this.currentMiterLimit=Mn.miterLimit},CVContextData.prototype.save=function(Fn){Fn&&this.nativeContext.save();var Mn=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var rs=this.stack[this.cArrPos],is;for(is=0;is<16;is+=1)rs.transform[is]=Mn[is];this.cArrPos+=1;var os=this.stack[this.cArrPos];os.opacity=rs.opacity,os.fillStyle=rs.fillStyle,os.strokeStyle=rs.strokeStyle,os.lineWidth=rs.lineWidth,os.lineCap=rs.lineCap,os.lineJoin=rs.lineJoin,os.miterLimit=rs.miterLimit},CVContextData.prototype.setOpacity=function(Fn){this.stack[this.cArrPos].opacity=Fn},CVContextData.prototype.setContext=function(Fn){this.nativeContext=Fn},CVContextData.prototype.fillStyle=function(Fn){this.stack[this.cArrPos].fillStyle!==Fn&&(this.currentFillStyle=Fn,this.stack[this.cArrPos].fillStyle=Fn)},CVContextData.prototype.strokeStyle=function(Fn){this.stack[this.cArrPos].strokeStyle!==Fn&&(this.currentStrokeStyle=Fn,this.stack[this.cArrPos].strokeStyle=Fn)},CVContextData.prototype.lineWidth=function(Fn){this.stack[this.cArrPos].lineWidth!==Fn&&(this.currentLineWidth=Fn,this.stack[this.cArrPos].lineWidth=Fn)},CVContextData.prototype.lineCap=function(Fn){this.stack[this.cArrPos].lineCap!==Fn&&(this.currentLineCap=Fn,this.stack[this.cArrPos].lineCap=Fn)},CVContextData.prototype.lineJoin=function(Fn){this.stack[this.cArrPos].lineJoin!==Fn&&(this.currentLineJoin=Fn,this.stack[this.cArrPos].lineJoin=Fn)},CVContextData.prototype.miterLimit=function(Fn){this.stack[this.cArrPos].miterLimit!==Fn&&(this.currentMiterLimit=Fn,this.stack[this.cArrPos].miterLimit=Fn)},CVContextData.prototype.transform=function(Fn){this.transformMat.cloneFromProps(Fn);var Mn=this.cTr;this.transformMat.multiply(Mn),Mn.cloneFromProps(this.transformMat.props);var rs=Mn.props;this.nativeContext.setTransform(rs[0],rs[1],rs[4],rs[5],rs[12],rs[13])},CVContextData.prototype.opacity=function(Fn){var Mn=this.stack[this.cArrPos].opacity;Mn*=Fn<0?0:Fn,this.stack[this.cArrPos].opacity!==Mn&&(this.currentOpacity!==Fn&&(this.nativeContext.globalAlpha=Fn,this.currentOpacity=Fn),this.stack[this.cArrPos].opacity=Mn)},CVContextData.prototype.fill=function(Fn){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fill(Fn)},CVContextData.prototype.fillRect=function(Fn,Mn,rs,is){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fillRect(Fn,Mn,rs,is)},CVContextData.prototype.stroke=function(){this.appliedStrokeStyle!==this.currentStrokeStyle&&(this.appliedStrokeStyle=this.currentStrokeStyle,this.nativeContext.strokeStyle=this.appliedStrokeStyle),this.appliedLineWidth!==this.currentLineWidth&&(this.appliedLineWidth=this.currentLineWidth,this.nativeContext.lineWidth=this.appliedLineWidth),this.appliedLineCap!==this.currentLineCap&&(this.appliedLineCap=this.currentLineCap,this.nativeContext.lineCap=this.appliedLineCap),this.appliedLineJoin!==this.currentLineJoin&&(this.appliedLineJoin=this.currentLineJoin,this.nativeContext.lineJoin=this.appliedLineJoin),this.appliedMiterLimit!==this.currentMiterLimit&&(this.appliedMiterLimit=this.currentMiterLimit,this.nativeContext.miterLimit=this.appliedMiterLimit),this.nativeContext.stroke()};function CVCompElement(Fn,Mn,rs){this.completeLayers=!1,this.layers=Fn.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(Fn,Mn,rs),this.tm=Fn.tm?PropertyFactory.getProp(this,Fn.tm,0,Mn.frameRate,this):{_placeholder:!0}}extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var Fn=this.canvasContext;Fn.beginPath(),Fn.moveTo(0,0),Fn.lineTo(this.data.w,0),Fn.lineTo(this.data.w,this.data.h),Fn.lineTo(0,this.data.h),Fn.lineTo(0,0),Fn.clip();var Mn,rs=this.layers.length;for(Mn=rs-1;Mn>=0;Mn-=1)(this.completeLayers||this.elements[Mn])&&this.elements[Mn].renderFrame()},CVCompElement.prototype.destroy=function(){var Fn,Mn=this.layers.length;for(Fn=Mn-1;Fn>=0;Fn-=1)this.elements[Fn]&&this.elements[Fn].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(Fn){return new CVCompElement(Fn,this.globalData,this)};function CanvasRenderer(Fn,Mn){this.animationItem=Fn,this.renderConfig={clearCanvas:Mn&&Mn.clearCanvas!==void 0?Mn.clearCanvas:!0,context:Mn&&Mn.context||null,progressiveLoad:Mn&&Mn.progressiveLoad||!1,preserveAspectRatio:Mn&&Mn.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:Mn&&Mn.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:Mn&&Mn.contentVisibility||"visible",className:Mn&&Mn.className||"",id:Mn&&Mn.id||"",runExpressions:!Mn||Mn.runExpressions===void 0||Mn.runExpressions},this.renderConfig.dpr=Mn&&Mn.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=Mn&&Mn.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(Fn){return new CVCompElement(Fn,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode()},renderElement:function(){var Mn=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var rs=this.finalTransform.mat.toCSS();Mn.transform=rs,Mn.webkitTransform=rs}this.finalTransform._opMdf&&(Mn.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(Fn,Mn,rs){this.initElement(Fn,Mn,rs)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var Fn;this.data.hasMask?(Fn=createNS("rect"),Fn.setAttribute("width",this.data.sw),Fn.setAttribute("height",this.data.sh),Fn.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(Fn=createTag("div"),Fn.style.width=this.data.sw+"px",Fn.style.height=this.data.sh+"px",Fn.style.backgroundColor=this.data.sc),this.layerElement.appendChild(Fn)};function HShapeElement(Fn,Mn,rs){this.shapes=[],this.shapesData=Fn.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(Fn,Mn,rs),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var Fn;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),Fn=this.svgElement;else{Fn=createNS("svg");var Mn=this.comp.data?this.comp.data:this.globalData.compSize;Fn.setAttribute("width",Mn.w),Fn.setAttribute("height",Mn.h),Fn.appendChild(this.shapesContainer),this.layerElement.appendChild(Fn)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=Fn},HShapeElement.prototype.getTransformedPoint=function(Fn,Mn){var rs,is=Fn.length;for(rs=0;rs<is;rs+=1)Mn=Fn[rs].mProps.v.applyToPointArray(Mn[0],Mn[1],0);return Mn},HShapeElement.prototype.calculateShapeBoundingBox=function(Fn,Mn){var rs=Fn.sh.v,is=Fn.transformers,os,as=rs._length,us,ds,hs,ps;if(!(as<=1)){for(os=0;os<as-1;os+=1)us=this.getTransformedPoint(is,rs.v[os]),ds=this.getTransformedPoint(is,rs.o[os]),hs=this.getTransformedPoint(is,rs.i[os+1]),ps=this.getTransformedPoint(is,rs.v[os+1]),this.checkBounds(us,ds,hs,ps,Mn);rs.c&&(us=this.getTransformedPoint(is,rs.v[os]),ds=this.getTransformedPoint(is,rs.o[os]),hs=this.getTransformedPoint(is,rs.i[0]),ps=this.getTransformedPoint(is,rs.v[0]),this.checkBounds(us,ds,hs,ps,Mn))}},HShapeElement.prototype.checkBounds=function(Fn,Mn,rs,is,os){this.getBoundsOfCurve(Fn,Mn,rs,is);var as=this.shapeBoundingBox;os.x=bmMin(as.left,os.x),os.xMax=bmMax(as.right,os.xMax),os.y=bmMin(as.top,os.y),os.yMax=bmMax(as.bottom,os.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(Fn,Mn,rs,is){for(var os=[[Fn[0],is[0]],[Fn[1],is[1]]],as,us,ds,hs,ps,io,fo,mo=0;mo<2;++mo)us=6*Fn[mo]-12*Mn[mo]+6*rs[mo],as=-3*Fn[mo]+9*Mn[mo]-9*rs[mo]+3*is[mo],ds=3*Mn[mo]-3*Fn[mo],us|=0,as|=0,ds|=0,as===0&&us===0||(as===0?(hs=-ds/us,hs>0&&hs<1&&os[mo].push(this.calculateF(hs,Fn,Mn,rs,is,mo))):(ps=us*us-4*ds*as,ps>=0&&(io=(-us+bmSqrt(ps))/(2*as),io>0&&io<1&&os[mo].push(this.calculateF(io,Fn,Mn,rs,is,mo)),fo=(-us-bmSqrt(ps))/(2*as),fo>0&&fo<1&&os[mo].push(this.calculateF(fo,Fn,Mn,rs,is,mo)))));this.shapeBoundingBox.left=bmMin.apply(null,os[0]),this.shapeBoundingBox.top=bmMin.apply(null,os[1]),this.shapeBoundingBox.right=bmMax.apply(null,os[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,os[1])},HShapeElement.prototype.calculateF=function(Fn,Mn,rs,is,os,as){return bmPow(1-Fn,3)*Mn[as]+3*bmPow(1-Fn,2)*Fn*rs[as]+3*(1-Fn)*bmPow(Fn,2)*is[as]+bmPow(Fn,3)*os[as]},HShapeElement.prototype.calculateBoundingBox=function(Fn,Mn){var rs,is=Fn.length;for(rs=0;rs<is;rs+=1)Fn[rs]&&Fn[rs].sh?this.calculateShapeBoundingBox(Fn[rs],Mn):Fn[rs]&&Fn[rs].it?this.calculateBoundingBox(Fn[rs].it,Mn):Fn[rs]&&Fn[rs].style&&Fn[rs].w&&this.expandStrokeBoundingBox(Fn[rs].w,Mn)},HShapeElement.prototype.expandStrokeBoundingBox=function(Fn,Mn){var rs=0;if(Fn.keyframes){for(var is=0;is<Fn.keyframes.length;is+=1){var os=Fn.keyframes[is].s;os>rs&&(rs=os)}rs*=Fn.mult}else rs=Fn.v*Fn.mult;Mn.x-=rs,Mn.xMax+=rs,Mn.y-=rs,Mn.yMax+=rs},HShapeElement.prototype.currentBoxContains=function(Fn){return this.currentBBox.x<=Fn.x&&this.currentBBox.y<=Fn.y&&this.currentBBox.width+this.currentBBox.x>=Fn.x+Fn.width&&this.currentBBox.height+this.currentBBox.y>=Fn.y+Fn.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var Fn=this.tempBoundingBox,Mn=999999;if(Fn.x=Mn,Fn.xMax=-Mn,Fn.y=Mn,Fn.yMax=-Mn,this.calculateBoundingBox(this.itemsData,Fn),Fn.width=Fn.xMax<Fn.x?0:Fn.xMax-Fn.x,Fn.height=Fn.yMax<Fn.y?0:Fn.yMax-Fn.y,this.currentBoxContains(Fn))return;var rs=!1;if(this.currentBBox.w!==Fn.width&&(this.currentBBox.w=Fn.width,this.shapeCont.setAttribute("width",Fn.width),rs=!0),this.currentBBox.h!==Fn.height&&(this.currentBBox.h=Fn.height,this.shapeCont.setAttribute("height",Fn.height),rs=!0),rs||this.currentBBox.x!==Fn.x||this.currentBBox.y!==Fn.y){this.currentBBox.w=Fn.width,this.currentBBox.h=Fn.height,this.currentBBox.x=Fn.x,this.currentBBox.y=Fn.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var is=this.shapeCont.style,os="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";is.transform=os,is.webkitTransform=os}}};function HTextElement(Fn,Mn,rs){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(Fn,Mn,rs)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var Fn=createNS("g");this.maskedElement.appendChild(Fn),this.innerElem=Fn}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var Fn=this.textProperty.currentData;this.renderedLetters=createSizedArray(Fn.l?Fn.l.length:0);var Mn=this.innerElem.style,rs=Fn.fc?this.buildColor(Fn.fc):"rgba(0,0,0,0)";Mn.fill=rs,Mn.color=rs,Fn.sc&&(Mn.stroke=this.buildColor(Fn.sc),Mn.strokeWidth=Fn.sw+"px");var is=this.globalData.fontManager.getFontByName(Fn.f);if(!this.globalData.fontManager.chars)if(Mn.fontSize=Fn.finalSize+"px",Mn.lineHeight=Fn.finalSize+"px",is.fClass)this.innerElem.className=is.fClass;else{Mn.fontFamily=is.fFamily;var os=Fn.fWeight,as=Fn.fStyle;Mn.fontStyle=as,Mn.fontWeight=os}var us,ds,hs=Fn.l;ds=hs.length;var ps,io,fo,mo=this.mHelper,Ao,$o="",Lo=0;for(us=0;us<ds;us+=1){if(this.globalData.fontManager.chars?(this.textPaths[Lo]?ps=this.textPaths[Lo]:(ps=createNS("path"),ps.setAttribute("stroke-linecap",lineCapEnum[1]),ps.setAttribute("stroke-linejoin",lineJoinEnum[2]),ps.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[Lo]?(io=this.textSpans[Lo],fo=io.children[0]):(io=createTag("div"),io.style.lineHeight=0,fo=createNS("svg"),fo.appendChild(ps),styleDiv(io)))):this.isMasked?ps=this.textPaths[Lo]?this.textPaths[Lo]:createNS("text"):this.textSpans[Lo]?(io=this.textSpans[Lo],ps=this.textPaths[Lo]):(io=createTag("span"),styleDiv(io),ps=createTag("span"),styleDiv(ps),io.appendChild(ps)),this.globalData.fontManager.chars){var Go=this.globalData.fontManager.getCharData(Fn.finalText[us],is.fStyle,this.globalData.fontManager.getFontByName(Fn.f).fFamily),Yo;if(Go?Yo=Go.data:Yo=null,mo.reset(),Yo&&Yo.shapes&&Yo.shapes.length&&(Ao=Yo.shapes[0].it,mo.scale(Fn.finalSize/100,Fn.finalSize/100),$o=this.createPathShape(mo,Ao),ps.setAttribute("d",$o)),this.isMasked)this.innerElem.appendChild(ps);else{if(this.innerElem.appendChild(io),Yo&&Yo.shapes){document.body.appendChild(fo);var Wo=fo.getBBox();fo.setAttribute("width",Wo.width+2),fo.setAttribute("height",Wo.height+2),fo.setAttribute("viewBox",Wo.x-1+" "+(Wo.y-1)+" "+(Wo.width+2)+" "+(Wo.height+2));var Jo=fo.style,xl="translate("+(Wo.x-1)+"px,"+(Wo.y-1)+"px)";Jo.transform=xl,Jo.webkitTransform=xl,hs[us].yOffset=Wo.y-1}else fo.setAttribute("width",1),fo.setAttribute("height",1);io.appendChild(fo)}}else if(ps.textContent=hs[us].val,ps.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(ps);else{this.innerElem.appendChild(io);var _l=ps.style,Tl="translate3d(0,"+-Fn.finalSize/1.2+"px,0)";_l.transform=Tl,_l.webkitTransform=Tl}this.isMasked?this.textSpans[Lo]=ps:this.textSpans[Lo]=io,this.textSpans[Lo].style.display="block",this.textPaths[Lo]=ps,Lo+=1}for(;Lo<this.textSpans.length;)this.textSpans[Lo].style.display="none",Lo+=1},HTextElement.prototype.renderInnerContent=function(){this.validateText();var Fn;if(this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),Fn=this.svgElement.style;var Mn="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";Fn.transform=Mn,Fn.webkitTransform=Mn}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),!(!this.lettersChangedFlag&&!this.textAnimator.lettersChangedFlag)){var rs,is,os=0,as=this.textAnimator.renderedLetters,us=this.textProperty.currentData.l;is=us.length;var ds,hs,ps;for(rs=0;rs<is;rs+=1)us[rs].n?os+=1:(hs=this.textSpans[rs],ps=this.textPaths[rs],ds=as[os],os+=1,ds._mdf.m&&(this.isMasked?hs.setAttribute("transform",ds.m):(hs.style.webkitTransform=ds.m,hs.style.transform=ds.m)),hs.style.opacity=ds.o,ds.sw&&ds._mdf.sw&&ps.setAttribute("stroke-width",ds.sw),ds.sc&&ds._mdf.sc&&ps.setAttribute("stroke",ds.sc),ds.fc&&ds._mdf.fc&&(ps.setAttribute("fill",ds.fc),ps.style.color=ds.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var io=this.innerElem.getBBox();this.currentBBox.w!==io.width&&(this.currentBBox.w=io.width,this.svgElement.setAttribute("width",io.width)),this.currentBBox.h!==io.height&&(this.currentBBox.h=io.height,this.svgElement.setAttribute("height",io.height));var fo=1;if(this.currentBBox.w!==io.width+fo*2||this.currentBBox.h!==io.height+fo*2||this.currentBBox.x!==io.x-fo||this.currentBBox.y!==io.y-fo){this.currentBBox.w=io.width+fo*2,this.currentBBox.h=io.height+fo*2,this.currentBBox.x=io.x-fo,this.currentBBox.y=io.y-fo,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),Fn=this.svgElement.style;var mo="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";Fn.transform=mo,Fn.webkitTransform=mo}}}};function HCameraElement(Fn,Mn,rs){this.initFrame(),this.initBaseData(Fn,Mn,rs),this.initHierarchy();var is=PropertyFactory.getProp;if(this.pe=is(this,Fn.pe,0,0,this),Fn.ks.p.s?(this.px=is(this,Fn.ks.p.x,1,0,this),this.py=is(this,Fn.ks.p.y,1,0,this),this.pz=is(this,Fn.ks.p.z,1,0,this)):this.p=is(this,Fn.ks.p,1,0,this),Fn.ks.a&&(this.a=is(this,Fn.ks.a,1,0,this)),Fn.ks.or.k.length&&Fn.ks.or.k[0].to){var os,as=Fn.ks.or.k.length;for(os=0;os<as;os+=1)Fn.ks.or.k[os].to=null,Fn.ks.or.k[os].ti=null}this.or=is(this,Fn.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=is(this,Fn.ks.rx,0,degToRads,this),this.ry=is(this,Fn.ks.ry,0,degToRads,this),this.rz=is(this,Fn.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var Fn,Mn=this.comp.threeDElements.length,rs,is,os;for(Fn=0;Fn<Mn;Fn+=1)if(rs=this.comp.threeDElements[Fn],rs.type==="3d"){is=rs.perspectiveElem.style,os=rs.container.style;var as=this.pe.v+"px",us="0px 0px 0px",ds="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";is.perspective=as,is.webkitPerspective=as,os.transformOrigin=us,os.mozTransformOrigin=us,os.webkitTransformOrigin=us,is.transform=ds,is.webkitTransform=ds}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var Fn=this._isFirstFrame,Mn,rs;if(this.hierarchy)for(rs=this.hierarchy.length,Mn=0;Mn<rs;Mn+=1)Fn=this.hierarchy[Mn].finalTransform.mProp._mdf||Fn;if(Fn||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(rs=this.hierarchy.length-1,Mn=rs;Mn>=0;Mn-=1){var is=this.hierarchy[Mn].finalTransform.mProp;this.mat.translate(-is.p.v[0],-is.p.v[1],is.p.v[2]),this.mat.rotateX(-is.or.v[0]).rotateY(-is.or.v[1]).rotateZ(is.or.v[2]),this.mat.rotateX(-is.rx.v).rotateY(-is.ry.v).rotateZ(is.rz.v),this.mat.scale(1/is.s.v[0],1/is.s.v[1],1/is.s.v[2]),this.mat.translate(is.a.v[0],is.a.v[1],is.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var os;this.p?os=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:os=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var as=Math.sqrt(Math.pow(os[0],2)+Math.pow(os[1],2)+Math.pow(os[2],2)),us=[os[0]/as,os[1]/as,os[2]/as],ds=Math.sqrt(us[2]*us[2]+us[0]*us[0]),hs=Math.atan2(us[1],ds),ps=Math.atan2(us[0],-us[2]);this.mat.rotateY(ps).rotateX(-hs)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var io=!this._prevMat.equals(this.mat);if((io||this.pe._mdf)&&this.comp.threeDElements){rs=this.comp.threeDElements.length;var fo,mo,Ao;for(Mn=0;Mn<rs;Mn+=1)if(fo=this.comp.threeDElements[Mn],fo.type==="3d"){if(io){var $o=this.mat.toCSS();Ao=fo.container.style,Ao.transform=$o,Ao.webkitTransform=$o}this.pe._mdf&&(mo=fo.perspectiveElem.style,mo.perspective=this.pe.v+"px",mo.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(Fn){this.prepareProperties(Fn,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null};function HImageElement(Fn,Mn,rs){this.assetData=Mn.getAssetData(Fn.refId),this.initElement(Fn,Mn,rs)}extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var Fn=this.globalData.getAssetsPath(this.assetData),Mn=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",Fn),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(Mn),Mn.crossOrigin="anonymous",Mn.src=Fn,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)};function HybridRendererBase(Fn,Mn){this.animationItem=Fn,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:Mn&&Mn.className||"",imagePreserveAspectRatio:Mn&&Mn.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(Mn&&Mn.hideOnTransparent===!1),filterSize:{width:Mn&&Mn.filterSize&&Mn.filterSize.width||"400%",height:Mn&&Mn.filterSize&&Mn.filterSize.height||"400%",x:Mn&&Mn.filterSize&&Mn.filterSize.x||"-100%",y:Mn&&Mn.filterSize&&Mn.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var Fn=this.pendingElements.pop();Fn.checkParenting()}},HybridRendererBase.prototype.appendElementInPos=function(Fn,Mn){var rs=Fn.getBaseElement();if(rs){var is=this.layers[Mn];if(!is.ddd||!this.supports3d)if(this.threeDElements)this.addTo3dContainer(rs,Mn);else{for(var os=0,as,us,ds;os<Mn;)this.elements[os]&&this.elements[os]!==!0&&this.elements[os].getBaseElement&&(us=this.elements[os],ds=this.layers[os].ddd?this.getThreeDContainerByPos(os):us.getBaseElement(),as=ds||as),os+=1;as?(!is.ddd||!this.supports3d)&&this.layerElement.insertBefore(rs,as):(!is.ddd||!this.supports3d)&&this.layerElement.appendChild(rs)}else this.addTo3dContainer(rs,Mn)}},HybridRendererBase.prototype.createShape=function(Fn){return this.supports3d?new HShapeElement(Fn,this.globalData,this):new SVGShapeElement(Fn,this.globalData,this)},HybridRendererBase.prototype.createText=function(Fn){return this.supports3d?new HTextElement(Fn,this.globalData,this):new SVGTextLottieElement(Fn,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(Fn){return this.camera=new HCameraElement(Fn,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(Fn){return this.supports3d?new HImageElement(Fn,this.globalData,this):new IImageElement(Fn,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(Fn){return this.supports3d?new HSolidElement(Fn,this.globalData,this):new ISolidElement(Fn,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(Fn){for(var Mn=0,rs=this.threeDElements.length;Mn<rs;){if(this.threeDElements[Mn].startPos<=Fn&&this.threeDElements[Mn].endPos>=Fn)return this.threeDElements[Mn].perspectiveElem;Mn+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(Fn,Mn){var rs=createTag("div"),is,os;styleDiv(rs);var as=createTag("div");if(styleDiv(as),Mn==="3d"){is=rs.style,is.width=this.globalData.compSize.w+"px",is.height=this.globalData.compSize.h+"px";var us="50% 50%";is.webkitTransformOrigin=us,is.mozTransformOrigin=us,is.transformOrigin=us,os=as.style;var ds="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";os.transform=ds,os.webkitTransform=ds}rs.appendChild(as);var hs={container:as,perspectiveElem:rs,startPos:Fn,endPos:Fn,type:Mn};return this.threeDElements.push(hs),hs},HybridRendererBase.prototype.build3dContainers=function(){var Fn,Mn=this.layers.length,rs,is="";for(Fn=0;Fn<Mn;Fn+=1)this.layers[Fn].ddd&&this.layers[Fn].ty!==3?(is!=="3d"&&(is="3d",rs=this.createThreeDContainer(Fn,"3d")),rs.endPos=Math.max(rs.endPos,Fn)):(is!=="2d"&&(is="2d",rs=this.createThreeDContainer(Fn,"2d")),rs.endPos=Math.max(rs.endPos,Fn));for(Mn=this.threeDElements.length,Fn=Mn-1;Fn>=0;Fn-=1)this.resizerElem.appendChild(this.threeDElements[Fn].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(Fn,Mn){for(var rs=0,is=this.threeDElements.length;rs<is;){if(Mn<=this.threeDElements[rs].endPos){for(var os=this.threeDElements[rs].startPos,as;os<Mn;)this.elements[os]&&this.elements[os].getBaseElement&&(as=this.elements[os].getBaseElement()),os+=1;as?this.threeDElements[rs].container.insertBefore(Fn,as):this.threeDElements[rs].container.appendChild(Fn);break}rs+=1}},HybridRendererBase.prototype.configAnimation=function(Fn){var Mn=createTag("div"),rs=this.animationItem.wrapper,is=Mn.style;is.width=Fn.w+"px",is.height=Fn.h+"px",this.resizerElem=Mn,styleDiv(Mn),is.transformStyle="flat",is.mozTransformStyle="flat",is.webkitTransformStyle="flat",this.renderConfig.className&&Mn.setAttribute("class",this.renderConfig.className),rs.appendChild(Mn),is.overflow="hidden";var os=createNS("svg");os.setAttribute("width","1"),os.setAttribute("height","1"),styleDiv(os),this.resizerElem.appendChild(os);var as=createNS("defs");os.appendChild(as),this.data=Fn,this.setupGlobalData(Fn,os),this.globalData.defs=as,this.layers=Fn.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var Fn,Mn=this.layers?this.layers.length:0;for(Fn=0;Fn<Mn;Fn+=1)this.elements[Fn]&&this.elements[Fn].destroy&&this.elements[Fn].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var Fn=this.animationItem.wrapper.offsetWidth,Mn=this.animationItem.wrapper.offsetHeight,rs=Fn/Mn,is=this.globalData.compSize.w/this.globalData.compSize.h,os,as,us,ds;is>rs?(os=Fn/this.globalData.compSize.w,as=Fn/this.globalData.compSize.w,us=0,ds=(Mn-this.globalData.compSize.h*(Fn/this.globalData.compSize.w))/2):(os=Mn/this.globalData.compSize.h,as=Mn/this.globalData.compSize.h,us=(Fn-this.globalData.compSize.w*(Mn/this.globalData.compSize.h))/2,ds=0);var hs=this.resizerElem.style;hs.webkitTransform="matrix3d("+os+",0,0,0,0,"+as+",0,0,0,0,1,0,"+us+","+ds+",0,1)",hs.transform=hs.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var Fn=this.globalData.compSize.w,Mn=this.globalData.compSize.h,rs,is=this.threeDElements.length;for(rs=0;rs<is;rs+=1){var os=this.threeDElements[rs].perspectiveElem.style;os.webkitPerspective=Math.sqrt(Math.pow(Fn,2)+Math.pow(Mn,2))+"px",os.perspective=os.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(Fn){var Mn,rs=Fn.length,is=createTag("div");for(Mn=0;Mn<rs;Mn+=1)if(Fn[Mn].xt){var os=this.createComp(Fn[Mn],is,this.globalData.comp,null);os.initExpressions(),this.globalData.projectInterface.registerComposition(os)}};function HCompElement(Fn,Mn,rs){this.layers=Fn.layers,this.supports3d=!Fn.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(Fn,Mn,rs),this.tm=Fn.tm?PropertyFactory.getProp(this,Fn.tm,0,Mn.frameRate,this):{_placeholder:!0}}extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(Fn,Mn){for(var rs=0,is;rs<Mn;)this.elements[rs]&&this.elements[rs].getBaseElement&&(is=this.elements[rs].getBaseElement()),rs+=1;is?this.layerElement.insertBefore(Fn,is):this.layerElement.appendChild(Fn)},HCompElement.prototype.createComp=function(Fn){return this.supports3d?new HCompElement(Fn,this.globalData,this):new SVGCompElement(Fn,this.globalData,this)};function HybridRenderer(Fn,Mn){this.animationItem=Fn,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:Mn&&Mn.className||"",imagePreserveAspectRatio:Mn&&Mn.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(Mn&&Mn.hideOnTransparent===!1),filterSize:{width:Mn&&Mn.filterSize&&Mn.filterSize.width||"400%",height:Mn&&Mn.filterSize&&Mn.filterSize.height||"400%",x:Mn&&Mn.filterSize&&Mn.filterSize.x||"-100%",y:Mn&&Mn.filterSize&&Mn.filterSize.y||"-100%"},runExpressions:!Mn||Mn.runExpressions===void 0||Mn.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(Fn){return this.supports3d?new HCompElement(Fn,this.globalData,this):new SVGCompElement(Fn,this.globalData,this)};var CompExpressionInterface=function(){return function(Fn){function Mn(rs){for(var is=0,os=Fn.layers.length;is<os;){if(Fn.layers[is].nm===rs||Fn.layers[is].ind===rs)return Fn.elements[is].layerInterface;is+=1}return null}return Object.defineProperty(Mn,"_name",{value:Fn.data.nm}),Mn.layer=Mn,Mn.pixelAspect=1,Mn.height=Fn.data.h||Fn.globalData.compSize.h,Mn.width=Fn.data.w||Fn.globalData.compSize.w,Mn.pixelAspect=1,Mn.frameDuration=1/Fn.globalData.frameRate,Mn.displayStartTime=0,Mn.numLayers=Fn.layers.length,Mn}}();function _typeof$2(Fn){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$2=function(rs){return typeof rs}:_typeof$2=function(rs){return rs&&typeof Symbol=="function"&&rs.constructor===Symbol&&rs!==Symbol.prototype?"symbol":typeof rs},_typeof$2(Fn)}function seedRandom(Fn,Mn){var rs=this,is=256,os=6,as=52,us="random",ds=Mn.pow(is,os),hs=Mn.pow(2,as),ps=hs*2,io=is-1,fo;function mo(Jo,xl,_l){var Tl=[];xl=xl===!0?{entropy:!0}:xl||{};var Sl=Go(Lo(xl.entropy?[Jo,Wo(Fn)]:Jo===null?Yo():Jo,3),Tl),$l=new Ao(Tl),Pl=function(){for(var Ol=$l.g(os),Rl=ds,Vo=0;Ol<hs;)Ol=(Ol+Vo)*is,Rl*=is,Vo=$l.g(1);for(;Ol>=ps;)Ol/=2,Rl/=2,Vo>>>=1;return(Ol+Vo)/Rl};return Pl.int32=function(){return $l.g(4)|0},Pl.quick=function(){return $l.g(4)/4294967296},Pl.double=Pl,Go(Wo($l.S),Fn),(xl.pass||_l||function(Dl,Ol,Rl,Vo){return Vo&&(Vo.S&&$o(Vo,$l),Dl.state=function(){return $o($l,{})}),Rl?(Mn[us]=Dl,Ol):Dl})(Pl,Sl,"global"in xl?xl.global:this==Mn,xl.state)}Mn["seed"+us]=mo;function Ao(Jo){var xl,_l=Jo.length,Tl=this,Sl=0,$l=Tl.i=Tl.j=0,Pl=Tl.S=[];for(_l||(Jo=[_l++]);Sl<is;)Pl[Sl]=Sl++;for(Sl=0;Sl<is;Sl++)Pl[Sl]=Pl[$l=io&$l+Jo[Sl%_l]+(xl=Pl[Sl])],Pl[$l]=xl;Tl.g=function(Dl){for(var Ol,Rl=0,Vo=Tl.i,jo=Tl.j,Ho=Tl.S;Dl--;)Ol=Ho[Vo=io&Vo+1],Rl=Rl*is+Ho[io&(Ho[Vo]=Ho[jo=io&jo+Ol])+(Ho[jo]=Ol)];return Tl.i=Vo,Tl.j=jo,Rl}}function $o(Jo,xl){return xl.i=Jo.i,xl.j=Jo.j,xl.S=Jo.S.slice(),xl}function Lo(Jo,xl){var _l=[],Tl=_typeof$2(Jo),Sl;if(xl&&Tl=="object")for(Sl in Jo)try{_l.push(Lo(Jo[Sl],xl-1))}catch{}return _l.length?_l:Tl=="string"?Jo:Jo+"\0"}function Go(Jo,xl){for(var _l=Jo+"",Tl,Sl=0;Sl<_l.length;)xl[io&Sl]=io&(Tl^=xl[io&Sl]*19)+_l.charCodeAt(Sl++);return Wo(xl)}function Yo(){try{var Jo=new Uint8Array(is);return(rs.crypto||rs.msCrypto).getRandomValues(Jo),Wo(Jo)}catch{var xl=rs.navigator,_l=xl&&xl.plugins;return[+new Date,rs,_l,rs.screen,Wo(Fn)]}}function Wo(Jo){return String.fromCharCode.apply(0,Jo)}Go(Mn.random(),Fn)}function initialize$2(Fn){seedRandom([],Fn)}var propTypes={SHAPE:"shape"};function _typeof$1(Fn){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$1=function(rs){return typeof rs}:_typeof$1=function(rs){return rs&&typeof Symbol=="function"&&rs.constructor===Symbol&&rs!==Symbol.prototype?"symbol":typeof rs},_typeof$1(Fn)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};initialize$2(BMMath);function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(Fn){return Fn.constructor===Array||Fn.constructor===Float32Array}function isNumerable(Fn,Mn){return Fn==="number"||Mn instanceof Number||Fn==="boolean"||Fn==="string"}function $bm_neg(Fn){var Mn=_typeof$1(Fn);if(Mn==="number"||Fn instanceof Number||Mn==="boolean")return-Fn;if($bm_isInstanceOfArray(Fn)){var rs,is=Fn.length,os=[];for(rs=0;rs<is;rs+=1)os[rs]=-Fn[rs];return os}return Fn.propType?Fn.v:-Fn}var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(Fn,Mn){var rs=_typeof$1(Fn),is=_typeof$1(Mn);if(isNumerable(rs,Fn)&&isNumerable(is,Mn)||rs==="string"||is==="string")return Fn+Mn;if($bm_isInstanceOfArray(Fn)&&isNumerable(is,Mn))return Fn=Fn.slice(0),Fn[0]+=Mn,Fn;if(isNumerable(rs,Fn)&&$bm_isInstanceOfArray(Mn))return Mn=Mn.slice(0),Mn[0]=Fn+Mn[0],Mn;if($bm_isInstanceOfArray(Fn)&&$bm_isInstanceOfArray(Mn)){for(var os=0,as=Fn.length,us=Mn.length,ds=[];os<as||os<us;)(typeof Fn[os]=="number"||Fn[os]instanceof Number)&&(typeof Mn[os]=="number"||Mn[os]instanceof Number)?ds[os]=Fn[os]+Mn[os]:ds[os]=Mn[os]===void 0?Fn[os]:Fn[os]||Mn[os],os+=1;return ds}return 0}var add=sum;function sub(Fn,Mn){var rs=_typeof$1(Fn),is=_typeof$1(Mn);if(isNumerable(rs,Fn)&&isNumerable(is,Mn))return rs==="string"&&(Fn=parseInt(Fn,10)),is==="string"&&(Mn=parseInt(Mn,10)),Fn-Mn;if($bm_isInstanceOfArray(Fn)&&isNumerable(is,Mn))return Fn=Fn.slice(0),Fn[0]-=Mn,Fn;if(isNumerable(rs,Fn)&&$bm_isInstanceOfArray(Mn))return Mn=Mn.slice(0),Mn[0]=Fn-Mn[0],Mn;if($bm_isInstanceOfArray(Fn)&&$bm_isInstanceOfArray(Mn)){for(var os=0,as=Fn.length,us=Mn.length,ds=[];os<as||os<us;)(typeof Fn[os]=="number"||Fn[os]instanceof Number)&&(typeof Mn[os]=="number"||Mn[os]instanceof Number)?ds[os]=Fn[os]-Mn[os]:ds[os]=Mn[os]===void 0?Fn[os]:Fn[os]||Mn[os],os+=1;return ds}return 0}function mul(Fn,Mn){var rs=_typeof$1(Fn),is=_typeof$1(Mn),os;if(isNumerable(rs,Fn)&&isNumerable(is,Mn))return Fn*Mn;var as,us;if($bm_isInstanceOfArray(Fn)&&isNumerable(is,Mn)){for(us=Fn.length,os=createTypedArray("float32",us),as=0;as<us;as+=1)os[as]=Fn[as]*Mn;return os}if(isNumerable(rs,Fn)&&$bm_isInstanceOfArray(Mn)){for(us=Mn.length,os=createTypedArray("float32",us),as=0;as<us;as+=1)os[as]=Fn*Mn[as];return os}return 0}function div(Fn,Mn){var rs=_typeof$1(Fn),is=_typeof$1(Mn),os;if(isNumerable(rs,Fn)&&isNumerable(is,Mn))return Fn/Mn;var as,us;if($bm_isInstanceOfArray(Fn)&&isNumerable(is,Mn)){for(us=Fn.length,os=createTypedArray("float32",us),as=0;as<us;as+=1)os[as]=Fn[as]/Mn;return os}if(isNumerable(rs,Fn)&&$bm_isInstanceOfArray(Mn)){for(us=Mn.length,os=createTypedArray("float32",us),as=0;as<us;as+=1)os[as]=Fn/Mn[as];return os}return 0}function mod(Fn,Mn){return typeof Fn=="string"&&(Fn=parseInt(Fn,10)),typeof Mn=="string"&&(Mn=parseInt(Mn,10)),Fn%Mn}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(Fn,Mn,rs){if(Mn>rs){var is=rs;rs=Mn,Mn=is}return Math.min(Math.max(Fn,Mn),rs)}function radiansToDegrees(Fn){return Fn/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(Fn){return Fn*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(Fn,Mn){if(typeof Fn=="number"||Fn instanceof Number)return Mn=Mn||0,Math.abs(Fn-Mn);Mn||(Mn=helperLengthArray);var rs,is=Math.min(Fn.length,Mn.length),os=0;for(rs=0;rs<is;rs+=1)os+=Math.pow(Mn[rs]-Fn[rs],2);return Math.sqrt(os)}function normalize(Fn){return div(Fn,length(Fn))}function rgbToHsl(Fn){var Mn=Fn[0],rs=Fn[1],is=Fn[2],os=Math.max(Mn,rs,is),as=Math.min(Mn,rs,is),us,ds,hs=(os+as)/2;if(os===as)us=0,ds=0;else{var ps=os-as;switch(ds=hs>.5?ps/(2-os-as):ps/(os+as),os){case Mn:us=(rs-is)/ps+(rs<is?6:0);break;case rs:us=(is-Mn)/ps+2;break;case is:us=(Mn-rs)/ps+4;break}us/=6}return[us,ds,hs,Fn[3]]}function hue2rgb(Fn,Mn,rs){return rs<0&&(rs+=1),rs>1&&(rs-=1),rs<1/6?Fn+(Mn-Fn)*6*rs:rs<1/2?Mn:rs<2/3?Fn+(Mn-Fn)*(2/3-rs)*6:Fn}function hslToRgb(Fn){var Mn=Fn[0],rs=Fn[1],is=Fn[2],os,as,us;if(rs===0)os=is,us=is,as=is;else{var ds=is<.5?is*(1+rs):is+rs-is*rs,hs=2*is-ds;os=hue2rgb(hs,ds,Mn+1/3),as=hue2rgb(hs,ds,Mn),us=hue2rgb(hs,ds,Mn-1/3)}return[os,as,us,Fn[3]]}function linear(Fn,Mn,rs,is,os){if((is===void 0||os===void 0)&&(is=Mn,os=rs,Mn=0,rs=1),rs<Mn){var as=rs;rs=Mn,Mn=as}if(Fn<=Mn)return is;if(Fn>=rs)return os;var us=rs===Mn?0:(Fn-Mn)/(rs-Mn);if(!is.length)return is+(os-is)*us;var ds,hs=is.length,ps=createTypedArray("float32",hs);for(ds=0;ds<hs;ds+=1)ps[ds]=is[ds]+(os[ds]-is[ds])*us;return ps}function random(Fn,Mn){if(Mn===void 0&&(Fn===void 0?(Fn=0,Mn=1):(Mn=Fn,Fn=void 0)),Mn.length){var rs,is=Mn.length;Fn||(Fn=createTypedArray("float32",is));var os=createTypedArray("float32",is),as=BMMath.random();for(rs=0;rs<is;rs+=1)os[rs]=Fn[rs]+as*(Mn[rs]-Fn[rs]);return os}Fn===void 0&&(Fn=0);var us=BMMath.random();return Fn+us*(Mn-Fn)}function createPath(Fn,Mn,rs,is){var os,as=Fn.length,us=shapePool.newElement();us.setPathData(!!is,as);var ds=[0,0],hs,ps;for(os=0;os<as;os+=1)hs=Mn&&Mn[os]?Mn[os]:ds,ps=rs&&rs[os]?rs[os]:ds,us.setTripleAt(Fn[os][0],Fn[os][1],ps[0]+Fn[os][0],ps[1]+Fn[os][1],hs[0]+Fn[os][0],hs[1]+Fn[os][1],os,!0);return us}function initiateExpression(elem,data,property){function noOp(Fn){return Fn}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=val.indexOf("random")!==-1,elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||this.data.hd!==!0,wiggle=(function Fn(Mn,rs){var is,os,as=this.pv.length?this.pv.length:1,us=createTypedArray("float32",as);Mn=5;var ds=Math.floor(time*Mn);for(is=0,os=0;is<ds;){for(os=0;os<as;os+=1)us[os]+=-rs+rs*2*BMMath.random();is+=1}var hs=time*Mn,ps=hs-Math.floor(hs),io=createTypedArray("float32",as);if(as>1){for(os=0;os<as;os+=1)io[os]=this.pv[os]+us[os]+(-rs+rs*2*BMMath.random())*ps;return io}return this.pv+us[0]+(-rs+rs*2*BMMath.random())*ps}).bind(this);thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty));function loopInDuration(Fn,Mn){return loopIn(Fn,Mn,!0)}function loopOutDuration(Fn,Mn){return loopOut(Fn,Mn,!0)}this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);function lookAt(Fn,Mn){var rs=[Mn[0]-Fn[0],Mn[1]-Fn[1],Mn[2]-Fn[2]],is=Math.atan2(rs[0],Math.sqrt(rs[1]*rs[1]+rs[2]*rs[2]))/degToRads,os=-Math.atan2(rs[1],rs[2])/degToRads;return[os,is,0]}function easeOut(Fn,Mn,rs,is,os){return applyEase(easeOutBez,Fn,Mn,rs,is,os)}function easeIn(Fn,Mn,rs,is,os){return applyEase(easeInBez,Fn,Mn,rs,is,os)}function ease(Fn,Mn,rs,is,os){return applyEase(easeInOutBez,Fn,Mn,rs,is,os)}function applyEase(Fn,Mn,rs,is,os,as){os===void 0?(os=rs,as=is):Mn=(Mn-rs)/(is-rs),Mn>1?Mn=1:Mn<0&&(Mn=0);var us=Fn(Mn);if($bm_isInstanceOfArray(os)){var ds,hs=os.length,ps=createTypedArray("float32",hs);for(ds=0;ds<hs;ds+=1)ps[ds]=(as[ds]-os[ds])*us+os[ds];return ps}return(as-os)*us+os}function nearestKey(Fn){var Mn,rs=data.k.length,is,os;if(!data.k.length||typeof data.k[0]=="number")is=0,os=0;else if(is=-1,Fn*=elem.comp.globalData.frameRate,Fn<data.k[0].t)is=1,os=data.k[0].t;else{for(Mn=0;Mn<rs-1;Mn+=1)if(Fn===data.k[Mn].t){is=Mn+1,os=data.k[Mn].t;break}else if(Fn>data.k[Mn].t&&Fn<data.k[Mn+1].t){Fn-data.k[Mn].t>data.k[Mn+1].t-Fn?(is=Mn+2,os=data.k[Mn+1].t):(is=Mn+1,os=data.k[Mn].t);break}is===-1&&(is=Mn+1,os=data.k[Mn].t)}var as={};return as.index=is,as.time=os/elem.comp.globalData.frameRate,as}function key(Fn){var Mn,rs,is;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+Fn);Fn-=1,Mn={time:data.k[Fn].t/elem.comp.globalData.frameRate,value:[]};var os=Object.prototype.hasOwnProperty.call(data.k[Fn],"s")?data.k[Fn].s:data.k[Fn-1].e;for(is=os.length,rs=0;rs<is;rs+=1)Mn[rs]=os[rs],Mn.value[rs]=os[rs];return Mn}function framesToTime(Fn,Mn){return Mn||(Mn=elem.comp.globalData.frameRate),Fn/Mn}function timeToFrames(Fn,Mn){return!Fn&&Fn!==0&&(Fn=time),Mn||(Mn=elem.comp.globalData.frameRate),Fn*Mn}function seedRandom(Fn){BMMath.seedrandom(randSeed+Fn)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(Fn,Mn){return typeof value=="string"?Mn===void 0?value.substring(Fn):value.substring(Fn,Mn):""}function substr(Fn,Mn){return typeof value=="string"?Mn===void 0?value.substr(Fn):value.substr(Fn,Mn):""}function posterizeTime(Fn){time=Fn===0?0:Math.floor(time*Fn)/Fn,value=valueAtTime(time)}var time,velocity,value,text,textIndex,textTotal,selectorValue,index=elem.data.ind,hasParent=!!(elem.hierarchy&&elem.hierarchy.length),parent,randSeed=Math.floor(Math.random()*1e6),globalData=elem.globalData;function executeExpression(Fn){return value=Fn,this.frameExpressionId===elem.globalData.frameId&&this.propType!=="textSelector"?value:(this.propType==="textSelector"&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),elemType===4&&!content&&(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),hasParent=!!(elem.hierarchy&&elem.hierarchy.length),hasParent&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt,scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath,_lottieGlobal],ob.resetFrame=resetFrame,ob}(),Expressions=function(){var Fn={};Fn.initExpressions=Mn,Fn.resetFrame=ExpressionManager.resetFrame;function Mn(rs){var is=0,os=[];function as(){is+=1}function us(){is-=1,is===0&&hs()}function ds(ps){os.indexOf(ps)===-1&&os.push(ps)}function hs(){var ps,io=os.length;for(ps=0;ps<io;ps+=1)os[ps].release();os.length=0}rs.renderer.compInterface=CompExpressionInterface(rs.renderer),rs.renderer.globalData.projectInterface.registerComposition(rs.renderer),rs.renderer.globalData.pushExpression=as,rs.renderer.globalData.popExpression=us,rs.renderer.globalData.registerExpressionProperty=ds}return Fn}(),MaskManagerInterface=function(){function Fn(rs,is){this._mask=rs,this._data=is}Object.defineProperty(Fn.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(Fn.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),this._mask.op.v*100}});var Mn=function(is){var os=createSizedArray(is.viewData.length),as,us=is.viewData.length;for(as=0;as<us;as+=1)os[as]=new Fn(is.viewData[as],is.masksProperties[as]);var ds=function(ps){for(as=0;as<us;){if(is.masksProperties[as].nm===ps)return os[as];as+=1}return null};return ds};return Mn}(),ExpressionPropertyInterface=function(){var Fn={pv:0,v:0,mult:1},Mn={pv:[0,0,0],v:[0,0,0],mult:1};function rs(us,ds,hs){Object.defineProperty(us,"velocity",{get:function(){return ds.getVelocityAtTime(ds.comp.currentFrame)}}),us.numKeys=ds.keyframes?ds.keyframes.length:0,us.key=function(ps){if(!us.numKeys)return 0;var io="";"s"in ds.keyframes[ps-1]?io=ds.keyframes[ps-1].s:"e"in ds.keyframes[ps-2]?io=ds.keyframes[ps-2].e:io=ds.keyframes[ps-2].s;var fo=hs==="unidimensional"?new Number(io):Object.assign({},io);return fo.time=ds.keyframes[ps-1].t/ds.elem.comp.globalData.frameRate,fo.value=hs==="unidimensional"?io[0]:io,fo},us.valueAtTime=ds.getValueAtTime,us.speedAtTime=ds.getSpeedAtTime,us.velocityAtTime=ds.getVelocityAtTime,us.propertyGroup=ds.propertyGroup}function is(us){(!us||!("pv"in us))&&(us=Fn);var ds=1/us.mult,hs=us.pv*ds,ps=new Number(hs);return ps.value=hs,rs(ps,us,"unidimensional"),function(){return us.k&&us.getValue(),hs=us.v*ds,ps.value!==hs&&(ps=new Number(hs),ps.value=hs,rs(ps,us,"unidimensional")),ps}}function os(us){(!us||!("pv"in us))&&(us=Mn);var ds=1/us.mult,hs=us.data&&us.data.l||us.pv.length,ps=createTypedArray("float32",hs),io=createTypedArray("float32",hs);return ps.value=io,rs(ps,us,"multidimensional"),function(){us.k&&us.getValue();for(var fo=0;fo<hs;fo+=1)io[fo]=us.v[fo]*ds,ps[fo]=io[fo];return ps}}function as(){return Fn}return function(us){return us?us.propType==="unidimensional"?is(us):os(us):as}}(),TransformExpressionInterface=function(){return function(Fn){function Mn(us){switch(us){case"scale":case"Scale":case"ADBE Scale":case 6:return Mn.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return Mn.rotation;case"ADBE Rotate X":return Mn.xRotation;case"ADBE Rotate Y":return Mn.yRotation;case"position":case"Position":case"ADBE Position":case 2:return Mn.position;case"ADBE Position_0":return Mn.xPosition;case"ADBE Position_1":return Mn.yPosition;case"ADBE Position_2":return Mn.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return Mn.anchorPoint;case"opacity":case"Opacity":case 11:return Mn.opacity;default:return null}}Object.defineProperty(Mn,"rotation",{get:ExpressionPropertyInterface(Fn.r||Fn.rz)}),Object.defineProperty(Mn,"zRotation",{get:ExpressionPropertyInterface(Fn.rz||Fn.r)}),Object.defineProperty(Mn,"xRotation",{get:ExpressionPropertyInterface(Fn.rx)}),Object.defineProperty(Mn,"yRotation",{get:ExpressionPropertyInterface(Fn.ry)}),Object.defineProperty(Mn,"scale",{get:ExpressionPropertyInterface(Fn.s)});var rs,is,os,as;return Fn.p?as=ExpressionPropertyInterface(Fn.p):(rs=ExpressionPropertyInterface(Fn.px),is=ExpressionPropertyInterface(Fn.py),Fn.pz&&(os=ExpressionPropertyInterface(Fn.pz))),Object.defineProperty(Mn,"position",{get:function(){return Fn.p?as():[rs(),is(),os?os():0]}}),Object.defineProperty(Mn,"xPosition",{get:ExpressionPropertyInterface(Fn.px)}),Object.defineProperty(Mn,"yPosition",{get:ExpressionPropertyInterface(Fn.py)}),Object.defineProperty(Mn,"zPosition",{get:ExpressionPropertyInterface(Fn.pz)}),Object.defineProperty(Mn,"anchorPoint",{get:ExpressionPropertyInterface(Fn.a)}),Object.defineProperty(Mn,"opacity",{get:ExpressionPropertyInterface(Fn.o)}),Object.defineProperty(Mn,"skew",{get:ExpressionPropertyInterface(Fn.sk)}),Object.defineProperty(Mn,"skewAxis",{get:ExpressionPropertyInterface(Fn.sa)}),Object.defineProperty(Mn,"orientation",{get:ExpressionPropertyInterface(Fn.or)}),Mn}}(),LayerExpressionInterface=function(){function Fn(ps){var io=new Matrix;if(ps!==void 0){var fo=this._elem.finalTransform.mProp.getValueAtTime(ps);fo.clone(io)}else{var mo=this._elem.finalTransform.mProp;mo.applyToMatrix(io)}return io}function Mn(ps,io){var fo=this.getMatrix(io);return fo.props[12]=0,fo.props[13]=0,fo.props[14]=0,this.applyPoint(fo,ps)}function rs(ps,io){var fo=this.getMatrix(io);return this.applyPoint(fo,ps)}function is(ps,io){var fo=this.getMatrix(io);return fo.props[12]=0,fo.props[13]=0,fo.props[14]=0,this.invertPoint(fo,ps)}function os(ps,io){var fo=this.getMatrix(io);return this.invertPoint(fo,ps)}function as(ps,io){if(this._elem.hierarchy&&this._elem.hierarchy.length){var fo,mo=this._elem.hierarchy.length;for(fo=0;fo<mo;fo+=1)this._elem.hierarchy[fo].finalTransform.mProp.applyToMatrix(ps)}return ps.applyToPointArray(io[0],io[1],io[2]||0)}function us(ps,io){if(this._elem.hierarchy&&this._elem.hierarchy.length){var fo,mo=this._elem.hierarchy.length;for(fo=0;fo<mo;fo+=1)this._elem.hierarchy[fo].finalTransform.mProp.applyToMatrix(ps)}return ps.inversePoint(io)}function ds(ps){var io=new Matrix;if(io.reset(),this._elem.finalTransform.mProp.applyToMatrix(io),this._elem.hierarchy&&this._elem.hierarchy.length){var fo,mo=this._elem.hierarchy.length;for(fo=0;fo<mo;fo+=1)this._elem.hierarchy[fo].finalTransform.mProp.applyToMatrix(io);return io.inversePoint(ps)}return io.inversePoint(ps)}function hs(){return[1,1,1,1]}return function(ps){var io;function fo(Lo){Ao.mask=new MaskManagerInterface(Lo,ps)}function mo(Lo){Ao.effect=Lo}function Ao(Lo){switch(Lo){case"ADBE Root Vectors Group":case"Contents":case 2:return Ao.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return io;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return Ao.effect;case"ADBE Text Properties":return Ao.textInterface;default:return null}}Ao.getMatrix=Fn,Ao.invertPoint=us,Ao.applyPoint=as,Ao.toWorld=rs,Ao.toWorldVec=Mn,Ao.fromWorld=os,Ao.fromWorldVec=is,Ao.toComp=rs,Ao.fromComp=ds,Ao.sampleImage=hs,Ao.sourceRectAtTime=ps.sourceRectAtTime.bind(ps),Ao._elem=ps,io=TransformExpressionInterface(ps.finalTransform.mProp);var $o=getDescriptor(io,"anchorPoint");return Object.defineProperties(Ao,{hasParent:{get:function(){return ps.hierarchy.length}},parent:{get:function(){return ps.hierarchy[0].layerInterface}},rotation:getDescriptor(io,"rotation"),scale:getDescriptor(io,"scale"),position:getDescriptor(io,"position"),opacity:getDescriptor(io,"opacity"),anchorPoint:$o,anchor_point:$o,transform:{get:function(){return io}},active:{get:function(){return ps.isInRange}}}),Ao.startTime=ps.data.st,Ao.index=ps.data.ind,Ao.source=ps.data.refId,Ao.height=ps.data.ty===0?ps.data.h:100,Ao.width=ps.data.ty===0?ps.data.w:100,Ao.inPoint=ps.data.ip/ps.comp.globalData.frameRate,Ao.outPoint=ps.data.op/ps.comp.globalData.frameRate,Ao._name=ps.data.nm,Ao.registerMaskInterface=fo,Ao.registerEffectsInterface=mo,Ao}}(),propertyGroupFactory=function(){return function(Fn,Mn){return function(rs){return rs=rs===void 0?1:rs,rs<=0?Fn:Mn(rs-1)}}}(),PropertyInterface=function(){return function(Fn,Mn){var rs={_name:Fn};function is(os){return os=os===void 0?1:os,os<=0?rs:Mn(os-1)}return is}}(),EffectsExpressionInterface=function(){var Fn={createEffectsInterface:Mn};function Mn(os,as){if(os.effectsManager){var us=[],ds=os.data.ef,hs,ps=os.effectsManager.effectElements.length;for(hs=0;hs<ps;hs+=1)us.push(rs(ds[hs],os.effectsManager.effectElements[hs],as,os));var io=os.data.ef||[],fo=function(Ao){for(hs=0,ps=io.length;hs<ps;){if(Ao===io[hs].nm||Ao===io[hs].mn||Ao===io[hs].ix)return us[hs];hs+=1}return null};return Object.defineProperty(fo,"numProperties",{get:function(){return io.length}}),fo}return null}function rs(os,as,us,ds){function hs(Ao){for(var $o=os.ef,Lo=0,Go=$o.length;Lo<Go;){if(Ao===$o[Lo].nm||Ao===$o[Lo].mn||Ao===$o[Lo].ix)return $o[Lo].ty===5?io[Lo]:io[Lo]();Lo+=1}throw new Error}var ps=propertyGroupFactory(hs,us),io=[],fo,mo=os.ef.length;for(fo=0;fo<mo;fo+=1)os.ef[fo].ty===5?io.push(rs(os.ef[fo],as.effectElements[fo],as.effectElements[fo].propertyGroup,ds)):io.push(is(as.effectElements[fo],os.ef[fo].ty,ds,ps));return os.mn==="ADBE Color Control"&&Object.defineProperty(hs,"color",{get:function(){return io[0]()}}),Object.defineProperties(hs,{numProperties:{get:function(){return os.np}},_name:{value:os.nm},propertyGroup:{value:ps}}),hs.enabled=os.en!==0,hs.active=hs.enabled,hs}function is(os,as,us,ds){var hs=ExpressionPropertyInterface(os.p);function ps(){return as===10?us.comp.compInterface(os.p.v):hs()}return os.p.setGroupProperty&&os.p.setGroupProperty(PropertyInterface("",ds)),ps}return Fn}(),ShapePathInterface=function(){return function(Mn,rs,is){var os=rs.sh;function as(ds){return ds==="Shape"||ds==="shape"||ds==="Path"||ds==="path"||ds==="ADBE Vector Shape"||ds===2?as.path:null}var us=propertyGroupFactory(as,is);return os.setGroupProperty(PropertyInterface("Path",us)),Object.defineProperties(as,{path:{get:function(){return os.k&&os.getValue(),os}},shape:{get:function(){return os.k&&os.getValue(),os}},_name:{value:Mn.nm},ix:{value:Mn.ix},propertyIndex:{value:Mn.ix},mn:{value:Mn.mn},propertyGroup:{value:is}}),as}}(),ShapeExpressionInterface=function(){function Fn($o,Lo,Go){var Yo=[],Wo,Jo=$o?$o.length:0;for(Wo=0;Wo<Jo;Wo+=1)$o[Wo].ty==="gr"?Yo.push(rs($o[Wo],Lo[Wo],Go)):$o[Wo].ty==="fl"?Yo.push(is($o[Wo],Lo[Wo],Go)):$o[Wo].ty==="st"?Yo.push(us($o[Wo],Lo[Wo],Go)):$o[Wo].ty==="tm"?Yo.push(ds($o[Wo],Lo[Wo],Go)):$o[Wo].ty==="tr"||($o[Wo].ty==="el"?Yo.push(ps($o[Wo],Lo[Wo],Go)):$o[Wo].ty==="sr"?Yo.push(io($o[Wo],Lo[Wo],Go)):$o[Wo].ty==="sh"?Yo.push(ShapePathInterface($o[Wo],Lo[Wo],Go)):$o[Wo].ty==="rc"?Yo.push(fo($o[Wo],Lo[Wo],Go)):$o[Wo].ty==="rd"?Yo.push(mo($o[Wo],Lo[Wo],Go)):$o[Wo].ty==="rp"?Yo.push(Ao($o[Wo],Lo[Wo],Go)):$o[Wo].ty==="gf"?Yo.push(os($o[Wo],Lo[Wo],Go)):Yo.push(as($o[Wo],Lo[Wo])));return Yo}function Mn($o,Lo,Go){var Yo,Wo=function(_l){for(var Tl=0,Sl=Yo.length;Tl<Sl;){if(Yo[Tl]._name===_l||Yo[Tl].mn===_l||Yo[Tl].propertyIndex===_l||Yo[Tl].ix===_l||Yo[Tl].ind===_l)return Yo[Tl];Tl+=1}return typeof _l=="number"?Yo[_l-1]:null};Wo.propertyGroup=propertyGroupFactory(Wo,Go),Yo=Fn($o.it,Lo.it,Wo.propertyGroup),Wo.numProperties=Yo.length;var Jo=hs($o.it[$o.it.length-1],Lo.it[Lo.it.length-1],Wo.propertyGroup);return Wo.transform=Jo,Wo.propertyIndex=$o.cix,Wo._name=$o.nm,Wo}function rs($o,Lo,Go){var Yo=function(_l){switch(_l){case"ADBE Vectors Group":case"Contents":case 2:return Yo.content;default:return Yo.transform}};Yo.propertyGroup=propertyGroupFactory(Yo,Go);var Wo=Mn($o,Lo,Yo.propertyGroup),Jo=hs($o.it[$o.it.length-1],Lo.it[Lo.it.length-1],Yo.propertyGroup);return Yo.content=Wo,Yo.transform=Jo,Object.defineProperty(Yo,"_name",{get:function(){return $o.nm}}),Yo.numProperties=$o.np,Yo.propertyIndex=$o.ix,Yo.nm=$o.nm,Yo.mn=$o.mn,Yo}function is($o,Lo,Go){function Yo(Wo){return Wo==="Color"||Wo==="color"?Yo.color:Wo==="Opacity"||Wo==="opacity"?Yo.opacity:null}return Object.defineProperties(Yo,{color:{get:ExpressionPropertyInterface(Lo.c)},opacity:{get:ExpressionPropertyInterface(Lo.o)},_name:{value:$o.nm},mn:{value:$o.mn}}),Lo.c.setGroupProperty(PropertyInterface("Color",Go)),Lo.o.setGroupProperty(PropertyInterface("Opacity",Go)),Yo}function os($o,Lo,Go){function Yo(Wo){return Wo==="Start Point"||Wo==="start point"?Yo.startPoint:Wo==="End Point"||Wo==="end point"?Yo.endPoint:Wo==="Opacity"||Wo==="opacity"?Yo.opacity:null}return Object.defineProperties(Yo,{startPoint:{get:ExpressionPropertyInterface(Lo.s)},endPoint:{get:ExpressionPropertyInterface(Lo.e)},opacity:{get:ExpressionPropertyInterface(Lo.o)},type:{get:function(){return"a"}},_name:{value:$o.nm},mn:{value:$o.mn}}),Lo.s.setGroupProperty(PropertyInterface("Start Point",Go)),Lo.e.setGroupProperty(PropertyInterface("End Point",Go)),Lo.o.setGroupProperty(PropertyInterface("Opacity",Go)),Yo}function as(){function $o(){return null}return $o}function us($o,Lo,Go){var Yo=propertyGroupFactory(Sl,Go),Wo=propertyGroupFactory(Tl,Yo);function Jo($l){Object.defineProperty(Tl,$o.d[$l].nm,{get:ExpressionPropertyInterface(Lo.d.dataProps[$l].p)})}var xl,_l=$o.d?$o.d.length:0,Tl={};for(xl=0;xl<_l;xl+=1)Jo(xl),Lo.d.dataProps[xl].p.setGroupProperty(Wo);function Sl($l){return $l==="Color"||$l==="color"?Sl.color:$l==="Opacity"||$l==="opacity"?Sl.opacity:$l==="Stroke Width"||$l==="stroke width"?Sl.strokeWidth:null}return Object.defineProperties(Sl,{color:{get:ExpressionPropertyInterface(Lo.c)},opacity:{get:ExpressionPropertyInterface(Lo.o)},strokeWidth:{get:ExpressionPropertyInterface(Lo.w)},dash:{get:function(){return Tl}},_name:{value:$o.nm},mn:{value:$o.mn}}),Lo.c.setGroupProperty(PropertyInterface("Color",Yo)),Lo.o.setGroupProperty(PropertyInterface("Opacity",Yo)),Lo.w.setGroupProperty(PropertyInterface("Stroke Width",Yo)),Sl}function ds($o,Lo,Go){function Yo(Jo){return Jo===$o.e.ix||Jo==="End"||Jo==="end"?Yo.end:Jo===$o.s.ix?Yo.start:Jo===$o.o.ix?Yo.offset:null}var Wo=propertyGroupFactory(Yo,Go);return Yo.propertyIndex=$o.ix,Lo.s.setGroupProperty(PropertyInterface("Start",Wo)),Lo.e.setGroupProperty(PropertyInterface("End",Wo)),Lo.o.setGroupProperty(PropertyInterface("Offset",Wo)),Yo.propertyIndex=$o.ix,Yo.propertyGroup=Go,Object.defineProperties(Yo,{start:{get:ExpressionPropertyInterface(Lo.s)},end:{get:ExpressionPropertyInterface(Lo.e)},offset:{get:ExpressionPropertyInterface(Lo.o)},_name:{value:$o.nm}}),Yo.mn=$o.mn,Yo}function hs($o,Lo,Go){function Yo(Jo){return $o.a.ix===Jo||Jo==="Anchor Point"?Yo.anchorPoint:$o.o.ix===Jo||Jo==="Opacity"?Yo.opacity:$o.p.ix===Jo||Jo==="Position"?Yo.position:$o.r.ix===Jo||Jo==="Rotation"||Jo==="ADBE Vector Rotation"?Yo.rotation:$o.s.ix===Jo||Jo==="Scale"?Yo.scale:$o.sk&&$o.sk.ix===Jo||Jo==="Skew"?Yo.skew:$o.sa&&$o.sa.ix===Jo||Jo==="Skew Axis"?Yo.skewAxis:null}var Wo=propertyGroupFactory(Yo,Go);return Lo.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",Wo)),Lo.transform.mProps.p.setGroupProperty(PropertyInterface("Position",Wo)),Lo.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",Wo)),Lo.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",Wo)),Lo.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",Wo)),Lo.transform.mProps.sk&&(Lo.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",Wo)),Lo.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",Wo))),Lo.transform.op.setGroupProperty(PropertyInterface("Opacity",Wo)),Object.defineProperties(Yo,{opacity:{get:ExpressionPropertyInterface(Lo.transform.mProps.o)},position:{get:ExpressionPropertyInterface(Lo.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(Lo.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(Lo.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(Lo.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(Lo.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(Lo.transform.mProps.sa)},_name:{value:$o.nm}}),Yo.ty="tr",Yo.mn=$o.mn,Yo.propertyGroup=Go,Yo}function ps($o,Lo,Go){function Yo(xl){return $o.p.ix===xl?Yo.position:$o.s.ix===xl?Yo.size:null}var Wo=propertyGroupFactory(Yo,Go);Yo.propertyIndex=$o.ix;var Jo=Lo.sh.ty==="tm"?Lo.sh.prop:Lo.sh;return Jo.s.setGroupProperty(PropertyInterface("Size",Wo)),Jo.p.setGroupProperty(PropertyInterface("Position",Wo)),Object.defineProperties(Yo,{size:{get:ExpressionPropertyInterface(Jo.s)},position:{get:ExpressionPropertyInterface(Jo.p)},_name:{value:$o.nm}}),Yo.mn=$o.mn,Yo}function io($o,Lo,Go){function Yo(xl){return $o.p.ix===xl?Yo.position:$o.r.ix===xl?Yo.rotation:$o.pt.ix===xl?Yo.points:$o.or.ix===xl||xl==="ADBE Vector Star Outer Radius"?Yo.outerRadius:$o.os.ix===xl?Yo.outerRoundness:$o.ir&&($o.ir.ix===xl||xl==="ADBE Vector Star Inner Radius")?Yo.innerRadius:$o.is&&$o.is.ix===xl?Yo.innerRoundness:null}var Wo=propertyGroupFactory(Yo,Go),Jo=Lo.sh.ty==="tm"?Lo.sh.prop:Lo.sh;return Yo.propertyIndex=$o.ix,Jo.or.setGroupProperty(PropertyInterface("Outer Radius",Wo)),Jo.os.setGroupProperty(PropertyInterface("Outer Roundness",Wo)),Jo.pt.setGroupProperty(PropertyInterface("Points",Wo)),Jo.p.setGroupProperty(PropertyInterface("Position",Wo)),Jo.r.setGroupProperty(PropertyInterface("Rotation",Wo)),$o.ir&&(Jo.ir.setGroupProperty(PropertyInterface("Inner Radius",Wo)),Jo.is.setGroupProperty(PropertyInterface("Inner Roundness",Wo))),Object.defineProperties(Yo,{position:{get:ExpressionPropertyInterface(Jo.p)},rotation:{get:ExpressionPropertyInterface(Jo.r)},points:{get:ExpressionPropertyInterface(Jo.pt)},outerRadius:{get:ExpressionPropertyInterface(Jo.or)},outerRoundness:{get:ExpressionPropertyInterface(Jo.os)},innerRadius:{get:ExpressionPropertyInterface(Jo.ir)},innerRoundness:{get:ExpressionPropertyInterface(Jo.is)},_name:{value:$o.nm}}),Yo.mn=$o.mn,Yo}function fo($o,Lo,Go){function Yo(xl){return $o.p.ix===xl?Yo.position:$o.r.ix===xl?Yo.roundness:$o.s.ix===xl||xl==="Size"||xl==="ADBE Vector Rect Size"?Yo.size:null}var Wo=propertyGroupFactory(Yo,Go),Jo=Lo.sh.ty==="tm"?Lo.sh.prop:Lo.sh;return Yo.propertyIndex=$o.ix,Jo.p.setGroupProperty(PropertyInterface("Position",Wo)),Jo.s.setGroupProperty(PropertyInterface("Size",Wo)),Jo.r.setGroupProperty(PropertyInterface("Rotation",Wo)),Object.defineProperties(Yo,{position:{get:ExpressionPropertyInterface(Jo.p)},roundness:{get:ExpressionPropertyInterface(Jo.r)},size:{get:ExpressionPropertyInterface(Jo.s)},_name:{value:$o.nm}}),Yo.mn=$o.mn,Yo}function mo($o,Lo,Go){function Yo(xl){return $o.r.ix===xl||xl==="Round Corners 1"?Yo.radius:null}var Wo=propertyGroupFactory(Yo,Go),Jo=Lo;return Yo.propertyIndex=$o.ix,Jo.rd.setGroupProperty(PropertyInterface("Radius",Wo)),Object.defineProperties(Yo,{radius:{get:ExpressionPropertyInterface(Jo.rd)},_name:{value:$o.nm}}),Yo.mn=$o.mn,Yo}function Ao($o,Lo,Go){function Yo(xl){return $o.c.ix===xl||xl==="Copies"?Yo.copies:$o.o.ix===xl||xl==="Offset"?Yo.offset:null}var Wo=propertyGroupFactory(Yo,Go),Jo=Lo;return Yo.propertyIndex=$o.ix,Jo.c.setGroupProperty(PropertyInterface("Copies",Wo)),Jo.o.setGroupProperty(PropertyInterface("Offset",Wo)),Object.defineProperties(Yo,{copies:{get:ExpressionPropertyInterface(Jo.c)},offset:{get:ExpressionPropertyInterface(Jo.o)},_name:{value:$o.nm}}),Yo.mn=$o.mn,Yo}return function($o,Lo,Go){var Yo;function Wo(xl){if(typeof xl=="number")return xl=xl===void 0?1:xl,xl===0?Go:Yo[xl-1];for(var _l=0,Tl=Yo.length;_l<Tl;){if(Yo[_l]._name===xl)return Yo[_l];_l+=1}return null}function Jo(){return Go}return Wo.propertyGroup=propertyGroupFactory(Wo,Jo),Yo=Fn($o,Lo,Wo.propertyGroup),Wo.numProperties=Yo.length,Wo._name="Contents",Wo}}(),TextExpressionInterface=function(){return function(Fn){var Mn;function rs(is){switch(is){case"ADBE Text Document":return rs.sourceText;default:return null}}return Object.defineProperty(rs,"sourceText",{get:function(){Fn.textProperty.getValue();var os=Fn.textProperty.currentData.t;return(!Mn||os!==Mn.value)&&(Mn=new String(os),Mn.value=os||new String(os),Object.defineProperty(Mn,"style",{get:function(){return{fillColor:Fn.textProperty.currentData.fc}}})),Mn}}),rs}}();function _typeof(Fn){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(rs){return typeof rs}:_typeof=function(rs){return rs&&typeof Symbol=="function"&&rs.constructor===Symbol&&rs!==Symbol.prototype?"symbol":typeof rs},_typeof(Fn)}var FootageInterface=function(){var Fn=function(is){var os="",as=is.getFootageData();function us(){return os="",as=is.getFootageData(),ds}function ds(hs){if(as[hs])return os=hs,as=as[hs],_typeof(as)==="object"?ds:as;var ps=hs.indexOf(os);if(ps!==-1){var io=parseInt(hs.substr(ps+os.length),10);return as=as[io],_typeof(as)==="object"?ds:as}return""}return us},Mn=function(is){function os(as){return as==="Outline"?os.outlineInterface():null}return os._name="Outline",os.outlineInterface=Fn(is),os};return function(rs){function is(os){return os==="Data"?is.dataInterface:null}return is._name="Data",is.dataInterface=Mn(rs),is}}(),interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(Fn){return interfaces[Fn]||null}var expressionHelpers=function(){function Fn(us,ds,hs){ds.x&&(hs.k=!0,hs.x=!0,hs.initiateExpression=ExpressionManager.initiateExpression,hs.effectsSequence.push(hs.initiateExpression(us,ds,hs).bind(hs)))}function Mn(us){return us*=this.elem.globalData.frameRate,us-=this.offsetTime,us!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<us?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(us,this._cachingAtTime),this._cachingAtTime.lastFrame=us),this._cachingAtTime.value}function rs(us){var ds=-.01,hs=this.getValueAtTime(us),ps=this.getValueAtTime(us+ds),io=0;if(hs.length){var fo;for(fo=0;fo<hs.length;fo+=1)io+=Math.pow(ps[fo]-hs[fo],2);io=Math.sqrt(io)*100}else io=0;return io}function is(us){if(this.vel!==void 0)return this.vel;var ds=-.001,hs=this.getValueAtTime(us),ps=this.getValueAtTime(us+ds),io;if(hs.length){io=createTypedArray("float32",hs.length);var fo;for(fo=0;fo<hs.length;fo+=1)io[fo]=(ps[fo]-hs[fo])/ds}else io=(ps-hs)/ds;return io}function os(){return this.pv}function as(us){this.propertyGroup=us}return{searchExpressions:Fn,getSpeedAtTime:rs,getVelocityAtTime:is,getValueAtTime:Mn,getStaticValueAtTime:os,setGroupProperty:as}}();function addPropertyDecorator(){function Fn(mo,Ao,$o){if(!this.k||!this.keyframes)return this.pv;mo=mo?mo.toLowerCase():"";var Lo=this.comp.renderedFrame,Go=this.keyframes,Yo=Go[Go.length-1].t;if(Lo<=Yo)return this.pv;var Wo,Jo;$o?(Ao?Wo=Math.abs(Yo-this.elem.comp.globalData.frameRate*Ao):Wo=Math.max(0,Yo-this.elem.data.ip),Jo=Yo-Wo):((!Ao||Ao>Go.length-1)&&(Ao=Go.length-1),Jo=Go[Go.length-1-Ao].t,Wo=Yo-Jo);var xl,_l,Tl;if(mo==="pingpong"){var Sl=Math.floor((Lo-Jo)/Wo);if(Sl%2!==0)return this.getValueAtTime((Wo-(Lo-Jo)%Wo+Jo)/this.comp.globalData.frameRate,0)}else if(mo==="offset"){var $l=this.getValueAtTime(Jo/this.comp.globalData.frameRate,0),Pl=this.getValueAtTime(Yo/this.comp.globalData.frameRate,0),Dl=this.getValueAtTime(((Lo-Jo)%Wo+Jo)/this.comp.globalData.frameRate,0),Ol=Math.floor((Lo-Jo)/Wo);if(this.pv.length){for(Tl=new Array($l.length),_l=Tl.length,xl=0;xl<_l;xl+=1)Tl[xl]=(Pl[xl]-$l[xl])*Ol+Dl[xl];return Tl}return(Pl-$l)*Ol+Dl}else if(mo==="continue"){var Rl=this.getValueAtTime(Yo/this.comp.globalData.frameRate,0),Vo=this.getValueAtTime((Yo-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(Tl=new Array(Rl.length),_l=Tl.length,xl=0;xl<_l;xl+=1)Tl[xl]=Rl[xl]+(Rl[xl]-Vo[xl])*((Lo-Yo)/this.comp.globalData.frameRate)/5e-4;return Tl}return Rl+(Rl-Vo)*((Lo-Yo)/.001)}return this.getValueAtTime(((Lo-Jo)%Wo+Jo)/this.comp.globalData.frameRate,0)}function Mn(mo,Ao,$o){if(!this.k)return this.pv;mo=mo?mo.toLowerCase():"";var Lo=this.comp.renderedFrame,Go=this.keyframes,Yo=Go[0].t;if(Lo>=Yo)return this.pv;var Wo,Jo;$o?(Ao?Wo=Math.abs(this.elem.comp.globalData.frameRate*Ao):Wo=Math.max(0,this.elem.data.op-Yo),Jo=Yo+Wo):((!Ao||Ao>Go.length-1)&&(Ao=Go.length-1),Jo=Go[Ao].t,Wo=Jo-Yo);var xl,_l,Tl;if(mo==="pingpong"){var Sl=Math.floor((Yo-Lo)/Wo);if(Sl%2===0)return this.getValueAtTime(((Yo-Lo)%Wo+Yo)/this.comp.globalData.frameRate,0)}else if(mo==="offset"){var $l=this.getValueAtTime(Yo/this.comp.globalData.frameRate,0),Pl=this.getValueAtTime(Jo/this.comp.globalData.frameRate,0),Dl=this.getValueAtTime((Wo-(Yo-Lo)%Wo+Yo)/this.comp.globalData.frameRate,0),Ol=Math.floor((Yo-Lo)/Wo)+1;if(this.pv.length){for(Tl=new Array($l.length),_l=Tl.length,xl=0;xl<_l;xl+=1)Tl[xl]=Dl[xl]-(Pl[xl]-$l[xl])*Ol;return Tl}return Dl-(Pl-$l)*Ol}else if(mo==="continue"){var Rl=this.getValueAtTime(Yo/this.comp.globalData.frameRate,0),Vo=this.getValueAtTime((Yo+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(Tl=new Array(Rl.length),_l=Tl.length,xl=0;xl<_l;xl+=1)Tl[xl]=Rl[xl]+(Rl[xl]-Vo[xl])*(Yo-Lo)/.001;return Tl}return Rl+(Rl-Vo)*(Yo-Lo)/.001}return this.getValueAtTime((Wo-((Yo-Lo)%Wo+Yo))/this.comp.globalData.frameRate,0)}function rs(mo,Ao){if(!this.k)return this.pv;if(mo=(mo||.4)*.5,Ao=Math.floor(Ao||5),Ao<=1)return this.pv;var $o=this.comp.renderedFrame/this.comp.globalData.frameRate,Lo=$o-mo,Go=$o+mo,Yo=Ao>1?(Go-Lo)/(Ao-1):1,Wo=0,Jo=0,xl;this.pv.length?xl=createTypedArray("float32",this.pv.length):xl=0;for(var _l;Wo<Ao;){if(_l=this.getValueAtTime(Lo+Wo*Yo),this.pv.length)for(Jo=0;Jo<this.pv.length;Jo+=1)xl[Jo]+=_l[Jo];else xl+=_l;Wo+=1}if(this.pv.length)for(Jo=0;Jo<this.pv.length;Jo+=1)xl[Jo]/=Ao;else xl/=Ao;return xl}function is(mo){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var Ao=this._transformCachingAtTime.v;if(Ao.cloneFromProps(this.pre.props),this.appliedTransformations<1){var $o=this.a.getValueAtTime(mo);Ao.translate(-$o[0]*this.a.mult,-$o[1]*this.a.mult,$o[2]*this.a.mult)}if(this.appliedTransformations<2){var Lo=this.s.getValueAtTime(mo);Ao.scale(Lo[0]*this.s.mult,Lo[1]*this.s.mult,Lo[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var Go=this.sk.getValueAtTime(mo),Yo=this.sa.getValueAtTime(mo);Ao.skewFromAxis(-Go*this.sk.mult,Yo*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var Wo=this.r.getValueAtTime(mo);Ao.rotate(-Wo*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var Jo=this.rz.getValueAtTime(mo),xl=this.ry.getValueAtTime(mo),_l=this.rx.getValueAtTime(mo),Tl=this.or.getValueAtTime(mo);Ao.rotateZ(-Jo*this.rz.mult).rotateY(xl*this.ry.mult).rotateX(_l*this.rx.mult).rotateZ(-Tl[2]*this.or.mult).rotateY(Tl[1]*this.or.mult).rotateX(Tl[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var Sl=this.px.getValueAtTime(mo),$l=this.py.getValueAtTime(mo);if(this.data.p.z){var Pl=this.pz.getValueAtTime(mo);Ao.translate(Sl*this.px.mult,$l*this.py.mult,-Pl*this.pz.mult)}else Ao.translate(Sl*this.px.mult,$l*this.py.mult,0)}else{var Dl=this.p.getValueAtTime(mo);Ao.translate(Dl[0]*this.p.mult,Dl[1]*this.p.mult,-Dl[2]*this.p.mult)}return Ao}function os(){return this.v.clone(new Matrix)}var as=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(mo,Ao,$o){var Lo=as(mo,Ao,$o);return Lo.dynamicProperties.length?Lo.getValueAtTime=is.bind(Lo):Lo.getValueAtTime=os.bind(Lo),Lo.setGroupProperty=expressionHelpers.setGroupProperty,Lo};var us=PropertyFactory.getProp;PropertyFactory.getProp=function(mo,Ao,$o,Lo,Go){var Yo=us(mo,Ao,$o,Lo,Go);Yo.kf?Yo.getValueAtTime=expressionHelpers.getValueAtTime.bind(Yo):Yo.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(Yo),Yo.setGroupProperty=expressionHelpers.setGroupProperty,Yo.loopOut=Fn,Yo.loopIn=Mn,Yo.smooth=rs,Yo.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(Yo),Yo.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(Yo),Yo.numKeys=Ao.a===1?Ao.k.length:0,Yo.propertyIndex=Ao.ix;var Wo=0;return $o!==0&&(Wo=createTypedArray("float32",Ao.a===1?Ao.k[0].s.length:Ao.k.length)),Yo._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:Wo},expressionHelpers.searchExpressions(mo,Ao,Yo),Yo.k&&Go.addDynamicProperty(Yo),Yo};function ds(mo){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),mo*=this.elem.globalData.frameRate,mo-=this.offsetTime,mo!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<mo?this._caching.lastIndex:0,this._cachingAtTime.lastTime=mo,this.interpolateShape(mo,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue}var hs=ShapePropertyFactory.getConstructorFunction(),ps=ShapePropertyFactory.getKeyframedConstructorFunction();function io(){}io.prototype={vertices:function(Ao,$o){this.k&&this.getValue();var Lo=this.v;$o!==void 0&&(Lo=this.getValueAtTime($o,0));var Go,Yo=Lo._length,Wo=Lo[Ao],Jo=Lo.v,xl=createSizedArray(Yo);for(Go=0;Go<Yo;Go+=1)Ao==="i"||Ao==="o"?xl[Go]=[Wo[Go][0]-Jo[Go][0],Wo[Go][1]-Jo[Go][1]]:xl[Go]=[Wo[Go][0],Wo[Go][1]];return xl},points:function(Ao){return this.vertices("v",Ao)},inTangents:function(Ao){return this.vertices("i",Ao)},outTangents:function(Ao){return this.vertices("o",Ao)},isClosed:function(){return this.v.c},pointOnPath:function(Ao,$o){var Lo=this.v;$o!==void 0&&(Lo=this.getValueAtTime($o,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(Lo));for(var Go=this._segmentsLength,Yo=Go.lengths,Wo=Go.totalLength*Ao,Jo=0,xl=Yo.length,_l=0,Tl;Jo<xl;){if(_l+Yo[Jo].addedLength>Wo){var Sl=Jo,$l=Lo.c&&Jo===xl-1?0:Jo+1,Pl=(Wo-_l)/Yo[Jo].addedLength;Tl=bez.getPointInSegment(Lo.v[Sl],Lo.v[$l],Lo.o[Sl],Lo.i[$l],Pl,Yo[Jo]);break}else _l+=Yo[Jo].addedLength;Jo+=1}return Tl||(Tl=Lo.c?[Lo.v[0][0],Lo.v[0][1]]:[Lo.v[Lo._length-1][0],Lo.v[Lo._length-1][1]]),Tl},vectorOnPath:function(Ao,$o,Lo){Ao==1?Ao=this.v.c:Ao==0&&(Ao=.999);var Go=this.pointOnPath(Ao,$o),Yo=this.pointOnPath(Ao+.001,$o),Wo=Yo[0]-Go[0],Jo=Yo[1]-Go[1],xl=Math.sqrt(Math.pow(Wo,2)+Math.pow(Jo,2));if(xl===0)return[0,0];var _l=Lo==="tangent"?[Wo/xl,Jo/xl]:[-Jo/xl,Wo/xl];return _l},tangentOnPath:function(Ao,$o){return this.vectorOnPath(Ao,$o,"tangent")},normalOnPath:function(Ao,$o){return this.vectorOnPath(Ao,$o,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([io],hs),extendPrototype([io],ps),ps.prototype.getValueAtTime=ds,ps.prototype.initiateExpression=ExpressionManager.initiateExpression;var fo=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(mo,Ao,$o,Lo,Go){var Yo=fo(mo,Ao,$o,Lo,Go);return Yo.propertyIndex=Ao.ix,Yo.lock=!1,$o===3?expressionHelpers.searchExpressions(mo,Ao.pt,Yo):$o===4&&expressionHelpers.searchExpressions(mo,Ao.ks,Yo),Yo.k&&mo.addDynamicProperty(Yo),Yo}}function initialize$1(){addPropertyDecorator()}function addDecorator(){function Fn(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(Mn,rs){var is=this.calculateExpression(rs);if(Mn.t!==is){var os={};return this.copyData(os,Mn),os.t=is.toString(),os.__complete=!1,os}return Mn},TextProperty.prototype.searchProperty=function(){var Mn=this.searchKeyframes(),rs=this.searchExpressions();return this.kf=Mn||rs,this.kf},TextProperty.prototype.searchExpressions=Fn}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function Fn(Mn,rs){var is=createNS("feMerge");is.setAttribute("result",Mn);var os,as;for(as=0;as<rs.length;as+=1)os=createNS("feMergeNode"),os.setAttribute("in",rs[as]),is.appendChild(os),is.appendChild(os);return is}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(Fn,Mn,rs,is,os){this.filterManager=Mn;var as=createNS("feColorMatrix");as.setAttribute("type","matrix"),as.setAttribute("color-interpolation-filters","linearRGB"),as.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=as,as.setAttribute("result",is+"_tint_1"),Fn.appendChild(as),as=createNS("feColorMatrix"),as.setAttribute("type","matrix"),as.setAttribute("color-interpolation-filters","sRGB"),as.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),as.setAttribute("result",is+"_tint_2"),Fn.appendChild(as),this.matrixFilter=as;var us=this.createMergeNode(is,[os,is+"_tint_1",is+"_tint_2"]);Fn.appendChild(us)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(Fn){if(Fn||this.filterManager._mdf){var Mn=this.filterManager.effectElements[0].p.v,rs=this.filterManager.effectElements[1].p.v,is=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+is+" 0"),this.matrixFilter.setAttribute("values",rs[0]-Mn[0]+" 0 0 0 "+Mn[0]+" "+(rs[1]-Mn[1])+" 0 0 0 "+Mn[1]+" "+(rs[2]-Mn[2])+" 0 0 0 "+Mn[2]+" 0 0 0 1 0")}};function SVGFillFilter(Fn,Mn,rs,is){this.filterManager=Mn;var os=createNS("feColorMatrix");os.setAttribute("type","matrix"),os.setAttribute("color-interpolation-filters","sRGB"),os.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),os.setAttribute("result",is),Fn.appendChild(os),this.matrixFilter=os}SVGFillFilter.prototype.renderFrame=function(Fn){if(Fn||this.filterManager._mdf){var Mn=this.filterManager.effectElements[2].p.v,rs=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+Mn[0]+" 0 0 0 0 "+Mn[1]+" 0 0 0 0 "+Mn[2]+" 0 0 0 "+rs+" 0")}};function SVGStrokeEffect(Fn,Mn,rs){this.initialized=!1,this.filterManager=Mn,this.elem=rs,this.paths=[]}SVGStrokeEffect.prototype.initialize=function(){var Fn=this.elem.layerElement.children||this.elem.layerElement.childNodes,Mn,rs,is,os;for(this.filterManager.effectElements[1].p.v===1?(os=this.elem.maskManager.masksProperties.length,is=0):(is=this.filterManager.effectElements[0].p.v-1,os=is+1),rs=createNS("g"),rs.setAttribute("fill","none"),rs.setAttribute("stroke-linecap","round"),rs.setAttribute("stroke-dashoffset",1),is;is<os;is+=1)Mn=createNS("path"),rs.appendChild(Mn),this.paths.push({p:Mn,m:is});if(this.filterManager.effectElements[10].p.v===3){var as=createNS("mask"),us=createElementID();as.setAttribute("id",us),as.setAttribute("mask-type","alpha"),as.appendChild(rs),this.elem.globalData.defs.appendChild(as);var ds=createNS("g");for(ds.setAttribute("mask","url("+getLocationHref()+"#"+us+")");Fn[0];)ds.appendChild(Fn[0]);this.elem.layerElement.appendChild(ds),this.masker=as,rs.setAttribute("stroke","#fff")}else if(this.filterManager.effectElements[10].p.v===1||this.filterManager.effectElements[10].p.v===2){if(this.filterManager.effectElements[10].p.v===2)for(Fn=this.elem.layerElement.children||this.elem.layerElement.childNodes;Fn.length;)this.elem.layerElement.removeChild(Fn[0]);this.elem.layerElement.appendChild(rs),this.elem.layerElement.removeAttribute("mask"),rs.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=rs},SVGStrokeEffect.prototype.renderFrame=function(Fn){this.initialized||this.initialize();var Mn,rs=this.paths.length,is,os;for(Mn=0;Mn<rs;Mn+=1)if(this.paths[Mn].m!==-1&&(is=this.elem.maskManager.viewData[this.paths[Mn].m],os=this.paths[Mn].p,(Fn||this.filterManager._mdf||is.prop._mdf)&&os.setAttribute("d",is.lastPath),Fn||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||is.prop._mdf)){var as;if(this.filterManager.effectElements[7].p.v!==0||this.filterManager.effectElements[8].p.v!==100){var us=Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)*.01,ds=Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v)*.01,hs=os.getTotalLength();as="0 0 0 "+hs*us+" ";var ps=hs*(ds-us),io=1+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v*.01,fo=Math.floor(ps/io),mo;for(mo=0;mo<fo;mo+=1)as+="1 "+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v*.01+" ";as+="0 "+hs*10+" 0 0"}else as="1 "+this.filterManager.effectElements[4].p.v*2*this.filterManager.effectElements[9].p.v*.01;os.setAttribute("stroke-dasharray",as)}if((Fn||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",this.filterManager.effectElements[4].p.v*2),(Fn||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(this.filterManager.effectElements[10].p.v===1||this.filterManager.effectElements[10].p.v===2)&&(Fn||this.filterManager.effectElements[3].p._mdf)){var Ao=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(Ao[0]*255)+","+bmFloor(Ao[1]*255)+","+bmFloor(Ao[2]*255)+")")}};function SVGTritoneFilter(Fn,Mn,rs,is){this.filterManager=Mn;var os=createNS("feColorMatrix");os.setAttribute("type","matrix"),os.setAttribute("color-interpolation-filters","linearRGB"),os.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),Fn.appendChild(os);var as=createNS("feComponentTransfer");as.setAttribute("color-interpolation-filters","sRGB"),as.setAttribute("result",is),this.matrixFilter=as;var us=createNS("feFuncR");us.setAttribute("type","table"),as.appendChild(us),this.feFuncR=us;var ds=createNS("feFuncG");ds.setAttribute("type","table"),as.appendChild(ds),this.feFuncG=ds;var hs=createNS("feFuncB");hs.setAttribute("type","table"),as.appendChild(hs),this.feFuncB=hs,Fn.appendChild(as)}SVGTritoneFilter.prototype.renderFrame=function(Fn){if(Fn||this.filterManager._mdf){var Mn=this.filterManager.effectElements[0].p.v,rs=this.filterManager.effectElements[1].p.v,is=this.filterManager.effectElements[2].p.v,os=is[0]+" "+rs[0]+" "+Mn[0],as=is[1]+" "+rs[1]+" "+Mn[1],us=is[2]+" "+rs[2]+" "+Mn[2];this.feFuncR.setAttribute("tableValues",os),this.feFuncG.setAttribute("tableValues",as),this.feFuncB.setAttribute("tableValues",us)}};function SVGProLevelsFilter(Fn,Mn,rs,is){this.filterManager=Mn;var os=this.filterManager.effectElements,as=createNS("feComponentTransfer");(os[10].p.k||os[10].p.v!==0||os[11].p.k||os[11].p.v!==1||os[12].p.k||os[12].p.v!==1||os[13].p.k||os[13].p.v!==0||os[14].p.k||os[14].p.v!==1)&&(this.feFuncR=this.createFeFunc("feFuncR",as)),(os[17].p.k||os[17].p.v!==0||os[18].p.k||os[18].p.v!==1||os[19].p.k||os[19].p.v!==1||os[20].p.k||os[20].p.v!==0||os[21].p.k||os[21].p.v!==1)&&(this.feFuncG=this.createFeFunc("feFuncG",as)),(os[24].p.k||os[24].p.v!==0||os[25].p.k||os[25].p.v!==1||os[26].p.k||os[26].p.v!==1||os[27].p.k||os[27].p.v!==0||os[28].p.k||os[28].p.v!==1)&&(this.feFuncB=this.createFeFunc("feFuncB",as)),(os[31].p.k||os[31].p.v!==0||os[32].p.k||os[32].p.v!==1||os[33].p.k||os[33].p.v!==1||os[34].p.k||os[34].p.v!==0||os[35].p.k||os[35].p.v!==1)&&(this.feFuncA=this.createFeFunc("feFuncA",as)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(as.setAttribute("color-interpolation-filters","sRGB"),Fn.appendChild(as)),(os[3].p.k||os[3].p.v!==0||os[4].p.k||os[4].p.v!==1||os[5].p.k||os[5].p.v!==1||os[6].p.k||os[6].p.v!==0||os[7].p.k||os[7].p.v!==1)&&(as=createNS("feComponentTransfer"),as.setAttribute("color-interpolation-filters","sRGB"),as.setAttribute("result",is),Fn.appendChild(as),this.feFuncRComposed=this.createFeFunc("feFuncR",as),this.feFuncGComposed=this.createFeFunc("feFuncG",as),this.feFuncBComposed=this.createFeFunc("feFuncB",as))}SVGProLevelsFilter.prototype.createFeFunc=function(Fn,Mn){var rs=createNS(Fn);return rs.setAttribute("type","table"),Mn.appendChild(rs),rs},SVGProLevelsFilter.prototype.getTableValue=function(Fn,Mn,rs,is,os){for(var as=0,us=256,ds,hs=Math.min(Fn,Mn),ps=Math.max(Fn,Mn),io=Array.call(null,{length:us}),fo,mo=0,Ao=os-is,$o=Mn-Fn;as<=256;)ds=as/256,ds<=hs?fo=$o<0?os:is:ds>=ps?fo=$o<0?is:os:fo=is+Ao*Math.pow((ds-Fn)/$o,1/rs),io[mo]=fo,mo+=1,as+=256/(us-1);return io.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(Fn){if(Fn||this.filterManager._mdf){var Mn,rs=this.filterManager.effectElements;this.feFuncRComposed&&(Fn||rs[3].p._mdf||rs[4].p._mdf||rs[5].p._mdf||rs[6].p._mdf||rs[7].p._mdf)&&(Mn=this.getTableValue(rs[3].p.v,rs[4].p.v,rs[5].p.v,rs[6].p.v,rs[7].p.v),this.feFuncRComposed.setAttribute("tableValues",Mn),this.feFuncGComposed.setAttribute("tableValues",Mn),this.feFuncBComposed.setAttribute("tableValues",Mn)),this.feFuncR&&(Fn||rs[10].p._mdf||rs[11].p._mdf||rs[12].p._mdf||rs[13].p._mdf||rs[14].p._mdf)&&(Mn=this.getTableValue(rs[10].p.v,rs[11].p.v,rs[12].p.v,rs[13].p.v,rs[14].p.v),this.feFuncR.setAttribute("tableValues",Mn)),this.feFuncG&&(Fn||rs[17].p._mdf||rs[18].p._mdf||rs[19].p._mdf||rs[20].p._mdf||rs[21].p._mdf)&&(Mn=this.getTableValue(rs[17].p.v,rs[18].p.v,rs[19].p.v,rs[20].p.v,rs[21].p.v),this.feFuncG.setAttribute("tableValues",Mn)),this.feFuncB&&(Fn||rs[24].p._mdf||rs[25].p._mdf||rs[26].p._mdf||rs[27].p._mdf||rs[28].p._mdf)&&(Mn=this.getTableValue(rs[24].p.v,rs[25].p.v,rs[26].p.v,rs[27].p.v,rs[28].p.v),this.feFuncB.setAttribute("tableValues",Mn)),this.feFuncA&&(Fn||rs[31].p._mdf||rs[32].p._mdf||rs[33].p._mdf||rs[34].p._mdf||rs[35].p._mdf)&&(Mn=this.getTableValue(rs[31].p.v,rs[32].p.v,rs[33].p.v,rs[34].p.v,rs[35].p.v),this.feFuncA.setAttribute("tableValues",Mn))}};function SVGDropShadowEffect(Fn,Mn,rs,is,os){var as=Mn.container.globalData.renderConfig.filterSize,us=Mn.data.fs||as;Fn.setAttribute("x",us.x||as.x),Fn.setAttribute("y",us.y||as.y),Fn.setAttribute("width",us.width||as.width),Fn.setAttribute("height",us.height||as.height),this.filterManager=Mn;var ds=createNS("feGaussianBlur");ds.setAttribute("in","SourceAlpha"),ds.setAttribute("result",is+"_drop_shadow_1"),ds.setAttribute("stdDeviation","0"),this.feGaussianBlur=ds,Fn.appendChild(ds);var hs=createNS("feOffset");hs.setAttribute("dx","25"),hs.setAttribute("dy","0"),hs.setAttribute("in",is+"_drop_shadow_1"),hs.setAttribute("result",is+"_drop_shadow_2"),this.feOffset=hs,Fn.appendChild(hs);var ps=createNS("feFlood");ps.setAttribute("flood-color","#00ff00"),ps.setAttribute("flood-opacity","1"),ps.setAttribute("result",is+"_drop_shadow_3"),this.feFlood=ps,Fn.appendChild(ps);var io=createNS("feComposite");io.setAttribute("in",is+"_drop_shadow_3"),io.setAttribute("in2",is+"_drop_shadow_2"),io.setAttribute("operator","in"),io.setAttribute("result",is+"_drop_shadow_4"),Fn.appendChild(io);var fo=this.createMergeNode(is,[is+"_drop_shadow_4",os]);Fn.appendChild(fo)}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(Fn){if(Fn||this.filterManager._mdf){if((Fn||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),Fn||this.filterManager.effectElements[0].p._mdf){var Mn=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(Mn[0]*255),Math.round(Mn[1]*255),Math.round(Mn[2]*255)))}if((Fn||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),Fn||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var rs=this.filterManager.effectElements[3].p.v,is=(this.filterManager.effectElements[2].p.v-90)*degToRads,os=rs*Math.cos(is),as=rs*Math.sin(is);this.feOffset.setAttribute("dx",os),this.feOffset.setAttribute("dy",as)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(Fn,Mn,rs){this.initialized=!1,this.filterManager=Mn,this.filterElem=Fn,this.elem=rs,rs.matteElement=createNS("g"),rs.matteElement.appendChild(rs.layerElement),rs.matteElement.appendChild(rs.transformedElement),rs.baseElement=rs.matteElement}SVGMatte3Effect.prototype.findSymbol=function(Fn){for(var Mn=0,rs=_svgMatteSymbols.length;Mn<rs;){if(_svgMatteSymbols[Mn]===Fn)return _svgMatteSymbols[Mn];Mn+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(Fn,Mn){var rs=Fn.layerElement.parentNode;if(rs){for(var is=rs.children,os=0,as=is.length;os<as&&is[os]!==Fn.layerElement;)os+=1;var us;os<=as-2&&(us=is[os+1]);var ds=createNS("use");ds.setAttribute("href","#"+Mn),us?rs.insertBefore(ds,us):rs.appendChild(ds)}},SVGMatte3Effect.prototype.setElementAsMask=function(Fn,Mn){if(!this.findSymbol(Mn)){var rs=createElementID(),is=createNS("mask");is.setAttribute("id",Mn.layerId),is.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(Mn);var os=Fn.globalData.defs;os.appendChild(is);var as=createNS("symbol");as.setAttribute("id",rs),this.replaceInParent(Mn,rs),as.appendChild(Mn.layerElement),os.appendChild(as);var us=createNS("use");us.setAttribute("href","#"+rs),is.appendChild(us),Mn.data.hd=!1,Mn.show()}Fn.setMatte(Mn.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var Fn=this.filterManager.effectElements[0].p.v,Mn=this.elem.comp.elements,rs=0,is=Mn.length;rs<is;)Mn[rs]&&Mn[rs].data.ind===Fn&&this.setElementAsMask(this.elem,Mn[rs]),rs+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()};function SVGGaussianBlurEffect(Fn,Mn,rs,is){Fn.setAttribute("x","-100%"),Fn.setAttribute("y","-100%"),Fn.setAttribute("width","300%"),Fn.setAttribute("height","300%"),this.filterManager=Mn;var os=createNS("feGaussianBlur");os.setAttribute("result",is),Fn.appendChild(os),this.feGaussianBlur=os}SVGGaussianBlurEffect.prototype.renderFrame=function(Fn){if(Fn||this.filterManager._mdf){var Mn=.3,rs=this.filterManager.effectElements[0].p.v*Mn,is=this.filterManager.effectElements[1].p.v,os=is==3?0:rs,as=is==2?0:rs;this.feGaussianBlur.setAttribute("stdDeviation",os+" "+as);var us=this.filterManager.effectElements[2].p.v==1?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",us)}};function TransformEffect(){}TransformEffect.prototype.init=function(Fn){this.effectsManager=Fn,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1},TransformEffect.prototype.renderFrame=function(Fn){if(this._opMdf=!1,this._mdf=!1,Fn||this.effectsManager._mdf){var Mn=this.effectsManager.effectElements,rs=Mn[0].p.v,is=Mn[1].p.v,os=Mn[2].p.v===1,as=Mn[3].p.v,us=os?as:Mn[4].p.v,ds=Mn[5].p.v,hs=Mn[6].p.v,ps=Mn[7].p.v;this.matrix.reset(),this.matrix.translate(-rs[0],-rs[1],rs[2]),this.matrix.scale(us*.01,as*.01,1),this.matrix.rotate(-ps*degToRads),this.matrix.skewFromAxis(-ds*degToRads,(hs+90)*degToRads),this.matrix.translate(is[0],is[1],0),this._mdf=!0,this.opacity!==Mn[8].p.v&&(this.opacity=Mn[8].p.v,this._opMdf=!0)}};function SVGTransformEffect(Fn,Mn){this.init(Mn)}extendPrototype([TransformEffect],SVGTransformEffect);function CVTransformEffect(Fn){this.init(Fn)}return extendPrototype([TransformEffect],CVTransformEffect),registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect$1(20,SVGTintFilter,!0),registerEffect$1(21,SVGFillFilter,!0),registerEffect$1(22,SVGStrokeEffect,!1),registerEffect$1(23,SVGTritoneFilter,!0),registerEffect$1(24,SVGProLevelsFilter,!0),registerEffect$1(25,SVGDropShadowEffect,!0),registerEffect$1(28,SVGMatte3Effect,!1),registerEffect$1(29,SVGGaussianBlurEffect,!0),registerEffect$1(35,SVGTransformEffect,!1),registerEffect(35,CVTransformEffect),lottie})})(lottie$1,lottie$1.exports);var lottieExports=lottie$1.exports;const lottie=getDefaultExportFromCjs(lottieExports);var react=function Fn(Mn,rs){if(Mn===rs)return!0;if(Mn&&rs&&typeof Mn=="object"&&typeof rs=="object"){if(Mn.constructor!==rs.constructor)return!1;var is,os,as;if(Array.isArray(Mn)){if(is=Mn.length,is!=rs.length)return!1;for(os=is;os--!==0;)if(!Fn(Mn[os],rs[os]))return!1;return!0}if(Mn instanceof Map&&rs instanceof Map){if(Mn.size!==rs.size)return!1;for(os of Mn.entries())if(!rs.has(os[0]))return!1;for(os of Mn.entries())if(!Fn(os[1],rs.get(os[0])))return!1;return!0}if(Mn instanceof Set&&rs instanceof Set){if(Mn.size!==rs.size)return!1;for(os of Mn.entries())if(!rs.has(os[0]))return!1;return!0}if(ArrayBuffer.isView(Mn)&&ArrayBuffer.isView(rs)){if(is=Mn.length,is!=rs.length)return!1;for(os=is;os--!==0;)if(Mn[os]!==rs[os])return!1;return!0}if(Mn.constructor===RegExp)return Mn.source===rs.source&&Mn.flags===rs.flags;if(Mn.valueOf!==Object.prototype.valueOf)return Mn.valueOf()===rs.valueOf();if(Mn.toString!==Object.prototype.toString)return Mn.toString()===rs.toString();if(as=Object.keys(Mn),is=as.length,is!==Object.keys(rs).length)return!1;for(os=is;os--!==0;)if(!Object.prototype.hasOwnProperty.call(rs,as[os]))return!1;for(os=is;os--!==0;){var us=as[os];if(!(us==="_owner"&&Mn.$$typeof)&&!Fn(Mn[us],rs[us]))return!1}return!0}return Mn!==Mn&&rs!==rs};const equal$2=getDefaultExportFromCjs(react);var rfdc_1=rfdc;function copyBuffer(Fn){return Fn instanceof Buffer?Buffer.from(Fn):new Fn.constructor(Fn.buffer.slice(),Fn.byteOffset,Fn.length)}function rfdc(Fn){if(Fn=Fn||{},Fn.circles)return rfdcCircles(Fn);const Mn=new Map;if(Mn.set(Date,us=>new Date(us)),Mn.set(Map,(us,ds)=>new Map(is(Array.from(us),ds))),Mn.set(Set,(us,ds)=>new Set(is(Array.from(us),ds))),Fn.constructorHandlers)for(const us of Fn.constructorHandlers)Mn.set(us[0],us[1]);let rs=null;return Fn.proto?as:os;function is(us,ds){const hs=Object.keys(us),ps=new Array(hs.length);for(let io=0;io<hs.length;io++){const fo=hs[io],mo=us[fo];typeof mo!="object"||mo===null?ps[fo]=mo:mo.constructor!==Object&&(rs=Mn.get(mo.constructor))?ps[fo]=rs(mo,ds):ArrayBuffer.isView(mo)?ps[fo]=copyBuffer(mo):ps[fo]=ds(mo)}return ps}function os(us){if(typeof us!="object"||us===null)return us;if(Array.isArray(us))return is(us,os);if(us.constructor!==Object&&(rs=Mn.get(us.constructor)))return rs(us,os);const ds={};for(const hs in us){if(Object.hasOwnProperty.call(us,hs)===!1)continue;const ps=us[hs];typeof ps!="object"||ps===null?ds[hs]=ps:ps.constructor!==Object&&(rs=Mn.get(ps.constructor))?ds[hs]=rs(ps,os):ArrayBuffer.isView(ps)?ds[hs]=copyBuffer(ps):ds[hs]=os(ps)}return ds}function as(us){if(typeof us!="object"||us===null)return us;if(Array.isArray(us))return is(us,as);if(us.constructor!==Object&&(rs=Mn.get(us.constructor)))return rs(us,as);const ds={};for(const hs in us){const ps=us[hs];typeof ps!="object"||ps===null?ds[hs]=ps:ps.constructor!==Object&&(rs=Mn.get(ps.constructor))?ds[hs]=rs(ps,as):ArrayBuffer.isView(ps)?ds[hs]=copyBuffer(ps):ds[hs]=as(ps)}return ds}}function rfdcCircles(Fn){const Mn=[],rs=[],is=new Map;if(is.set(Date,hs=>new Date(hs)),is.set(Map,(hs,ps)=>new Map(as(Array.from(hs),ps))),is.set(Set,(hs,ps)=>new Set(as(Array.from(hs),ps))),Fn.constructorHandlers)for(const hs of Fn.constructorHandlers)is.set(hs[0],hs[1]);let os=null;return Fn.proto?ds:us;function as(hs,ps){const io=Object.keys(hs),fo=new Array(io.length);for(let mo=0;mo<io.length;mo++){const Ao=io[mo],$o=hs[Ao];if(typeof $o!="object"||$o===null)fo[Ao]=$o;else if($o.constructor!==Object&&(os=is.get($o.constructor)))fo[Ao]=os($o,ps);else if(ArrayBuffer.isView($o))fo[Ao]=copyBuffer($o);else{const Lo=Mn.indexOf($o);Lo!==-1?fo[Ao]=rs[Lo]:fo[Ao]=ps($o)}}return fo}function us(hs){if(typeof hs!="object"||hs===null)return hs;if(Array.isArray(hs))return as(hs,us);if(hs.constructor!==Object&&(os=is.get(hs.constructor)))return os(hs,us);const ps={};Mn.push(hs),rs.push(ps);for(const io in hs){if(Object.hasOwnProperty.call(hs,io)===!1)continue;const fo=hs[io];if(typeof fo!="object"||fo===null)ps[io]=fo;else if(fo.constructor!==Object&&(os=is.get(fo.constructor)))ps[io]=os(fo,us);else if(ArrayBuffer.isView(fo))ps[io]=copyBuffer(fo);else{const mo=Mn.indexOf(fo);mo!==-1?ps[io]=rs[mo]:ps[io]=us(fo)}}return Mn.pop(),rs.pop(),ps}function ds(hs){if(typeof hs!="object"||hs===null)return hs;if(Array.isArray(hs))return as(hs,ds);if(hs.constructor!==Object&&(os=is.get(hs.constructor)))return os(hs,ds);const ps={};Mn.push(hs),rs.push(ps);for(const io in hs){const fo=hs[io];if(typeof fo!="object"||fo===null)ps[io]=fo;else if(fo.constructor!==Object&&(os=is.get(fo.constructor)))ps[io]=os(fo,ds);else if(ArrayBuffer.isView(fo))ps[io]=copyBuffer(fo);else{const mo=Mn.indexOf(fo);mo!==-1?ps[io]=rs[mo]:ps[io]=ds(fo)}}return Mn.pop(),rs.pop(),ps}}var _default=rfdc_1();const clone$3=getDefaultExportFromCjs(_default);function _extends$3(){return _extends$3=Object.assign||function(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn];for(var is in rs)Object.prototype.hasOwnProperty.call(rs,is)&&(Fn[is]=rs[is])}return Fn},_extends$3.apply(this,arguments)}function _objectWithoutPropertiesLoose$1(Fn,Mn){if(Fn==null)return{};var rs={},is=Object.keys(Fn),os,as;for(as=0;as<is.length;as++)os=is[as],!(Mn.indexOf(os)>=0)&&(rs[os]=Fn[os]);return rs}function createCommonjsModule(Fn,Mn){return Mn={exports:{}},Fn(Mn,Mn.exports),Mn.exports}/** @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 b$3=typeof Symbol=="function"&&Symbol.for,c$7=b$3?Symbol.for("react.element"):60103,d$4=b$3?Symbol.for("react.portal"):60106,e$5=b$3?Symbol.for("react.fragment"):60107,f$6=b$3?Symbol.for("react.strict_mode"):60108,g$4=b$3?Symbol.for("react.profiler"):60114,h$8=b$3?Symbol.for("react.provider"):60109,k$3=b$3?Symbol.for("react.context"):60110,l$5=b$3?Symbol.for("react.async_mode"):60111,m$2=b$3?Symbol.for("react.concurrent_mode"):60111,n$9=b$3?Symbol.for("react.forward_ref"):60112,p$4=b$3?Symbol.for("react.suspense"):60113,q$2=b$3?Symbol.for("react.suspense_list"):60120,r$9=b$3?Symbol.for("react.memo"):60115,t$4=b$3?Symbol.for("react.lazy"):60116,v$6=b$3?Symbol.for("react.block"):60121,w$6=b$3?Symbol.for("react.fundamental"):60117,x$5=b$3?Symbol.for("react.responder"):60118,y$6=b$3?Symbol.for("react.scope"):60119;function z$7(Fn){if(typeof Fn=="object"&&Fn!==null){var Mn=Fn.$$typeof;switch(Mn){case c$7:switch(Fn=Fn.type,Fn){case l$5:case m$2:case e$5:case g$4:case f$6:case p$4:return Fn;default:switch(Fn=Fn&&Fn.$$typeof,Fn){case k$3:case n$9:case t$4:case r$9:case h$8:return Fn;default:return Mn}}case d$4:return Mn}}}function A$2(Fn){return z$7(Fn)===m$2}var AsyncMode=l$5,ConcurrentMode=m$2,ContextConsumer=k$3,ContextProvider=h$8,Element$2=c$7,ForwardRef=n$9,Fragment=e$5,Lazy=t$4,Memo=r$9,Portal=d$4,Profiler=g$4,StrictMode=f$6,Suspense=p$4,isAsyncMode=function(Fn){return A$2(Fn)||z$7(Fn)===l$5},isConcurrentMode=A$2,isContextConsumer=function(Fn){return z$7(Fn)===k$3},isContextProvider=function(Fn){return z$7(Fn)===h$8},isElement=function(Fn){return typeof Fn=="object"&&Fn!==null&&Fn.$$typeof===c$7},isForwardRef=function(Fn){return z$7(Fn)===n$9},isFragment=function(Fn){return z$7(Fn)===e$5},isLazy=function(Fn){return z$7(Fn)===t$4},isMemo=function(Fn){return z$7(Fn)===r$9},isPortal=function(Fn){return z$7(Fn)===d$4},isProfiler=function(Fn){return z$7(Fn)===g$4},isStrictMode=function(Fn){return z$7(Fn)===f$6},isSuspense=function(Fn){return z$7(Fn)===p$4},isValidElementType=function(Fn){return typeof Fn=="string"||typeof Fn=="function"||Fn===e$5||Fn===m$2||Fn===g$4||Fn===f$6||Fn===p$4||Fn===q$2||typeof Fn=="object"&&Fn!==null&&(Fn.$$typeof===t$4||Fn.$$typeof===r$9||Fn.$$typeof===h$8||Fn.$$typeof===k$3||Fn.$$typeof===n$9||Fn.$$typeof===w$6||Fn.$$typeof===x$5||Fn.$$typeof===y$6||Fn.$$typeof===v$6)},typeOf=z$7,reactIs_production_min={AsyncMode,ConcurrentMode,ContextConsumer,ContextProvider,Element:Element$2,ForwardRef,Fragment,Lazy,Memo,Portal,Profiler,StrictMode,Suspense,isAsyncMode,isConcurrentMode,isContextConsumer,isContextProvider,isElement,isForwardRef,isFragment,isLazy,isMemo,isPortal,isProfiler,isStrictMode,isSuspense,isValidElementType,typeOf};createCommonjsModule(function(Fn,Mn){});createCommonjsModule(function(Fn){Fn.exports=reactIs_production_min});/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(Fn){if(Fn==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(Fn)}function shouldUseNative(){try{if(!Object.assign)return!1;var Fn=new String("abc");if(Fn[5]="de",Object.getOwnPropertyNames(Fn)[0]==="5")return!1;for(var Mn={},rs=0;rs<10;rs++)Mn["_"+String.fromCharCode(rs)]=rs;var is=Object.getOwnPropertyNames(Mn).map(function(as){return Mn[as]});if(is.join("")!=="0123456789")return!1;var os={};return"abcdefghijklmnopqrst".split("").forEach(function(as){os[as]=as}),Object.keys(Object.assign({},os)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}shouldUseNative();var ReactPropTypesSecret$2="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1$1=ReactPropTypesSecret$2;Function.call.bind(Object.prototype.hasOwnProperty);function emptyFunction$1(){}function emptyFunctionWithReset$1(){}emptyFunctionWithReset$1.resetWarningCache=emptyFunction$1;var factoryWithThrowingShims$1=function(){function Fn(is,os,as,us,ds,hs){if(hs!==ReactPropTypesSecret_1$1){var ps=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 ps.name="Invariant Violation",ps}}Fn.isRequired=Fn;function Mn(){return Fn}var rs={array:Fn,bigint:Fn,bool:Fn,func:Fn,number:Fn,object:Fn,string:Fn,symbol:Fn,any:Fn,arrayOf:Mn,element:Fn,elementType:Fn,instanceOf:Mn,node:Fn,objectOf:Mn,oneOf:Mn,oneOfType:Mn,shape:Mn,exact:Mn,checkPropTypes:emptyFunctionWithReset$1,resetWarningCache:emptyFunction$1};return rs.PropTypes=rs,rs},propTypes$2=createCommonjsModule(function(Fn){Fn.exports=factoryWithThrowingShims$1()}),propTypes$1$1={animationData:propTypes$2.object,path:propTypes$2.string,play:propTypes$2.bool,goTo:propTypes$2.number,speed:propTypes$2.number,direction:propTypes$2.number,loop:propTypes$2.oneOfType([propTypes$2.number,propTypes$2.bool]),useSubframes:propTypes$2.bool,segments:propTypes$2.oneOfType([propTypes$2.arrayOf(propTypes$2.number),propTypes$2.bool]),rendererSettings:propTypes$2.object,renderer:propTypes$2.string,audioFactory:propTypes$2.func,onComplete:propTypes$2.func,onLoopComplete:propTypes$2.func,onEnterFrame:propTypes$2.func,onSegmentStart:propTypes$2.func},emptyObject={},noOp=function Fn(){},makeLottiePlayer=function Fn(Mn){var rs=Mn.loadAnimation,is=reactExports.memo(reactExports.forwardRef(function(os,as){var us=os.animationData,ds=us===void 0?null:us,hs=os.path,ps=hs===void 0?null:hs,io=os.play,fo=io===void 0?null:io,mo=os.speed,Ao=mo===void 0?1:mo,$o=os.direction,Lo=$o===void 0?1:$o,Go=os.segments,Yo=Go===void 0?null:Go,Wo=os.goTo,Jo=Wo===void 0?null:Wo,xl=os.useSubframes,_l=xl===void 0?!0:xl,Tl=os.renderer,Sl=Tl===void 0?"svg":Tl,$l=os.loop,Pl=$l===void 0?!0:$l,Dl=os.rendererSettings,Ol=Dl===void 0?emptyObject:Dl,Rl=os.audioFactory,Vo=Rl===void 0?null:Rl,jo=os.onLoad,Ho=jo===void 0?noOp:jo,Qo=os.onComplete,El=Qo===void 0?noOp:Qo,Xo=os.onLoopComplete,Al=Xo===void 0?noOp:Xo,wl=os.onEnterFrame,yl=wl===void 0?noOp:wl,Il=os.onSegmentStart,Bl=Il===void 0?noOp:Il,Gl=_objectWithoutPropertiesLoose$1(os,["animationData","path","play","speed","direction","segments","goTo","useSubframes","renderer","loop","rendererSettings","audioFactory","onLoad","onComplete","onLoopComplete","onEnterFrame","onSegmentStart"]),Nl=reactExports.useRef(),zl=reactExports.useRef(),Vl=reactExports.useState(!1),Hl=Vl[0],Yl=Vl[1],Ll=reactExports.useState(Yo),Zl=Ll[0],Xl=Ll[1];reactExports.useEffect(function(){equal$2(Zl,Yo)||Xl(Yo)},[Yo,Zl]);var wu=reactExports.useState(Ol),yu=wu[0],rp=wu[1];reactExports.useEffect(function(){equal$2(yu,Ol)||rp(Ol)},[Ol,yu]),reactExports.useEffect(function(){return function(){return zl.current.removeEventListener("complete",El)}},[El]),reactExports.useEffect(function(){return function(){return zl.current.removeEventListener("loopComplete",Al)}},[Al]),reactExports.useEffect(function(){return function(){return zl.current.removeEventListener("enterFrame",yl)}},[yl]),reactExports.useEffect(function(){return function(){return zl.current.removeEventListener("segmentStart",Bl)}},[Bl]),reactExports.useEffect(function(){return function(){return zl.current.removeEventListener("DOMLoaded",Ho)}},[Ho]);var dp=reactExports.useCallback(function(wp){zl.current=wp,typeof as=="function"?as(wp):as!=null&&(as.current=wp)},[as]);reactExports.useEffect(function(){function wp(){return ds==null||typeof ds!="object"?ds:typeof ds.default=="object"?clone$3(ds.default):clone$3(ds)}var vp=rs({animationData:wp(),path:ps,container:Nl.current,renderer:Sl,loop:!1,autoplay:!1,rendererSettings:yu,audioFactory:Vo});dp(vp);var pp=function(){return Yl(!0)};return zl.current.addEventListener("DOMLoaded",pp),function(){zl.current.removeEventListener("DOMLoaded",pp),Yl(!1),zl.current.destroy(),dp(void 0)}},[Pl,Sl,yu,ds,ps,Vo,dp]),reactExports.useEffect(function(){zl.current.addEventListener("DOMLoaded",Ho)},[Ho]),reactExports.useEffect(function(){zl.current.addEventListener("complete",El)},[El]),reactExports.useEffect(function(){zl.current.addEventListener("loopComplete",Al)},[Al]),reactExports.useEffect(function(){zl.current.addEventListener("enterFrame",yl)},[yl]),reactExports.useEffect(function(){zl.current.addEventListener("segmentStart",Bl)},[Bl]),reactExports.useEffect(function(){Hl&&(zl.current.loop=Pl)},[Hl,Pl]);var up=reactExports.useRef(!1);return reactExports.useEffect(function(){if(!Hl)return;function wp(gp){zl.current.goToAndPlay(gp,!0),zl.current.setDirection(Lo)}if(fo===!0){var vp=!0;if(Zl){if(zl.current.playSegments(Zl,vp),up.current=!0,Lo===-1){var pp=Zl[1];wp(pp)}}else if(up.current&&zl.current.resetSegments(vp),up.current=!1,Lo===-1){var cp=zl.current.getDuration(!0);wp(cp)}else zl.current.play()}else fo===!1&&zl.current.pause()},[fo,Zl,Hl,Lo]),reactExports.useEffect(function(){Hl&&(Number.isNaN(Ao)||zl.current.setSpeed(Ao))},[Ao,Hl]),reactExports.useEffect(function(){Hl&&zl.current.setDirection(Lo)},[Lo,Hl]),reactExports.useEffect(function(){if(Hl&&Jo!=null){var wp=!0;fo?zl.current.goToAndPlay(Jo,wp):zl.current.goToAndStop(Jo,wp)}},[Jo,fo,Hl]),reactExports.useEffect(function(){zl.current.setSubframe&&zl.current.setSubframe(_l)},[_l]),React.createElement("div",_extends$3({},Gl,{ref:Nl}))}));return is.propTypes=propTypes$1$1,is},LottiePlayer=makeLottiePlayer(lottie);const v$5="5.12.2",fr$2=60,ip=0,op=158,w$5=1620,h$7=1080,nm="Comp 4",ddd=1,assets=[],layers=[{ddd:1,ind:1,ty:3,nm:"Null 1",sr:1,ks:{o:{a:0,k:0,ix:11},rx:{a:0,k:0,ix:8},ry:{a:1,k:[{i:{x:[.351],y:[1]},o:{x:[.589],y:[0]},t:0,s:[-90]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:157,s:[630]},{i:{x:[.667],y:[1]},o:{x:[.679],y:[0]},t:175,s:[630]},{t:296,s:[1080]}],ix:9},rz:{a:0,k:0,ix:10},or:{a:0,k:[0,0,0],ix:7},p:{s:!0,x:{a:0,k:810,ix:3},y:{a:0,k:540,ix:4},z:{a:0,k:372,ix:5}},a:{a:0,k:[50,50,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,ip:0,op:300,st:0,bm:0},{ddd:1,ind:2,ty:4,nm:"Shape Layer 17",parent:1,sr:1,ks:{o:{a:0,k:100,ix:11},rx:{a:0,k:0,ix:8},ry:{a:1,k:[{i:{x:[.351],y:[1]},o:{x:[.589],y:[0]},t:0,s:[90]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:157,s:[-630]},{i:{x:[.667],y:[1]},o:{x:[.679],y:[0]},t:175,s:[-630]},{t:296,s:[-1080]}],ix:9},rz:{a:0,k:0,ix:10},or:{a:0,k:[0,0,0],ix:7},p:{a:0,k:[-348,50,0],ix:2},a:{a:0,k:[-952.424,1.135,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[-135.512,0],[0,-135.512],[135.512,0],[0,135.512]],o:[[135.512,0],[0,135.512],[-135.512,0],[0,-135.512]],v:[[0,-245.367],[245.367,0],[0,245.367],[-245.367,0]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"gf",o:{a:0,k:100,ix:10},r:1,bm:0,g:{p:3,k:{a:0,k:[0,.031,.675,.957,.5,.065,.784,.906,1,.098,.894,.855],ix:9}},s:{a:0,k:[16.808,257.724],ix:5},e:{a:0,k:[62.135,-229.284],ix:6},t:1,nm:"Gradient Fill 1",mn:"ADBE Vector Graphic - G-Fill",hd:!1},{ty:"tr",p:{a:0,k:[-952.424,1.135],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[102.711,102.711],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:480,st:0,ct:1,bm:0},{ddd:1,ind:3,ty:4,nm:"Shape Layer 15",parent:1,sr:1,ks:{o:{a:0,k:100,ix:11},rx:{a:0,k:0,ix:8},ry:{a:1,k:[{i:{x:[.351],y:[1]},o:{x:[.589],y:[0]},t:0,s:[90]},{i:{x:[.667],y:[1]},o:{x:[.333],y:[0]},t:157,s:[-630]},{i:{x:[.667],y:[1]},o:{x:[.679],y:[0]},t:175,s:[-630]},{t:296,s:[-1080]}],ix:9},rz:{a:0,k:0,ix:10},or:{a:0,k:[0,0,0],ix:7},p:{a:0,k:[555,50,0],ix:2},a:{a:0,k:[-952.424,1.135,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[-135.512,0],[0,-135.512],[135.512,0],[0,135.512]],o:[[135.512,0],[0,135.512],[-135.512,0],[0,-135.512]],v:[[0,-245.367],[245.367,0],[0,245.367],[-245.367,0]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"gf",o:{a:0,k:100,ix:10},r:1,bm:0,g:{p:3,k:{a:0,k:[0,.031,.675,.957,.5,.065,.784,.906,1,.098,.894,.855],ix:9}},s:{a:0,k:[16.808,257.724],ix:5},e:{a:0,k:[62.135,-229.284],ix:6},t:1,nm:"Gradient Fill 1",mn:"ADBE Vector Graphic - G-Fill",hd:!1},{ty:"tr",p:{a:0,k:[-952.424,1.135],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[102.711,102.711],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Ellipse 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:480,st:0,ct:1,bm:0}],markers=[],props$1={},kanaloader={v:v$5,fr:fr$2,ip,op,w:w$5,h:h$7,nm,ddd,assets,layers,markers,props:props$1},CopyDark="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='M19.1998%2019.1999V21.4398C19.1998%2022.3359%2019.1998%2022.7839%2019.0254%2023.1261C18.872%2023.4272%2018.6272%2023.6719%2018.3261%2023.8253C17.9839%2023.9997%2017.5358%2023.9997%2016.6397%2023.9997H10.5594C9.66326%2023.9997%209.2152%2023.9997%208.87292%2023.8253C8.57185%2023.6719%208.32707%2023.4272%208.17367%2023.1261C7.99927%2022.7839%207.99927%2022.3359%207.99927%2021.4398V15.3601C7.99927%2014.4641%207.99927%2014.0161%208.17367%2013.6738C8.32707%2013.3728%208.57185%2013.128%208.87292%2012.9746C9.2152%2012.8003%209.66326%2012.8003%2010.5594%2012.8003H12.7995M15.3596%2019.1999H21.4399C22.336%2019.1999%2022.7841%2019.1999%2023.1263%2019.0256C23.4274%2018.8722%2023.6722%2018.6274%2023.8256%2018.3264C24%2017.9841%2024%2017.5361%2024%2016.6401V10.5604C24%209.66432%2024%209.2163%2023.8256%208.87406C23.6722%208.57302%2023.4274%208.32826%2023.1263%208.17487C22.7841%208.00049%2022.336%208.00049%2021.4399%208.00049H15.3596C14.4635%208.00049%2014.0154%208.00049%2013.6731%208.17487C13.3721%208.32826%2013.1273%208.57302%2012.9739%208.87406C12.7995%209.2163%2012.7995%209.66432%2012.7995%2010.5604V16.6401C12.7995%2017.5361%2012.7995%2017.9841%2012.9739%2018.3264C13.1273%2018.6274%2013.3721%2018.8722%2013.6731%2019.0256C14.0154%2019.1999%2014.4635%2019.1999%2015.3596%2019.1999Z'%20stroke='%230E9384'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Switch="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='M1.66682%208.66683H5.66682M10.3335%208.66683H14.3335M8.00015%204.66683V14.0002M8.00015%204.66683C8.92063%204.66683%209.66682%203.92064%209.66682%203.00016M8.00015%204.66683C7.07968%204.66683%206.33349%203.92064%206.33349%203.00016M2.66682%2014.0002L13.3335%2014.0002M2.66682%203.00017L6.33349%203.00016M6.33349%203.00016C6.33349%202.07969%207.07968%201.3335%208.00015%201.3335C8.92063%201.3335%209.66682%202.07969%209.66682%203.00016M9.66682%203.00016L13.3335%203.00016M5.92045%209.55774C5.65332%2010.5806%204.74556%2011.3335%203.66682%2011.3335C2.58808%2011.3335%201.68032%2010.5806%201.4132%209.55774C1.39137%209.47416%201.38046%209.43238%201.3794%209.26541C1.37876%209.16306%201.41679%208.92707%201.44956%208.83011C1.50302%208.67193%201.56089%208.58264%201.67663%208.40408L3.66682%205.3335L5.65701%208.40408C5.77275%208.58264%205.83062%208.67193%205.88408%208.83011C5.91685%208.92707%205.95488%209.16306%205.95424%209.26541C5.95319%209.43238%205.94227%209.47416%205.92045%209.55774ZM14.5871%209.55774C14.32%2010.5806%2013.4122%2011.3335%2012.3335%2011.3335C11.2548%2011.3335%2010.347%2010.5806%2010.0799%209.55774C10.058%209.47416%2010.0471%209.43238%2010.0461%209.26541C10.0454%209.16306%2010.0835%208.92707%2010.1162%208.83011C10.1697%208.67193%2010.2276%208.58264%2010.3433%208.40408L12.3335%205.3335L14.3237%208.40408C14.4394%208.58264%2014.4973%208.67193%2014.5507%208.83011C14.5835%208.92707%2014.6215%209.16306%2014.6209%209.26541C14.6199%209.43238%2014.6089%209.47416%2014.5871%209.55774Z'%20stroke='white'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",SwitchDark="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='M1.66682%208.66683H5.66682M10.3335%208.66683H14.3335M8.00015%204.66683V14.0002M8.00015%204.66683C8.92063%204.66683%209.66682%203.92064%209.66682%203.00016M8.00015%204.66683C7.07968%204.66683%206.33349%203.92064%206.33349%203.00016M2.66682%2014.0002L13.3335%2014.0002M2.66682%203.00017L6.33349%203.00016M6.33349%203.00016C6.33349%202.07969%207.07968%201.3335%208.00015%201.3335C8.92063%201.3335%209.66682%202.07969%209.66682%203.00016M9.66682%203.00016L13.3335%203.00016M5.92045%209.55774C5.65332%2010.5806%204.74556%2011.3335%203.66682%2011.3335C2.58808%2011.3335%201.68032%2010.5806%201.4132%209.55774C1.39137%209.47416%201.38046%209.43238%201.3794%209.26541C1.37876%209.16306%201.41679%208.92707%201.44956%208.83011C1.50302%208.67193%201.56089%208.58264%201.67663%208.40408L3.66682%205.3335L5.65701%208.40408C5.77275%208.58264%205.83062%208.67193%205.88408%208.83011C5.91685%208.92707%205.95488%209.16306%205.95424%209.26541C5.95319%209.43238%205.94227%209.47416%205.92045%209.55774ZM14.5871%209.55774C14.32%2010.5806%2013.4122%2011.3335%2012.3335%2011.3335C11.2548%2011.3335%2010.347%2010.5806%2010.0799%209.55774C10.058%209.47416%2010.0471%209.43238%2010.0461%209.26541C10.0454%209.16306%2010.0835%208.92707%2010.1162%208.83011C10.1697%208.67193%2010.2276%208.58264%2010.3433%208.40408L12.3335%205.3335L14.3237%208.40408C14.4394%208.58264%2014.4973%208.67193%2014.5507%208.83011C14.5835%208.92707%2014.6215%209.16306%2014.6209%209.26541C14.6199%209.43238%2014.6089%209.47416%2014.5871%209.55774Z'%20stroke='%230C0C0D'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Faucet="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='M21%2015V16.2C21%2017.8802%2021%2018.7202%2020.673%2019.362C20.3854%2019.9265%2019.9265%2020.3854%2019.362%2020.673C18.7202%2021%2017.8802%2021%2016.2%2021H7.8C6.11984%2021%205.27976%2021%204.63803%2020.673C4.07354%2020.3854%203.6146%2019.9265%203.32698%2019.362C3%2018.7202%203%2017.8802%203%2016.2V15M17%2010L12%2015M12%2015L7%2010M12%2015V3'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",FaucetDark="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='M21%2015V16.2C21%2017.8802%2021%2018.7202%2020.673%2019.362C20.3854%2019.9265%2019.9265%2020.3854%2019.362%2020.673C18.7202%2021%2017.8802%2021%2016.2%2021H7.8C6.11984%2021%205.27976%2021%204.63803%2020.673C4.07354%2020.3854%203.6146%2019.9265%203.32698%2019.362C3%2018.7202%203%2017.8802%203%2016.2V15M17%2010L12%2015M12%2015L7%2010M12%2015V3'%20stroke='%230E9384'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",MainnetLight="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='M20.5%207.27734L12%2011.9996M12%2011.9996L3.49997%207.27734M12%2011.9996L12%2021.4996M21%2016.0582V7.94104C21%207.5984%2021%207.42708%2020.9495%207.27428C20.9049%207.1391%2020.8318%207.01502%2020.7354%206.91033C20.6263%206.79199%2020.4766%206.70879%2020.177%206.54239L12.777%202.43128C12.4934%202.27372%2012.3516%202.19494%2012.2015%202.16406C12.0685%202.13672%2011.9315%202.13672%2011.7986%202.16406C11.6484%202.19494%2011.5066%202.27372%2011.223%202.43128L3.82297%206.54239C3.52345%206.70879%203.37369%206.792%203.26463%206.91033C3.16816%207.01502%203.09515%207.1391%203.05048%207.27428C3%207.42708%203%207.5984%203%207.94104V16.0582C3%2016.4008%203%2016.5721%203.05048%2016.7249C3.09515%2016.8601%203.16816%2016.9842%203.26463%2017.0889C3.37369%2017.2072%203.52345%2017.2904%203.82297%2017.4568L11.223%2021.5679C11.5066%2021.7255%2011.6484%2021.8042%2011.7986%2021.8351C11.9315%2021.8625%2012.0685%2021.8625%2012.2015%2021.8351C12.3516%2021.8042%2012.4934%2021.7255%2012.777%2021.5679L20.177%2017.4568C20.4766%2017.2904%2020.6263%2017.2072%2020.7354%2017.0889C20.8318%2016.9842%2020.9049%2016.8601%2020.9495%2016.7249C21%2016.5721%2021%2016.4008%2021%2016.0582Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Mainnet="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='M20.5%207.27734L12%2011.9996M12%2011.9996L3.49997%207.27734M12%2011.9996L12%2021.4996M21%2016.0582V7.94104C21%207.5984%2021%207.42708%2020.9495%207.27428C20.9049%207.1391%2020.8318%207.01502%2020.7354%206.91033C20.6263%206.79199%2020.4766%206.70879%2020.177%206.54239L12.777%202.43128C12.4934%202.27372%2012.3516%202.19494%2012.2015%202.16406C12.0685%202.13672%2011.9315%202.13672%2011.7986%202.16406C11.6484%202.19494%2011.5066%202.27372%2011.223%202.43128L3.82297%206.54239C3.52345%206.70879%203.37369%206.792%203.26463%206.91033C3.16816%207.01502%203.09515%207.1391%203.05048%207.27428C3%207.42708%203%207.5984%203%207.94104V16.0582C3%2016.4008%203%2016.5721%203.05048%2016.7249C3.09515%2016.8601%203.16816%2016.9842%203.26463%2017.0889C3.37369%2017.2072%203.52345%2017.2904%203.82297%2017.4568L11.223%2021.5679C11.5066%2021.7255%2011.6484%2021.8042%2011.7986%2021.8351C11.9315%2021.8625%2012.0685%2021.8625%2012.2015%2021.8351C12.3516%2021.8042%2012.4934%2021.7255%2012.777%2021.5679L20.177%2017.4568C20.4766%2017.2904%2020.6263%2017.2072%2020.7354%2017.0889C20.8318%2016.9842%2020.9049%2016.8601%2020.9495%2016.7249C21%2016.5721%2021%2016.4008%2021%2016.0582Z'%20stroke='%230E9384'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Notification="data:image/svg+xml,%3csvg%20width='20'%20height='22'%20viewBox='0%200%2020%2022'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.35102%2020C8.05615%2020.6224%208.9824%2021%209.99685%2021C11.0113%2021%2011.9375%2020.6224%2012.6427%2020M15.9968%207C15.9968%205.4087%2015.3647%203.88258%2014.2395%202.75736C13.1143%201.63214%2011.5881%201%209.99685%201C8.40555%201%206.87942%201.63214%205.7542%202.75736C4.62899%203.88258%203.99684%205.4087%203.99684%207C3.99684%2010.0902%203.21731%2012.206%202.34651%2013.6054C1.61197%2014.7859%201.2447%2015.3761%201.25817%2015.5408C1.27308%2015.7231%201.3117%2015.7926%201.45862%2015.9016C1.5913%2016%202.18944%2016%203.3857%2016H16.608C17.8043%2016%2018.4024%2016%2018.5351%2015.9016C18.682%2015.7926%2018.7206%2015.7231%2018.7355%2015.5408C18.749%2015.3761%2018.3817%2014.7859%2017.6472%2013.6054C16.7764%2012.206%2015.9968%2010.0902%2015.9968%207Z'%20stroke='%23777879'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Coins="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='M10.101%204C11.3636%202.76281%2013.0927%202%2015%202C18.866%202%2022%205.13401%2022%209C22%2010.9073%2021.2372%2012.6365%2019.9999%2013.899M16%2015C16%2018.866%2012.866%2022%209%2022C5.13401%2022%202%2018.866%202%2015C2%2011.134%205.13401%208%209%208C12.866%208%2016%2011.134%2016%2015Z'%20stroke='%23777879'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",CoinsGreen="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_3439_10652)'%3e%3cpath%20d='M6.73417%202.66659C7.57587%201.84179%208.72863%201.33325%2010.0002%201.33325C12.5775%201.33325%2014.6668%203.42259%2014.6668%205.99992C14.6668%207.27148%2014.1583%208.42425%2013.3335%209.26595M10.6668%209.99992C10.6668%2012.5772%208.57749%2014.6666%206.00016%2014.6666C3.42283%2014.6666%201.3335%2012.5772%201.3335%209.99992C1.3335%207.42259%203.42283%205.33325%206.00016%205.33325C8.57749%205.33325%2010.6668%207.42259%2010.6668%209.99992Z'%20stroke='%232ED3B7'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3439_10652'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",CoinsBlack="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_3377_8889)'%3e%3cpath%20d='M6.73393%202.66659C7.57562%201.84179%208.72838%201.33325%209.99992%201.33325C12.5772%201.33325%2014.6666%203.42259%2014.6666%205.99992C14.6666%207.27148%2014.158%208.42425%2013.3332%209.26595M10.6666%209.99992C10.6666%2012.5772%208.57725%2014.6666%205.99992%2014.6666C3.42259%2014.6666%201.33325%2012.5772%201.33325%209.99992C1.33325%207.42259%203.42259%205.33325%205.99992%205.33325C8.57725%205.33325%2010.6666%207.42259%2010.6666%209.99992Z'%20stroke='black'%20stroke-opacity='0.8'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3377_8889'%3e%3crect%20width='16'%20height='16'%20fill='black'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Bell="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='M9.35395%2021C10.0591%2021.6224%2010.9853%2022%2011.9998%2022C13.0142%2022%2013.9405%2021.6224%2014.6456%2021M17.9998%208C17.9998%206.4087%2017.3676%204.88258%2016.2424%203.75736C15.1172%202.63214%2013.5911%202%2011.9998%202C10.4085%202%208.88235%202.63214%207.75713%203.75736C6.63192%204.88258%205.99977%206.4087%205.99977%208C5.99977%2011.0902%205.22024%2013.206%204.34944%2014.6054C3.6149%2015.7859%203.24763%2016.3761%203.2611%2016.5408C3.27601%2016.7231%203.31463%2016.7926%203.46155%2016.9016C3.59423%2017%204.19237%2017%205.38863%2017H18.6109C19.8072%2017%2020.4053%2017%2020.538%2016.9016C20.6849%2016.7926%2020.7235%2016.7231%2020.7384%2016.5408C20.7519%2016.3761%2020.3846%2015.7859%2019.6501%2014.6054C18.7793%2013.206%2017.9998%2011.0902%2017.9998%208Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",BellDark="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='M9.35395%2021C10.0591%2021.6224%2010.9853%2022%2011.9998%2022C13.0142%2022%2013.9405%2021.6224%2014.6456%2021M17.9998%208C17.9998%206.4087%2017.3676%204.88258%2016.2424%203.75736C15.1172%202.63214%2013.5911%202%2011.9998%202C10.4085%202%208.88235%202.63214%207.75713%203.75736C6.63192%204.88258%205.99977%206.4087%205.99977%208C5.99977%2011.0902%205.22024%2013.206%204.34944%2014.6054C3.6149%2015.7859%203.24763%2016.3761%203.2611%2016.5408C3.27601%2016.7231%203.31463%2016.7926%203.46155%2016.9016C3.59423%2017%204.19237%2017%205.38863%2017H18.6109C19.8072%2017%2020.4053%2017%2020.538%2016.9016C20.6849%2016.7926%2020.7235%2016.7231%2020.7384%2016.5408C20.7519%2016.3761%2020.3846%2015.7859%2019.6501%2014.6054C18.7793%2013.206%2017.9998%2011.0902%2017.9998%208Z'%20stroke='%230E9384'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",BellInactive="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='M9.35395%2021C10.0591%2021.6224%2010.9853%2022%2011.9998%2022C13.0142%2022%2013.9405%2021.6224%2014.6456%2021M17.9998%208C17.9998%206.4087%2017.3676%204.88258%2016.2424%203.75736C15.1172%202.63214%2013.5911%202%2011.9998%202C10.4085%202%208.88235%202.63214%207.75713%203.75736C6.63192%204.88258%205.99977%206.4087%205.99977%208C5.99977%2011.0902%205.22024%2013.206%204.34944%2014.6054C3.6149%2015.7859%203.24763%2016.3761%203.2611%2016.5408C3.27601%2016.7231%203.31463%2016.7926%203.46155%2016.9016C3.59423%2017%204.19237%2017%205.38863%2017H18.6109C19.8072%2017%2020.4053%2017%2020.538%2016.9016C20.6849%2016.7926%2020.7235%2016.7231%2020.7384%2016.5408C20.7519%2016.3761%2020.3846%2015.7859%2019.6501%2014.6054C18.7793%2013.206%2017.9998%2011.0902%2017.9998%208Z'%20stroke='%23777879'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",close="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.4081%203.41559C20.189%202.6347%2020.189%201.36655%2019.4081%200.585663C18.6272%20-0.195221%2017.359%20-0.195221%2016.5782%200.585663L10%207.17008L3.41559%200.59191C2.6347%20-0.188974%201.36655%20-0.188974%200.585663%200.59191C-0.195221%201.37279%20-0.195221%202.64095%200.585663%203.42183L7.17008%2010L0.59191%2016.5844C-0.188974%2017.3653%20-0.188974%2018.6335%200.59191%2019.4143C1.37279%2020.1952%202.64095%2020.1952%203.42183%2019.4143L10%2012.8299L16.5844%2019.4081C17.3653%2020.189%2018.6335%2020.189%2019.4143%2019.4081C20.1952%2018.6272%2020.1952%2017.359%2019.4143%2016.5782L12.8299%2010L19.4081%203.41559Z'%20fill='white'/%3e%3c/svg%3e",CloseBlack="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.4081%203.41559C20.189%202.6347%2020.189%201.36655%2019.4081%200.585663C18.6272%20-0.195221%2017.359%20-0.195221%2016.5782%200.585663L10%207.17008L3.41559%200.59191C2.6347%20-0.188974%201.36655%20-0.188974%200.585663%200.59191C-0.195221%201.37279%20-0.195221%202.64095%200.585663%203.42183L7.17008%2010L0.59191%2016.5844C-0.188974%2017.3653%20-0.188974%2018.6335%200.59191%2019.4143C1.37279%2020.1952%202.64095%2020.1952%203.42183%2019.4143L10%2012.8299L16.5844%2019.4081C17.3653%2020.189%2018.6335%2020.189%2019.4143%2019.4081C20.1952%2018.6272%2020.1952%2017.359%2019.4143%2016.5782L12.8299%2010L19.4081%203.41559Z'%20fill='black'/%3e%3c/svg%3e",t$3=Symbol(),s$3=Object.getPrototypeOf,c$6=new WeakMap,l$4=Fn=>Fn&&(c$6.has(Fn)?c$6.get(Fn):s$3(Fn)===Object.prototype||s$3(Fn)===Array.prototype),y$5=Fn=>l$4(Fn)&&Fn[t$3]||null,h$6=(Fn,Mn=!0)=>{c$6.set(Fn,Mn)},__vite_import_meta_env__={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_ARBITRUM_BTC_CALL_CONTROLLER_ADDRESS:"0x88e7a3A04384B873121A3D4D8c7260C30a17f9b6",VITE_ARBITRUM_BTC_CALL_LONGTOKEN_ADDRESS:"0x849A6746D6235087593789184215B16a09353b58",VITE_ARBITRUM_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0x0f4f76a9DC0C9e5920928D443BD56a9910B9d440",VITE_ARBITRUM_BTC_CALL_SHORTTOKEN_ADDRESS:"0x7204F3591EfA344D7Db30A93B53f7ee896407A46",VITE_ARBITRUM_BTC_CALL_VAULT_ADDRESS:"0x1EF72E09cdcc719994Df01ef420413c387afF523",VITE_ARBITRUM_BTC_PUT_CONTROLLER_ADDRESS:"0x023b95F123d9F1f7c501cBC0Ff119C1148ae244d",VITE_ARBITRUM_BTC_PUT_LONGTOKEN_ADDRESS:"0x2A1be4b228e486d33988549b72fc0EDE7c67DfeC",VITE_ARBITRUM_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x6d635c3059C42e661D4f4D1aB3Ad7ad8Cb21a0ea",VITE_ARBITRUM_BTC_PUT_SHORTTOKEN_ADDRESS:"0x1ca634Fc2ba18EF9e23a1a4f50C204Fccee5b959",VITE_ARBITRUM_BTC_PUT_VAULT_ADDRESS:"0xCF4cb0D6058f6a0a2599997CB66EaC0AeBdB4be4",VITE_ARBITRUM_CANDLE_INTERVAL:"1",VITE_ARBITRUM_CHAIN_ID:"421614",VITE_ARBITRUM_CHAIN_ID_HEX:"0x66eee",VITE_ARBITRUM_CHAIN_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_CONNECT_NETWORK_NAME:"arbitrumSepolia",VITE_ARBITRUM_CYCLE_DURATION:"5",VITE_ARBITRUM_ETH_CALL_CONTROLLER_ADDRESS:"0xFf72B4fBCCeC5a01554BeE50595E999B84c4b5cd",VITE_ARBITRUM_ETH_CALL_LONGTOKEN_ADDRESS:"0x331D8e8e0ad743F3A1908734106051a21A79a809",VITE_ARBITRUM_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5f9A93b04De5fCFd4FA552Bab87927B4F7811283",VITE_ARBITRUM_ETH_CALL_SHORTTOKEN_ADDRESS:"0xe5a3222720347c3ABAD046D69C16f97B3f69D6e6",VITE_ARBITRUM_ETH_CALL_VAULT_ADDRESS:"0x3d2D17Dd22AAF2b5E78aC8287e91D94c6f293264",VITE_ARBITRUM_ETH_PUT_CONTROLLER_ADDRESS:"0x7113e58c3E35E4adcF49f8C94915541BF3c0b54b",VITE_ARBITRUM_ETH_PUT_LONGTOKEN_ADDRESS:"0x623AC047de297c98B0a300299D66334Fb6653334",VITE_ARBITRUM_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x8BD2f0d7713AF3Fbd1bCd4837D6B0dEE2424BF62",VITE_ARBITRUM_ETH_PUT_SHORTTOKEN_ADDRESS:"0x555FaB7E6909d62812a57a22A4e4782fB227943a",VITE_ARBITRUM_ETH_PUT_VAULT_ADDRESS:"0xD5a2e5eC7B7E12E4D13fF0CD86510e5d0ED9f22F",VITE_ARBITRUM_EXPLORER_LINK:"https://sepolia.arbiscan.io",VITE_ARBITRUM_FAUCET_URL:"https://www.alchemy.com/faucets/arbitrum-sepolia",VITE_ARBITRUM_GAS_MULTIPLIER:"200",VITE_ARBITRUM_INFO_AGGREGATOR_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_ARBITRUM_NATIVE_TOKEN:"Arbitrum ETH",VITE_ARBITRUM_NATIVE_TOKEN_DECIMALS:"18",VITE_ARBITRUM_NATIVE_TOKEN_NAME:"ETH",VITE_ARBITRUM_NATIVE_TOKEN_SYMBOL:"ETH",VITE_ARBITRUM_NETWORK_NAME:"Arbitrum Sepolia",VITE_ARBITRUM_PEPE_CALL_CONTROLLER_ADDRESS:"0x9e4c0853D182280dDb07700E754f5164870b19b8",VITE_ARBITRUM_PEPE_CALL_LONGTOKEN_ADDRESS:"0x59c5c8cAf2f35711D6AeB3aB10d9C0941332c8C1",VITE_ARBITRUM_PEPE_CALL_SETTLEMENTMANAGER_ADDRESS:"0x5b7B8058f9E42f5E1a1c8a5777e4fc7337ea388e",VITE_ARBITRUM_PEPE_CALL_SHORTTOKEN_ADDRESS:"0x2A92e73FB8E70245d8e5a02796Fbd337f218a2b3",VITE_ARBITRUM_PEPE_CALL_VAULT_ADDRESS:"0x47D92807f3DD509ca9263ad89869eedc2c929d8D",VITE_ARBITRUM_PEPE_PUT_CONTROLLER_ADDRESS:"0x335Aa597E78Ce41df4BFC5d8Fb239CE788549Fbf",VITE_ARBITRUM_PEPE_PUT_LONGTOKEN_ADDRESS:"0x0833370393c95F6248B0993f72115049a17C7e2B",VITE_ARBITRUM_PEPE_PUT_SETTLEMENTMANAGER_ADDRESS:"0xcF237Eaf46ec94003CF6BAfcB2d7ec1bdD9760aa",VITE_ARBITRUM_PEPE_PUT_SHORTTOKEN_ADDRESS:"0xDf148c772598A24eA94A96FA6556D53EBED5E248",VITE_ARBITRUM_PEPE_PUT_VAULT_ADDRESS:"0x6A1Fd2267bC482C8D5833F6cE54e34951b6554cf",VITE_ARBITRUM_PREMIUM_PER_CYCLE:"0.5",VITE_ARBITRUM_PUBLIC_RPC:"https://arbitrum-sepolia.blockpi.network/v1/rpc/public",VITE_ARBITRUM_RPC:"https://greatest-falling-patron.arbitrum-sepolia.quiknode.pro/933e64a18e212561d0a0fdab953df2fdc1c06080",VITE_ARBITRUM_SCRAPPING_TIME:"30",VITE_ARBITRUM_SETTLEMENT_TOKEN_ADDRESS:"0x30B74a8766563DbAbAf04e0FFE392817F2D02Da1",VITE_ARBITRUM_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_ARBITRUM_WIF_CALL_CONTROLLER_ADDRESS:"0x4871807209e54b608e5844107Cf06Bcf12129F80",VITE_ARBITRUM_WIF_CALL_LONGTOKEN_ADDRESS:"0xa8DdE51B13C7d81b4D9c2c8EAa2E79bB828d82C4",VITE_ARBITRUM_WIF_CALL_SETTLEMENTMANAGER_ADDRESS:"0x583855075C098F2Cd7b2dA5995a2B329f0aE0f3c",VITE_ARBITRUM_WIF_CALL_SHORTTOKEN_ADDRESS:"0x582071a082189236f41527339DBb56B0c111CD6E",VITE_ARBITRUM_WIF_CALL_VAULT_ADDRESS:"0xFbd0Df32C6f75374B4b4Cb03f405932b4eeAC199",VITE_ARBITRUM_WIF_PUT_CONTROLLER_ADDRESS:"0x463377730eCaa7310Dcb3A3d48aDE097A23Bdd42",VITE_ARBITRUM_WIF_PUT_LONGTOKEN_ADDRESS:"0x607324341E75a5a51959a7b541cC8Fd7576e3066",VITE_ARBITRUM_WIF_PUT_SETTLEMENTMANAGER_ADDRESS:"0xFaA4AbaF2890958B200A04AE4cB2880Ad929d8A9",VITE_ARBITRUM_WIF_PUT_SHORTTOKEN_ADDRESS:"0x3FD0b87A9b30738F8086f0c2fDDe469687250FEb",VITE_ARBITRUM_WIF_PUT_VAULT_ADDRESS:"0x4C585D80bDDa554278F909bA51F2E42A2d5f5b96",VITE_BACKEND_URL:"https://switch-testnet-backend.kanalabs.io",VITE_BINANCE_BTC_CALL_CONTROLLER_ADDRESS:"0xC0028f1E9493bdba1670E8C65284f43F897D16d4",VITE_BINANCE_BTC_CALL_LONGTOKEN_ADDRESS:"0xA3fD705798AF4FA090B4dC95E97Ffb353a576969",VITE_BINANCE_BTC_CALL_SETTLEMENTMANAGER_ADDRESS:"0xd38fd86FCCBf8DE9102d7C3D82799432D0B8da32",VITE_BINANCE_BTC_CALL_SHORTTOKEN_ADDRESS:"0xCaEC56628DCe5709F6B17De68C3431f45D4aBc37",VITE_BINANCE_BTC_CALL_VAULT_ADDRESS:"0x2fdbb070D4767cb11fe176CE48986aF222830437",VITE_BINANCE_BTC_PUT_CONTROLLER_ADDRESS:"0xBd99Fdae11A55E41e9ce1Cb27F2A6182dB579af8",VITE_BINANCE_BTC_PUT_LONGTOKEN_ADDRESS:"0x5E7f282a9Cd7BF64fD4EccD13b34703D7F27333d",VITE_BINANCE_BTC_PUT_SETTLEMENTMANAGER_ADDRESS:"0x9f3D3a8D3f0215Fe2D7692096DBC4b097EF5D963",VITE_BINANCE_BTC_PUT_SHORTTOKEN_ADDRESS:"0x7961F22D5931a510b40f740a005339109243Ca30",VITE_BINANCE_BTC_PUT_VAULT_ADDRESS:"0xaaBbF2bC143F59ab731C48FD687a14a8c30F2383",VITE_BINANCE_CANDLE_INTERVAL:"15",VITE_BINANCE_CHAIN_ID:"97",VITE_BINANCE_CHAIN_ID_HEX:"0x61",VITE_BINANCE_CHAIN_NAME:"BNB Smart Chain Testnet",VITE_BINANCE_CONNECT_NETWORK_NAME:"bscTestnet",VITE_BINANCE_CYCLE_DURATION:"120",VITE_BINANCE_ETH_CALL_CONTROLLER_ADDRESS:"0x9e35EDB90CF67A455Dc54418363bd6EC8fd0750d",VITE_BINANCE_ETH_CALL_LONGTOKEN_ADDRESS:"0x264821A828df29D027AF824Fb8A3a9cCCfbfB4bE",VITE_BINANCE_ETH_CALL_SETTLEMENTMANAGER_ADDRESS:"0xbfE633B7A33e75EfD4af4522666a1c8eac4b3b65",VITE_BINANCE_ETH_CALL_SHORTTOKEN_ADDRESS:"0xE649a5a93224F6dc9bD9d5934A93b28F0a153956",VITE_BINANCE_ETH_CALL_VAULT_ADDRESS:"0x1E88b5ffd67313aC35cb13b4574284a1856047a3",VITE_BINANCE_ETH_PUT_CONTROLLER_ADDRESS:"0x3a577c95f96990E7741F8c07568476bA84567356",VITE_BINANCE_ETH_PUT_LONGTOKEN_ADDRESS:"0x85Be1e660e9D0BCcD610Cd7881c6028A8e8f000b",VITE_BINANCE_ETH_PUT_SETTLEMENTMANAGER_ADDRESS:"0x254FF4CFa3d7dd1829B408243266870266f841CA",VITE_BINANCE_ETH_PUT_SHORTTOKEN_ADDRESS:"0x7051898114C8347fea6a2dcd6E3606D3FB31508F",VITE_BINANCE_ETH_PUT_VAULT_ADDRESS:"0x1FEF214CAdc20AB09562ECa67408e2cda49518A2",VITE_BINANCE_EXPLORER_LINK:"https://testnet.bscscan.com",VITE_BINANCE_FAUCET_URL:"https://testnet.bnbchain.org/faucet-smart",VITE_BINANCE_GAS_MULTIPLIER:"110",VITE_BINANCE_INFO_AGGREGATOR_ADDRESS:"0x3DFc4c69bce8e9455EafE3f429590fa9De5f128d",VITE_BINANCE_NATIVE_TOKEN:"tBNB",VITE_BINANCE_NATIVE_TOKEN_DECIMALS:"18",VITE_BINANCE_NATIVE_TOKEN_NAME:"tBNB",VITE_BINANCE_NATIVE_TOKEN_SYMBOL:"tBNB",VITE_BINANCE_NETWORK_NAME:"Binance Testnet",VITE_BINANCE_PREMIUM_PER_CYCLE:"0.5",VITE_BINANCE_PUBLIC_RPC:"https://endpoints.omniatech.io/v1/bsc/testnet/public",VITE_BINANCE_RPC:"https://cold-burned-general.bsc-testnet.quiknode.pro/5dc69c2182e7f66da44461e6dde3d7d786575a30/",VITE_BINANCE_SCRAPPING_TIME:"300",VITE_BINANCE_SETTLEMENT_TOKEN_ADDRESS:"0xDD0020ffDD1B371189778954Cf556B2979b0D33d",VITE_BINANCE_SETTLEMENT_TOKEN_DECIMALS:"6",VITE_CHAIN_TOKEN_ARRAY:"BINANCE_ETH,BINANCE_BTC,ARBITRUM_ETH,ARBITRUM_PEPE",VITE_CIPHERDATA:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjRlYjViZDZhOWNmNDE2YzJmNzc3ZjU2OTg3ODkzNWE4OTBlMTc5NDdjODUyZmRjMzNlYjU1NmZmNzNkZjE5OGUyODU1NTg4NGNkYzM1ZWMwZjQwNzZkMWE4M2RhNTFiM2ZjYTA1YmQ1YTBlNTIwZGViZGVkZTViNzQ5NjdlMGEwIn0.b7ECWqqAvXtC8fblJcVKLO0GKBxa7rfNDtUwsnAaUno",VITE_MORALIS_API_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjM1MGU5MDEyLTU1Y2MtNDZkMi1iZTRkLWU2YTNhNTFmYzIxYyIsIm9yZ0lkIjoiMzczNjA3IiwidXNlcklkIjoiMzgzOTUxIiwidHlwZUlkIjoiYTBlZWJlNWYtMjQ3Ny00NTRjLWFlMDEtYmIxMThjYzliNjZiIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MDU5MTM4MTMsImV4cCI6NDg2MTY3MzgxM30.6ChaPKm5D80_qsZMnlsCoSumD2z9gkBWSP7wwoCAido",VITE_NETWORK:"TESTNET",VITE_PAYMASTER_API_KEY:"6kz6vdwgdbzs3w55jbn45chhhkw7yq8yk",VITE_QUICKNODE_KEY:"f2d17d0c3e7ac54189a60dad8133a533c4b4e945",VITE_VERCEL_BRANCH_URL:"kana-operps-frontend-git-testnet-operps-projects.vercel.app",VITE_VERCEL_ENV:"preview",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"operps",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"operps",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Merge pull request #409 from operps/devnet

Devnet`,VITE_VERCEL_GIT_COMMIT_REF:"testnet",VITE_VERCEL_GIT_COMMIT_SHA:"226178a17dbaec9ac480571ddea005cdee23e6a9",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"800575360",VITE_VERCEL_GIT_REPO_OWNER:"operps",VITE_VERCEL_GIT_REPO_SLUG:"kana-operps-frontend",VITE_VERCEL_PROJECT_PRODUCTION_URL:"operps.kanalabs.io",VITE_VERCEL_URL:"kana-operps-frontend-1n78omxub-operps-projects.vercel.app",VITE_WALLETCONNECTPROJECTID:"b8d15d96157934a210eb13769a539caa"},isObject$2=Fn=>typeof Fn=="object"&&Fn!==null,proxyStateMap=new WeakMap,refSet=new WeakSet,buildProxyFunction=(Fn=Object.is,Mn=(ps,io)=>new Proxy(ps,io),rs=ps=>isObject$2(ps)&&!refSet.has(ps)&&(Array.isArray(ps)||!(Symbol.iterator in ps))&&!(ps instanceof WeakMap)&&!(ps instanceof WeakSet)&&!(ps instanceof Error)&&!(ps instanceof Number)&&!(ps instanceof Date)&&!(ps instanceof String)&&!(ps instanceof RegExp)&&!(ps instanceof ArrayBuffer),is=ps=>{switch(ps.status){case"fulfilled":return ps.value;case"rejected":throw ps.reason;default:throw ps}},os=new WeakMap,as=(ps,io,fo=is)=>{const mo=os.get(ps);if((mo==null?void 0:mo[0])===io)return mo[1];const Ao=Array.isArray(ps)?[]:Object.create(Object.getPrototypeOf(ps));return h$6(Ao,!0),os.set(ps,[io,Ao]),Reflect.ownKeys(ps).forEach($o=>{if(Object.getOwnPropertyDescriptor(Ao,$o))return;const Lo=Reflect.get(ps,$o),Go={value:Lo,enumerable:!0,configurable:!0};if(refSet.has(Lo))h$6(Lo,!1);else if(Lo instanceof Promise)delete Go.value,Go.get=()=>fo(Lo);else if(proxyStateMap.has(Lo)){const[Yo,Wo]=proxyStateMap.get(Lo);Go.value=as(Yo,Wo(),fo)}Object.defineProperty(Ao,$o,Go)}),Object.preventExtensions(Ao)},us=new WeakMap,ds=[1,1],hs=ps=>{if(!isObject$2(ps))throw new Error("object required");const io=us.get(ps);if(io)return io;let fo=ds[0];const mo=new Set,Ao=(Pl,Dl=++ds[0])=>{fo!==Dl&&(fo=Dl,mo.forEach(Ol=>Ol(Pl,Dl)))};let $o=ds[1];const Lo=(Pl=++ds[1])=>($o!==Pl&&!mo.size&&($o=Pl,Yo.forEach(([Dl])=>{const Ol=Dl[1](Pl);Ol>fo&&(fo=Ol)})),fo),Go=Pl=>(Dl,Ol)=>{const Rl=[...Dl];Rl[1]=[Pl,...Rl[1]],Ao(Rl,Ol)},Yo=new Map,Wo=(Pl,Dl)=>{if((__vite_import_meta_env__?"production":void 0)!=="production"&&Yo.has(Pl))throw new Error("prop listener already exists");if(mo.size){const Ol=Dl[3](Go(Pl));Yo.set(Pl,[Dl,Ol])}else Yo.set(Pl,[Dl])},Jo=Pl=>{var Dl;const Ol=Yo.get(Pl);Ol&&(Yo.delete(Pl),(Dl=Ol[1])==null||Dl.call(Ol))},xl=Pl=>(mo.add(Pl),mo.size===1&&Yo.forEach(([Ol,Rl],Vo)=>{if((__vite_import_meta_env__?"production":void 0)!=="production"&&Rl)throw new Error("remove already exists");const jo=Ol[3](Go(Vo));Yo.set(Vo,[Ol,jo])}),()=>{mo.delete(Pl),mo.size===0&&Yo.forEach(([Ol,Rl],Vo)=>{Rl&&(Rl(),Yo.set(Vo,[Ol]))})}),_l=Array.isArray(ps)?[]:Object.create(Object.getPrototypeOf(ps)),Sl=Mn(_l,{deleteProperty(Pl,Dl){const Ol=Reflect.get(Pl,Dl);Jo(Dl);const Rl=Reflect.deleteProperty(Pl,Dl);return Rl&&Ao(["delete",[Dl],Ol]),Rl},set(Pl,Dl,Ol,Rl){const Vo=Reflect.has(Pl,Dl),jo=Reflect.get(Pl,Dl,Rl);if(Vo&&(Fn(jo,Ol)||us.has(Ol)&&Fn(jo,us.get(Ol))))return!0;Jo(Dl),isObject$2(Ol)&&(Ol=y$5(Ol)||Ol);let Ho=Ol;if(Ol instanceof Promise)Ol.then(Qo=>{Ol.status="fulfilled",Ol.value=Qo,Ao(["resolve",[Dl],Qo])}).catch(Qo=>{Ol.status="rejected",Ol.reason=Qo,Ao(["reject",[Dl],Qo])});else{!proxyStateMap.has(Ol)&&rs(Ol)&&(Ho=hs(Ol));const Qo=!refSet.has(Ho)&&proxyStateMap.get(Ho);Qo&&Wo(Dl,Qo)}return Reflect.set(Pl,Dl,Ho,Rl),Ao(["set",[Dl],Ol,jo]),!0}});us.set(ps,Sl);const $l=[_l,Lo,as,xl];return proxyStateMap.set(Sl,$l),Reflect.ownKeys(ps).forEach(Pl=>{const Dl=Object.getOwnPropertyDescriptor(ps,Pl);"value"in Dl&&(Sl[Pl]=ps[Pl],delete Dl.value,delete Dl.writable),Object.defineProperty(_l,Pl,Dl)}),Sl})=>[hs,proxyStateMap,refSet,Fn,Mn,rs,is,os,as,us,ds],[defaultProxyFunction]=buildProxyFunction();function proxy(Fn={}){return defaultProxyFunction(Fn)}function subscribe(Fn,Mn,rs){const is=proxyStateMap.get(Fn);(__vite_import_meta_env__?"production":void 0)!=="production"&&!is&&console.warn("Please use proxy object");let os;const as=[],us=is[3];let ds=!1;const ps=us(io=>{as.push(io),os||(os=Promise.resolve().then(()=>{os=void 0,ds&&Mn(as.splice(0))}))});return ds=!0,()=>{ds=!1,ps()}}function snapshot(Fn,Mn){const rs=proxyStateMap.get(Fn);(__vite_import_meta_env__?"production":void 0)!=="production"&&!rs&&console.warn("Please use proxy object");const[is,os,as]=rs;return as(is,os(),Mn)}function ref(Fn){return refSet.add(Fn),Fn}function subscribeKey(Fn,Mn,rs,is){let os=Fn[Mn];return subscribe(Fn,()=>{const as=Fn[Mn];Object.is(os,as)||rs(os=as)})}function proxyMap(Fn){const Mn=proxy({data:Array.from([]),has(rs){return this.data.some(is=>is[0]===rs)},set(rs,is){const os=this.data.find(as=>as[0]===rs);return os?os[1]=is:this.data.push([rs,is]),this},get(rs){var is;return(is=this.data.find(os=>os[0]===rs))==null?void 0:is[1]},delete(rs){const is=this.data.findIndex(os=>os[0]===rs);return is===-1?!1:(this.data.splice(is,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(rs){this.data.forEach(is=>{rs(is[1],is[0],this)})},keys(){return this.data.map(rs=>rs[0]).values()},values(){return this.data.map(rs=>rs[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(Mn,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(Mn),Mn}var dayjs_min={exports:{}};(function(Fn,Mn){(function(rs,is){Fn.exports=is()})(commonjsGlobal,function(){var rs=1e3,is=6e4,os=36e5,as="millisecond",us="second",ds="minute",hs="hour",ps="day",io="week",fo="month",mo="quarter",Ao="year",$o="date",Lo="Invalid Date",Go=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Yo=/\[([^\]]+)]|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,Wo={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(jo){var Ho=["th","st","nd","rd"],Qo=jo%100;return"["+jo+(Ho[(Qo-20)%10]||Ho[Qo]||Ho[0])+"]"}},Jo=function(jo,Ho,Qo){var El=String(jo);return!El||El.length>=Ho?jo:""+Array(Ho+1-El.length).join(Qo)+jo},xl={s:Jo,z:function(jo){var Ho=-jo.utcOffset(),Qo=Math.abs(Ho),El=Math.floor(Qo/60),Xo=Qo%60;return(Ho<=0?"+":"-")+Jo(El,2,"0")+":"+Jo(Xo,2,"0")},m:function jo(Ho,Qo){if(Ho.date()<Qo.date())return-jo(Qo,Ho);var El=12*(Qo.year()-Ho.year())+(Qo.month()-Ho.month()),Xo=Ho.clone().add(El,fo),Al=Qo-Xo<0,wl=Ho.clone().add(El+(Al?-1:1),fo);return+(-(El+(Qo-Xo)/(Al?Xo-wl:wl-Xo))||0)},a:function(jo){return jo<0?Math.ceil(jo)||0:Math.floor(jo)},p:function(jo){return{M:fo,y:Ao,w:io,d:ps,D:$o,h:hs,m:ds,s:us,ms:as,Q:mo}[jo]||String(jo||"").toLowerCase().replace(/s$/,"")},u:function(jo){return jo===void 0}},_l="en",Tl={};Tl[_l]=Wo;var Sl="$isDayjsObject",$l=function(jo){return jo instanceof Rl||!(!jo||!jo[Sl])},Pl=function jo(Ho,Qo,El){var Xo;if(!Ho)return _l;if(typeof Ho=="string"){var Al=Ho.toLowerCase();Tl[Al]&&(Xo=Al),Qo&&(Tl[Al]=Qo,Xo=Al);var wl=Ho.split("-");if(!Xo&&wl.length>1)return jo(wl[0])}else{var yl=Ho.name;Tl[yl]=Ho,Xo=yl}return!El&&Xo&&(_l=Xo),Xo||!El&&_l},Dl=function(jo,Ho){if($l(jo))return jo.clone();var Qo=typeof Ho=="object"?Ho:{};return Qo.date=jo,Qo.args=arguments,new Rl(Qo)},Ol=xl;Ol.l=Pl,Ol.i=$l,Ol.w=function(jo,Ho){return Dl(jo,{locale:Ho.$L,utc:Ho.$u,x:Ho.$x,$offset:Ho.$offset})};var Rl=function(){function jo(Qo){this.$L=Pl(Qo.locale,null,!0),this.parse(Qo),this.$x=this.$x||Qo.x||{},this[Sl]=!0}var Ho=jo.prototype;return Ho.parse=function(Qo){this.$d=function(El){var Xo=El.date,Al=El.utc;if(Xo===null)return new Date(NaN);if(Ol.u(Xo))return new Date;if(Xo instanceof Date)return new Date(Xo);if(typeof Xo=="string"&&!/Z$/i.test(Xo)){var wl=Xo.match(Go);if(wl){var yl=wl[2]-1||0,Il=(wl[7]||"0").substring(0,3);return Al?new Date(Date.UTC(wl[1],yl,wl[3]||1,wl[4]||0,wl[5]||0,wl[6]||0,Il)):new Date(wl[1],yl,wl[3]||1,wl[4]||0,wl[5]||0,wl[6]||0,Il)}}return new Date(Xo)}(Qo),this.init()},Ho.init=function(){var Qo=this.$d;this.$y=Qo.getFullYear(),this.$M=Qo.getMonth(),this.$D=Qo.getDate(),this.$W=Qo.getDay(),this.$H=Qo.getHours(),this.$m=Qo.getMinutes(),this.$s=Qo.getSeconds(),this.$ms=Qo.getMilliseconds()},Ho.$utils=function(){return Ol},Ho.isValid=function(){return this.$d.toString()!==Lo},Ho.isSame=function(Qo,El){var Xo=Dl(Qo);return this.startOf(El)<=Xo&&Xo<=this.endOf(El)},Ho.isAfter=function(Qo,El){return Dl(Qo)<this.startOf(El)},Ho.isBefore=function(Qo,El){return this.endOf(El)<Dl(Qo)},Ho.$g=function(Qo,El,Xo){return Ol.u(Qo)?this[El]:this.set(Xo,Qo)},Ho.unix=function(){return Math.floor(this.valueOf()/1e3)},Ho.valueOf=function(){return this.$d.getTime()},Ho.startOf=function(Qo,El){var Xo=this,Al=!!Ol.u(El)||El,wl=Ol.p(Qo),yl=function(Yl,Ll){var Zl=Ol.w(Xo.$u?Date.UTC(Xo.$y,Ll,Yl):new Date(Xo.$y,Ll,Yl),Xo);return Al?Zl:Zl.endOf(ps)},Il=function(Yl,Ll){return Ol.w(Xo.toDate()[Yl].apply(Xo.toDate("s"),(Al?[0,0,0,0]:[23,59,59,999]).slice(Ll)),Xo)},Bl=this.$W,Gl=this.$M,Nl=this.$D,zl="set"+(this.$u?"UTC":"");switch(wl){case Ao:return Al?yl(1,0):yl(31,11);case fo:return Al?yl(1,Gl):yl(0,Gl+1);case io:var Vl=this.$locale().weekStart||0,Hl=(Bl<Vl?Bl+7:Bl)-Vl;return yl(Al?Nl-Hl:Nl+(6-Hl),Gl);case ps:case $o:return Il(zl+"Hours",0);case hs:return Il(zl+"Minutes",1);case ds:return Il(zl+"Seconds",2);case us:return Il(zl+"Milliseconds",3);default:return this.clone()}},Ho.endOf=function(Qo){return this.startOf(Qo,!1)},Ho.$set=function(Qo,El){var Xo,Al=Ol.p(Qo),wl="set"+(this.$u?"UTC":""),yl=(Xo={},Xo[ps]=wl+"Date",Xo[$o]=wl+"Date",Xo[fo]=wl+"Month",Xo[Ao]=wl+"FullYear",Xo[hs]=wl+"Hours",Xo[ds]=wl+"Minutes",Xo[us]=wl+"Seconds",Xo[as]=wl+"Milliseconds",Xo)[Al],Il=Al===ps?this.$D+(El-this.$W):El;if(Al===fo||Al===Ao){var Bl=this.clone().set($o,1);Bl.$d[yl](Il),Bl.init(),this.$d=Bl.set($o,Math.min(this.$D,Bl.daysInMonth())).$d}else yl&&this.$d[yl](Il);return this.init(),this},Ho.set=function(Qo,El){return this.clone().$set(Qo,El)},Ho.get=function(Qo){return this[Ol.p(Qo)]()},Ho.add=function(Qo,El){var Xo,Al=this;Qo=Number(Qo);var wl=Ol.p(El),yl=function(Gl){var Nl=Dl(Al);return Ol.w(Nl.date(Nl.date()+Math.round(Gl*Qo)),Al)};if(wl===fo)return this.set(fo,this.$M+Qo);if(wl===Ao)return this.set(Ao,this.$y+Qo);if(wl===ps)return yl(1);if(wl===io)return yl(7);var Il=(Xo={},Xo[ds]=is,Xo[hs]=os,Xo[us]=rs,Xo)[wl]||1,Bl=this.$d.getTime()+Qo*Il;return Ol.w(Bl,this)},Ho.subtract=function(Qo,El){return this.add(-1*Qo,El)},Ho.format=function(Qo){var El=this,Xo=this.$locale();if(!this.isValid())return Xo.invalidDate||Lo;var Al=Qo||"YYYY-MM-DDTHH:mm:ssZ",wl=Ol.z(this),yl=this.$H,Il=this.$m,Bl=this.$M,Gl=Xo.weekdays,Nl=Xo.months,zl=Xo.meridiem,Vl=function(Ll,Zl,Xl,wu){return Ll&&(Ll[Zl]||Ll(El,Al))||Xl[Zl].slice(0,wu)},Hl=function(Ll){return Ol.s(yl%12||12,Ll,"0")},Yl=zl||function(Ll,Zl,Xl){var wu=Ll<12?"AM":"PM";return Xl?wu.toLowerCase():wu};return Al.replace(Yo,function(Ll,Zl){return Zl||function(Xl){switch(Xl){case"YY":return String(El.$y).slice(-2);case"YYYY":return Ol.s(El.$y,4,"0");case"M":return Bl+1;case"MM":return Ol.s(Bl+1,2,"0");case"MMM":return Vl(Xo.monthsShort,Bl,Nl,3);case"MMMM":return Vl(Nl,Bl);case"D":return El.$D;case"DD":return Ol.s(El.$D,2,"0");case"d":return String(El.$W);case"dd":return Vl(Xo.weekdaysMin,El.$W,Gl,2);case"ddd":return Vl(Xo.weekdaysShort,El.$W,Gl,3);case"dddd":return Gl[El.$W];case"H":return String(yl);case"HH":return Ol.s(yl,2,"0");case"h":return Hl(1);case"hh":return Hl(2);case"a":return Yl(yl,Il,!0);case"A":return Yl(yl,Il,!1);case"m":return String(Il);case"mm":return Ol.s(Il,2,"0");case"s":return String(El.$s);case"ss":return Ol.s(El.$s,2,"0");case"SSS":return Ol.s(El.$ms,3,"0");case"Z":return wl}return null}(Ll)||wl.replace(":","")})},Ho.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Ho.diff=function(Qo,El,Xo){var Al,wl=this,yl=Ol.p(El),Il=Dl(Qo),Bl=(Il.utcOffset()-this.utcOffset())*is,Gl=this-Il,Nl=function(){return Ol.m(wl,Il)};switch(yl){case Ao:Al=Nl()/12;break;case fo:Al=Nl();break;case mo:Al=Nl()/3;break;case io:Al=(Gl-Bl)/6048e5;break;case ps:Al=(Gl-Bl)/864e5;break;case hs:Al=Gl/os;break;case ds:Al=Gl/is;break;case us:Al=Gl/rs;break;default:Al=Gl}return Xo?Al:Ol.a(Al)},Ho.daysInMonth=function(){return this.endOf(fo).$D},Ho.$locale=function(){return Tl[this.$L]},Ho.locale=function(Qo,El){if(!Qo)return this.$L;var Xo=this.clone(),Al=Pl(Qo,El,!0);return Al&&(Xo.$L=Al),Xo},Ho.clone=function(){return Ol.w(this.$d,this)},Ho.toDate=function(){return new Date(this.valueOf())},Ho.toJSON=function(){return this.isValid()?this.toISOString():null},Ho.toISOString=function(){return this.$d.toISOString()},Ho.toString=function(){return this.$d.toUTCString()},jo}(),Vo=Rl.prototype;return Dl.prototype=Vo,[["$ms",as],["$s",us],["$m",ds],["$H",hs],["$W",ps],["$M",fo],["$y",Ao],["$D",$o]].forEach(function(jo){Vo[jo[1]]=function(Ho){return this.$g(Ho,jo[0],jo[1])}}),Dl.extend=function(jo,Ho){return jo.$i||(jo(Ho,Rl,Dl),jo.$i=!0),Dl},Dl.locale=Pl,Dl.isDayjs=$l,Dl.unix=function(jo){return Dl(1e3*jo)},Dl.en=Tl[_l],Dl.Ls=Tl,Dl.p={},Dl})})(dayjs_min);var dayjs_minExports=dayjs_min.exports;const dayjs=getDefaultExportFromCjs(dayjs_minExports);var en$3={exports:{}};(function(Fn,Mn){(function(rs,is){Fn.exports=is()})(commonjsGlobal,function(){return{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(rs){var is=["th","st","nd","rd"],os=rs%100;return"["+rs+(is[(os-20)%10]||is[os]||is[0])+"]"}}})})(en$3);var enExports=en$3.exports;const englishLocale=getDefaultExportFromCjs(enExports);var relativeTime$1={exports:{}};(function(Fn,Mn){(function(rs,is){Fn.exports=is()})(commonjsGlobal,function(){return function(rs,is,os){rs=rs||{};var as=is.prototype,us={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ds(ps,io,fo,mo){return as.fromToBase(ps,io,fo,mo)}os.en.relativeTime=us,as.fromToBase=function(ps,io,fo,mo,Ao){for(var $o,Lo,Go,Yo=fo.$locale().relativeTime||us,Wo=rs.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],Jo=Wo.length,xl=0;xl<Jo;xl+=1){var _l=Wo[xl];_l.d&&($o=mo?os(ps).diff(fo,_l.d,!0):fo.diff(ps,_l.d,!0));var Tl=(rs.rounding||Math.round)(Math.abs($o));if(Go=$o>0,Tl<=_l.r||!_l.r){Tl<=1&&xl>0&&(_l=Wo[xl-1]);var Sl=Yo[_l.l];Ao&&(Tl=Ao(""+Tl)),Lo=typeof Sl=="string"?Sl.replace("%d",Tl):Sl(Tl,io,_l.l,Go);break}}if(io)return Lo;var $l=Go?Yo.future:Yo.past;return typeof $l=="function"?$l(Lo):$l.replace("%s",Lo)},as.to=function(ps,io){return ds(ps,io,this,!0)},as.from=function(ps,io){return ds(ps,io,this)};var hs=function(ps){return ps.$u?os.utc():os()};as.toNow=function(ps){return this.to(hs(this),ps)},as.fromNow=function(ps){return this.from(hs(this),ps)}}})})(relativeTime$1);var relativeTimeExports=relativeTime$1.exports;const relativeTime=getDefaultExportFromCjs(relativeTimeExports);var updateLocale$1={exports:{}};(function(Fn,Mn){(function(rs,is){Fn.exports=is()})(commonjsGlobal,function(){return function(rs,is,os){os.updateLocale=function(as,us){var ds=os.Ls[as];if(ds)return(us?Object.keys(us):[]).forEach(function(hs){ds[hs]=us[hs]}),ds}}})})(updateLocale$1);var updateLocaleExports=updateLocale$1.exports;const updateLocale=getDefaultExportFromCjs(updateLocaleExports);dayjs.extend(relativeTime);dayjs.extend(updateLocale);const localeObject={...englishLocale,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}};dayjs.locale("en-web3-modal",localeObject);const DateUtil={getYear(Fn=new Date().toISOString()){return dayjs(Fn).year()},getRelativeDateFromNow(Fn){return dayjs(Fn).locale("en-web3-modal").fromNow(!0)},formatDate(Fn,Mn="DD MMM"){return dayjs(Fn).format(Mn)}},NetworkUtil={caipNetworkIdToNumber(Fn){return Fn?Number(Fn.split(":")[1]):void 0},parseEvmChainId(Fn){return typeof Fn=="string"?this.caipNetworkIdToNumber(Fn):Fn}};var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone$2(Fn){var Mn,rs,is,os=Wo.prototype={constructor:Wo,toString:null,valueOf:null},as=new Wo(1),us=20,ds=4,hs=-7,ps=21,io=-1e7,fo=1e7,mo=!1,Ao=1,$o=0,Lo={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Go="0123456789abcdefghijklmnopqrstuvwxyz",Yo=!0;function Wo($l,Pl){var Dl,Ol,Rl,Vo,jo,Ho,Qo,El,Xo=this;if(!(Xo instanceof Wo))return new Wo($l,Pl);if(Pl==null){if($l&&$l._isBigNumber===!0){Xo.s=$l.s,!$l.c||$l.e>fo?Xo.c=Xo.e=null:$l.e<io?Xo.c=[Xo.e=0]:(Xo.e=$l.e,Xo.c=$l.c.slice());return}if((Ho=typeof $l=="number")&&$l*0==0){if(Xo.s=1/$l<0?($l=-$l,-1):1,$l===~~$l){for(Vo=0,jo=$l;jo>=10;jo/=10,Vo++);Vo>fo?Xo.c=Xo.e=null:(Xo.e=Vo,Xo.c=[$l]);return}El=String($l)}else{if(!isNumeric.test(El=String($l)))return is(Xo,El,Ho);Xo.s=El.charCodeAt(0)==45?(El=El.slice(1),-1):1}(Vo=El.indexOf("."))>-1&&(El=El.replace(".","")),(jo=El.search(/e/i))>0?(Vo<0&&(Vo=jo),Vo+=+El.slice(jo+1),El=El.substring(0,jo)):Vo<0&&(Vo=El.length)}else{if(intCheck(Pl,2,Go.length,"Base"),Pl==10&&Yo)return Xo=new Wo($l),Tl(Xo,us+Xo.e+1,ds);if(El=String($l),Ho=typeof $l=="number"){if($l*0!=0)return is(Xo,El,Ho,Pl);if(Xo.s=1/$l<0?(El=El.slice(1),-1):1,Wo.DEBUG&&El.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+$l)}else Xo.s=El.charCodeAt(0)===45?(El=El.slice(1),-1):1;for(Dl=Go.slice(0,Pl),Vo=jo=0,Qo=El.length;jo<Qo;jo++)if(Dl.indexOf(Ol=El.charAt(jo))<0){if(Ol=="."){if(jo>Vo){Vo=Qo;continue}}else if(!Rl&&(El==El.toUpperCase()&&(El=El.toLowerCase())||El==El.toLowerCase()&&(El=El.toUpperCase()))){Rl=!0,jo=-1,Vo=0;continue}return is(Xo,String($l),Ho,Pl)}Ho=!1,El=rs(El,Pl,10,Xo.s),(Vo=El.indexOf("."))>-1?El=El.replace(".",""):Vo=El.length}for(jo=0;El.charCodeAt(jo)===48;jo++);for(Qo=El.length;El.charCodeAt(--Qo)===48;);if(El=El.slice(jo,++Qo)){if(Qo-=jo,Ho&&Wo.DEBUG&&Qo>15&&($l>MAX_SAFE_INTEGER||$l!==mathfloor($l)))throw Error(tooManyDigits+Xo.s*$l);if((Vo=Vo-jo-1)>fo)Xo.c=Xo.e=null;else if(Vo<io)Xo.c=[Xo.e=0];else{if(Xo.e=Vo,Xo.c=[],jo=(Vo+1)%LOG_BASE,Vo<0&&(jo+=LOG_BASE),jo<Qo){for(jo&&Xo.c.push(+El.slice(0,jo)),Qo-=LOG_BASE;jo<Qo;)Xo.c.push(+El.slice(jo,jo+=LOG_BASE));jo=LOG_BASE-(El=El.slice(jo)).length}else jo-=Qo;for(;jo--;El+="0");Xo.c.push(+El)}}else Xo.c=[Xo.e=0]}Wo.clone=clone$2,Wo.ROUND_UP=0,Wo.ROUND_DOWN=1,Wo.ROUND_CEIL=2,Wo.ROUND_FLOOR=3,Wo.ROUND_HALF_UP=4,Wo.ROUND_HALF_DOWN=5,Wo.ROUND_HALF_EVEN=6,Wo.ROUND_HALF_CEIL=7,Wo.ROUND_HALF_FLOOR=8,Wo.EUCLID=9,Wo.config=Wo.set=function($l){var Pl,Dl;if($l!=null)if(typeof $l=="object"){if($l.hasOwnProperty(Pl="DECIMAL_PLACES")&&(Dl=$l[Pl],intCheck(Dl,0,MAX,Pl),us=Dl),$l.hasOwnProperty(Pl="ROUNDING_MODE")&&(Dl=$l[Pl],intCheck(Dl,0,8,Pl),ds=Dl),$l.hasOwnProperty(Pl="EXPONENTIAL_AT")&&(Dl=$l[Pl],Dl&&Dl.pop?(intCheck(Dl[0],-MAX,0,Pl),intCheck(Dl[1],0,MAX,Pl),hs=Dl[0],ps=Dl[1]):(intCheck(Dl,-MAX,MAX,Pl),hs=-(ps=Dl<0?-Dl:Dl))),$l.hasOwnProperty(Pl="RANGE"))if(Dl=$l[Pl],Dl&&Dl.pop)intCheck(Dl[0],-MAX,-1,Pl),intCheck(Dl[1],1,MAX,Pl),io=Dl[0],fo=Dl[1];else if(intCheck(Dl,-MAX,MAX,Pl),Dl)io=-(fo=Dl<0?-Dl:Dl);else throw Error(bignumberError+Pl+" cannot be zero: "+Dl);if($l.hasOwnProperty(Pl="CRYPTO"))if(Dl=$l[Pl],Dl===!!Dl)if(Dl)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))mo=Dl;else throw mo=!Dl,Error(bignumberError+"crypto unavailable");else mo=Dl;else throw Error(bignumberError+Pl+" not true or false: "+Dl);if($l.hasOwnProperty(Pl="MODULO_MODE")&&(Dl=$l[Pl],intCheck(Dl,0,9,Pl),Ao=Dl),$l.hasOwnProperty(Pl="POW_PRECISION")&&(Dl=$l[Pl],intCheck(Dl,0,MAX,Pl),$o=Dl),$l.hasOwnProperty(Pl="FORMAT"))if(Dl=$l[Pl],typeof Dl=="object")Lo=Dl;else throw Error(bignumberError+Pl+" not an object: "+Dl);if($l.hasOwnProperty(Pl="ALPHABET"))if(Dl=$l[Pl],typeof Dl=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(Dl))Yo=Dl.slice(0,10)=="0123456789",Go=Dl;else throw Error(bignumberError+Pl+" invalid: "+Dl)}else throw Error(bignumberError+"Object expected: "+$l);return{DECIMAL_PLACES:us,ROUNDING_MODE:ds,EXPONENTIAL_AT:[hs,ps],RANGE:[io,fo],CRYPTO:mo,MODULO_MODE:Ao,POW_PRECISION:$o,FORMAT:Lo,ALPHABET:Go}},Wo.isBigNumber=function($l){if(!$l||$l._isBigNumber!==!0)return!1;if(!Wo.DEBUG)return!0;var Pl,Dl,Ol=$l.c,Rl=$l.e,Vo=$l.s;e:if({}.toString.call(Ol)=="[object Array]"){if((Vo===1||Vo===-1)&&Rl>=-MAX&&Rl<=MAX&&Rl===mathfloor(Rl)){if(Ol[0]===0){if(Rl===0&&Ol.length===1)return!0;break e}if(Pl=(Rl+1)%LOG_BASE,Pl<1&&(Pl+=LOG_BASE),String(Ol[0]).length==Pl){for(Pl=0;Pl<Ol.length;Pl++)if(Dl=Ol[Pl],Dl<0||Dl>=BASE||Dl!==mathfloor(Dl))break e;if(Dl!==0)return!0}}}else if(Ol===null&&Rl===null&&(Vo===null||Vo===1||Vo===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+$l)},Wo.maximum=Wo.max=function(){return xl(arguments,-1)},Wo.minimum=Wo.min=function(){return xl(arguments,1)},Wo.random=function(){var $l=9007199254740992,Pl=Math.random()*$l&2097151?function(){return mathfloor(Math.random()*$l)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(Dl){var Ol,Rl,Vo,jo,Ho,Qo=0,El=[],Xo=new Wo(as);if(Dl==null?Dl=us:intCheck(Dl,0,MAX),jo=mathceil(Dl/LOG_BASE),mo)if(crypto.getRandomValues){for(Ol=crypto.getRandomValues(new Uint32Array(jo*=2));Qo<jo;)Ho=Ol[Qo]*131072+(Ol[Qo+1]>>>11),Ho>=9e15?(Rl=crypto.getRandomValues(new Uint32Array(2)),Ol[Qo]=Rl[0],Ol[Qo+1]=Rl[1]):(El.push(Ho%1e14),Qo+=2);Qo=jo/2}else if(crypto.randomBytes){for(Ol=crypto.randomBytes(jo*=7);Qo<jo;)Ho=(Ol[Qo]&31)*281474976710656+Ol[Qo+1]*1099511627776+Ol[Qo+2]*4294967296+Ol[Qo+3]*16777216+(Ol[Qo+4]<<16)+(Ol[Qo+5]<<8)+Ol[Qo+6],Ho>=9e15?crypto.randomBytes(7).copy(Ol,Qo):(El.push(Ho%1e14),Qo+=7);Qo=jo/7}else throw mo=!1,Error(bignumberError+"crypto unavailable");if(!mo)for(;Qo<jo;)Ho=Pl(),Ho<9e15&&(El[Qo++]=Ho%1e14);for(jo=El[--Qo],Dl%=LOG_BASE,jo&&Dl&&(Ho=POWS_TEN[LOG_BASE-Dl],El[Qo]=mathfloor(jo/Ho)*Ho);El[Qo]===0;El.pop(),Qo--);if(Qo<0)El=[Vo=0];else{for(Vo=-1;El[0]===0;El.splice(0,1),Vo-=LOG_BASE);for(Qo=1,Ho=El[0];Ho>=10;Ho/=10,Qo++);Qo<LOG_BASE&&(Vo-=LOG_BASE-Qo)}return Xo.e=Vo,Xo.c=El,Xo}}(),Wo.sum=function(){for(var $l=1,Pl=arguments,Dl=new Wo(Pl[0]);$l<Pl.length;)Dl=Dl.plus(Pl[$l++]);return Dl},rs=function(){var $l="0123456789";function Pl(Dl,Ol,Rl,Vo){for(var jo,Ho=[0],Qo,El=0,Xo=Dl.length;El<Xo;){for(Qo=Ho.length;Qo--;Ho[Qo]*=Ol);for(Ho[0]+=Vo.indexOf(Dl.charAt(El++)),jo=0;jo<Ho.length;jo++)Ho[jo]>Rl-1&&(Ho[jo+1]==null&&(Ho[jo+1]=0),Ho[jo+1]+=Ho[jo]/Rl|0,Ho[jo]%=Rl)}return Ho.reverse()}return function(Dl,Ol,Rl,Vo,jo){var Ho,Qo,El,Xo,Al,wl,yl,Il,Bl=Dl.indexOf("."),Gl=us,Nl=ds;for(Bl>=0&&(Xo=$o,$o=0,Dl=Dl.replace(".",""),Il=new Wo(Ol),wl=Il.pow(Dl.length-Bl),$o=Xo,Il.c=Pl(toFixedPoint(coeffToString(wl.c),wl.e,"0"),10,Rl,$l),Il.e=Il.c.length),yl=Pl(Dl,Ol,Rl,jo?(Ho=Go,$l):(Ho=$l,Go)),El=Xo=yl.length;yl[--Xo]==0;yl.pop());if(!yl[0])return Ho.charAt(0);if(Bl<0?--El:(wl.c=yl,wl.e=El,wl.s=Vo,wl=Mn(wl,Il,Gl,Nl,Rl),yl=wl.c,Al=wl.r,El=wl.e),Qo=El+Gl+1,Bl=yl[Qo],Xo=Rl/2,Al=Al||Qo<0||yl[Qo+1]!=null,Al=Nl<4?(Bl!=null||Al)&&(Nl==0||Nl==(wl.s<0?3:2)):Bl>Xo||Bl==Xo&&(Nl==4||Al||Nl==6&&yl[Qo-1]&1||Nl==(wl.s<0?8:7)),Qo<1||!yl[0])Dl=Al?toFixedPoint(Ho.charAt(1),-Gl,Ho.charAt(0)):Ho.charAt(0);else{if(yl.length=Qo,Al)for(--Rl;++yl[--Qo]>Rl;)yl[Qo]=0,Qo||(++El,yl=[1].concat(yl));for(Xo=yl.length;!yl[--Xo];);for(Bl=0,Dl="";Bl<=Xo;Dl+=Ho.charAt(yl[Bl++]));Dl=toFixedPoint(Dl,El,Ho.charAt(0))}return Dl}}(),Mn=function(){function $l(Ol,Rl,Vo){var jo,Ho,Qo,El,Xo=0,Al=Ol.length,wl=Rl%SQRT_BASE,yl=Rl/SQRT_BASE|0;for(Ol=Ol.slice();Al--;)Qo=Ol[Al]%SQRT_BASE,El=Ol[Al]/SQRT_BASE|0,jo=yl*Qo+El*wl,Ho=wl*Qo+jo%SQRT_BASE*SQRT_BASE+Xo,Xo=(Ho/Vo|0)+(jo/SQRT_BASE|0)+yl*El,Ol[Al]=Ho%Vo;return Xo&&(Ol=[Xo].concat(Ol)),Ol}function Pl(Ol,Rl,Vo,jo){var Ho,Qo;if(Vo!=jo)Qo=Vo>jo?1:-1;else for(Ho=Qo=0;Ho<Vo;Ho++)if(Ol[Ho]!=Rl[Ho]){Qo=Ol[Ho]>Rl[Ho]?1:-1;break}return Qo}function Dl(Ol,Rl,Vo,jo){for(var Ho=0;Vo--;)Ol[Vo]-=Ho,Ho=Ol[Vo]<Rl[Vo]?1:0,Ol[Vo]=Ho*jo+Ol[Vo]-Rl[Vo];for(;!Ol[0]&&Ol.length>1;Ol.splice(0,1));}return function(Ol,Rl,Vo,jo,Ho){var Qo,El,Xo,Al,wl,yl,Il,Bl,Gl,Nl,zl,Vl,Hl,Yl,Ll,Zl,Xl,wu=Ol.s==Rl.s?1:-1,yu=Ol.c,rp=Rl.c;if(!yu||!yu[0]||!rp||!rp[0])return new Wo(!Ol.s||!Rl.s||(yu?rp&&yu[0]==rp[0]:!rp)?NaN:yu&&yu[0]==0||!rp?wu*0:wu/0);for(Bl=new Wo(wu),Gl=Bl.c=[],El=Ol.e-Rl.e,wu=Vo+El+1,Ho||(Ho=BASE,El=bitFloor(Ol.e/LOG_BASE)-bitFloor(Rl.e/LOG_BASE),wu=wu/LOG_BASE|0),Xo=0;rp[Xo]==(yu[Xo]||0);Xo++);if(rp[Xo]>(yu[Xo]||0)&&El--,wu<0)Gl.push(1),Al=!0;else{for(Yl=yu.length,Zl=rp.length,Xo=0,wu+=2,wl=mathfloor(Ho/(rp[0]+1)),wl>1&&(rp=$l(rp,wl,Ho),yu=$l(yu,wl,Ho),Zl=rp.length,Yl=yu.length),Hl=Zl,Nl=yu.slice(0,Zl),zl=Nl.length;zl<Zl;Nl[zl++]=0);Xl=rp.slice(),Xl=[0].concat(Xl),Ll=rp[0],rp[1]>=Ho/2&&Ll++;do{if(wl=0,Qo=Pl(rp,Nl,Zl,zl),Qo<0){if(Vl=Nl[0],Zl!=zl&&(Vl=Vl*Ho+(Nl[1]||0)),wl=mathfloor(Vl/Ll),wl>1)for(wl>=Ho&&(wl=Ho-1),yl=$l(rp,wl,Ho),Il=yl.length,zl=Nl.length;Pl(yl,Nl,Il,zl)==1;)wl--,Dl(yl,Zl<Il?Xl:rp,Il,Ho),Il=yl.length,Qo=1;else wl==0&&(Qo=wl=1),yl=rp.slice(),Il=yl.length;if(Il<zl&&(yl=[0].concat(yl)),Dl(Nl,yl,zl,Ho),zl=Nl.length,Qo==-1)for(;Pl(rp,Nl,Zl,zl)<1;)wl++,Dl(Nl,Zl<zl?Xl:rp,zl,Ho),zl=Nl.length}else Qo===0&&(wl++,Nl=[0]);Gl[Xo++]=wl,Nl[0]?Nl[zl++]=yu[Hl]||0:(Nl=[yu[Hl]],zl=1)}while((Hl++<Yl||Nl[0]!=null)&&wu--);Al=Nl[0]!=null,Gl[0]||Gl.splice(0,1)}if(Ho==BASE){for(Xo=1,wu=Gl[0];wu>=10;wu/=10,Xo++);Tl(Bl,Vo+(Bl.e=Xo+El*LOG_BASE-1)+1,jo,Al)}else Bl.e=El,Bl.r=+Al;return Bl}}();function Jo($l,Pl,Dl,Ol){var Rl,Vo,jo,Ho,Qo;if(Dl==null?Dl=ds:intCheck(Dl,0,8),!$l.c)return $l.toString();if(Rl=$l.c[0],jo=$l.e,Pl==null)Qo=coeffToString($l.c),Qo=Ol==1||Ol==2&&(jo<=hs||jo>=ps)?toExponential(Qo,jo):toFixedPoint(Qo,jo,"0");else if($l=Tl(new Wo($l),Pl,Dl),Vo=$l.e,Qo=coeffToString($l.c),Ho=Qo.length,Ol==1||Ol==2&&(Pl<=Vo||Vo<=hs)){for(;Ho<Pl;Qo+="0",Ho++);Qo=toExponential(Qo,Vo)}else if(Pl-=jo,Qo=toFixedPoint(Qo,Vo,"0"),Vo+1>Ho){if(--Pl>0)for(Qo+=".";Pl--;Qo+="0");}else if(Pl+=Vo-Ho,Pl>0)for(Vo+1==Ho&&(Qo+=".");Pl--;Qo+="0");return $l.s<0&&Rl?"-"+Qo:Qo}function xl($l,Pl){for(var Dl,Ol,Rl=1,Vo=new Wo($l[0]);Rl<$l.length;Rl++)Ol=new Wo($l[Rl]),(!Ol.s||(Dl=compare$1(Vo,Ol))===Pl||Dl===0&&Vo.s===Pl)&&(Vo=Ol);return Vo}function _l($l,Pl,Dl){for(var Ol=1,Rl=Pl.length;!Pl[--Rl];Pl.pop());for(Rl=Pl[0];Rl>=10;Rl/=10,Ol++);return(Dl=Ol+Dl*LOG_BASE-1)>fo?$l.c=$l.e=null:Dl<io?$l.c=[$l.e=0]:($l.e=Dl,$l.c=Pl),$l}is=function(){var $l=/^(-?)0([xbo])(?=\w[\w.]*$)/i,Pl=/^([^.]+)\.$/,Dl=/^\.([^.]+)$/,Ol=/^-?(Infinity|NaN)$/,Rl=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(Vo,jo,Ho,Qo){var El,Xo=Ho?jo:jo.replace(Rl,"");if(Ol.test(Xo))Vo.s=isNaN(Xo)?null:Xo<0?-1:1;else{if(!Ho&&(Xo=Xo.replace($l,function(Al,wl,yl){return El=(yl=yl.toLowerCase())=="x"?16:yl=="b"?2:8,!Qo||Qo==El?wl:Al}),Qo&&(El=Qo,Xo=Xo.replace(Pl,"$1").replace(Dl,"0.$1")),jo!=Xo))return new Wo(Xo,El);if(Wo.DEBUG)throw Error(bignumberError+"Not a"+(Qo?" base "+Qo:"")+" number: "+jo);Vo.s=null}Vo.c=Vo.e=null}}();function Tl($l,Pl,Dl,Ol){var Rl,Vo,jo,Ho,Qo,El,Xo,Al=$l.c,wl=POWS_TEN;if(Al){e:{for(Rl=1,Ho=Al[0];Ho>=10;Ho/=10,Rl++);if(Vo=Pl-Rl,Vo<0)Vo+=LOG_BASE,jo=Pl,Qo=Al[El=0],Xo=mathfloor(Qo/wl[Rl-jo-1]%10);else if(El=mathceil((Vo+1)/LOG_BASE),El>=Al.length)if(Ol){for(;Al.length<=El;Al.push(0));Qo=Xo=0,Rl=1,Vo%=LOG_BASE,jo=Vo-LOG_BASE+1}else break e;else{for(Qo=Ho=Al[El],Rl=1;Ho>=10;Ho/=10,Rl++);Vo%=LOG_BASE,jo=Vo-LOG_BASE+Rl,Xo=jo<0?0:mathfloor(Qo/wl[Rl-jo-1]%10)}if(Ol=Ol||Pl<0||Al[El+1]!=null||(jo<0?Qo:Qo%wl[Rl-jo-1]),Ol=Dl<4?(Xo||Ol)&&(Dl==0||Dl==($l.s<0?3:2)):Xo>5||Xo==5&&(Dl==4||Ol||Dl==6&&(Vo>0?jo>0?Qo/wl[Rl-jo]:0:Al[El-1])%10&1||Dl==($l.s<0?8:7)),Pl<1||!Al[0])return Al.length=0,Ol?(Pl-=$l.e+1,Al[0]=wl[(LOG_BASE-Pl%LOG_BASE)%LOG_BASE],$l.e=-Pl||0):Al[0]=$l.e=0,$l;if(Vo==0?(Al.length=El,Ho=1,El--):(Al.length=El+1,Ho=wl[LOG_BASE-Vo],Al[El]=jo>0?mathfloor(Qo/wl[Rl-jo]%wl[jo])*Ho:0),Ol)for(;;)if(El==0){for(Vo=1,jo=Al[0];jo>=10;jo/=10,Vo++);for(jo=Al[0]+=Ho,Ho=1;jo>=10;jo/=10,Ho++);Vo!=Ho&&($l.e++,Al[0]==BASE&&(Al[0]=1));break}else{if(Al[El]+=Ho,Al[El]!=BASE)break;Al[El--]=0,Ho=1}for(Vo=Al.length;Al[--Vo]===0;Al.pop());}$l.e>fo?$l.c=$l.e=null:$l.e<io&&($l.c=[$l.e=0])}return $l}function Sl($l){var Pl,Dl=$l.e;return Dl===null?$l.toString():(Pl=coeffToString($l.c),Pl=Dl<=hs||Dl>=ps?toExponential(Pl,Dl):toFixedPoint(Pl,Dl,"0"),$l.s<0?"-"+Pl:Pl)}return os.absoluteValue=os.abs=function(){var $l=new Wo(this);return $l.s<0&&($l.s=1),$l},os.comparedTo=function($l,Pl){return compare$1(this,new Wo($l,Pl))},os.decimalPlaces=os.dp=function($l,Pl){var Dl,Ol,Rl,Vo=this;if($l!=null)return intCheck($l,0,MAX),Pl==null?Pl=ds:intCheck(Pl,0,8),Tl(new Wo(Vo),$l+Vo.e+1,Pl);if(!(Dl=Vo.c))return null;if(Ol=((Rl=Dl.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,Rl=Dl[Rl])for(;Rl%10==0;Rl/=10,Ol--);return Ol<0&&(Ol=0),Ol},os.dividedBy=os.div=function($l,Pl){return Mn(this,new Wo($l,Pl),us,ds)},os.dividedToIntegerBy=os.idiv=function($l,Pl){return Mn(this,new Wo($l,Pl),0,1)},os.exponentiatedBy=os.pow=function($l,Pl){var Dl,Ol,Rl,Vo,jo,Ho,Qo,El,Xo,Al=this;if($l=new Wo($l),$l.c&&!$l.isInteger())throw Error(bignumberError+"Exponent not an integer: "+Sl($l));if(Pl!=null&&(Pl=new Wo(Pl)),Ho=$l.e>14,!Al.c||!Al.c[0]||Al.c[0]==1&&!Al.e&&Al.c.length==1||!$l.c||!$l.c[0])return Xo=new Wo(Math.pow(+Sl(Al),Ho?$l.s*(2-isOdd($l)):+Sl($l))),Pl?Xo.mod(Pl):Xo;if(Qo=$l.s<0,Pl){if(Pl.c?!Pl.c[0]:!Pl.s)return new Wo(NaN);Ol=!Qo&&Al.isInteger()&&Pl.isInteger(),Ol&&(Al=Al.mod(Pl))}else{if($l.e>9&&(Al.e>0||Al.e<-1||(Al.e==0?Al.c[0]>1||Ho&&Al.c[1]>=24e7:Al.c[0]<8e13||Ho&&Al.c[0]<=9999975e7)))return Vo=Al.s<0&&isOdd($l)?-0:0,Al.e>-1&&(Vo=1/Vo),new Wo(Qo?1/Vo:Vo);$o&&(Vo=mathceil($o/LOG_BASE+2))}for(Ho?(Dl=new Wo(.5),Qo&&($l.s=1),El=isOdd($l)):(Rl=Math.abs(+Sl($l)),El=Rl%2),Xo=new Wo(as);;){if(El){if(Xo=Xo.times(Al),!Xo.c)break;Vo?Xo.c.length>Vo&&(Xo.c.length=Vo):Ol&&(Xo=Xo.mod(Pl))}if(Rl){if(Rl=mathfloor(Rl/2),Rl===0)break;El=Rl%2}else if($l=$l.times(Dl),Tl($l,$l.e+1,1),$l.e>14)El=isOdd($l);else{if(Rl=+Sl($l),Rl===0)break;El=Rl%2}Al=Al.times(Al),Vo?Al.c&&Al.c.length>Vo&&(Al.c.length=Vo):Ol&&(Al=Al.mod(Pl))}return Ol?Xo:(Qo&&(Xo=as.div(Xo)),Pl?Xo.mod(Pl):Vo?Tl(Xo,$o,ds,jo):Xo)},os.integerValue=function($l){var Pl=new Wo(this);return $l==null?$l=ds:intCheck($l,0,8),Tl(Pl,Pl.e+1,$l)},os.isEqualTo=os.eq=function($l,Pl){return compare$1(this,new Wo($l,Pl))===0},os.isFinite=function(){return!!this.c},os.isGreaterThan=os.gt=function($l,Pl){return compare$1(this,new Wo($l,Pl))>0},os.isGreaterThanOrEqualTo=os.gte=function($l,Pl){return(Pl=compare$1(this,new Wo($l,Pl)))===1||Pl===0},os.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},os.isLessThan=os.lt=function($l,Pl){return compare$1(this,new Wo($l,Pl))<0},os.isLessThanOrEqualTo=os.lte=function($l,Pl){return(Pl=compare$1(this,new Wo($l,Pl)))===-1||Pl===0},os.isNaN=function(){return!this.s},os.isNegative=function(){return this.s<0},os.isPositive=function(){return this.s>0},os.isZero=function(){return!!this.c&&this.c[0]==0},os.minus=function($l,Pl){var Dl,Ol,Rl,Vo,jo=this,Ho=jo.s;if($l=new Wo($l,Pl),Pl=$l.s,!Ho||!Pl)return new Wo(NaN);if(Ho!=Pl)return $l.s=-Pl,jo.plus($l);var Qo=jo.e/LOG_BASE,El=$l.e/LOG_BASE,Xo=jo.c,Al=$l.c;if(!Qo||!El){if(!Xo||!Al)return Xo?($l.s=-Pl,$l):new Wo(Al?jo:NaN);if(!Xo[0]||!Al[0])return Al[0]?($l.s=-Pl,$l):new Wo(Xo[0]?jo:ds==3?-0:0)}if(Qo=bitFloor(Qo),El=bitFloor(El),Xo=Xo.slice(),Ho=Qo-El){for((Vo=Ho<0)?(Ho=-Ho,Rl=Xo):(El=Qo,Rl=Al),Rl.reverse(),Pl=Ho;Pl--;Rl.push(0));Rl.reverse()}else for(Ol=(Vo=(Ho=Xo.length)<(Pl=Al.length))?Ho:Pl,Ho=Pl=0;Pl<Ol;Pl++)if(Xo[Pl]!=Al[Pl]){Vo=Xo[Pl]<Al[Pl];break}if(Vo&&(Rl=Xo,Xo=Al,Al=Rl,$l.s=-$l.s),Pl=(Ol=Al.length)-(Dl=Xo.length),Pl>0)for(;Pl--;Xo[Dl++]=0);for(Pl=BASE-1;Ol>Ho;){if(Xo[--Ol]<Al[Ol]){for(Dl=Ol;Dl&&!Xo[--Dl];Xo[Dl]=Pl);--Xo[Dl],Xo[Ol]+=BASE}Xo[Ol]-=Al[Ol]}for(;Xo[0]==0;Xo.splice(0,1),--El);return Xo[0]?_l($l,Xo,El):($l.s=ds==3?-1:1,$l.c=[$l.e=0],$l)},os.modulo=os.mod=function($l,Pl){var Dl,Ol,Rl=this;return $l=new Wo($l,Pl),!Rl.c||!$l.s||$l.c&&!$l.c[0]?new Wo(NaN):!$l.c||Rl.c&&!Rl.c[0]?new Wo(Rl):(Ao==9?(Ol=$l.s,$l.s=1,Dl=Mn(Rl,$l,0,3),$l.s=Ol,Dl.s*=Ol):Dl=Mn(Rl,$l,0,Ao),$l=Rl.minus(Dl.times($l)),!$l.c[0]&&Ao==1&&($l.s=Rl.s),$l)},os.multipliedBy=os.times=function($l,Pl){var Dl,Ol,Rl,Vo,jo,Ho,Qo,El,Xo,Al,wl,yl,Il,Bl,Gl,Nl=this,zl=Nl.c,Vl=($l=new Wo($l,Pl)).c;if(!zl||!Vl||!zl[0]||!Vl[0])return!Nl.s||!$l.s||zl&&!zl[0]&&!Vl||Vl&&!Vl[0]&&!zl?$l.c=$l.e=$l.s=null:($l.s*=Nl.s,!zl||!Vl?$l.c=$l.e=null:($l.c=[0],$l.e=0)),$l;for(Ol=bitFloor(Nl.e/LOG_BASE)+bitFloor($l.e/LOG_BASE),$l.s*=Nl.s,Qo=zl.length,Al=Vl.length,Qo<Al&&(Il=zl,zl=Vl,Vl=Il,Rl=Qo,Qo=Al,Al=Rl),Rl=Qo+Al,Il=[];Rl--;Il.push(0));for(Bl=BASE,Gl=SQRT_BASE,Rl=Al;--Rl>=0;){for(Dl=0,wl=Vl[Rl]%Gl,yl=Vl[Rl]/Gl|0,jo=Qo,Vo=Rl+jo;Vo>Rl;)El=zl[--jo]%Gl,Xo=zl[jo]/Gl|0,Ho=yl*El+Xo*wl,El=wl*El+Ho%Gl*Gl+Il[Vo]+Dl,Dl=(El/Bl|0)+(Ho/Gl|0)+yl*Xo,Il[Vo--]=El%Bl;Il[Vo]=Dl}return Dl?++Ol:Il.splice(0,1),_l($l,Il,Ol)},os.negated=function(){var $l=new Wo(this);return $l.s=-$l.s||null,$l},os.plus=function($l,Pl){var Dl,Ol=this,Rl=Ol.s;if($l=new Wo($l,Pl),Pl=$l.s,!Rl||!Pl)return new Wo(NaN);if(Rl!=Pl)return $l.s=-Pl,Ol.minus($l);var Vo=Ol.e/LOG_BASE,jo=$l.e/LOG_BASE,Ho=Ol.c,Qo=$l.c;if(!Vo||!jo){if(!Ho||!Qo)return new Wo(Rl/0);if(!Ho[0]||!Qo[0])return Qo[0]?$l:new Wo(Ho[0]?Ol:Rl*0)}if(Vo=bitFloor(Vo),jo=bitFloor(jo),Ho=Ho.slice(),Rl=Vo-jo){for(Rl>0?(jo=Vo,Dl=Qo):(Rl=-Rl,Dl=Ho),Dl.reverse();Rl--;Dl.push(0));Dl.reverse()}for(Rl=Ho.length,Pl=Qo.length,Rl-Pl<0&&(Dl=Qo,Qo=Ho,Ho=Dl,Pl=Rl),Rl=0;Pl;)Rl=(Ho[--Pl]=Ho[Pl]+Qo[Pl]+Rl)/BASE|0,Ho[Pl]=BASE===Ho[Pl]?0:Ho[Pl]%BASE;return Rl&&(Ho=[Rl].concat(Ho),++jo),_l($l,Ho,jo)},os.precision=os.sd=function($l,Pl){var Dl,Ol,Rl,Vo=this;if($l!=null&&$l!==!!$l)return intCheck($l,1,MAX),Pl==null?Pl=ds:intCheck(Pl,0,8),Tl(new Wo(Vo),$l,Pl);if(!(Dl=Vo.c))return null;if(Rl=Dl.length-1,Ol=Rl*LOG_BASE+1,Rl=Dl[Rl]){for(;Rl%10==0;Rl/=10,Ol--);for(Rl=Dl[0];Rl>=10;Rl/=10,Ol++);}return $l&&Vo.e+1>Ol&&(Ol=Vo.e+1),Ol},os.shiftedBy=function($l){return intCheck($l,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+$l)},os.squareRoot=os.sqrt=function(){var $l,Pl,Dl,Ol,Rl,Vo=this,jo=Vo.c,Ho=Vo.s,Qo=Vo.e,El=us+4,Xo=new Wo("0.5");if(Ho!==1||!jo||!jo[0])return new Wo(!Ho||Ho<0&&(!jo||jo[0])?NaN:jo?Vo:1/0);if(Ho=Math.sqrt(+Sl(Vo)),Ho==0||Ho==1/0?(Pl=coeffToString(jo),(Pl.length+Qo)%2==0&&(Pl+="0"),Ho=Math.sqrt(+Pl),Qo=bitFloor((Qo+1)/2)-(Qo<0||Qo%2),Ho==1/0?Pl="5e"+Qo:(Pl=Ho.toExponential(),Pl=Pl.slice(0,Pl.indexOf("e")+1)+Qo),Dl=new Wo(Pl)):Dl=new Wo(Ho+""),Dl.c[0]){for(Qo=Dl.e,Ho=Qo+El,Ho<3&&(Ho=0);;)if(Rl=Dl,Dl=Xo.times(Rl.plus(Mn(Vo,Rl,El,1))),coeffToString(Rl.c).slice(0,Ho)===(Pl=coeffToString(Dl.c)).slice(0,Ho))if(Dl.e<Qo&&--Ho,Pl=Pl.slice(Ho-3,Ho+1),Pl=="9999"||!Ol&&Pl=="4999"){if(!Ol&&(Tl(Rl,Rl.e+us+2,0),Rl.times(Rl).eq(Vo))){Dl=Rl;break}El+=4,Ho+=4,Ol=1}else{(!+Pl||!+Pl.slice(1)&&Pl.charAt(0)=="5")&&(Tl(Dl,Dl.e+us+2,1),$l=!Dl.times(Dl).eq(Vo));break}}return Tl(Dl,Dl.e+us+1,ds,$l)},os.toExponential=function($l,Pl){return $l!=null&&(intCheck($l,0,MAX),$l++),Jo(this,$l,Pl,1)},os.toFixed=function($l,Pl){return $l!=null&&(intCheck($l,0,MAX),$l=$l+this.e+1),Jo(this,$l,Pl)},os.toFormat=function($l,Pl,Dl){var Ol,Rl=this;if(Dl==null)$l!=null&&Pl&&typeof Pl=="object"?(Dl=Pl,Pl=null):$l&&typeof $l=="object"?(Dl=$l,$l=Pl=null):Dl=Lo;else if(typeof Dl!="object")throw Error(bignumberError+"Argument not an object: "+Dl);if(Ol=Rl.toFixed($l,Pl),Rl.c){var Vo,jo=Ol.split("."),Ho=+Dl.groupSize,Qo=+Dl.secondaryGroupSize,El=Dl.groupSeparator||"",Xo=jo[0],Al=jo[1],wl=Rl.s<0,yl=wl?Xo.slice(1):Xo,Il=yl.length;if(Qo&&(Vo=Ho,Ho=Qo,Qo=Vo,Il-=Vo),Ho>0&&Il>0){for(Vo=Il%Ho||Ho,Xo=yl.substr(0,Vo);Vo<Il;Vo+=Ho)Xo+=El+yl.substr(Vo,Ho);Qo>0&&(Xo+=El+yl.slice(Vo)),wl&&(Xo="-"+Xo)}Ol=Al?Xo+(Dl.decimalSeparator||"")+((Qo=+Dl.fractionGroupSize)?Al.replace(new RegExp("\\d{"+Qo+"}\\B","g"),"$&"+(Dl.fractionGroupSeparator||"")):Al):Xo}return(Dl.prefix||"")+Ol+(Dl.suffix||"")},os.toFraction=function($l){var Pl,Dl,Ol,Rl,Vo,jo,Ho,Qo,El,Xo,Al,wl,yl=this,Il=yl.c;if($l!=null&&(Ho=new Wo($l),!Ho.isInteger()&&(Ho.c||Ho.s!==1)||Ho.lt(as)))throw Error(bignumberError+"Argument "+(Ho.isInteger()?"out of range: ":"not an integer: ")+Sl(Ho));if(!Il)return new Wo(yl);for(Pl=new Wo(as),El=Dl=new Wo(as),Ol=Qo=new Wo(as),wl=coeffToString(Il),Vo=Pl.e=wl.length-yl.e-1,Pl.c[0]=POWS_TEN[(jo=Vo%LOG_BASE)<0?LOG_BASE+jo:jo],$l=!$l||Ho.comparedTo(Pl)>0?Vo>0?Pl:El:Ho,jo=fo,fo=1/0,Ho=new Wo(wl),Qo.c[0]=0;Xo=Mn(Ho,Pl,0,1),Rl=Dl.plus(Xo.times(Ol)),Rl.comparedTo($l)!=1;)Dl=Ol,Ol=Rl,El=Qo.plus(Xo.times(Rl=El)),Qo=Rl,Pl=Ho.minus(Xo.times(Rl=Pl)),Ho=Rl;return Rl=Mn($l.minus(Dl),Ol,0,1),Qo=Qo.plus(Rl.times(El)),Dl=Dl.plus(Rl.times(Ol)),Qo.s=El.s=yl.s,Vo=Vo*2,Al=Mn(El,Ol,Vo,ds).minus(yl).abs().comparedTo(Mn(Qo,Dl,Vo,ds).minus(yl).abs())<1?[El,Ol]:[Qo,Dl],fo=jo,Al},os.toNumber=function(){return+Sl(this)},os.toPrecision=function($l,Pl){return $l!=null&&intCheck($l,1,MAX),Jo(this,$l,Pl,2)},os.toString=function($l){var Pl,Dl=this,Ol=Dl.s,Rl=Dl.e;return Rl===null?Ol?(Pl="Infinity",Ol<0&&(Pl="-"+Pl)):Pl="NaN":($l==null?Pl=Rl<=hs||Rl>=ps?toExponential(coeffToString(Dl.c),Rl):toFixedPoint(coeffToString(Dl.c),Rl,"0"):$l===10&&Yo?(Dl=Tl(new Wo(Dl),us+Rl+1,ds),Pl=toFixedPoint(coeffToString(Dl.c),Dl.e,"0")):(intCheck($l,2,Go.length,"Base"),Pl=rs(toFixedPoint(coeffToString(Dl.c),Rl,"0"),10,$l,Ol,!0)),Ol<0&&Dl.c[0]&&(Pl="-"+Pl)),Pl},os.valueOf=os.toJSON=function(){return Sl(this)},os._isBigNumber=!0,os[Symbol.toStringTag]="BigNumber",os[Symbol.for("nodejs.util.inspect.custom")]=os.valueOf,Fn!=null&&Wo.set(Fn),Wo}function bitFloor(Fn){var Mn=Fn|0;return Fn>0||Fn===Mn?Mn:Mn-1}function coeffToString(Fn){for(var Mn,rs,is=1,os=Fn.length,as=Fn[0]+"";is<os;){for(Mn=Fn[is++]+"",rs=LOG_BASE-Mn.length;rs--;Mn="0"+Mn);as+=Mn}for(os=as.length;as.charCodeAt(--os)===48;);return as.slice(0,os+1||1)}function compare$1(Fn,Mn){var rs,is,os=Fn.c,as=Mn.c,us=Fn.s,ds=Mn.s,hs=Fn.e,ps=Mn.e;if(!us||!ds)return null;if(rs=os&&!os[0],is=as&&!as[0],rs||is)return rs?is?0:-ds:us;if(us!=ds)return us;if(rs=us<0,is=hs==ps,!os||!as)return is?0:!os^rs?1:-1;if(!is)return hs>ps^rs?1:-1;for(ds=(hs=os.length)<(ps=as.length)?hs:ps,us=0;us<ds;us++)if(os[us]!=as[us])return os[us]>as[us]^rs?1:-1;return hs==ps?0:hs>ps^rs?1:-1}function intCheck(Fn,Mn,rs,is){if(Fn<Mn||Fn>rs||Fn!==mathfloor(Fn))throw Error(bignumberError+(is||"Argument")+(typeof Fn=="number"?Fn<Mn||Fn>rs?" out of range: ":" not an integer: ":" not a primitive number: ")+String(Fn))}function isOdd(Fn){var Mn=Fn.c.length-1;return bitFloor(Fn.e/LOG_BASE)==Mn&&Fn.c[Mn]%2!=0}function toExponential(Fn,Mn){return(Fn.length>1?Fn.charAt(0)+"."+Fn.slice(1):Fn)+(Mn<0?"e":"e+")+Mn}function toFixedPoint(Fn,Mn,rs){var is,os;if(Mn<0){for(os=rs+".";++Mn;os+=rs);Fn=os+Fn}else if(is=Fn.length,++Mn>is){for(os=rs,Mn-=is;--Mn;os+=rs);Fn+=os}else Mn<is&&(Fn=Fn.slice(0,Mn)+"."+Fn.slice(Mn));return Fn}var BigNumber=clone$2();const NumberUtil={bigNumber(Fn){return new BigNumber(Fn)},multiply(Fn,Mn){if(Fn===void 0||Mn===void 0)return BigNumber(0);const rs=new BigNumber(Fn),is=new BigNumber(Mn);return rs.multipliedBy(is)},formatNumberToLocalString(Fn,Mn=2){return Fn===void 0?"0.00":typeof Fn=="number"?Fn.toLocaleString("en-US",{maximumFractionDigits:Mn,minimumFractionDigits:Mn}):parseFloat(Fn).toLocaleString("en-US",{maximumFractionDigits:Mn,minimumFractionDigits:Mn})}},InputUtil={numericInputKeyDown(Fn,Mn,rs){const is=["Backspace","Meta","Ctrl","a","A","c","C","x","X","v","V","ArrowLeft","ArrowRight","Tab"],os=Fn.metaKey||Fn.ctrlKey,as=Fn.key,us=as.toLocaleLowerCase(),ds=us==="a",hs=us==="c",ps=us==="v",io=us==="x",fo=as===",",mo=as===".",Ao=as>="0"&&as<="9";!os&&(ds||hs||ps||io)&&Fn.preventDefault(),Mn==="0"&&!fo&&!mo&&as==="0"&&Fn.preventDefault(),Mn==="0"&&Ao&&(rs(as),Fn.preventDefault()),(fo||mo)&&(Mn||(rs("0."),Fn.preventDefault()),(Mn!=null&&Mn.includes(".")||Mn!=null&&Mn.includes(","))&&Fn.preventDefault()),!Ao&&!is.includes(as)&&!mo&&!fo&&Fn.preventDefault()}},erc20ABI=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],usdtABI=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],ConstantsUtil$3={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot"},CHAIN_NAME_MAP:{eip155:"Ethereum",solana:"Solana",polkadot:"Polkadot"},USDT_CONTRACT_ADDRESSES:["0xdac17f958d2ee523a2206206994597c13d831ec7","0xc2132d05d31c914a87c6611c10748aeb04b58e8f","0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7","0x919C1c267BC06a7039e03fcc2eF738525769109c","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e","0x55d398326f99059fF775485246999027B3197955","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"]},ContractUtil={getERC20Abi:Fn=>ConstantsUtil$3.USDT_CONTRACT_ADDRESSES.includes(Fn)?usdtABI:erc20ABI},NavigationUtil={URLS:{FAQ:"https://walletconnect.com/faq"}},SafeLocalStorageKeys={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_CONNECTOR:"@appkit/connected_connector",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit/connected_social_username",RECENT_WALLETS:"@appkit/recent_wallets",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE"},SafeLocalStorage={setItem(Fn,Mn){isSafe$1()&&localStorage.setItem(Fn,Mn)},getItem(Fn){if(isSafe$1())return localStorage.getItem(Fn)||void 0},removeItem(Fn){isSafe$1()&&localStorage.removeItem(Fn)},clear(){isSafe$1()&&localStorage.clear()}};function isSafe$1(){return typeof window<"u"&&typeof localStorage<"u"}function getW3mThemeVariables(Fn,Mn){return Mn==="light"?{"--w3m-accent":(Fn==null?void 0:Fn["--w3m-accent"])||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":(Fn==null?void 0:Fn["--w3m-accent"])||"hsla(230, 100%, 67%, 1)","--w3m-background":"#121313"}}function isReownName(Fn){return(Fn==null?void 0:Fn.endsWith(ConstantsUtil$3.WC_NAME_SUFFIX_LEGACY))||(Fn==null?void 0:Fn.endsWith(ConstantsUtil$3.WC_NAME_SUFFIX))}const SECURE_SITE="https://secure.walletconnect.org",ONRAMP_PROVIDERS=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:"",supportedChains:["eip155"]},{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],MELD_PROD_PUBLIC_KEY="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",ConstantsUtil$2={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,FIVE_SEC_MS:5e3,THREE_SEC_MS:3e3,ONE_SEC_MS:1e3,SECURE_SITE,SECURE_SITE_DASHBOARD:`${SECURE_SITE}/dashboard`,SECURE_SITE_FAVICON:`${SECURE_SITE}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e",SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NAMES_SUPPORTED_CHAIN_NAMESPACES:["eip155"],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,CONNECT_LABELS:{MOBILE:"Open and continue in a new browser tab"},DEFAULT_FEATURES:{swaps:!0,onramp:!0,email:!0,emailShowWallets:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],history:!0,analytics:!0,allWallets:!0,smartSessions:!1}},CoreHelperUtil={isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(Fn,Mn=""){return Fn==null?void 0:Fn.caipNetworkId.toLocaleLowerCase().includes(Mn.toLowerCase())},isAndroid(){const Fn=window.navigator.userAgent.toLowerCase();return CoreHelperUtil.isMobile()&&Fn.includes("android")},isIos(){const Fn=window.navigator.userAgent.toLowerCase();return CoreHelperUtil.isMobile()&&(Fn.includes("iphone")||Fn.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(Fn){return Fn?Fn-Date.now()<=ConstantsUtil$2.TEN_SEC_MS:!0},isAllowedRetry(Fn,Mn=ConstantsUtil$2.ONE_SEC_MS){return Date.now()-Fn>=Mn},copyToClopboard(Fn){navigator.clipboard.writeText(Fn)},getPairingExpiry(){return Date.now()+ConstantsUtil$2.FOUR_MINUTES_MS},getNetworkId(Fn){return Fn==null?void 0:Fn.split(":")[1]},getPlainAddress(Fn){return Fn==null?void 0:Fn.split(":")[2]},async wait(Fn){return new Promise(Mn=>{setTimeout(Mn,Fn)})},debounce(Fn,Mn=500){let rs;return(...is)=>{function os(){Fn(...is)}rs&&clearTimeout(rs),rs=setTimeout(os,Mn)}},isHttpUrl(Fn){return Fn.startsWith("http://")||Fn.startsWith("https://")},formatNativeUrl(Fn,Mn){if(CoreHelperUtil.isHttpUrl(Fn))return this.formatUniversalUrl(Fn,Mn);let rs=Fn;rs.includes("://")||(rs=Fn.replaceAll("/","").replaceAll(":",""),rs=`${rs}://`),rs.endsWith("/")||(rs=`${rs}/`),this.isTelegram()&&this.isAndroid()&&(Mn=encodeURIComponent(Mn));const is=encodeURIComponent(Mn);return{redirect:`${rs}wc?uri=${is}`,href:rs}},formatUniversalUrl(Fn,Mn){if(!CoreHelperUtil.isHttpUrl(Fn))return this.formatNativeUrl(Fn,Mn);let rs=Fn;rs.endsWith("/")||(rs=`${rs}/`);const is=encodeURIComponent(Mn);return{redirect:`${rs}wc?uri=${is}`,href:rs}},getOpenTargetForPlatform(Fn){return this.isTelegram()?"_blank":Fn},openHref(Fn,Mn,rs){window.open(Fn,this.getOpenTargetForPlatform(Mn),rs||"noreferrer noopener")},returnOpenHref(Fn,Mn,rs){return window.open(Fn,this.getOpenTargetForPlatform(Mn),rs||"noreferrer noopener")},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},async preloadImage(Fn){const Mn=new Promise((rs,is)=>{const os=new Image;os.onload=rs,os.onerror=is,os.crossOrigin="anonymous",os.src=Fn});return Promise.race([Mn,CoreHelperUtil.wait(2e3)])},formatBalance(Fn,Mn){let rs="0.000";if(typeof Fn=="string"){const is=Number(Fn);if(is){const os=Math.floor(is*1e3)/1e3;os&&(rs=os.toString())}}return`${rs}${Mn?` ${Mn}`:""}`},formatBalance2(Fn,Mn){var is;let rs;if(Fn==="0")rs="0";else if(typeof Fn=="string"){const os=Number(Fn);os&&(rs=(is=os.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:is[0])}return{value:rs??"0",rest:rs==="0"?"000":"",symbol:Mn}},getApiUrl(){return ConstantsUtil$3.W3M_API_URL},getBlockchainApiUrl(){return ConstantsUtil$3.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return ConstantsUtil$3.PULSE_API_URL},getUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,Fn=>{const Mn=Math.random()*16|0;return(Fn==="x"?Mn:Mn&3|8).toString(16)})},parseError(Fn){var Mn,rs;return typeof Fn=="string"?Fn:typeof((rs=(Mn=Fn==null?void 0:Fn.issues)==null?void 0:Mn[0])==null?void 0:rs.message)=="string"?Fn.issues[0].message:Fn instanceof Error?Fn.message:"Unknown error"},sortRequestedNetworks(Fn,Mn=[]){const rs={};return Mn&&Fn&&(Fn.forEach((is,os)=>{rs[is]=os}),Mn.sort((is,os)=>{const as=rs[is.id],us=rs[os.id];return as!==void 0&&us!==void 0?as-us:as!==void 0?-1:us!==void 0?1:0})),Mn},calculateBalance(Fn){let Mn=0;for(const rs of Fn)Mn+=rs.value??0;return Mn},formatTokenBalance(Fn){const Mn=Fn.toFixed(2),[rs,is]=Mn.split(".");return{dollars:rs,pennies:is}},isAddress(Fn,Mn="eip155"){switch(Mn){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(Fn)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(Fn)||/^(?:0x)?[0-9A-F]{40}$/iu.test(Fn))return!0}else return!1;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(Fn);default:return!1}},uniqueBy(Fn,Mn){const rs=new Set;return Fn.filter(is=>{const os=is[Mn];return rs.has(os)?!1:(rs.add(os),!0)})},generateSdkVersion(Fn,Mn,rs){const os=Fn.length===0?"universal":Fn.map(as=>as.adapterType).join(",");return`${Mn}-${os}-${rs}`}};async function fetchData(...Fn){const Mn=await fetch(...Fn);if(!Mn.ok)throw new Error(`HTTP status code: ${Mn.status}`,{cause:Mn});return Mn}class FetchUtil{constructor({baseUrl:Mn,clientId:rs}){this.baseUrl=Mn,this.clientId=rs}async get({headers:Mn,signal:rs,cache:is,...os}){const as=this.createUrl(os);return(await fetchData(as,{method:"GET",headers:Mn,signal:rs,cache:is})).json()}async getBlob({headers:Mn,signal:rs,...is}){const os=this.createUrl(is);return(await fetchData(os,{method:"GET",headers:Mn,signal:rs})).blob()}async post({body:Mn,headers:rs,signal:is,...os}){const as=this.createUrl(os);return(await fetchData(as,{method:"POST",headers:rs,body:Mn?JSON.stringify(Mn):void 0,signal:is})).json()}async put({body:Mn,headers:rs,signal:is,...os}){const as=this.createUrl(os);return(await fetchData(as,{method:"PUT",headers:rs,body:Mn?JSON.stringify(Mn):void 0,signal:is})).json()}async delete({body:Mn,headers:rs,signal:is,...os}){const as=this.createUrl(os);return(await fetchData(as,{method:"DELETE",headers:rs,body:Mn?JSON.stringify(Mn):void 0,signal:is})).json()}createUrl({path:Mn,params:rs}){const is=new URL(Mn,this.baseUrl);return rs&&Object.entries(rs).forEach(([os,as])=>{as&&is.searchParams.append(os,as)}),this.clientId&&is.searchParams.append("clientId",this.clientId),is}}const state$l=proxy({features:ConstantsUtil$2.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined"}),OptionsController={state:state$l,subscribeKey(Fn,Mn){return subscribeKey(state$l,Fn,Mn)},setOptions(Fn){Object.assign(state$l,Fn)},setFeatures(Fn){Fn&&Object.entries(Fn).forEach(([Mn,rs])=>{state$l.features||(state$l.features=ConstantsUtil$2.DEFAULT_FEATURES),Mn in state$l.features&&(state$l.features[Mn]=rs)})},setProjectId(Fn){state$l.projectId=Fn},setAllWallets(Fn){state$l.allWallets=Fn},setIncludeWalletIds(Fn){state$l.includeWalletIds=Fn},setExcludeWalletIds(Fn){state$l.excludeWalletIds=Fn},setFeaturedWalletIds(Fn){state$l.featuredWalletIds=Fn},setTokens(Fn){state$l.tokens=Fn},setTermsConditionsUrl(Fn){state$l.termsConditionsUrl=Fn},setPrivacyPolicyUrl(Fn){state$l.privacyPolicyUrl=Fn},setCustomWallets(Fn){state$l.customWallets=Fn},setIsSiweEnabled(Fn){state$l.isSiweEnabled=Fn},setIsUniversalProvider(Fn){state$l.isUniversalProvider=Fn},setSdkVersion(Fn){state$l.sdkVersion=Fn},setMetadata(Fn){state$l.metadata=Fn},setDisableAppend(Fn){state$l.disableAppend=Fn},setEIP6963Enabled(Fn){state$l.enableEIP6963=Fn},setDebug(Fn){state$l.debug=Fn},setEnableWalletConnect(Fn){state$l.enableWalletConnect=Fn},setEnableWallets(Fn){state$l.enableWallets=Fn},setHasMultipleAddresses(Fn){state$l.hasMultipleAddresses=Fn}},DEFAULT_OPTIONS={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},baseUrl$2=CoreHelperUtil.getBlockchainApiUrl(),state$k=proxy({clientId:null,api:new FetchUtil({baseUrl:baseUrl$2,clientId:null})}),BlockchainApiController={state:state$k,fetchIdentity({address:Fn}){return state$k.api.get({path:`/v1/identity/${Fn}`,params:{projectId:OptionsController.state.projectId,sender:ChainController.state.activeCaipAddress?CoreHelperUtil.getPlainAddress(ChainController.state.activeCaipAddress):void 0}})},fetchTransactions({account:Fn,projectId:Mn,cursor:rs,onramp:is,signal:os,cache:as,chainId:us}){return state$k.api.get({path:`/v1/account/${Fn}/history`,params:{projectId:Mn,cursor:rs,onramp:is,chainId:us},signal:os,cache:as})},fetchSwapQuote({projectId:Fn,amount:Mn,userAddress:rs,from:is,to:os,gasPrice:as}){return state$k.api.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{projectId:Fn,amount:Mn,userAddress:rs,from:is,to:os,gasPrice:as}})},fetchSwapTokens({projectId:Fn,chainId:Mn}){return state$k.api.get({path:"/v1/convert/tokens",params:{projectId:Fn,chainId:Mn}})},fetchTokenPrice({projectId:Fn,addresses:Mn}){return state$k.api.post({path:"/v1/fungible/price",body:{projectId:Fn,currency:"usd",addresses:Mn},headers:{"Content-Type":"application/json"}})},fetchSwapAllowance({projectId:Fn,tokenAddress:Mn,userAddress:rs}){const{sdkType:is,sdkVersion:os}=OptionsController.state;return state$k.api.get({path:"/v1/convert/allowance",params:{projectId:Fn,tokenAddress:Mn,userAddress:rs},headers:{"Content-Type":"application/json","x-sdk-type":is,"x-sdk-version":os||"html-wagmi-4.2.2"}})},fetchGasPrice({projectId:Fn,chainId:Mn}){const{sdkType:rs,sdkVersion:is}=OptionsController.state;return state$k.api.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json","x-sdk-type":rs,"x-sdk-version":is||"html-wagmi-4.2.2"},params:{projectId:Fn,chainId:Mn}})},generateSwapCalldata({amount:Fn,from:Mn,projectId:rs,to:is,userAddress:os}){return state$k.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:Fn,eip155:{slippage:ConstantsUtil$2.CONVERT_SLIPPAGE_TOLERANCE},from:Mn,projectId:rs,to:is,userAddress:os}})},generateApproveCalldata({from:Fn,projectId:Mn,to:rs,userAddress:is}){const{sdkType:os,sdkVersion:as}=OptionsController.state;return state$k.api.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json","x-sdk-type":os,"x-sdk-version":as||"html-wagmi-4.2.2"},params:{projectId:Mn,userAddress:is,from:Fn,to:rs}})},async getBalance(Fn,Mn,rs){const{sdkType:is,sdkVersion:os}=OptionsController.state;return state$k.api.get({path:`/v1/account/${Fn}/balance`,headers:{"x-sdk-type":is,"x-sdk-version":os||"html-wagmi-4.2.2"},params:{currency:"usd",projectId:OptionsController.state.projectId,chainId:Mn,forceUpdate:rs}})},async lookupEnsName(Fn){return state$k.api.get({path:`/v1/profile/account/${Fn}`,params:{projectId:OptionsController.state.projectId,apiVersion:"2"}})},async reverseLookupEnsName({address:Fn}){return state$k.api.get({path:`/v1/profile/reverse/${Fn}`,params:{sender:AccountController.state.address,projectId:OptionsController.state.projectId,apiVersion:"2"}})},async getEnsNameSuggestions(Fn){return state$k.api.get({path:`/v1/profile/suggestions/${Fn}`,params:{projectId:OptionsController.state.projectId,zone:"reown.id"}})},async registerEnsName({coinType:Fn,address:Mn,message:rs,signature:is}){return state$k.api.post({path:"/v1/profile/account",body:{coin_type:Fn,address:Mn,message:rs,signature:is},headers:{"Content-Type":"application/json"}})},async generateOnRampURL({destinationWallets:Fn,partnerUserId:Mn,defaultNetwork:rs,purchaseAmount:is,paymentAmount:os}){return(await state$k.api.post({path:"/v1/generators/onrampurl",params:{projectId:OptionsController.state.projectId},body:{destinationWallets:Fn,defaultNetwork:rs,partnerUserId:Mn,defaultExperience:"buy",presetCryptoAmount:is,presetFiatAmount:os}})).url},async getOnrampOptions(){try{return await state$k.api.get({path:"/v1/onramp/options",params:{projectId:OptionsController.state.projectId}})}catch{return DEFAULT_OPTIONS}},async getOnrampQuote({purchaseCurrency:Fn,paymentCurrency:Mn,amount:rs,network:is}){try{return await state$k.api.post({path:"/v1/onramp/quote",params:{projectId:OptionsController.state.projectId},body:{purchaseCurrency:Fn,paymentCurrency:Mn,amount:rs,network:is}})}catch{return{coinbaseFee:{amount:rs,currency:Mn.id},networkFee:{amount:rs,currency:Mn.id},paymentSubtotal:{amount:rs,currency:Mn.id},paymentTotal:{amount:rs,currency:Mn.id},purchaseAmount:{amount:rs,currency:Mn.id},quoteId:"mocked-quote-id"}}},getSmartSessions(Fn){return state$k.api.get({path:`/v1/sessions/${Fn}`,params:{projectId:OptionsController.state.projectId}})},revokeSmartSession(Fn,Mn,rs){return state$k.api.post({path:`/v1/sessions/${Fn}/revoke`,params:{projectId:OptionsController.state.projectId},body:{pci:Mn,signature:rs}})},setClientId(Fn){state$k.clientId=Fn,state$k.api=new FetchUtil({baseUrl:baseUrl$2,clientId:Fn})}},state$j=proxy({message:"",variant:"success",open:!1}),SnackController={state:state$j,subscribeKey(Fn,Mn){return subscribeKey(state$j,Fn,Mn)},showLoading(Fn){this._showMessage(Fn,"loading")},showSuccess(Fn){this._showMessage(Fn,"success")},showError(Fn){const Mn=CoreHelperUtil.parseError(Fn);this._showMessage(Mn,"error")},hide(){state$j.open=!1},_showMessage(Fn,Mn){state$j.open?(state$j.open=!1,setTimeout(()=>{state$j.message=Fn,state$j.variant=Mn,state$j.open=!0},150)):(state$j.message=Fn,state$j.variant=Mn,state$j.open=!0)}},baseUrl$1=CoreHelperUtil.getAnalyticsUrl(),api$1=new FetchUtil({baseUrl:baseUrl$1,clientId:null}),excluded=["MODAL_CREATED"],state$i=proxy({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),EventsController={state:state$i,subscribe(Fn){return subscribe(state$i,()=>Fn(state$i))},_getApiHeaders(){const{projectId:Fn,sdkType:Mn,sdkVersion:rs}=OptionsController.state;return{"x-project-id":Fn,"x-sdk-type":Mn,"x-sdk-version":rs||"html-wagmi-4.2.2"}},async _sendAnalyticsEvent(Fn){try{if(excluded.includes(Fn.data.event)||typeof window>"u")return;await api$1.post({path:"/e",headers:EventsController._getApiHeaders(),body:{eventId:CoreHelperUtil.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:Fn.timestamp,props:Fn.data}})}catch{}},sendEvent(Fn){var Mn;state$i.timestamp=Date.now(),state$i.data=Fn,(Mn=OptionsController.state.features)!=null&&Mn.analytics&&EventsController._sendAnalyticsEvent(state$i)}};var buffer={},base64Js={};base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i$6=0,len=code.length;i$6<len;++i$6)lookup[i$6]=code[i$6],revLookup[code.charCodeAt(i$6)]=i$6;revLookup[45]=62;revLookup[95]=63;function getLens(Fn){var Mn=Fn.length;if(Mn%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var rs=Fn.indexOf("=");rs===-1&&(rs=Mn);var is=rs===Mn?0:4-rs%4;return[rs,is]}function byteLength(Fn){var Mn=getLens(Fn),rs=Mn[0],is=Mn[1];return(rs+is)*3/4-is}function _byteLength(Fn,Mn,rs){return(Mn+rs)*3/4-rs}function toByteArray(Fn){var Mn,rs=getLens(Fn),is=rs[0],os=rs[1],as=new Arr(_byteLength(Fn,is,os)),us=0,ds=os>0?is-4:is,hs;for(hs=0;hs<ds;hs+=4)Mn=revLookup[Fn.charCodeAt(hs)]<<18|revLookup[Fn.charCodeAt(hs+1)]<<12|revLookup[Fn.charCodeAt(hs+2)]<<6|revLookup[Fn.charCodeAt(hs+3)],as[us++]=Mn>>16&255,as[us++]=Mn>>8&255,as[us++]=Mn&255;return os===2&&(Mn=revLookup[Fn.charCodeAt(hs)]<<2|revLookup[Fn.charCodeAt(hs+1)]>>4,as[us++]=Mn&255),os===1&&(Mn=revLookup[Fn.charCodeAt(hs)]<<10|revLookup[Fn.charCodeAt(hs+1)]<<4|revLookup[Fn.charCodeAt(hs+2)]>>2,as[us++]=Mn>>8&255,as[us++]=Mn&255),as}function tripletToBase64(Fn){return lookup[Fn>>18&63]+lookup[Fn>>12&63]+lookup[Fn>>6&63]+lookup[Fn&63]}function encodeChunk(Fn,Mn,rs){for(var is,os=[],as=Mn;as<rs;as+=3)is=(Fn[as]<<16&16711680)+(Fn[as+1]<<8&65280)+(Fn[as+2]&255),os.push(tripletToBase64(is));return os.join("")}function fromByteArray(Fn){for(var Mn,rs=Fn.length,is=rs%3,os=[],as=16383,us=0,ds=rs-is;us<ds;us+=as)os.push(encodeChunk(Fn,us,us+as>ds?ds:us+as));return is===1?(Mn=Fn[rs-1],os.push(lookup[Mn>>2]+lookup[Mn<<4&63]+"==")):is===2&&(Mn=(Fn[rs-2]<<8)+Fn[rs-1],os.push(lookup[Mn>>10]+lookup[Mn>>4&63]+lookup[Mn<<2&63]+"=")),os.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(Fn,Mn,rs,is,os){var as,us,ds=os*8-is-1,hs=(1<<ds)-1,ps=hs>>1,io=-7,fo=rs?os-1:0,mo=rs?-1:1,Ao=Fn[Mn+fo];for(fo+=mo,as=Ao&(1<<-io)-1,Ao>>=-io,io+=ds;io>0;as=as*256+Fn[Mn+fo],fo+=mo,io-=8);for(us=as&(1<<-io)-1,as>>=-io,io+=is;io>0;us=us*256+Fn[Mn+fo],fo+=mo,io-=8);if(as===0)as=1-ps;else{if(as===hs)return us?NaN:(Ao?-1:1)*(1/0);us=us+Math.pow(2,is),as=as-ps}return(Ao?-1:1)*us*Math.pow(2,as-is)};ieee754.write=function(Fn,Mn,rs,is,os,as){var us,ds,hs,ps=as*8-os-1,io=(1<<ps)-1,fo=io>>1,mo=os===23?Math.pow(2,-24)-Math.pow(2,-77):0,Ao=is?0:as-1,$o=is?1:-1,Lo=Mn<0||Mn===0&&1/Mn<0?1:0;for(Mn=Math.abs(Mn),isNaN(Mn)||Mn===1/0?(ds=isNaN(Mn)?1:0,us=io):(us=Math.floor(Math.log(Mn)/Math.LN2),Mn*(hs=Math.pow(2,-us))<1&&(us--,hs*=2),us+fo>=1?Mn+=mo/hs:Mn+=mo*Math.pow(2,1-fo),Mn*hs>=2&&(us++,hs/=2),us+fo>=io?(ds=0,us=io):us+fo>=1?(ds=(Mn*hs-1)*Math.pow(2,os),us=us+fo):(ds=Mn*Math.pow(2,fo-1)*Math.pow(2,os),us=0));os>=8;Fn[rs+Ao]=ds&255,Ao+=$o,ds/=256,os-=8);for(us=us<<os|ds,ps+=os;ps>0;Fn[rs+Ao]=us&255,Ao+=$o,us/=256,ps-=8);Fn[rs+Ao-$o]|=Lo*128};/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */(function(Fn){const Mn=base64Js,rs=ieee754,is=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Fn.Buffer=ds,Fn.SlowBuffer=Wo,Fn.INSPECT_MAX_BYTES=50;const os=2147483647;Fn.kMaxLength=os,ds.TYPED_ARRAY_SUPPORT=as(),!ds.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function as(){try{const Kl=new Uint8Array(1),Fl={foo:function(){return 42}};return Object.setPrototypeOf(Fl,Uint8Array.prototype),Object.setPrototypeOf(Kl,Fl),Kl.foo()===42}catch{return!1}}Object.defineProperty(ds.prototype,"parent",{enumerable:!0,get:function(){if(ds.isBuffer(this))return this.buffer}}),Object.defineProperty(ds.prototype,"offset",{enumerable:!0,get:function(){if(ds.isBuffer(this))return this.byteOffset}});function us(Kl){if(Kl>os)throw new RangeError('The value "'+Kl+'" is invalid for option "size"');const Fl=new Uint8Array(Kl);return Object.setPrototypeOf(Fl,ds.prototype),Fl}function ds(Kl,Fl,Ul){if(typeof Kl=="number"){if(typeof Fl=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return fo(Kl)}return hs(Kl,Fl,Ul)}ds.poolSize=8192;function hs(Kl,Fl,Ul){if(typeof Kl=="string")return mo(Kl,Fl);if(ArrayBuffer.isView(Kl))return $o(Kl);if(Kl==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Kl);if(gp(Kl,ArrayBuffer)||Kl&&gp(Kl.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(gp(Kl,SharedArrayBuffer)||Kl&&gp(Kl.buffer,SharedArrayBuffer)))return Lo(Kl,Fl,Ul);if(typeof Kl=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Jl=Kl.valueOf&&Kl.valueOf();if(Jl!=null&&Jl!==Kl)return ds.from(Jl,Fl,Ul);const fu=Go(Kl);if(fu)return fu;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Kl[Symbol.toPrimitive]=="function")return ds.from(Kl[Symbol.toPrimitive]("string"),Fl,Ul);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Kl)}ds.from=function(Kl,Fl,Ul){return hs(Kl,Fl,Ul)},Object.setPrototypeOf(ds.prototype,Uint8Array.prototype),Object.setPrototypeOf(ds,Uint8Array);function ps(Kl){if(typeof Kl!="number")throw new TypeError('"size" argument must be of type number');if(Kl<0)throw new RangeError('The value "'+Kl+'" is invalid for option "size"')}function io(Kl,Fl,Ul){return ps(Kl),Kl<=0?us(Kl):Fl!==void 0?typeof Ul=="string"?us(Kl).fill(Fl,Ul):us(Kl).fill(Fl):us(Kl)}ds.alloc=function(Kl,Fl,Ul){return io(Kl,Fl,Ul)};function fo(Kl){return ps(Kl),us(Kl<0?0:Yo(Kl)|0)}ds.allocUnsafe=function(Kl){return fo(Kl)},ds.allocUnsafeSlow=function(Kl){return fo(Kl)};function mo(Kl,Fl){if((typeof Fl!="string"||Fl==="")&&(Fl="utf8"),!ds.isEncoding(Fl))throw new TypeError("Unknown encoding: "+Fl);const Ul=Jo(Kl,Fl)|0;let Jl=us(Ul);const fu=Jl.write(Kl,Fl);return fu!==Ul&&(Jl=Jl.slice(0,fu)),Jl}function Ao(Kl){const Fl=Kl.length<0?0:Yo(Kl.length)|0,Ul=us(Fl);for(let Jl=0;Jl<Fl;Jl+=1)Ul[Jl]=Kl[Jl]&255;return Ul}function $o(Kl){if(gp(Kl,Uint8Array)){const Fl=new Uint8Array(Kl);return Lo(Fl.buffer,Fl.byteOffset,Fl.byteLength)}return Ao(Kl)}function Lo(Kl,Fl,Ul){if(Fl<0||Kl.byteLength<Fl)throw new RangeError('"offset" is outside of buffer bounds');if(Kl.byteLength<Fl+(Ul||0))throw new RangeError('"length" is outside of buffer bounds');let Jl;return Fl===void 0&&Ul===void 0?Jl=new Uint8Array(Kl):Ul===void 0?Jl=new Uint8Array(Kl,Fl):Jl=new Uint8Array(Kl,Fl,Ul),Object.setPrototypeOf(Jl,ds.prototype),Jl}function Go(Kl){if(ds.isBuffer(Kl)){const Fl=Yo(Kl.length)|0,Ul=us(Fl);return Ul.length===0||Kl.copy(Ul,0,0,Fl),Ul}if(Kl.length!==void 0)return typeof Kl.length!="number"||mp(Kl.length)?us(0):Ao(Kl);if(Kl.type==="Buffer"&&Array.isArray(Kl.data))return Ao(Kl.data)}function Yo(Kl){if(Kl>=os)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+os.toString(16)+" bytes");return Kl|0}function Wo(Kl){return+Kl!=Kl&&(Kl=0),ds.alloc(+Kl)}ds.isBuffer=function(Fl){return Fl!=null&&Fl._isBuffer===!0&&Fl!==ds.prototype},ds.compare=function(Fl,Ul){if(gp(Fl,Uint8Array)&&(Fl=ds.from(Fl,Fl.offset,Fl.byteLength)),gp(Ul,Uint8Array)&&(Ul=ds.from(Ul,Ul.offset,Ul.byteLength)),!ds.isBuffer(Fl)||!ds.isBuffer(Ul))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Fl===Ul)return 0;let Jl=Fl.length,fu=Ul.length;for(let _d=0,tp=Math.min(Jl,fu);_d<tp;++_d)if(Fl[_d]!==Ul[_d]){Jl=Fl[_d],fu=Ul[_d];break}return Jl<fu?-1:fu<Jl?1:0},ds.isEncoding=function(Fl){switch(String(Fl).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ds.concat=function(Fl,Ul){if(!Array.isArray(Fl))throw new TypeError('"list" argument must be an Array of Buffers');if(Fl.length===0)return ds.alloc(0);let Jl;if(Ul===void 0)for(Ul=0,Jl=0;Jl<Fl.length;++Jl)Ul+=Fl[Jl].length;const fu=ds.allocUnsafe(Ul);let _d=0;for(Jl=0;Jl<Fl.length;++Jl){let tp=Fl[Jl];if(gp(tp,Uint8Array))_d+tp.length>fu.length?(ds.isBuffer(tp)||(tp=ds.from(tp)),tp.copy(fu,_d)):Uint8Array.prototype.set.call(fu,tp,_d);else if(ds.isBuffer(tp))tp.copy(fu,_d);else throw new TypeError('"list" argument must be an Array of Buffers');_d+=tp.length}return fu};function Jo(Kl,Fl){if(ds.isBuffer(Kl))return Kl.length;if(ArrayBuffer.isView(Kl)||gp(Kl,ArrayBuffer))return Kl.byteLength;if(typeof Kl!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Kl);const Ul=Kl.length,Jl=arguments.length>2&&arguments[2]===!0;if(!Jl&&Ul===0)return 0;let fu=!1;for(;;)switch(Fl){case"ascii":case"latin1":case"binary":return Ul;case"utf8":case"utf-8":return up(Kl).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ul*2;case"hex":return Ul>>>1;case"base64":return pp(Kl).length;default:if(fu)return Jl?-1:up(Kl).length;Fl=(""+Fl).toLowerCase(),fu=!0}}ds.byteLength=Jo;function xl(Kl,Fl,Ul){let Jl=!1;if((Fl===void 0||Fl<0)&&(Fl=0),Fl>this.length||((Ul===void 0||Ul>this.length)&&(Ul=this.length),Ul<=0)||(Ul>>>=0,Fl>>>=0,Ul<=Fl))return"";for(Kl||(Kl="utf8");;)switch(Kl){case"hex":return Al(this,Fl,Ul);case"utf8":case"utf-8":return jo(this,Fl,Ul);case"ascii":return El(this,Fl,Ul);case"latin1":case"binary":return Xo(this,Fl,Ul);case"base64":return Vo(this,Fl,Ul);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wl(this,Fl,Ul);default:if(Jl)throw new TypeError("Unknown encoding: "+Kl);Kl=(Kl+"").toLowerCase(),Jl=!0}}ds.prototype._isBuffer=!0;function _l(Kl,Fl,Ul){const Jl=Kl[Fl];Kl[Fl]=Kl[Ul],Kl[Ul]=Jl}ds.prototype.swap16=function(){const Fl=this.length;if(Fl%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Ul=0;Ul<Fl;Ul+=2)_l(this,Ul,Ul+1);return this},ds.prototype.swap32=function(){const Fl=this.length;if(Fl%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Ul=0;Ul<Fl;Ul+=4)_l(this,Ul,Ul+3),_l(this,Ul+1,Ul+2);return this},ds.prototype.swap64=function(){const Fl=this.length;if(Fl%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Ul=0;Ul<Fl;Ul+=8)_l(this,Ul,Ul+7),_l(this,Ul+1,Ul+6),_l(this,Ul+2,Ul+5),_l(this,Ul+3,Ul+4);return this},ds.prototype.toString=function(){const Fl=this.length;return Fl===0?"":arguments.length===0?jo(this,0,Fl):xl.apply(this,arguments)},ds.prototype.toLocaleString=ds.prototype.toString,ds.prototype.equals=function(Fl){if(!ds.isBuffer(Fl))throw new TypeError("Argument must be a Buffer");return this===Fl?!0:ds.compare(this,Fl)===0},ds.prototype.inspect=function(){let Fl="";const Ul=Fn.INSPECT_MAX_BYTES;return Fl=this.toString("hex",0,Ul).replace(/(.{2})/g,"$1 ").trim(),this.length>Ul&&(Fl+=" ... "),"<Buffer "+Fl+">"},is&&(ds.prototype[is]=ds.prototype.inspect),ds.prototype.compare=function(Fl,Ul,Jl,fu,_d){if(gp(Fl,Uint8Array)&&(Fl=ds.from(Fl,Fl.offset,Fl.byteLength)),!ds.isBuffer(Fl))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Fl);if(Ul===void 0&&(Ul=0),Jl===void 0&&(Jl=Fl?Fl.length:0),fu===void 0&&(fu=0),_d===void 0&&(_d=this.length),Ul<0||Jl>Fl.length||fu<0||_d>this.length)throw new RangeError("out of range index");if(fu>=_d&&Ul>=Jl)return 0;if(fu>=_d)return-1;if(Ul>=Jl)return 1;if(Ul>>>=0,Jl>>>=0,fu>>>=0,_d>>>=0,this===Fl)return 0;let tp=_d-fu,yp=Jl-Ul;const _p=Math.min(tp,yp),Sp=this.slice(fu,_d),Ap=Fl.slice(Ul,Jl);for(let Op=0;Op<_p;++Op)if(Sp[Op]!==Ap[Op]){tp=Sp[Op],yp=Ap[Op];break}return tp<yp?-1:yp<tp?1:0};function Tl(Kl,Fl,Ul,Jl,fu){if(Kl.length===0)return-1;if(typeof Ul=="string"?(Jl=Ul,Ul=0):Ul>2147483647?Ul=2147483647:Ul<-2147483648&&(Ul=-2147483648),Ul=+Ul,mp(Ul)&&(Ul=fu?0:Kl.length-1),Ul<0&&(Ul=Kl.length+Ul),Ul>=Kl.length){if(fu)return-1;Ul=Kl.length-1}else if(Ul<0)if(fu)Ul=0;else return-1;if(typeof Fl=="string"&&(Fl=ds.from(Fl,Jl)),ds.isBuffer(Fl))return Fl.length===0?-1:Sl(Kl,Fl,Ul,Jl,fu);if(typeof Fl=="number")return Fl=Fl&255,typeof Uint8Array.prototype.indexOf=="function"?fu?Uint8Array.prototype.indexOf.call(Kl,Fl,Ul):Uint8Array.prototype.lastIndexOf.call(Kl,Fl,Ul):Sl(Kl,[Fl],Ul,Jl,fu);throw new TypeError("val must be string, number or Buffer")}function Sl(Kl,Fl,Ul,Jl,fu){let _d=1,tp=Kl.length,yp=Fl.length;if(Jl!==void 0&&(Jl=String(Jl).toLowerCase(),Jl==="ucs2"||Jl==="ucs-2"||Jl==="utf16le"||Jl==="utf-16le")){if(Kl.length<2||Fl.length<2)return-1;_d=2,tp/=2,yp/=2,Ul/=2}function _p(Ap,Op){return _d===1?Ap[Op]:Ap.readUInt16BE(Op*_d)}let Sp;if(fu){let Ap=-1;for(Sp=Ul;Sp<tp;Sp++)if(_p(Kl,Sp)===_p(Fl,Ap===-1?0:Sp-Ap)){if(Ap===-1&&(Ap=Sp),Sp-Ap+1===yp)return Ap*_d}else Ap!==-1&&(Sp-=Sp-Ap),Ap=-1}else for(Ul+yp>tp&&(Ul=tp-yp),Sp=Ul;Sp>=0;Sp--){let Ap=!0;for(let Op=0;Op<yp;Op++)if(_p(Kl,Sp+Op)!==_p(Fl,Op)){Ap=!1;break}if(Ap)return Sp}return-1}ds.prototype.includes=function(Fl,Ul,Jl){return this.indexOf(Fl,Ul,Jl)!==-1},ds.prototype.indexOf=function(Fl,Ul,Jl){return Tl(this,Fl,Ul,Jl,!0)},ds.prototype.lastIndexOf=function(Fl,Ul,Jl){return Tl(this,Fl,Ul,Jl,!1)};function $l(Kl,Fl,Ul,Jl){Ul=Number(Ul)||0;const fu=Kl.length-Ul;Jl?(Jl=Number(Jl),Jl>fu&&(Jl=fu)):Jl=fu;const _d=Fl.length;Jl>_d/2&&(Jl=_d/2);let tp;for(tp=0;tp<Jl;++tp){const yp=parseInt(Fl.substr(tp*2,2),16);if(mp(yp))return tp;Kl[Ul+tp]=yp}return tp}function Pl(Kl,Fl,Ul,Jl){return cp(up(Fl,Kl.length-Ul),Kl,Ul,Jl)}function Dl(Kl,Fl,Ul,Jl){return cp(wp(Fl),Kl,Ul,Jl)}function Ol(Kl,Fl,Ul,Jl){return cp(pp(Fl),Kl,Ul,Jl)}function Rl(Kl,Fl,Ul,Jl){return cp(vp(Fl,Kl.length-Ul),Kl,Ul,Jl)}ds.prototype.write=function(Fl,Ul,Jl,fu){if(Ul===void 0)fu="utf8",Jl=this.length,Ul=0;else if(Jl===void 0&&typeof Ul=="string")fu=Ul,Jl=this.length,Ul=0;else if(isFinite(Ul))Ul=Ul>>>0,isFinite(Jl)?(Jl=Jl>>>0,fu===void 0&&(fu="utf8")):(fu=Jl,Jl=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const _d=this.length-Ul;if((Jl===void 0||Jl>_d)&&(Jl=_d),Fl.length>0&&(Jl<0||Ul<0)||Ul>this.length)throw new RangeError("Attempt to write outside buffer bounds");fu||(fu="utf8");let tp=!1;for(;;)switch(fu){case"hex":return $l(this,Fl,Ul,Jl);case"utf8":case"utf-8":return Pl(this,Fl,Ul,Jl);case"ascii":case"latin1":case"binary":return Dl(this,Fl,Ul,Jl);case"base64":return Ol(this,Fl,Ul,Jl);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rl(this,Fl,Ul,Jl);default:if(tp)throw new TypeError("Unknown encoding: "+fu);fu=(""+fu).toLowerCase(),tp=!0}},ds.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Vo(Kl,Fl,Ul){return Fl===0&&Ul===Kl.length?Mn.fromByteArray(Kl):Mn.fromByteArray(Kl.slice(Fl,Ul))}function jo(Kl,Fl,Ul){Ul=Math.min(Kl.length,Ul);const Jl=[];let fu=Fl;for(;fu<Ul;){const _d=Kl[fu];let tp=null,yp=_d>239?4:_d>223?3:_d>191?2:1;if(fu+yp<=Ul){let _p,Sp,Ap,Op;switch(yp){case 1:_d<128&&(tp=_d);break;case 2:_p=Kl[fu+1],(_p&192)===128&&(Op=(_d&31)<<6|_p&63,Op>127&&(tp=Op));break;case 3:_p=Kl[fu+1],Sp=Kl[fu+2],(_p&192)===128&&(Sp&192)===128&&(Op=(_d&15)<<12|(_p&63)<<6|Sp&63,Op>2047&&(Op<55296||Op>57343)&&(tp=Op));break;case 4:_p=Kl[fu+1],Sp=Kl[fu+2],Ap=Kl[fu+3],(_p&192)===128&&(Sp&192)===128&&(Ap&192)===128&&(Op=(_d&15)<<18|(_p&63)<<12|(Sp&63)<<6|Ap&63,Op>65535&&Op<1114112&&(tp=Op))}}tp===null?(tp=65533,yp=1):tp>65535&&(tp-=65536,Jl.push(tp>>>10&1023|55296),tp=56320|tp&1023),Jl.push(tp),fu+=yp}return Qo(Jl)}const Ho=4096;function Qo(Kl){const Fl=Kl.length;if(Fl<=Ho)return String.fromCharCode.apply(String,Kl);let Ul="",Jl=0;for(;Jl<Fl;)Ul+=String.fromCharCode.apply(String,Kl.slice(Jl,Jl+=Ho));return Ul}function El(Kl,Fl,Ul){let Jl="";Ul=Math.min(Kl.length,Ul);for(let fu=Fl;fu<Ul;++fu)Jl+=String.fromCharCode(Kl[fu]&127);return Jl}function Xo(Kl,Fl,Ul){let Jl="";Ul=Math.min(Kl.length,Ul);for(let fu=Fl;fu<Ul;++fu)Jl+=String.fromCharCode(Kl[fu]);return Jl}function Al(Kl,Fl,Ul){const Jl=Kl.length;(!Fl||Fl<0)&&(Fl=0),(!Ul||Ul<0||Ul>Jl)&&(Ul=Jl);let fu="";for(let _d=Fl;_d<Ul;++_d)fu+=fp[Kl[_d]];return fu}function wl(Kl,Fl,Ul){const Jl=Kl.slice(Fl,Ul);let fu="";for(let _d=0;_d<Jl.length-1;_d+=2)fu+=String.fromCharCode(Jl[_d]+Jl[_d+1]*256);return fu}ds.prototype.slice=function(Fl,Ul){const Jl=this.length;Fl=~~Fl,Ul=Ul===void 0?Jl:~~Ul,Fl<0?(Fl+=Jl,Fl<0&&(Fl=0)):Fl>Jl&&(Fl=Jl),Ul<0?(Ul+=Jl,Ul<0&&(Ul=0)):Ul>Jl&&(Ul=Jl),Ul<Fl&&(Ul=Fl);const fu=this.subarray(Fl,Ul);return Object.setPrototypeOf(fu,ds.prototype),fu};function yl(Kl,Fl,Ul){if(Kl%1!==0||Kl<0)throw new RangeError("offset is not uint");if(Kl+Fl>Ul)throw new RangeError("Trying to access beyond buffer length")}ds.prototype.readUintLE=ds.prototype.readUIntLE=function(Fl,Ul,Jl){Fl=Fl>>>0,Ul=Ul>>>0,Jl||yl(Fl,Ul,this.length);let fu=this[Fl],_d=1,tp=0;for(;++tp<Ul&&(_d*=256);)fu+=this[Fl+tp]*_d;return fu},ds.prototype.readUintBE=ds.prototype.readUIntBE=function(Fl,Ul,Jl){Fl=Fl>>>0,Ul=Ul>>>0,Jl||yl(Fl,Ul,this.length);let fu=this[Fl+--Ul],_d=1;for(;Ul>0&&(_d*=256);)fu+=this[Fl+--Ul]*_d;return fu},ds.prototype.readUint8=ds.prototype.readUInt8=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,1,this.length),this[Fl]},ds.prototype.readUint16LE=ds.prototype.readUInt16LE=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,2,this.length),this[Fl]|this[Fl+1]<<8},ds.prototype.readUint16BE=ds.prototype.readUInt16BE=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,2,this.length),this[Fl]<<8|this[Fl+1]},ds.prototype.readUint32LE=ds.prototype.readUInt32LE=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,4,this.length),(this[Fl]|this[Fl+1]<<8|this[Fl+2]<<16)+this[Fl+3]*16777216},ds.prototype.readUint32BE=ds.prototype.readUInt32BE=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,4,this.length),this[Fl]*16777216+(this[Fl+1]<<16|this[Fl+2]<<8|this[Fl+3])},ds.prototype.readBigUInt64LE=hp(function(Fl){Fl=Fl>>>0,wu(Fl,"offset");const Ul=this[Fl],Jl=this[Fl+7];(Ul===void 0||Jl===void 0)&&yu(Fl,this.length-8);const fu=Ul+this[++Fl]*2**8+this[++Fl]*2**16+this[++Fl]*2**24,_d=this[++Fl]+this[++Fl]*2**8+this[++Fl]*2**16+Jl*2**24;return BigInt(fu)+(BigInt(_d)<<BigInt(32))}),ds.prototype.readBigUInt64BE=hp(function(Fl){Fl=Fl>>>0,wu(Fl,"offset");const Ul=this[Fl],Jl=this[Fl+7];(Ul===void 0||Jl===void 0)&&yu(Fl,this.length-8);const fu=Ul*2**24+this[++Fl]*2**16+this[++Fl]*2**8+this[++Fl],_d=this[++Fl]*2**24+this[++Fl]*2**16+this[++Fl]*2**8+Jl;return(BigInt(fu)<<BigInt(32))+BigInt(_d)}),ds.prototype.readIntLE=function(Fl,Ul,Jl){Fl=Fl>>>0,Ul=Ul>>>0,Jl||yl(Fl,Ul,this.length);let fu=this[Fl],_d=1,tp=0;for(;++tp<Ul&&(_d*=256);)fu+=this[Fl+tp]*_d;return _d*=128,fu>=_d&&(fu-=Math.pow(2,8*Ul)),fu},ds.prototype.readIntBE=function(Fl,Ul,Jl){Fl=Fl>>>0,Ul=Ul>>>0,Jl||yl(Fl,Ul,this.length);let fu=Ul,_d=1,tp=this[Fl+--fu];for(;fu>0&&(_d*=256);)tp+=this[Fl+--fu]*_d;return _d*=128,tp>=_d&&(tp-=Math.pow(2,8*Ul)),tp},ds.prototype.readInt8=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,1,this.length),this[Fl]&128?(255-this[Fl]+1)*-1:this[Fl]},ds.prototype.readInt16LE=function(Fl,Ul){Fl=Fl>>>0,Ul||yl(Fl,2,this.length);const Jl=this[Fl]|this[Fl+1]<<8;return Jl&32768?Jl|4294901760:Jl},ds.prototype.readInt16BE=function(Fl,Ul){Fl=Fl>>>0,Ul||yl(Fl,2,this.length);const Jl=this[Fl+1]|this[Fl]<<8;return Jl&32768?Jl|4294901760:Jl},ds.prototype.readInt32LE=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,4,this.length),this[Fl]|this[Fl+1]<<8|this[Fl+2]<<16|this[Fl+3]<<24},ds.prototype.readInt32BE=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,4,this.length),this[Fl]<<24|this[Fl+1]<<16|this[Fl+2]<<8|this[Fl+3]},ds.prototype.readBigInt64LE=hp(function(Fl){Fl=Fl>>>0,wu(Fl,"offset");const Ul=this[Fl],Jl=this[Fl+7];(Ul===void 0||Jl===void 0)&&yu(Fl,this.length-8);const fu=this[Fl+4]+this[Fl+5]*2**8+this[Fl+6]*2**16+(Jl<<24);return(BigInt(fu)<<BigInt(32))+BigInt(Ul+this[++Fl]*2**8+this[++Fl]*2**16+this[++Fl]*2**24)}),ds.prototype.readBigInt64BE=hp(function(Fl){Fl=Fl>>>0,wu(Fl,"offset");const Ul=this[Fl],Jl=this[Fl+7];(Ul===void 0||Jl===void 0)&&yu(Fl,this.length-8);const fu=(Ul<<24)+this[++Fl]*2**16+this[++Fl]*2**8+this[++Fl];return(BigInt(fu)<<BigInt(32))+BigInt(this[++Fl]*2**24+this[++Fl]*2**16+this[++Fl]*2**8+Jl)}),ds.prototype.readFloatLE=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,4,this.length),rs.read(this,Fl,!0,23,4)},ds.prototype.readFloatBE=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,4,this.length),rs.read(this,Fl,!1,23,4)},ds.prototype.readDoubleLE=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,8,this.length),rs.read(this,Fl,!0,52,8)},ds.prototype.readDoubleBE=function(Fl,Ul){return Fl=Fl>>>0,Ul||yl(Fl,8,this.length),rs.read(this,Fl,!1,52,8)};function Il(Kl,Fl,Ul,Jl,fu,_d){if(!ds.isBuffer(Kl))throw new TypeError('"buffer" argument must be a Buffer instance');if(Fl>fu||Fl<_d)throw new RangeError('"value" argument is out of bounds');if(Ul+Jl>Kl.length)throw new RangeError("Index out of range")}ds.prototype.writeUintLE=ds.prototype.writeUIntLE=function(Fl,Ul,Jl,fu){if(Fl=+Fl,Ul=Ul>>>0,Jl=Jl>>>0,!fu){const yp=Math.pow(2,8*Jl)-1;Il(this,Fl,Ul,Jl,yp,0)}let _d=1,tp=0;for(this[Ul]=Fl&255;++tp<Jl&&(_d*=256);)this[Ul+tp]=Fl/_d&255;return Ul+Jl},ds.prototype.writeUintBE=ds.prototype.writeUIntBE=function(Fl,Ul,Jl,fu){if(Fl=+Fl,Ul=Ul>>>0,Jl=Jl>>>0,!fu){const yp=Math.pow(2,8*Jl)-1;Il(this,Fl,Ul,Jl,yp,0)}let _d=Jl-1,tp=1;for(this[Ul+_d]=Fl&255;--_d>=0&&(tp*=256);)this[Ul+_d]=Fl/tp&255;return Ul+Jl},ds.prototype.writeUint8=ds.prototype.writeUInt8=function(Fl,Ul,Jl){return Fl=+Fl,Ul=Ul>>>0,Jl||Il(this,Fl,Ul,1,255,0),this[Ul]=Fl&255,Ul+1},ds.prototype.writeUint16LE=ds.prototype.writeUInt16LE=function(Fl,Ul,Jl){return Fl=+Fl,Ul=Ul>>>0,Jl||Il(this,Fl,Ul,2,65535,0),this[Ul]=Fl&255,this[Ul+1]=Fl>>>8,Ul+2},ds.prototype.writeUint16BE=ds.prototype.writeUInt16BE=function(Fl,Ul,Jl){return Fl=+Fl,Ul=Ul>>>0,Jl||Il(this,Fl,Ul,2,65535,0),this[Ul]=Fl>>>8,this[Ul+1]=Fl&255,Ul+2},ds.prototype.writeUint32LE=ds.prototype.writeUInt32LE=function(Fl,Ul,Jl){return Fl=+Fl,Ul=Ul>>>0,Jl||Il(this,Fl,Ul,4,4294967295,0),this[Ul+3]=Fl>>>24,this[Ul+2]=Fl>>>16,this[Ul+1]=Fl>>>8,this[Ul]=Fl&255,Ul+4},ds.prototype.writeUint32BE=ds.prototype.writeUInt32BE=function(Fl,Ul,Jl){return Fl=+Fl,Ul=Ul>>>0,Jl||Il(this,Fl,Ul,4,4294967295,0),this[Ul]=Fl>>>24,this[Ul+1]=Fl>>>16,this[Ul+2]=Fl>>>8,this[Ul+3]=Fl&255,Ul+4};function Bl(Kl,Fl,Ul,Jl,fu){Xl(Fl,Jl,fu,Kl,Ul,7);let _d=Number(Fl&BigInt(4294967295));Kl[Ul++]=_d,_d=_d>>8,Kl[Ul++]=_d,_d=_d>>8,Kl[Ul++]=_d,_d=_d>>8,Kl[Ul++]=_d;let tp=Number(Fl>>BigInt(32)&BigInt(4294967295));return Kl[Ul++]=tp,tp=tp>>8,Kl[Ul++]=tp,tp=tp>>8,Kl[Ul++]=tp,tp=tp>>8,Kl[Ul++]=tp,Ul}function Gl(Kl,Fl,Ul,Jl,fu){Xl(Fl,Jl,fu,Kl,Ul,7);let _d=Number(Fl&BigInt(4294967295));Kl[Ul+7]=_d,_d=_d>>8,Kl[Ul+6]=_d,_d=_d>>8,Kl[Ul+5]=_d,_d=_d>>8,Kl[Ul+4]=_d;let tp=Number(Fl>>BigInt(32)&BigInt(4294967295));return Kl[Ul+3]=tp,tp=tp>>8,Kl[Ul+2]=tp,tp=tp>>8,Kl[Ul+1]=tp,tp=tp>>8,Kl[Ul]=tp,Ul+8}ds.prototype.writeBigUInt64LE=hp(function(Fl,Ul=0){return Bl(this,Fl,Ul,BigInt(0),BigInt("0xffffffffffffffff"))}),ds.prototype.writeBigUInt64BE=hp(function(Fl,Ul=0){return Gl(this,Fl,Ul,BigInt(0),BigInt("0xffffffffffffffff"))}),ds.prototype.writeIntLE=function(Fl,Ul,Jl,fu){if(Fl=+Fl,Ul=Ul>>>0,!fu){const _p=Math.pow(2,8*Jl-1);Il(this,Fl,Ul,Jl,_p-1,-_p)}let _d=0,tp=1,yp=0;for(this[Ul]=Fl&255;++_d<Jl&&(tp*=256);)Fl<0&&yp===0&&this[Ul+_d-1]!==0&&(yp=1),this[Ul+_d]=(Fl/tp>>0)-yp&255;return Ul+Jl},ds.prototype.writeIntBE=function(Fl,Ul,Jl,fu){if(Fl=+Fl,Ul=Ul>>>0,!fu){const _p=Math.pow(2,8*Jl-1);Il(this,Fl,Ul,Jl,_p-1,-_p)}let _d=Jl-1,tp=1,yp=0;for(this[Ul+_d]=Fl&255;--_d>=0&&(tp*=256);)Fl<0&&yp===0&&this[Ul+_d+1]!==0&&(yp=1),this[Ul+_d]=(Fl/tp>>0)-yp&255;return Ul+Jl},ds.prototype.writeInt8=function(Fl,Ul,Jl){return Fl=+Fl,Ul=Ul>>>0,Jl||Il(this,Fl,Ul,1,127,-128),Fl<0&&(Fl=255+Fl+1),this[Ul]=Fl&255,Ul+1},ds.prototype.writeInt16LE=function(Fl,Ul,Jl){return Fl=+Fl,Ul=Ul>>>0,Jl||Il(this,Fl,Ul,2,32767,-32768),this[Ul]=Fl&255,this[Ul+1]=Fl>>>8,Ul+2},ds.prototype.writeInt16BE=function(Fl,Ul,Jl){return Fl=+Fl,Ul=Ul>>>0,Jl||Il(this,Fl,Ul,2,32767,-32768),this[Ul]=Fl>>>8,this[Ul+1]=Fl&255,Ul+2},ds.prototype.writeInt32LE=function(Fl,Ul,Jl){return Fl=+Fl,Ul=Ul>>>0,Jl||Il(this,Fl,Ul,4,2147483647,-2147483648),this[Ul]=Fl&255,this[Ul+1]=Fl>>>8,this[Ul+2]=Fl>>>16,this[Ul+3]=Fl>>>24,Ul+4},ds.prototype.writeInt32BE=function(Fl,Ul,Jl){return Fl=+Fl,Ul=Ul>>>0,Jl||Il(this,Fl,Ul,4,2147483647,-2147483648),Fl<0&&(Fl=4294967295+Fl+1),this[Ul]=Fl>>>24,this[Ul+1]=Fl>>>16,this[Ul+2]=Fl>>>8,this[Ul+3]=Fl&255,Ul+4},ds.prototype.writeBigInt64LE=hp(function(Fl,Ul=0){return Bl(this,Fl,Ul,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),ds.prototype.writeBigInt64BE=hp(function(Fl,Ul=0){return Gl(this,Fl,Ul,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Nl(Kl,Fl,Ul,Jl,fu,_d){if(Ul+Jl>Kl.length)throw new RangeError("Index out of range");if(Ul<0)throw new RangeError("Index out of range")}function zl(Kl,Fl,Ul,Jl,fu){return Fl=+Fl,Ul=Ul>>>0,fu||Nl(Kl,Fl,Ul,4),rs.write(Kl,Fl,Ul,Jl,23,4),Ul+4}ds.prototype.writeFloatLE=function(Fl,Ul,Jl){return zl(this,Fl,Ul,!0,Jl)},ds.prototype.writeFloatBE=function(Fl,Ul,Jl){return zl(this,Fl,Ul,!1,Jl)};function Vl(Kl,Fl,Ul,Jl,fu){return Fl=+Fl,Ul=Ul>>>0,fu||Nl(Kl,Fl,Ul,8),rs.write(Kl,Fl,Ul,Jl,52,8),Ul+8}ds.prototype.writeDoubleLE=function(Fl,Ul,Jl){return Vl(this,Fl,Ul,!0,Jl)},ds.prototype.writeDoubleBE=function(Fl,Ul,Jl){return Vl(this,Fl,Ul,!1,Jl)},ds.prototype.copy=function(Fl,Ul,Jl,fu){if(!ds.isBuffer(Fl))throw new TypeError("argument should be a Buffer");if(Jl||(Jl=0),!fu&&fu!==0&&(fu=this.length),Ul>=Fl.length&&(Ul=Fl.length),Ul||(Ul=0),fu>0&&fu<Jl&&(fu=Jl),fu===Jl||Fl.length===0||this.length===0)return 0;if(Ul<0)throw new RangeError("targetStart out of bounds");if(Jl<0||Jl>=this.length)throw new RangeError("Index out of range");if(fu<0)throw new RangeError("sourceEnd out of bounds");fu>this.length&&(fu=this.length),Fl.length-Ul<fu-Jl&&(fu=Fl.length-Ul+Jl);const _d=fu-Jl;return this===Fl&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Ul,Jl,fu):Uint8Array.prototype.set.call(Fl,this.subarray(Jl,fu),Ul),_d},ds.prototype.fill=function(Fl,Ul,Jl,fu){if(typeof Fl=="string"){if(typeof Ul=="string"?(fu=Ul,Ul=0,Jl=this.length):typeof Jl=="string"&&(fu=Jl,Jl=this.length),fu!==void 0&&typeof fu!="string")throw new TypeError("encoding must be a string");if(typeof fu=="string"&&!ds.isEncoding(fu))throw new TypeError("Unknown encoding: "+fu);if(Fl.length===1){const tp=Fl.charCodeAt(0);(fu==="utf8"&&tp<128||fu==="latin1")&&(Fl=tp)}}else typeof Fl=="number"?Fl=Fl&255:typeof Fl=="boolean"&&(Fl=Number(Fl));if(Ul<0||this.length<Ul||this.length<Jl)throw new RangeError("Out of range index");if(Jl<=Ul)return this;Ul=Ul>>>0,Jl=Jl===void 0?this.length:Jl>>>0,Fl||(Fl=0);let _d;if(typeof Fl=="number")for(_d=Ul;_d<Jl;++_d)this[_d]=Fl;else{const tp=ds.isBuffer(Fl)?Fl:ds.from(Fl,fu),yp=tp.length;if(yp===0)throw new TypeError('The value "'+Fl+'" is invalid for argument "value"');for(_d=0;_d<Jl-Ul;++_d)this[_d+Ul]=tp[_d%yp]}return this};const Hl={};function Yl(Kl,Fl,Ul){Hl[Kl]=class extends Ul{constructor(){super(),Object.defineProperty(this,"message",{value:Fl.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Kl}]`,this.stack,delete this.name}get code(){return Kl}set code(fu){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:fu,writable:!0})}toString(){return`${this.name} [${Kl}]: ${this.message}`}}}Yl("ERR_BUFFER_OUT_OF_BOUNDS",function(Kl){return Kl?`${Kl} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Yl("ERR_INVALID_ARG_TYPE",function(Kl,Fl){return`The "${Kl}" argument must be of type number. Received type ${typeof Fl}`},TypeError),Yl("ERR_OUT_OF_RANGE",function(Kl,Fl,Ul){let Jl=`The value of "${Kl}" is out of range.`,fu=Ul;return Number.isInteger(Ul)&&Math.abs(Ul)>2**32?fu=Ll(String(Ul)):typeof Ul=="bigint"&&(fu=String(Ul),(Ul>BigInt(2)**BigInt(32)||Ul<-(BigInt(2)**BigInt(32)))&&(fu=Ll(fu)),fu+="n"),Jl+=` It must be ${Fl}. Received ${fu}`,Jl},RangeError);function Ll(Kl){let Fl="",Ul=Kl.length;const Jl=Kl[0]==="-"?1:0;for(;Ul>=Jl+4;Ul-=3)Fl=`_${Kl.slice(Ul-3,Ul)}${Fl}`;return`${Kl.slice(0,Ul)}${Fl}`}function Zl(Kl,Fl,Ul){wu(Fl,"offset"),(Kl[Fl]===void 0||Kl[Fl+Ul]===void 0)&&yu(Fl,Kl.length-(Ul+1))}function Xl(Kl,Fl,Ul,Jl,fu,_d){if(Kl>Ul||Kl<Fl){const tp=typeof Fl=="bigint"?"n":"";let yp;throw Fl===0||Fl===BigInt(0)?yp=`>= 0${tp} and < 2${tp} ** ${(_d+1)*8}${tp}`:yp=`>= -(2${tp} ** ${(_d+1)*8-1}${tp}) and < 2 ** ${(_d+1)*8-1}${tp}`,new Hl.ERR_OUT_OF_RANGE("value",yp,Kl)}Zl(Jl,fu,_d)}function wu(Kl,Fl){if(typeof Kl!="number")throw new Hl.ERR_INVALID_ARG_TYPE(Fl,"number",Kl)}function yu(Kl,Fl,Ul){throw Math.floor(Kl)!==Kl?(wu(Kl,Ul),new Hl.ERR_OUT_OF_RANGE("offset","an integer",Kl)):Fl<0?new Hl.ERR_BUFFER_OUT_OF_BOUNDS:new Hl.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Fl}`,Kl)}const rp=/[^+/0-9A-Za-z-_]/g;function dp(Kl){if(Kl=Kl.split("=")[0],Kl=Kl.trim().replace(rp,""),Kl.length<2)return"";for(;Kl.length%4!==0;)Kl=Kl+"=";return Kl}function up(Kl,Fl){Fl=Fl||1/0;let Ul;const Jl=Kl.length;let fu=null;const _d=[];for(let tp=0;tp<Jl;++tp){if(Ul=Kl.charCodeAt(tp),Ul>55295&&Ul<57344){if(!fu){if(Ul>56319){(Fl-=3)>-1&&_d.push(239,191,189);continue}else if(tp+1===Jl){(Fl-=3)>-1&&_d.push(239,191,189);continue}fu=Ul;continue}if(Ul<56320){(Fl-=3)>-1&&_d.push(239,191,189),fu=Ul;continue}Ul=(fu-55296<<10|Ul-56320)+65536}else fu&&(Fl-=3)>-1&&_d.push(239,191,189);if(fu=null,Ul<128){if((Fl-=1)<0)break;_d.push(Ul)}else if(Ul<2048){if((Fl-=2)<0)break;_d.push(Ul>>6|192,Ul&63|128)}else if(Ul<65536){if((Fl-=3)<0)break;_d.push(Ul>>12|224,Ul>>6&63|128,Ul&63|128)}else if(Ul<1114112){if((Fl-=4)<0)break;_d.push(Ul>>18|240,Ul>>12&63|128,Ul>>6&63|128,Ul&63|128)}else throw new Error("Invalid code point")}return _d}function wp(Kl){const Fl=[];for(let Ul=0;Ul<Kl.length;++Ul)Fl.push(Kl.charCodeAt(Ul)&255);return Fl}function vp(Kl,Fl){let Ul,Jl,fu;const _d=[];for(let tp=0;tp<Kl.length&&!((Fl-=2)<0);++tp)Ul=Kl.charCodeAt(tp),Jl=Ul>>8,fu=Ul%256,_d.push(fu),_d.push(Jl);return _d}function pp(Kl){return Mn.toByteArray(dp(Kl))}function cp(Kl,Fl,Ul,Jl){let fu;for(fu=0;fu<Jl&&!(fu+Ul>=Fl.length||fu>=Kl.length);++fu)Fl[fu+Ul]=Kl[fu];return fu}function gp(Kl,Fl){return Kl instanceof Fl||Kl!=null&&Kl.constructor!=null&&Kl.constructor.name!=null&&Kl.constructor.name===Fl.name}function mp(Kl){return Kl!==Kl}const fp=function(){const Kl="0123456789abcdef",Fl=new Array(256);for(let Ul=0;Ul<16;++Ul){const Jl=Ul*16;for(let fu=0;fu<16;++fu)Fl[Jl+fu]=Kl[Ul]+Kl[fu]}return Fl}();function hp(Kl){return typeof BigInt>"u"?xp:Kl}function xp(){throw new Error("BigInt not supported")}})(buffer);var e_;typeof window<"u"&&(window.Buffer||(window.Buffer=buffer.Buffer),window.global||(window.global=window),window.process||(window.process={}),(e_=window.process)!=null&&e_.env||(window.process={env:{}}));var define_process_env_default$2={};const SECURE_SITE_SDK=define_process_env_default$2.NEXT_PUBLIC_SECURE_SITE_SDK_URL||"https://secure.walletconnect.org/sdk",DEFAULT_LOG_LEVEL=define_process_env_default$2.NEXT_PUBLIC_DEFAULT_LOG_LEVEL||"error",W3mFrameConstants={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",FRAME_SWITCH_NETWORK_ERROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",FRAME_READY:"@w3m-frame/READY",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},W3mFrameRpcConstants={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","wallet_revokePermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RPC_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}};var util;(function(Fn){Fn.assertEqual=os=>os;function Mn(os){}Fn.assertIs=Mn;function rs(os){throw new Error}Fn.assertNever=rs,Fn.arrayToEnum=os=>{const as={};for(const us of os)as[us]=us;return as},Fn.getValidEnumValues=os=>{const as=Fn.objectKeys(os).filter(ds=>typeof os[os[ds]]!="number"),us={};for(const ds of as)us[ds]=os[ds];return Fn.objectValues(us)},Fn.objectValues=os=>Fn.objectKeys(os).map(function(as){return os[as]}),Fn.objectKeys=typeof Object.keys=="function"?os=>Object.keys(os):os=>{const as=[];for(const us in os)Object.prototype.hasOwnProperty.call(os,us)&&as.push(us);return as},Fn.find=(os,as)=>{for(const us of os)if(as(us))return us},Fn.isInteger=typeof Number.isInteger=="function"?os=>Number.isInteger(os):os=>typeof os=="number"&&isFinite(os)&&Math.floor(os)===os;function is(os,as=" | "){return os.map(us=>typeof us=="string"?`'${us}'`:us).join(as)}Fn.joinValues=is,Fn.jsonStringifyReplacer=(os,as)=>typeof as=="bigint"?as.toString():as})(util||(util={}));var objectUtil;(function(Fn){Fn.mergeShapes=(Mn,rs)=>({...Mn,...rs})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=Fn=>{switch(typeof Fn){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(Fn)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(Fn)?ZodParsedType.array:Fn===null?ZodParsedType.null:Fn.then&&typeof Fn.then=="function"&&Fn.catch&&typeof Fn.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&Fn instanceof Map?ZodParsedType.map:typeof Set<"u"&&Fn instanceof Set?ZodParsedType.set:typeof Date<"u"&&Fn instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.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"]),quotelessJson=Fn=>JSON.stringify(Fn,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(Mn){super(),this.issues=[],this.addIssue=is=>{this.issues=[...this.issues,is]},this.addIssues=(is=[])=>{this.issues=[...this.issues,...is]};const rs=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,rs):this.__proto__=rs,this.name="ZodError",this.issues=Mn}get errors(){return this.issues}format(Mn){const rs=Mn||function(as){return as.message},is={_errors:[]},os=as=>{for(const us of as.issues)if(us.code==="invalid_union")us.unionErrors.map(os);else if(us.code==="invalid_return_type")os(us.returnTypeError);else if(us.code==="invalid_arguments")os(us.argumentsError);else if(us.path.length===0)is._errors.push(rs(us));else{let ds=is,hs=0;for(;hs<us.path.length;){const ps=us.path[hs];hs===us.path.length-1?(ds[ps]=ds[ps]||{_errors:[]},ds[ps]._errors.push(rs(us))):ds[ps]=ds[ps]||{_errors:[]},ds=ds[ps],hs++}}};return os(this),is}toString(){return this.message}get message(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(Mn=rs=>rs.message){const rs={},is=[];for(const os of this.issues)os.path.length>0?(rs[os.path[0]]=rs[os.path[0]]||[],rs[os.path[0]].push(Mn(os))):is.push(Mn(os));return{formErrors:is,fieldErrors:rs}}get formErrors(){return this.flatten()}}ZodError.create=Fn=>new ZodError(Fn);const errorMap=(Fn,Mn)=>{let rs;switch(Fn.code){case ZodIssueCode.invalid_type:Fn.received===ZodParsedType.undefined?rs="Required":rs=`Expected ${Fn.expected}, received ${Fn.received}`;break;case ZodIssueCode.invalid_literal:rs=`Invalid literal value, expected ${JSON.stringify(Fn.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:rs=`Unrecognized key(s) in object: ${util.joinValues(Fn.keys,", ")}`;break;case ZodIssueCode.invalid_union:rs="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:rs=`Invalid discriminator value. Expected ${util.joinValues(Fn.options)}`;break;case ZodIssueCode.invalid_enum_value:rs=`Invalid enum value. Expected ${util.joinValues(Fn.options)}, received '${Fn.received}'`;break;case ZodIssueCode.invalid_arguments:rs="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:rs="Invalid function return type";break;case ZodIssueCode.invalid_date:rs="Invalid date";break;case ZodIssueCode.invalid_string:typeof Fn.validation=="object"?"includes"in Fn.validation?(rs=`Invalid input: must include "${Fn.validation.includes}"`,typeof Fn.validation.position=="number"&&(rs=`${rs} at one or more positions greater than or equal to ${Fn.validation.position}`)):"startsWith"in Fn.validation?rs=`Invalid input: must start with "${Fn.validation.startsWith}"`:"endsWith"in Fn.validation?rs=`Invalid input: must end with "${Fn.validation.endsWith}"`:util.assertNever(Fn.validation):Fn.validation!=="regex"?rs=`Invalid ${Fn.validation}`:rs="Invalid";break;case ZodIssueCode.too_small:Fn.type==="array"?rs=`Array must contain ${Fn.exact?"exactly":Fn.inclusive?"at least":"more than"} ${Fn.minimum} element(s)`:Fn.type==="string"?rs=`String must contain ${Fn.exact?"exactly":Fn.inclusive?"at least":"over"} ${Fn.minimum} character(s)`:Fn.type==="number"?rs=`Number must be ${Fn.exact?"exactly equal to ":Fn.inclusive?"greater than or equal to ":"greater than "}${Fn.minimum}`:Fn.type==="date"?rs=`Date must be ${Fn.exact?"exactly equal to ":Fn.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(Fn.minimum))}`:rs="Invalid input";break;case ZodIssueCode.too_big:Fn.type==="array"?rs=`Array must contain ${Fn.exact?"exactly":Fn.inclusive?"at most":"less than"} ${Fn.maximum} element(s)`:Fn.type==="string"?rs=`String must contain ${Fn.exact?"exactly":Fn.inclusive?"at most":"under"} ${Fn.maximum} character(s)`:Fn.type==="number"?rs=`Number must be ${Fn.exact?"exactly":Fn.inclusive?"less than or equal to":"less than"} ${Fn.maximum}`:Fn.type==="bigint"?rs=`BigInt must be ${Fn.exact?"exactly":Fn.inclusive?"less than or equal to":"less than"} ${Fn.maximum}`:Fn.type==="date"?rs=`Date must be ${Fn.exact?"exactly":Fn.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(Fn.maximum))}`:rs="Invalid input";break;case ZodIssueCode.custom:rs="Invalid input";break;case ZodIssueCode.invalid_intersection_types:rs="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:rs=`Number must be a multiple of ${Fn.multipleOf}`;break;case ZodIssueCode.not_finite:rs="Number must be finite";break;default:rs=Mn.defaultError,util.assertNever(Fn)}return{message:rs}};let overrideErrorMap=errorMap;function setErrorMap(Fn){overrideErrorMap=Fn}function getErrorMap(){return overrideErrorMap}const makeIssue=Fn=>{const{data:Mn,path:rs,errorMaps:is,issueData:os}=Fn,as=[...rs,...os.path||[]],us={...os,path:as};let ds="";const hs=is.filter(ps=>!!ps).slice().reverse();for(const ps of hs)ds=ps(us,{data:Mn,defaultError:ds}).message;return{...os,path:as,message:os.message||ds}},EMPTY_PATH=[];function addIssueToContext(Fn,Mn){const rs=makeIssue({issueData:Mn,data:Fn.data,path:Fn.path,errorMaps:[Fn.common.contextualErrorMap,Fn.schemaErrorMap,getErrorMap(),errorMap].filter(is=>!!is)});Fn.common.issues.push(rs)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(Mn,rs){const is=[];for(const os of rs){if(os.status==="aborted")return INVALID;os.status==="dirty"&&Mn.dirty(),is.push(os.value)}return{status:Mn.value,value:is}}static async mergeObjectAsync(Mn,rs){const is=[];for(const os of rs)is.push({key:await os.key,value:await os.value});return ParseStatus.mergeObjectSync(Mn,is)}static mergeObjectSync(Mn,rs){const is={};for(const os of rs){const{key:as,value:us}=os;if(as.status==="aborted"||us.status==="aborted")return INVALID;as.status==="dirty"&&Mn.dirty(),us.status==="dirty"&&Mn.dirty(),as.value!=="__proto__"&&(typeof us.value<"u"||os.alwaysSet)&&(is[as.value]=us.value)}return{status:Mn.value,value:is}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=Fn=>({status:"dirty",value:Fn}),OK=Fn=>({status:"valid",value:Fn}),isAborted=Fn=>Fn.status==="aborted",isDirty=Fn=>Fn.status==="dirty",isValid=Fn=>Fn.status==="valid",isAsync=Fn=>typeof Promise<"u"&&Fn instanceof Promise;var errorUtil;(function(Fn){Fn.errToObj=Mn=>typeof Mn=="string"?{message:Mn}:Mn||{},Fn.toString=Mn=>typeof Mn=="string"?Mn:Mn==null?void 0:Mn.message})(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(Mn,rs,is,os){this._cachedPath=[],this.parent=Mn,this.data=rs,this._path=is,this._key=os}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(Fn,Mn)=>{if(isValid(Mn))return{success:!0,data:Mn.value};if(!Fn.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const rs=new ZodError(Fn.common.issues);return this._error=rs,this._error}}};function processCreateParams(Fn){if(!Fn)return{};const{errorMap:Mn,invalid_type_error:rs,required_error:is,description:os}=Fn;if(Mn&&(rs||is))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return Mn?{errorMap:Mn,description:os}:{errorMap:(us,ds)=>us.code!=="invalid_type"?{message:ds.defaultError}:typeof ds.data>"u"?{message:is??ds.defaultError}:{message:rs??ds.defaultError},description:os}}class ZodType{constructor(Mn){this.spa=this.safeParseAsync,this._def=Mn,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)}get description(){return this._def.description}_getType(Mn){return getParsedType(Mn.data)}_getOrReturnCtx(Mn,rs){return rs||{common:Mn.parent.common,data:Mn.data,parsedType:getParsedType(Mn.data),schemaErrorMap:this._def.errorMap,path:Mn.path,parent:Mn.parent}}_processInputParams(Mn){return{status:new ParseStatus,ctx:{common:Mn.parent.common,data:Mn.data,parsedType:getParsedType(Mn.data),schemaErrorMap:this._def.errorMap,path:Mn.path,parent:Mn.parent}}}_parseSync(Mn){const rs=this._parse(Mn);if(isAsync(rs))throw new Error("Synchronous parse encountered promise.");return rs}_parseAsync(Mn){const rs=this._parse(Mn);return Promise.resolve(rs)}parse(Mn,rs){const is=this.safeParse(Mn,rs);if(is.success)return is.data;throw is.error}safeParse(Mn,rs){var is;const os={common:{issues:[],async:(is=rs==null?void 0:rs.async)!==null&&is!==void 0?is:!1,contextualErrorMap:rs==null?void 0:rs.errorMap},path:(rs==null?void 0:rs.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:Mn,parsedType:getParsedType(Mn)},as=this._parseSync({data:Mn,path:os.path,parent:os});return handleResult(os,as)}async parseAsync(Mn,rs){const is=await this.safeParseAsync(Mn,rs);if(is.success)return is.data;throw is.error}async safeParseAsync(Mn,rs){const is={common:{issues:[],contextualErrorMap:rs==null?void 0:rs.errorMap,async:!0},path:(rs==null?void 0:rs.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:Mn,parsedType:getParsedType(Mn)},os=this._parse({data:Mn,path:is.path,parent:is}),as=await(isAsync(os)?os:Promise.resolve(os));return handleResult(is,as)}refine(Mn,rs){const is=os=>typeof rs=="string"||typeof rs>"u"?{message:rs}:typeof rs=="function"?rs(os):rs;return this._refinement((os,as)=>{const us=Mn(os),ds=()=>as.addIssue({code:ZodIssueCode.custom,...is(os)});return typeof Promise<"u"&&us instanceof Promise?us.then(hs=>hs?!0:(ds(),!1)):us?!0:(ds(),!1)})}refinement(Mn,rs){return this._refinement((is,os)=>Mn(is)?!0:(os.addIssue(typeof rs=="function"?rs(is,os):rs),!1))}_refinement(Mn){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:Mn}})}superRefine(Mn){return this._refinement(Mn)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(Mn){return ZodUnion.create([this,Mn],this._def)}and(Mn){return ZodIntersection.create(this,Mn,this._def)}transform(Mn){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:Mn}})}default(Mn){const rs=typeof Mn=="function"?Mn:()=>Mn;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:rs,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(Mn){const rs=typeof Mn=="function"?Mn:()=>Mn;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:rs,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(Mn){const rs=this.constructor;return new rs({...this._def,description:Mn})}pipe(Mn){return ZodPipeline.create(this,Mn)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[a-z][a-z0-9]*$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[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,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,datetimeRegex=Fn=>Fn.precision?Fn.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${Fn.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${Fn.precision}}Z$`):Fn.precision===0?Fn.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):Fn.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function isValidIP(Fn,Mn){return!!((Mn==="v4"||!Mn)&&ipv4Regex.test(Fn)||(Mn==="v6"||!Mn)&&ipv6Regex.test(Fn))}class ZodString extends ZodType{_parse(Mn){if(this._def.coerce&&(Mn.data=String(Mn.data)),this._getType(Mn)!==ZodParsedType.string){const as=this._getOrReturnCtx(Mn);return addIssueToContext(as,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:as.parsedType}),INVALID}const is=new ParseStatus;let os;for(const as of this._def.checks)if(as.kind==="min")Mn.data.length<as.value&&(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{code:ZodIssueCode.too_small,minimum:as.value,type:"string",inclusive:!0,exact:!1,message:as.message}),is.dirty());else if(as.kind==="max")Mn.data.length>as.value&&(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{code:ZodIssueCode.too_big,maximum:as.value,type:"string",inclusive:!0,exact:!1,message:as.message}),is.dirty());else if(as.kind==="length"){const us=Mn.data.length>as.value,ds=Mn.data.length<as.value;(us||ds)&&(os=this._getOrReturnCtx(Mn,os),us?addIssueToContext(os,{code:ZodIssueCode.too_big,maximum:as.value,type:"string",inclusive:!0,exact:!0,message:as.message}):ds&&addIssueToContext(os,{code:ZodIssueCode.too_small,minimum:as.value,type:"string",inclusive:!0,exact:!0,message:as.message}),is.dirty())}else if(as.kind==="email")emailRegex.test(Mn.data)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{validation:"email",code:ZodIssueCode.invalid_string,message:as.message}),is.dirty());else if(as.kind==="emoji")emojiRegex||(emojiRegex=new RegExp(_emojiRegex,"u")),emojiRegex.test(Mn.data)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{validation:"emoji",code:ZodIssueCode.invalid_string,message:as.message}),is.dirty());else if(as.kind==="uuid")uuidRegex.test(Mn.data)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{validation:"uuid",code:ZodIssueCode.invalid_string,message:as.message}),is.dirty());else if(as.kind==="cuid")cuidRegex.test(Mn.data)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{validation:"cuid",code:ZodIssueCode.invalid_string,message:as.message}),is.dirty());else if(as.kind==="cuid2")cuid2Regex.test(Mn.data)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:as.message}),is.dirty());else if(as.kind==="ulid")ulidRegex.test(Mn.data)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{validation:"ulid",code:ZodIssueCode.invalid_string,message:as.message}),is.dirty());else if(as.kind==="url")try{new URL(Mn.data)}catch{os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{validation:"url",code:ZodIssueCode.invalid_string,message:as.message}),is.dirty()}else as.kind==="regex"?(as.regex.lastIndex=0,as.regex.test(Mn.data)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{validation:"regex",code:ZodIssueCode.invalid_string,message:as.message}),is.dirty())):as.kind==="trim"?Mn.data=Mn.data.trim():as.kind==="includes"?Mn.data.includes(as.value,as.position)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{code:ZodIssueCode.invalid_string,validation:{includes:as.value,position:as.position},message:as.message}),is.dirty()):as.kind==="toLowerCase"?Mn.data=Mn.data.toLowerCase():as.kind==="toUpperCase"?Mn.data=Mn.data.toUpperCase():as.kind==="startsWith"?Mn.data.startsWith(as.value)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{code:ZodIssueCode.invalid_string,validation:{startsWith:as.value},message:as.message}),is.dirty()):as.kind==="endsWith"?Mn.data.endsWith(as.value)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{code:ZodIssueCode.invalid_string,validation:{endsWith:as.value},message:as.message}),is.dirty()):as.kind==="datetime"?datetimeRegex(as).test(Mn.data)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{code:ZodIssueCode.invalid_string,validation:"datetime",message:as.message}),is.dirty()):as.kind==="ip"?isValidIP(Mn.data,as.version)||(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{validation:"ip",code:ZodIssueCode.invalid_string,message:as.message}),is.dirty()):util.assertNever(as);return{status:is.value,value:Mn.data}}_regex(Mn,rs,is){return this.refinement(os=>Mn.test(os),{validation:rs,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(is)})}_addCheck(Mn){return new ZodString({...this._def,checks:[...this._def.checks,Mn]})}email(Mn){return this._addCheck({kind:"email",...errorUtil.errToObj(Mn)})}url(Mn){return this._addCheck({kind:"url",...errorUtil.errToObj(Mn)})}emoji(Mn){return this._addCheck({kind:"emoji",...errorUtil.errToObj(Mn)})}uuid(Mn){return this._addCheck({kind:"uuid",...errorUtil.errToObj(Mn)})}cuid(Mn){return this._addCheck({kind:"cuid",...errorUtil.errToObj(Mn)})}cuid2(Mn){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(Mn)})}ulid(Mn){return this._addCheck({kind:"ulid",...errorUtil.errToObj(Mn)})}ip(Mn){return this._addCheck({kind:"ip",...errorUtil.errToObj(Mn)})}datetime(Mn){var rs;return typeof Mn=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:Mn}):this._addCheck({kind:"datetime",precision:typeof(Mn==null?void 0:Mn.precision)>"u"?null:Mn==null?void 0:Mn.precision,offset:(rs=Mn==null?void 0:Mn.offset)!==null&&rs!==void 0?rs:!1,...errorUtil.errToObj(Mn==null?void 0:Mn.message)})}regex(Mn,rs){return this._addCheck({kind:"regex",regex:Mn,...errorUtil.errToObj(rs)})}includes(Mn,rs){return this._addCheck({kind:"includes",value:Mn,position:rs==null?void 0:rs.position,...errorUtil.errToObj(rs==null?void 0:rs.message)})}startsWith(Mn,rs){return this._addCheck({kind:"startsWith",value:Mn,...errorUtil.errToObj(rs)})}endsWith(Mn,rs){return this._addCheck({kind:"endsWith",value:Mn,...errorUtil.errToObj(rs)})}min(Mn,rs){return this._addCheck({kind:"min",value:Mn,...errorUtil.errToObj(rs)})}max(Mn,rs){return this._addCheck({kind:"max",value:Mn,...errorUtil.errToObj(rs)})}length(Mn,rs){return this._addCheck({kind:"length",value:Mn,...errorUtil.errToObj(rs)})}nonempty(Mn){return this.min(1,errorUtil.errToObj(Mn))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(Mn=>Mn.kind==="datetime")}get isEmail(){return!!this._def.checks.find(Mn=>Mn.kind==="email")}get isURL(){return!!this._def.checks.find(Mn=>Mn.kind==="url")}get isEmoji(){return!!this._def.checks.find(Mn=>Mn.kind==="emoji")}get isUUID(){return!!this._def.checks.find(Mn=>Mn.kind==="uuid")}get isCUID(){return!!this._def.checks.find(Mn=>Mn.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(Mn=>Mn.kind==="cuid2")}get isULID(){return!!this._def.checks.find(Mn=>Mn.kind==="ulid")}get isIP(){return!!this._def.checks.find(Mn=>Mn.kind==="ip")}get minLength(){let Mn=null;for(const rs of this._def.checks)rs.kind==="min"&&(Mn===null||rs.value>Mn)&&(Mn=rs.value);return Mn}get maxLength(){let Mn=null;for(const rs of this._def.checks)rs.kind==="max"&&(Mn===null||rs.value<Mn)&&(Mn=rs.value);return Mn}}ZodString.create=Fn=>{var Mn;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(Mn=Fn==null?void 0:Fn.coerce)!==null&&Mn!==void 0?Mn:!1,...processCreateParams(Fn)})};function floatSafeRemainder(Fn,Mn){const rs=(Fn.toString().split(".")[1]||"").length,is=(Mn.toString().split(".")[1]||"").length,os=rs>is?rs:is,as=parseInt(Fn.toFixed(os).replace(".","")),us=parseInt(Mn.toFixed(os).replace(".",""));return as%us/Math.pow(10,os)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(Mn){if(this._def.coerce&&(Mn.data=Number(Mn.data)),this._getType(Mn)!==ZodParsedType.number){const as=this._getOrReturnCtx(Mn);return addIssueToContext(as,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:as.parsedType}),INVALID}let is;const os=new ParseStatus;for(const as of this._def.checks)as.kind==="int"?util.isInteger(Mn.data)||(is=this._getOrReturnCtx(Mn,is),addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:as.message}),os.dirty()):as.kind==="min"?(as.inclusive?Mn.data<as.value:Mn.data<=as.value)&&(is=this._getOrReturnCtx(Mn,is),addIssueToContext(is,{code:ZodIssueCode.too_small,minimum:as.value,type:"number",inclusive:as.inclusive,exact:!1,message:as.message}),os.dirty()):as.kind==="max"?(as.inclusive?Mn.data>as.value:Mn.data>=as.value)&&(is=this._getOrReturnCtx(Mn,is),addIssueToContext(is,{code:ZodIssueCode.too_big,maximum:as.value,type:"number",inclusive:as.inclusive,exact:!1,message:as.message}),os.dirty()):as.kind==="multipleOf"?floatSafeRemainder(Mn.data,as.value)!==0&&(is=this._getOrReturnCtx(Mn,is),addIssueToContext(is,{code:ZodIssueCode.not_multiple_of,multipleOf:as.value,message:as.message}),os.dirty()):as.kind==="finite"?Number.isFinite(Mn.data)||(is=this._getOrReturnCtx(Mn,is),addIssueToContext(is,{code:ZodIssueCode.not_finite,message:as.message}),os.dirty()):util.assertNever(as);return{status:os.value,value:Mn.data}}gte(Mn,rs){return this.setLimit("min",Mn,!0,errorUtil.toString(rs))}gt(Mn,rs){return this.setLimit("min",Mn,!1,errorUtil.toString(rs))}lte(Mn,rs){return this.setLimit("max",Mn,!0,errorUtil.toString(rs))}lt(Mn,rs){return this.setLimit("max",Mn,!1,errorUtil.toString(rs))}setLimit(Mn,rs,is,os){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:Mn,value:rs,inclusive:is,message:errorUtil.toString(os)}]})}_addCheck(Mn){return new ZodNumber({...this._def,checks:[...this._def.checks,Mn]})}int(Mn){return this._addCheck({kind:"int",message:errorUtil.toString(Mn)})}positive(Mn){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(Mn)})}negative(Mn){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(Mn)})}nonpositive(Mn){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(Mn)})}nonnegative(Mn){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(Mn)})}multipleOf(Mn,rs){return this._addCheck({kind:"multipleOf",value:Mn,message:errorUtil.toString(rs)})}finite(Mn){return this._addCheck({kind:"finite",message:errorUtil.toString(Mn)})}safe(Mn){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(Mn)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(Mn)})}get minValue(){let Mn=null;for(const rs of this._def.checks)rs.kind==="min"&&(Mn===null||rs.value>Mn)&&(Mn=rs.value);return Mn}get maxValue(){let Mn=null;for(const rs of this._def.checks)rs.kind==="max"&&(Mn===null||rs.value<Mn)&&(Mn=rs.value);return Mn}get isInt(){return!!this._def.checks.find(Mn=>Mn.kind==="int"||Mn.kind==="multipleOf"&&util.isInteger(Mn.value))}get isFinite(){let Mn=null,rs=null;for(const is of this._def.checks){if(is.kind==="finite"||is.kind==="int"||is.kind==="multipleOf")return!0;is.kind==="min"?(rs===null||is.value>rs)&&(rs=is.value):is.kind==="max"&&(Mn===null||is.value<Mn)&&(Mn=is.value)}return Number.isFinite(rs)&&Number.isFinite(Mn)}}ZodNumber.create=Fn=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(Fn==null?void 0:Fn.coerce)||!1,...processCreateParams(Fn)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(Mn){if(this._def.coerce&&(Mn.data=BigInt(Mn.data)),this._getType(Mn)!==ZodParsedType.bigint){const as=this._getOrReturnCtx(Mn);return addIssueToContext(as,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:as.parsedType}),INVALID}let is;const os=new ParseStatus;for(const as of this._def.checks)as.kind==="min"?(as.inclusive?Mn.data<as.value:Mn.data<=as.value)&&(is=this._getOrReturnCtx(Mn,is),addIssueToContext(is,{code:ZodIssueCode.too_small,type:"bigint",minimum:as.value,inclusive:as.inclusive,message:as.message}),os.dirty()):as.kind==="max"?(as.inclusive?Mn.data>as.value:Mn.data>=as.value)&&(is=this._getOrReturnCtx(Mn,is),addIssueToContext(is,{code:ZodIssueCode.too_big,type:"bigint",maximum:as.value,inclusive:as.inclusive,message:as.message}),os.dirty()):as.kind==="multipleOf"?Mn.data%as.value!==BigInt(0)&&(is=this._getOrReturnCtx(Mn,is),addIssueToContext(is,{code:ZodIssueCode.not_multiple_of,multipleOf:as.value,message:as.message}),os.dirty()):util.assertNever(as);return{status:os.value,value:Mn.data}}gte(Mn,rs){return this.setLimit("min",Mn,!0,errorUtil.toString(rs))}gt(Mn,rs){return this.setLimit("min",Mn,!1,errorUtil.toString(rs))}lte(Mn,rs){return this.setLimit("max",Mn,!0,errorUtil.toString(rs))}lt(Mn,rs){return this.setLimit("max",Mn,!1,errorUtil.toString(rs))}setLimit(Mn,rs,is,os){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:Mn,value:rs,inclusive:is,message:errorUtil.toString(os)}]})}_addCheck(Mn){return new ZodBigInt({...this._def,checks:[...this._def.checks,Mn]})}positive(Mn){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(Mn)})}negative(Mn){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(Mn)})}nonpositive(Mn){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(Mn)})}nonnegative(Mn){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(Mn)})}multipleOf(Mn,rs){return this._addCheck({kind:"multipleOf",value:Mn,message:errorUtil.toString(rs)})}get minValue(){let Mn=null;for(const rs of this._def.checks)rs.kind==="min"&&(Mn===null||rs.value>Mn)&&(Mn=rs.value);return Mn}get maxValue(){let Mn=null;for(const rs of this._def.checks)rs.kind==="max"&&(Mn===null||rs.value<Mn)&&(Mn=rs.value);return Mn}}ZodBigInt.create=Fn=>{var Mn;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(Mn=Fn==null?void 0:Fn.coerce)!==null&&Mn!==void 0?Mn:!1,...processCreateParams(Fn)})};class ZodBoolean extends ZodType{_parse(Mn){if(this._def.coerce&&(Mn.data=!!Mn.data),this._getType(Mn)!==ZodParsedType.boolean){const is=this._getOrReturnCtx(Mn);return addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:is.parsedType}),INVALID}return OK(Mn.data)}}ZodBoolean.create=Fn=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(Fn==null?void 0:Fn.coerce)||!1,...processCreateParams(Fn)});class ZodDate extends ZodType{_parse(Mn){if(this._def.coerce&&(Mn.data=new Date(Mn.data)),this._getType(Mn)!==ZodParsedType.date){const as=this._getOrReturnCtx(Mn);return addIssueToContext(as,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:as.parsedType}),INVALID}if(isNaN(Mn.data.getTime())){const as=this._getOrReturnCtx(Mn);return addIssueToContext(as,{code:ZodIssueCode.invalid_date}),INVALID}const is=new ParseStatus;let os;for(const as of this._def.checks)as.kind==="min"?Mn.data.getTime()<as.value&&(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{code:ZodIssueCode.too_small,message:as.message,inclusive:!0,exact:!1,minimum:as.value,type:"date"}),is.dirty()):as.kind==="max"?Mn.data.getTime()>as.value&&(os=this._getOrReturnCtx(Mn,os),addIssueToContext(os,{code:ZodIssueCode.too_big,message:as.message,inclusive:!0,exact:!1,maximum:as.value,type:"date"}),is.dirty()):util.assertNever(as);return{status:is.value,value:new Date(Mn.data.getTime())}}_addCheck(Mn){return new ZodDate({...this._def,checks:[...this._def.checks,Mn]})}min(Mn,rs){return this._addCheck({kind:"min",value:Mn.getTime(),message:errorUtil.toString(rs)})}max(Mn,rs){return this._addCheck({kind:"max",value:Mn.getTime(),message:errorUtil.toString(rs)})}get minDate(){let Mn=null;for(const rs of this._def.checks)rs.kind==="min"&&(Mn===null||rs.value>Mn)&&(Mn=rs.value);return Mn!=null?new Date(Mn):null}get maxDate(){let Mn=null;for(const rs of this._def.checks)rs.kind==="max"&&(Mn===null||rs.value<Mn)&&(Mn=rs.value);return Mn!=null?new Date(Mn):null}}ZodDate.create=Fn=>new ZodDate({checks:[],coerce:(Fn==null?void 0:Fn.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(Fn)});class ZodSymbol extends ZodType{_parse(Mn){if(this._getType(Mn)!==ZodParsedType.symbol){const is=this._getOrReturnCtx(Mn);return addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:is.parsedType}),INVALID}return OK(Mn.data)}}ZodSymbol.create=Fn=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(Fn)});class ZodUndefined extends ZodType{_parse(Mn){if(this._getType(Mn)!==ZodParsedType.undefined){const is=this._getOrReturnCtx(Mn);return addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:is.parsedType}),INVALID}return OK(Mn.data)}}ZodUndefined.create=Fn=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(Fn)});class ZodNull extends ZodType{_parse(Mn){if(this._getType(Mn)!==ZodParsedType.null){const is=this._getOrReturnCtx(Mn);return addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:is.parsedType}),INVALID}return OK(Mn.data)}}ZodNull.create=Fn=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(Fn)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(Mn){return OK(Mn.data)}}ZodAny.create=Fn=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(Fn)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(Mn){return OK(Mn.data)}}ZodUnknown.create=Fn=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(Fn)});class ZodNever extends ZodType{_parse(Mn){const rs=this._getOrReturnCtx(Mn);return addIssueToContext(rs,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:rs.parsedType}),INVALID}}ZodNever.create=Fn=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(Fn)});class ZodVoid extends ZodType{_parse(Mn){if(this._getType(Mn)!==ZodParsedType.undefined){const is=this._getOrReturnCtx(Mn);return addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:is.parsedType}),INVALID}return OK(Mn.data)}}ZodVoid.create=Fn=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(Fn)});class ZodArray extends ZodType{_parse(Mn){const{ctx:rs,status:is}=this._processInputParams(Mn),os=this._def;if(rs.parsedType!==ZodParsedType.array)return addIssueToContext(rs,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:rs.parsedType}),INVALID;if(os.exactLength!==null){const us=rs.data.length>os.exactLength.value,ds=rs.data.length<os.exactLength.value;(us||ds)&&(addIssueToContext(rs,{code:us?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:ds?os.exactLength.value:void 0,maximum:us?os.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:os.exactLength.message}),is.dirty())}if(os.minLength!==null&&rs.data.length<os.minLength.value&&(addIssueToContext(rs,{code:ZodIssueCode.too_small,minimum:os.minLength.value,type:"array",inclusive:!0,exact:!1,message:os.minLength.message}),is.dirty()),os.maxLength!==null&&rs.data.length>os.maxLength.value&&(addIssueToContext(rs,{code:ZodIssueCode.too_big,maximum:os.maxLength.value,type:"array",inclusive:!0,exact:!1,message:os.maxLength.message}),is.dirty()),rs.common.async)return Promise.all([...rs.data].map((us,ds)=>os.type._parseAsync(new ParseInputLazyPath(rs,us,rs.path,ds)))).then(us=>ParseStatus.mergeArray(is,us));const as=[...rs.data].map((us,ds)=>os.type._parseSync(new ParseInputLazyPath(rs,us,rs.path,ds)));return ParseStatus.mergeArray(is,as)}get element(){return this._def.type}min(Mn,rs){return new ZodArray({...this._def,minLength:{value:Mn,message:errorUtil.toString(rs)}})}max(Mn,rs){return new ZodArray({...this._def,maxLength:{value:Mn,message:errorUtil.toString(rs)}})}length(Mn,rs){return new ZodArray({...this._def,exactLength:{value:Mn,message:errorUtil.toString(rs)}})}nonempty(Mn){return this.min(1,Mn)}}ZodArray.create=(Fn,Mn)=>new ZodArray({type:Fn,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(Mn)});function deepPartialify(Fn){if(Fn instanceof ZodObject){const Mn={};for(const rs in Fn.shape){const is=Fn.shape[rs];Mn[rs]=ZodOptional.create(deepPartialify(is))}return new ZodObject({...Fn._def,shape:()=>Mn})}else return Fn instanceof ZodArray?new ZodArray({...Fn._def,type:deepPartialify(Fn.element)}):Fn instanceof ZodOptional?ZodOptional.create(deepPartialify(Fn.unwrap())):Fn instanceof ZodNullable?ZodNullable.create(deepPartialify(Fn.unwrap())):Fn instanceof ZodTuple?ZodTuple.create(Fn.items.map(Mn=>deepPartialify(Mn))):Fn}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const Mn=this._def.shape(),rs=util.objectKeys(Mn);return this._cached={shape:Mn,keys:rs}}_parse(Mn){if(this._getType(Mn)!==ZodParsedType.object){const ps=this._getOrReturnCtx(Mn);return addIssueToContext(ps,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ps.parsedType}),INVALID}const{status:is,ctx:os}=this._processInputParams(Mn),{shape:as,keys:us}=this._getCached(),ds=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const ps in os.data)us.includes(ps)||ds.push(ps);const hs=[];for(const ps of us){const io=as[ps],fo=os.data[ps];hs.push({key:{status:"valid",value:ps},value:io._parse(new ParseInputLazyPath(os,fo,os.path,ps)),alwaysSet:ps in os.data})}if(this._def.catchall instanceof ZodNever){const ps=this._def.unknownKeys;if(ps==="passthrough")for(const io of ds)hs.push({key:{status:"valid",value:io},value:{status:"valid",value:os.data[io]}});else if(ps==="strict")ds.length>0&&(addIssueToContext(os,{code:ZodIssueCode.unrecognized_keys,keys:ds}),is.dirty());else if(ps!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const ps=this._def.catchall;for(const io of ds){const fo=os.data[io];hs.push({key:{status:"valid",value:io},value:ps._parse(new ParseInputLazyPath(os,fo,os.path,io)),alwaysSet:io in os.data})}}return os.common.async?Promise.resolve().then(async()=>{const ps=[];for(const io of hs){const fo=await io.key;ps.push({key:fo,value:await io.value,alwaysSet:io.alwaysSet})}return ps}).then(ps=>ParseStatus.mergeObjectSync(is,ps)):ParseStatus.mergeObjectSync(is,hs)}get shape(){return this._def.shape()}strict(Mn){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...Mn!==void 0?{errorMap:(rs,is)=>{var os,as,us,ds;const hs=(us=(as=(os=this._def).errorMap)===null||as===void 0?void 0:as.call(os,rs,is).message)!==null&&us!==void 0?us:is.defaultError;return rs.code==="unrecognized_keys"?{message:(ds=errorUtil.errToObj(Mn).message)!==null&&ds!==void 0?ds:hs}:{message:hs}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(Mn){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...Mn})})}merge(Mn){return new ZodObject({unknownKeys:Mn._def.unknownKeys,catchall:Mn._def.catchall,shape:()=>({...this._def.shape(),...Mn._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(Mn,rs){return this.augment({[Mn]:rs})}catchall(Mn){return new ZodObject({...this._def,catchall:Mn})}pick(Mn){const rs={};return util.objectKeys(Mn).forEach(is=>{Mn[is]&&this.shape[is]&&(rs[is]=this.shape[is])}),new ZodObject({...this._def,shape:()=>rs})}omit(Mn){const rs={};return util.objectKeys(this.shape).forEach(is=>{Mn[is]||(rs[is]=this.shape[is])}),new ZodObject({...this._def,shape:()=>rs})}deepPartial(){return deepPartialify(this)}partial(Mn){const rs={};return util.objectKeys(this.shape).forEach(is=>{const os=this.shape[is];Mn&&!Mn[is]?rs[is]=os:rs[is]=os.optional()}),new ZodObject({...this._def,shape:()=>rs})}required(Mn){const rs={};return util.objectKeys(this.shape).forEach(is=>{if(Mn&&!Mn[is])rs[is]=this.shape[is];else{let as=this.shape[is];for(;as instanceof ZodOptional;)as=as._def.innerType;rs[is]=as}}),new ZodObject({...this._def,shape:()=>rs})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(Fn,Mn)=>new ZodObject({shape:()=>Fn,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Mn)});ZodObject.strictCreate=(Fn,Mn)=>new ZodObject({shape:()=>Fn,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Mn)});ZodObject.lazycreate=(Fn,Mn)=>new ZodObject({shape:Fn,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Mn)});class ZodUnion extends ZodType{_parse(Mn){const{ctx:rs}=this._processInputParams(Mn),is=this._def.options;function os(as){for(const ds of as)if(ds.result.status==="valid")return ds.result;for(const ds of as)if(ds.result.status==="dirty")return rs.common.issues.push(...ds.ctx.common.issues),ds.result;const us=as.map(ds=>new ZodError(ds.ctx.common.issues));return addIssueToContext(rs,{code:ZodIssueCode.invalid_union,unionErrors:us}),INVALID}if(rs.common.async)return Promise.all(is.map(async as=>{const us={...rs,common:{...rs.common,issues:[]},parent:null};return{result:await as._parseAsync({data:rs.data,path:rs.path,parent:us}),ctx:us}})).then(os);{let as;const us=[];for(const hs of is){const ps={...rs,common:{...rs.common,issues:[]},parent:null},io=hs._parseSync({data:rs.data,path:rs.path,parent:ps});if(io.status==="valid")return io;io.status==="dirty"&&!as&&(as={result:io,ctx:ps}),ps.common.issues.length&&us.push(ps.common.issues)}if(as)return rs.common.issues.push(...as.ctx.common.issues),as.result;const ds=us.map(hs=>new ZodError(hs));return addIssueToContext(rs,{code:ZodIssueCode.invalid_union,unionErrors:ds}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(Fn,Mn)=>new ZodUnion({options:Fn,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(Mn)});const getDiscriminator=Fn=>Fn instanceof ZodLazy?getDiscriminator(Fn.schema):Fn instanceof ZodEffects?getDiscriminator(Fn.innerType()):Fn instanceof ZodLiteral?[Fn.value]:Fn instanceof ZodEnum?Fn.options:Fn instanceof ZodNativeEnum?Object.keys(Fn.enum):Fn instanceof ZodDefault?getDiscriminator(Fn._def.innerType):Fn instanceof ZodUndefined?[void 0]:Fn instanceof ZodNull?[null]:null;class ZodDiscriminatedUnion extends ZodType{_parse(Mn){const{ctx:rs}=this._processInputParams(Mn);if(rs.parsedType!==ZodParsedType.object)return addIssueToContext(rs,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:rs.parsedType}),INVALID;const is=this.discriminator,os=rs.data[is],as=this.optionsMap.get(os);return as?rs.common.async?as._parseAsync({data:rs.data,path:rs.path,parent:rs}):as._parseSync({data:rs.data,path:rs.path,parent:rs}):(addIssueToContext(rs,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[is]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(Mn,rs,is){const os=new Map;for(const as of rs){const us=getDiscriminator(as.shape[Mn]);if(!us)throw new Error(`A discriminator value for key \`${Mn}\` could not be extracted from all schema options`);for(const ds of us){if(os.has(ds))throw new Error(`Discriminator property ${String(Mn)} has duplicate value ${String(ds)}`);os.set(ds,as)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:Mn,options:rs,optionsMap:os,...processCreateParams(is)})}}function mergeValues(Fn,Mn){const rs=getParsedType(Fn),is=getParsedType(Mn);if(Fn===Mn)return{valid:!0,data:Fn};if(rs===ZodParsedType.object&&is===ZodParsedType.object){const os=util.objectKeys(Mn),as=util.objectKeys(Fn).filter(ds=>os.indexOf(ds)!==-1),us={...Fn,...Mn};for(const ds of as){const hs=mergeValues(Fn[ds],Mn[ds]);if(!hs.valid)return{valid:!1};us[ds]=hs.data}return{valid:!0,data:us}}else if(rs===ZodParsedType.array&&is===ZodParsedType.array){if(Fn.length!==Mn.length)return{valid:!1};const os=[];for(let as=0;as<Fn.length;as++){const us=Fn[as],ds=Mn[as],hs=mergeValues(us,ds);if(!hs.valid)return{valid:!1};os.push(hs.data)}return{valid:!0,data:os}}else return rs===ZodParsedType.date&&is===ZodParsedType.date&&+Fn==+Mn?{valid:!0,data:Fn}:{valid:!1}}class ZodIntersection extends ZodType{_parse(Mn){const{status:rs,ctx:is}=this._processInputParams(Mn),os=(as,us)=>{if(isAborted(as)||isAborted(us))return INVALID;const ds=mergeValues(as.value,us.value);return ds.valid?((isDirty(as)||isDirty(us))&&rs.dirty(),{status:rs.value,value:ds.data}):(addIssueToContext(is,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return is.common.async?Promise.all([this._def.left._parseAsync({data:is.data,path:is.path,parent:is}),this._def.right._parseAsync({data:is.data,path:is.path,parent:is})]).then(([as,us])=>os(as,us)):os(this._def.left._parseSync({data:is.data,path:is.path,parent:is}),this._def.right._parseSync({data:is.data,path:is.path,parent:is}))}}ZodIntersection.create=(Fn,Mn,rs)=>new ZodIntersection({left:Fn,right:Mn,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(rs)});class ZodTuple extends ZodType{_parse(Mn){const{status:rs,ctx:is}=this._processInputParams(Mn);if(is.parsedType!==ZodParsedType.array)return addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:is.parsedType}),INVALID;if(is.data.length<this._def.items.length)return addIssueToContext(is,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),INVALID;!this._def.rest&&is.data.length>this._def.items.length&&(addIssueToContext(is,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),rs.dirty());const as=[...is.data].map((us,ds)=>{const hs=this._def.items[ds]||this._def.rest;return hs?hs._parse(new ParseInputLazyPath(is,us,is.path,ds)):null}).filter(us=>!!us);return is.common.async?Promise.all(as).then(us=>ParseStatus.mergeArray(rs,us)):ParseStatus.mergeArray(rs,as)}get items(){return this._def.items}rest(Mn){return new ZodTuple({...this._def,rest:Mn})}}ZodTuple.create=(Fn,Mn)=>{if(!Array.isArray(Fn))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:Fn,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(Mn)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Mn){const{status:rs,ctx:is}=this._processInputParams(Mn);if(is.parsedType!==ZodParsedType.object)return addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:is.parsedType}),INVALID;const os=[],as=this._def.keyType,us=this._def.valueType;for(const ds in is.data)os.push({key:as._parse(new ParseInputLazyPath(is,ds,is.path,ds)),value:us._parse(new ParseInputLazyPath(is,is.data[ds],is.path,ds))});return is.common.async?ParseStatus.mergeObjectAsync(rs,os):ParseStatus.mergeObjectSync(rs,os)}get element(){return this._def.valueType}static create(Mn,rs,is){return rs instanceof ZodType?new ZodRecord({keyType:Mn,valueType:rs,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(is)}):new ZodRecord({keyType:ZodString.create(),valueType:Mn,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(rs)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Mn){const{status:rs,ctx:is}=this._processInputParams(Mn);if(is.parsedType!==ZodParsedType.map)return addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:is.parsedType}),INVALID;const os=this._def.keyType,as=this._def.valueType,us=[...is.data.entries()].map(([ds,hs],ps)=>({key:os._parse(new ParseInputLazyPath(is,ds,is.path,[ps,"key"])),value:as._parse(new ParseInputLazyPath(is,hs,is.path,[ps,"value"]))}));if(is.common.async){const ds=new Map;return Promise.resolve().then(async()=>{for(const hs of us){const ps=await hs.key,io=await hs.value;if(ps.status==="aborted"||io.status==="aborted")return INVALID;(ps.status==="dirty"||io.status==="dirty")&&rs.dirty(),ds.set(ps.value,io.value)}return{status:rs.value,value:ds}})}else{const ds=new Map;for(const hs of us){const ps=hs.key,io=hs.value;if(ps.status==="aborted"||io.status==="aborted")return INVALID;(ps.status==="dirty"||io.status==="dirty")&&rs.dirty(),ds.set(ps.value,io.value)}return{status:rs.value,value:ds}}}}ZodMap.create=(Fn,Mn,rs)=>new ZodMap({valueType:Mn,keyType:Fn,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(rs)});class ZodSet extends ZodType{_parse(Mn){const{status:rs,ctx:is}=this._processInputParams(Mn);if(is.parsedType!==ZodParsedType.set)return addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:is.parsedType}),INVALID;const os=this._def;os.minSize!==null&&is.data.size<os.minSize.value&&(addIssueToContext(is,{code:ZodIssueCode.too_small,minimum:os.minSize.value,type:"set",inclusive:!0,exact:!1,message:os.minSize.message}),rs.dirty()),os.maxSize!==null&&is.data.size>os.maxSize.value&&(addIssueToContext(is,{code:ZodIssueCode.too_big,maximum:os.maxSize.value,type:"set",inclusive:!0,exact:!1,message:os.maxSize.message}),rs.dirty());const as=this._def.valueType;function us(hs){const ps=new Set;for(const io of hs){if(io.status==="aborted")return INVALID;io.status==="dirty"&&rs.dirty(),ps.add(io.value)}return{status:rs.value,value:ps}}const ds=[...is.data.values()].map((hs,ps)=>as._parse(new ParseInputLazyPath(is,hs,is.path,ps)));return is.common.async?Promise.all(ds).then(hs=>us(hs)):us(ds)}min(Mn,rs){return new ZodSet({...this._def,minSize:{value:Mn,message:errorUtil.toString(rs)}})}max(Mn,rs){return new ZodSet({...this._def,maxSize:{value:Mn,message:errorUtil.toString(rs)}})}size(Mn,rs){return this.min(Mn,rs).max(Mn,rs)}nonempty(Mn){return this.min(1,Mn)}}ZodSet.create=(Fn,Mn)=>new ZodSet({valueType:Fn,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(Mn)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(Mn){const{ctx:rs}=this._processInputParams(Mn);if(rs.parsedType!==ZodParsedType.function)return addIssueToContext(rs,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:rs.parsedType}),INVALID;function is(ds,hs){return makeIssue({data:ds,path:rs.path,errorMaps:[rs.common.contextualErrorMap,rs.schemaErrorMap,getErrorMap(),errorMap].filter(ps=>!!ps),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:hs}})}function os(ds,hs){return makeIssue({data:ds,path:rs.path,errorMaps:[rs.common.contextualErrorMap,rs.schemaErrorMap,getErrorMap(),errorMap].filter(ps=>!!ps),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:hs}})}const as={errorMap:rs.common.contextualErrorMap},us=rs.data;if(this._def.returns instanceof ZodPromise){const ds=this;return OK(async function(...hs){const ps=new ZodError([]),io=await ds._def.args.parseAsync(hs,as).catch(Ao=>{throw ps.addIssue(is(hs,Ao)),ps}),fo=await Reflect.apply(us,this,io);return await ds._def.returns._def.type.parseAsync(fo,as).catch(Ao=>{throw ps.addIssue(os(fo,Ao)),ps})})}else{const ds=this;return OK(function(...hs){const ps=ds._def.args.safeParse(hs,as);if(!ps.success)throw new ZodError([is(hs,ps.error)]);const io=Reflect.apply(us,this,ps.data),fo=ds._def.returns.safeParse(io,as);if(!fo.success)throw new ZodError([os(io,fo.error)]);return fo.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...Mn){return new ZodFunction({...this._def,args:ZodTuple.create(Mn).rest(ZodUnknown.create())})}returns(Mn){return new ZodFunction({...this._def,returns:Mn})}implement(Mn){return this.parse(Mn)}strictImplement(Mn){return this.parse(Mn)}static create(Mn,rs,is){return new ZodFunction({args:Mn||ZodTuple.create([]).rest(ZodUnknown.create()),returns:rs||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(is)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(Mn){const{ctx:rs}=this._processInputParams(Mn);return this._def.getter()._parse({data:rs.data,path:rs.path,parent:rs})}}ZodLazy.create=(Fn,Mn)=>new ZodLazy({getter:Fn,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(Mn)});class ZodLiteral extends ZodType{_parse(Mn){if(Mn.data!==this._def.value){const rs=this._getOrReturnCtx(Mn);return addIssueToContext(rs,{received:rs.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:Mn.data}}get value(){return this._def.value}}ZodLiteral.create=(Fn,Mn)=>new ZodLiteral({value:Fn,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(Mn)});function createZodEnum(Fn,Mn){return new ZodEnum({values:Fn,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(Mn)})}class ZodEnum extends ZodType{_parse(Mn){if(typeof Mn.data!="string"){const rs=this._getOrReturnCtx(Mn),is=this._def.values;return addIssueToContext(rs,{expected:util.joinValues(is),received:rs.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._def.values.indexOf(Mn.data)===-1){const rs=this._getOrReturnCtx(Mn),is=this._def.values;return addIssueToContext(rs,{received:rs.data,code:ZodIssueCode.invalid_enum_value,options:is}),INVALID}return OK(Mn.data)}get options(){return this._def.values}get enum(){const Mn={};for(const rs of this._def.values)Mn[rs]=rs;return Mn}get Values(){const Mn={};for(const rs of this._def.values)Mn[rs]=rs;return Mn}get Enum(){const Mn={};for(const rs of this._def.values)Mn[rs]=rs;return Mn}extract(Mn){return ZodEnum.create(Mn)}exclude(Mn){return ZodEnum.create(this.options.filter(rs=>!Mn.includes(rs)))}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(Mn){const rs=util.getValidEnumValues(this._def.values),is=this._getOrReturnCtx(Mn);if(is.parsedType!==ZodParsedType.string&&is.parsedType!==ZodParsedType.number){const os=util.objectValues(rs);return addIssueToContext(is,{expected:util.joinValues(os),received:is.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(rs.indexOf(Mn.data)===-1){const os=util.objectValues(rs);return addIssueToContext(is,{received:is.data,code:ZodIssueCode.invalid_enum_value,options:os}),INVALID}return OK(Mn.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(Fn,Mn)=>new ZodNativeEnum({values:Fn,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(Mn)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(Mn){const{ctx:rs}=this._processInputParams(Mn);if(rs.parsedType!==ZodParsedType.promise&&rs.common.async===!1)return addIssueToContext(rs,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:rs.parsedType}),INVALID;const is=rs.parsedType===ZodParsedType.promise?rs.data:Promise.resolve(rs.data);return OK(is.then(os=>this._def.type.parseAsync(os,{path:rs.path,errorMap:rs.common.contextualErrorMap})))}}ZodPromise.create=(Fn,Mn)=>new ZodPromise({type:Fn,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(Mn)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(Mn){const{status:rs,ctx:is}=this._processInputParams(Mn),os=this._def.effect||null,as={addIssue:us=>{addIssueToContext(is,us),us.fatal?rs.abort():rs.dirty()},get path(){return is.path}};if(as.addIssue=as.addIssue.bind(as),os.type==="preprocess"){const us=os.transform(is.data,as);return is.common.issues.length?{status:"dirty",value:is.data}:is.common.async?Promise.resolve(us).then(ds=>this._def.schema._parseAsync({data:ds,path:is.path,parent:is})):this._def.schema._parseSync({data:us,path:is.path,parent:is})}if(os.type==="refinement"){const us=ds=>{const hs=os.refinement(ds,as);if(is.common.async)return Promise.resolve(hs);if(hs instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return ds};if(is.common.async===!1){const ds=this._def.schema._parseSync({data:is.data,path:is.path,parent:is});return ds.status==="aborted"?INVALID:(ds.status==="dirty"&&rs.dirty(),us(ds.value),{status:rs.value,value:ds.value})}else return this._def.schema._parseAsync({data:is.data,path:is.path,parent:is}).then(ds=>ds.status==="aborted"?INVALID:(ds.status==="dirty"&&rs.dirty(),us(ds.value).then(()=>({status:rs.value,value:ds.value}))))}if(os.type==="transform")if(is.common.async===!1){const us=this._def.schema._parseSync({data:is.data,path:is.path,parent:is});if(!isValid(us))return us;const ds=os.transform(us.value,as);if(ds instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:rs.value,value:ds}}else return this._def.schema._parseAsync({data:is.data,path:is.path,parent:is}).then(us=>isValid(us)?Promise.resolve(os.transform(us.value,as)).then(ds=>({status:rs.value,value:ds})):us);util.assertNever(os)}}ZodEffects.create=(Fn,Mn,rs)=>new ZodEffects({schema:Fn,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:Mn,...processCreateParams(rs)});ZodEffects.createWithPreprocess=(Fn,Mn,rs)=>new ZodEffects({schema:Mn,effect:{type:"preprocess",transform:Fn},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(rs)});class ZodOptional extends ZodType{_parse(Mn){return this._getType(Mn)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(Mn)}unwrap(){return this._def.innerType}}ZodOptional.create=(Fn,Mn)=>new ZodOptional({innerType:Fn,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(Mn)});class ZodNullable extends ZodType{_parse(Mn){return this._getType(Mn)===ZodParsedType.null?OK(null):this._def.innerType._parse(Mn)}unwrap(){return this._def.innerType}}ZodNullable.create=(Fn,Mn)=>new ZodNullable({innerType:Fn,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(Mn)});class ZodDefault extends ZodType{_parse(Mn){const{ctx:rs}=this._processInputParams(Mn);let is=rs.data;return rs.parsedType===ZodParsedType.undefined&&(is=this._def.defaultValue()),this._def.innerType._parse({data:is,path:rs.path,parent:rs})}removeDefault(){return this._def.innerType}}ZodDefault.create=(Fn,Mn)=>new ZodDefault({innerType:Fn,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof Mn.default=="function"?Mn.default:()=>Mn.default,...processCreateParams(Mn)});class ZodCatch extends ZodType{_parse(Mn){const{ctx:rs}=this._processInputParams(Mn),is={...rs,common:{...rs.common,issues:[]}},os=this._def.innerType._parse({data:is.data,path:is.path,parent:{...is}});return isAsync(os)?os.then(as=>({status:"valid",value:as.status==="valid"?as.value:this._def.catchValue({get error(){return new ZodError(is.common.issues)},input:is.data})})):{status:"valid",value:os.status==="valid"?os.value:this._def.catchValue({get error(){return new ZodError(is.common.issues)},input:is.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(Fn,Mn)=>new ZodCatch({innerType:Fn,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof Mn.catch=="function"?Mn.catch:()=>Mn.catch,...processCreateParams(Mn)});class ZodNaN extends ZodType{_parse(Mn){if(this._getType(Mn)!==ZodParsedType.nan){const is=this._getOrReturnCtx(Mn);return addIssueToContext(is,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:is.parsedType}),INVALID}return{status:"valid",value:Mn.data}}}ZodNaN.create=Fn=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(Fn)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(Mn){const{ctx:rs}=this._processInputParams(Mn),is=rs.data;return this._def.type._parse({data:is,path:rs.path,parent:rs})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(Mn){const{status:rs,ctx:is}=this._processInputParams(Mn);if(is.common.async)return(async()=>{const as=await this._def.in._parseAsync({data:is.data,path:is.path,parent:is});return as.status==="aborted"?INVALID:as.status==="dirty"?(rs.dirty(),DIRTY(as.value)):this._def.out._parseAsync({data:as.value,path:is.path,parent:is})})();{const os=this._def.in._parseSync({data:is.data,path:is.path,parent:is});return os.status==="aborted"?INVALID:os.status==="dirty"?(rs.dirty(),{status:"dirty",value:os.value}):this._def.out._parseSync({data:os.value,path:is.path,parent:is})}}static create(Mn,rs){return new ZodPipeline({in:Mn,out:rs,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(Mn){const rs=this._def.innerType._parse(Mn);return isValid(rs)&&(rs.value=Object.freeze(rs.value)),rs}}ZodReadonly.create=(Fn,Mn)=>new ZodReadonly({innerType:Fn,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(Mn)});const custom=(Fn,Mn={},rs)=>Fn?ZodAny.create().superRefine((is,os)=>{var as,us;if(!Fn(is)){const ds=typeof Mn=="function"?Mn(is):typeof Mn=="string"?{message:Mn}:Mn,hs=(us=(as=ds.fatal)!==null&&as!==void 0?as:rs)!==null&&us!==void 0?us:!0,ps=typeof ds=="string"?{message:ds}:ds;os.addIssue({code:"custom",...ps,fatal:hs})}}):ZodAny.create(),late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(Fn){Fn.ZodString="ZodString",Fn.ZodNumber="ZodNumber",Fn.ZodNaN="ZodNaN",Fn.ZodBigInt="ZodBigInt",Fn.ZodBoolean="ZodBoolean",Fn.ZodDate="ZodDate",Fn.ZodSymbol="ZodSymbol",Fn.ZodUndefined="ZodUndefined",Fn.ZodNull="ZodNull",Fn.ZodAny="ZodAny",Fn.ZodUnknown="ZodUnknown",Fn.ZodNever="ZodNever",Fn.ZodVoid="ZodVoid",Fn.ZodArray="ZodArray",Fn.ZodObject="ZodObject",Fn.ZodUnion="ZodUnion",Fn.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Fn.ZodIntersection="ZodIntersection",Fn.ZodTuple="ZodTuple",Fn.ZodRecord="ZodRecord",Fn.ZodMap="ZodMap",Fn.ZodSet="ZodSet",Fn.ZodFunction="ZodFunction",Fn.ZodLazy="ZodLazy",Fn.ZodLiteral="ZodLiteral",Fn.ZodEnum="ZodEnum",Fn.ZodEffects="ZodEffects",Fn.ZodNativeEnum="ZodNativeEnum",Fn.ZodOptional="ZodOptional",Fn.ZodNullable="ZodNullable",Fn.ZodDefault="ZodDefault",Fn.ZodCatch="ZodCatch",Fn.ZodPromise="ZodPromise",Fn.ZodBranded="ZodBranded",Fn.ZodPipeline="ZodPipeline",Fn.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(Fn,Mn={message:`Input not instance of ${Fn.name}`})=>custom(rs=>rs instanceof Fn,Mn),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce$1={string:Fn=>ZodString.create({...Fn,coerce:!0}),number:Fn=>ZodNumber.create({...Fn,coerce:!0}),boolean:Fn=>ZodBoolean.create({...Fn,coerce:!0}),bigint:Fn=>ZodBigInt.create({...Fn,coerce:!0}),date:Fn=>ZodDate.create({...Fn,coerce:!0})},NEVER=INVALID;var z$6=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce:coerce$1,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const zError=z$6.object({message:z$6.string()});function zType(Fn){return z$6.literal(W3mFrameConstants[Fn])}z$6.object({accessList:z$6.array(z$6.string()),blockHash:z$6.string().nullable(),blockNumber:z$6.string().nullable(),chainId:z$6.string().or(z$6.number()),from:z$6.string(),gas:z$6.string(),hash:z$6.string(),input:z$6.string().nullable(),maxFeePerGas:z$6.string(),maxPriorityFeePerGas:z$6.string(),nonce:z$6.string(),r:z$6.string(),s:z$6.string(),to:z$6.string(),transactionIndex:z$6.string().nullable(),type:z$6.string(),v:z$6.string(),value:z$6.string()});const AppSwitchNetworkRequest=z$6.object({chainId:z$6.string().or(z$6.number())}),AppConnectEmailRequest=z$6.object({email:z$6.string().email()}),AppConnectOtpRequest=z$6.object({otp:z$6.string()}),AppConnectSocialRequest=z$6.object({uri:z$6.string()}),AppGetUserRequest=z$6.object({chainId:z$6.optional(z$6.string().or(z$6.number())),preferredAccountType:z$6.optional(z$6.string())}),AppGetSocialRedirectUriRequest=z$6.object({provider:z$6.enum(["google","github","apple","facebook","x","discord"])}),AppUpdateEmailRequest=z$6.object({email:z$6.string().email()}),AppUpdateEmailPrimaryOtpRequest=z$6.object({otp:z$6.string()}),AppUpdateEmailSecondaryOtpRequest=z$6.object({otp:z$6.string()}),AppSyncThemeRequest=z$6.object({themeMode:z$6.optional(z$6.enum(["light","dark"])),themeVariables:z$6.optional(z$6.record(z$6.string(),z$6.string().or(z$6.number()))),w3mThemeVariables:z$6.optional(z$6.record(z$6.string(),z$6.string()))}),AppSyncDappDataRequest=z$6.object({metadata:z$6.object({name:z$6.string(),description:z$6.string(),url:z$6.string(),icons:z$6.array(z$6.string())}).optional(),sdkVersion:z$6.string().optional(),sdkType:z$6.string().optional(),projectId:z$6.string()}),AppSetPreferredAccountRequest=z$6.object({type:z$6.string()}),FrameConnectEmailResponse=z$6.object({action:z$6.enum(["VERIFY_DEVICE","VERIFY_OTP"])}),FrameGetFarcasterUriResponse=z$6.object({url:z$6.string()}),FrameConnectFarcasterResponse=z$6.object({userName:z$6.string()}),FrameConnectSocialResponse=z$6.object({email:z$6.string(),address:z$6.string(),chainId:z$6.string().or(z$6.number()),accounts:z$6.array(z$6.object({address:z$6.string(),type:z$6.enum([W3mFrameRpcConstants.ACCOUNT_TYPES.EOA,W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),userName:z$6.string().optional()}),FrameUpdateEmailResponse=z$6.object({action:z$6.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),FrameGetUserResponse=z$6.object({email:z$6.string().email().optional().nullable(),address:z$6.string(),chainId:z$6.string().or(z$6.number()),smartAccountDeployed:z$6.optional(z$6.boolean()),accounts:z$6.array(z$6.object({address:z$6.string(),type:z$6.enum([W3mFrameRpcConstants.ACCOUNT_TYPES.EOA,W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),preferredAccountType:z$6.optional(z$6.string())}),FrameGetSocialRedirectUriResponse=z$6.object({uri:z$6.string()}),FrameIsConnectedResponse=z$6.object({isConnected:z$6.boolean()}),FrameGetChainIdResponse=z$6.object({chainId:z$6.string().or(z$6.number())}),FrameSwitchNetworkResponse=z$6.object({chainId:z$6.string().or(z$6.number())}),FrameUpdateEmailSecondaryOtpResponse=z$6.object({newEmail:z$6.string().email()}),FrameGetSmartAccountEnabledNetworksResponse=z$6.object({smartAccountEnabledNetworks:z$6.array(z$6.number())});z$6.object({address:z$6.string(),isDeployed:z$6.boolean()});const FrameReadyResponse=z$6.object({version:z$6.string().optional()}),FrameSetPreferredAccountResponse=z$6.object({type:z$6.string(),address:z$6.string()}),RpcResponse=z$6.any(),RpcEthAccountsRequest=z$6.object({method:z$6.literal("eth_accounts")}),RpcEthBlockNumber=z$6.object({method:z$6.literal("eth_blockNumber")}),RpcEthCall=z$6.object({method:z$6.literal("eth_call"),params:z$6.array(z$6.any())}),RpcEthChainId=z$6.object({method:z$6.literal("eth_chainId")}),RpcEthEstimateGas=z$6.object({method:z$6.literal("eth_estimateGas"),params:z$6.array(z$6.any())}),RpcEthFeeHistory=z$6.object({method:z$6.literal("eth_feeHistory"),params:z$6.array(z$6.any())}),RpcEthGasPrice=z$6.object({method:z$6.literal("eth_gasPrice")}),RpcEthGetAccount=z$6.object({method:z$6.literal("eth_getAccount"),params:z$6.array(z$6.any())}),RpcEthGetBalance=z$6.object({method:z$6.literal("eth_getBalance"),params:z$6.array(z$6.any())}),RpcEthGetBlockyByHash=z$6.object({method:z$6.literal("eth_getBlockByHash"),params:z$6.array(z$6.any())}),RpcEthGetBlockByNumber=z$6.object({method:z$6.literal("eth_getBlockByNumber"),params:z$6.array(z$6.any())}),RpcEthGetBlockReceipts=z$6.object({method:z$6.literal("eth_getBlockReceipts"),params:z$6.array(z$6.any())}),RcpEthGetBlockTransactionCountByHash=z$6.object({method:z$6.literal("eth_getBlockTransactionCountByHash"),params:z$6.array(z$6.any())}),RcpEthGetBlockTransactionCountByNumber=z$6.object({method:z$6.literal("eth_getBlockTransactionCountByNumber"),params:z$6.array(z$6.any())}),RpcEthGetCode=z$6.object({method:z$6.literal("eth_getCode"),params:z$6.array(z$6.any())}),RpcEthGetFilter=z$6.object({method:z$6.literal("eth_getFilterChanges"),params:z$6.array(z$6.any())}),RpcEthGetFilterLogs=z$6.object({method:z$6.literal("eth_getFilterLogs"),params:z$6.array(z$6.any())}),RpcEthGetLogs=z$6.object({method:z$6.literal("eth_getLogs"),params:z$6.array(z$6.any())}),RpcEthGetProof=z$6.object({method:z$6.literal("eth_getProof"),params:z$6.array(z$6.any())}),RpcEthGetStorageAt=z$6.object({method:z$6.literal("eth_getStorageAt"),params:z$6.array(z$6.any())}),RpcEthGetTransactionByBlockHashAndIndex=z$6.object({method:z$6.literal("eth_getTransactionByBlockHashAndIndex"),params:z$6.array(z$6.any())}),RpcEthGetTransactionByBlockNumberAndIndex=z$6.object({method:z$6.literal("eth_getTransactionByBlockNumberAndIndex"),params:z$6.array(z$6.any())}),RpcEthGetTransactionByHash=z$6.object({method:z$6.literal("eth_getTransactionByHash"),params:z$6.array(z$6.any())}),RpcEthGetTransactionCount=z$6.object({method:z$6.literal("eth_getTransactionCount"),params:z$6.array(z$6.any())}),RpcEthGetTransactionReceipt=z$6.object({method:z$6.literal("eth_getTransactionReceipt"),params:z$6.array(z$6.any())}),RpcEthGetUncleCountByBlockHash=z$6.object({method:z$6.literal("eth_getUncleCountByBlockHash"),params:z$6.array(z$6.any())}),RpcEthGetUncleCountByBlockNumber=z$6.object({method:z$6.literal("eth_getUncleCountByBlockNumber"),params:z$6.array(z$6.any())}),RpcEthMaxPriorityFeePerGas=z$6.object({method:z$6.literal("eth_maxPriorityFeePerGas")}),RpcEthNewBlockFilter=z$6.object({method:z$6.literal("eth_newBlockFilter")}),RpcEthNewFilter=z$6.object({method:z$6.literal("eth_newFilter"),params:z$6.array(z$6.any())}),RpcEthNewPendingTransactionFilter=z$6.object({method:z$6.literal("eth_newPendingTransactionFilter")}),RpcEthSendRawTransaction=z$6.object({method:z$6.literal("eth_sendRawTransaction"),params:z$6.array(z$6.any())}),RpcEthSyncing=z$6.object({method:z$6.literal("eth_syncing"),params:z$6.array(z$6.any())}),RpcUnistallFilter=z$6.object({method:z$6.literal("eth_uninstallFilter"),params:z$6.array(z$6.any())}),RpcPersonalSignRequest=z$6.object({method:z$6.literal("personal_sign"),params:z$6.array(z$6.any())}),RpcEthSignTypedDataV4=z$6.object({method:z$6.literal("eth_signTypedData_v4"),params:z$6.array(z$6.any())}),RpcEthSendTransactionRequest=z$6.object({method:z$6.literal("eth_sendTransaction"),params:z$6.array(z$6.any())}),RpcSolanaSignMessageRequest=z$6.object({method:z$6.literal("solana_signMessage"),params:z$6.object({message:z$6.string(),pubkey:z$6.string()})}),RpcSolanaSignTransactionRequest=z$6.object({method:z$6.literal("solana_signTransaction"),params:z$6.object({transaction:z$6.string()})}),RpcSolanaSignAllTransactionsRequest=z$6.object({method:z$6.literal("solana_signAllTransactions"),params:z$6.object({transactions:z$6.array(z$6.string())})}),RpcSolanaSignAndSendTransactionRequest=z$6.object({method:z$6.literal("solana_signAndSendTransaction"),params:z$6.object({transaction:z$6.string(),options:z$6.object({skipPreflight:z$6.boolean().optional(),preflightCommitment:z$6.enum(["processed","confirmed","finalized","recent","single","singleGossip","root","max"]).optional(),maxRetries:z$6.number().optional(),minContextSlot:z$6.number().optional()}).optional()})}),WalletSendCallsRequest=z$6.object({method:z$6.literal("wallet_sendCalls"),params:z$6.array(z$6.object({chainId:z$6.string().or(z$6.number()).optional(),from:z$6.string().optional(),version:z$6.string().optional(),capabilities:z$6.any().optional(),calls:z$6.array(z$6.object({to:z$6.string().startsWith("0x"),data:z$6.string().startsWith("0x").optional(),value:z$6.string().optional()}))}))}),WalletGetCallsReceiptRequest=z$6.object({method:z$6.literal("wallet_getCallsStatus"),params:z$6.array(z$6.string())}),WalletGetCapabilitiesRequest=z$6.object({method:z$6.literal("wallet_getCapabilities")}),WalletGrantPermissionsRequest=z$6.object({method:z$6.literal("wallet_grantPermissions"),params:z$6.array(z$6.any())}),WalletRevokePermissionsRequest=z$6.object({method:z$6.literal("wallet_revokePermissions"),params:z$6.any()}),FrameSession=z$6.object({token:z$6.string()}),EventSchema=z$6.object({id:z$6.string().optional()}),W3mFrameSchema={appEvent:EventSchema.extend({type:zType("APP_SWITCH_NETWORK"),payload:AppSwitchNetworkRequest}).or(EventSchema.extend({type:zType("APP_CONNECT_EMAIL"),payload:AppConnectEmailRequest})).or(EventSchema.extend({type:zType("APP_CONNECT_DEVICE")})).or(EventSchema.extend({type:zType("APP_CONNECT_OTP"),payload:AppConnectOtpRequest})).or(EventSchema.extend({type:zType("APP_CONNECT_SOCIAL"),payload:AppConnectSocialRequest})).or(EventSchema.extend({type:zType("APP_GET_FARCASTER_URI")})).or(EventSchema.extend({type:zType("APP_CONNECT_FARCASTER")})).or(EventSchema.extend({type:zType("APP_GET_USER"),payload:z$6.optional(AppGetUserRequest)})).or(EventSchema.extend({type:zType("APP_GET_SOCIAL_REDIRECT_URI"),payload:AppGetSocialRedirectUriRequest})).or(EventSchema.extend({type:zType("APP_SIGN_OUT")})).or(EventSchema.extend({type:zType("APP_IS_CONNECTED"),payload:z$6.optional(FrameSession)})).or(EventSchema.extend({type:zType("APP_GET_CHAIN_ID")})).or(EventSchema.extend({type:zType("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(EventSchema.extend({type:zType("APP_INIT_SMART_ACCOUNT")})).or(EventSchema.extend({type:zType("APP_SET_PREFERRED_ACCOUNT"),payload:AppSetPreferredAccountRequest})).or(EventSchema.extend({type:zType("APP_RPC_REQUEST"),payload:RpcPersonalSignRequest.or(RpcEthSendTransactionRequest).or(RpcEthAccountsRequest).or(RpcEthBlockNumber).or(RpcEthCall).or(RpcEthChainId).or(RpcEthEstimateGas).or(RpcEthFeeHistory).or(RpcEthGasPrice).or(RpcEthGetAccount).or(RpcEthGetBalance).or(RpcEthGetBlockyByHash).or(RpcEthGetBlockByNumber).or(RpcEthGetBlockReceipts).or(RcpEthGetBlockTransactionCountByHash).or(RcpEthGetBlockTransactionCountByNumber).or(RpcEthGetCode).or(RpcEthGetFilter).or(RpcEthGetFilterLogs).or(RpcEthGetLogs).or(RpcEthGetProof).or(RpcEthGetStorageAt).or(RpcEthGetTransactionByBlockHashAndIndex).or(RpcEthGetTransactionByBlockNumberAndIndex).or(RpcEthGetTransactionByHash).or(RpcEthGetTransactionCount).or(RpcEthGetTransactionReceipt).or(RpcEthGetUncleCountByBlockHash).or(RpcEthGetUncleCountByBlockNumber).or(RpcEthMaxPriorityFeePerGas).or(RpcEthNewBlockFilter).or(RpcEthNewFilter).or(RpcEthNewPendingTransactionFilter).or(RpcEthSendRawTransaction).or(RpcEthSyncing).or(RpcUnistallFilter).or(RpcPersonalSignRequest).or(RpcEthSignTypedDataV4).or(RpcEthSendTransactionRequest).or(RpcSolanaSignMessageRequest).or(RpcSolanaSignTransactionRequest).or(RpcSolanaSignAllTransactionsRequest).or(RpcSolanaSignAndSendTransactionRequest).or(WalletGetCallsReceiptRequest).or(WalletSendCallsRequest).or(WalletGetCapabilitiesRequest).or(WalletGrantPermissionsRequest).or(WalletRevokePermissionsRequest)})).or(EventSchema.extend({type:zType("APP_UPDATE_EMAIL"),payload:AppUpdateEmailRequest})).or(EventSchema.extend({type:zType("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:AppUpdateEmailPrimaryOtpRequest})).or(EventSchema.extend({type:zType("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:AppUpdateEmailSecondaryOtpRequest})).or(EventSchema.extend({type:zType("APP_SYNC_THEME"),payload:AppSyncThemeRequest})).or(EventSchema.extend({type:zType("APP_SYNC_DAPP_DATA"),payload:AppSyncDappDataRequest})),frameEvent:EventSchema.extend({type:zType("FRAME_SWITCH_NETWORK_ERROR"),payload:zError}).or(EventSchema.extend({type:zType("FRAME_SWITCH_NETWORK_SUCCESS"),payload:FrameSwitchNetworkResponse})).or(EventSchema.extend({type:zType("FRAME_CONNECT_EMAIL_SUCCESS"),payload:FrameConnectEmailResponse})).or(EventSchema.extend({type:zType("FRAME_CONNECT_EMAIL_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_GET_FARCASTER_URI_SUCCESS"),payload:FrameGetFarcasterUriResponse})).or(EventSchema.extend({type:zType("FRAME_GET_FARCASTER_URI_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_CONNECT_FARCASTER_SUCCESS"),payload:FrameConnectFarcasterResponse})).or(EventSchema.extend({type:zType("FRAME_CONNECT_FARCASTER_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_CONNECT_OTP_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_CONNECT_OTP_SUCCESS")})).or(EventSchema.extend({type:zType("FRAME_CONNECT_DEVICE_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_CONNECT_DEVICE_SUCCESS")})).or(EventSchema.extend({type:zType("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:FrameConnectSocialResponse})).or(EventSchema.extend({type:zType("FRAME_CONNECT_SOCIAL_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_GET_USER_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_GET_USER_SUCCESS"),payload:FrameGetUserResponse})).or(EventSchema.extend({type:zType("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:FrameGetSocialRedirectUriResponse})).or(EventSchema.extend({type:zType("FRAME_SIGN_OUT_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_SIGN_OUT_SUCCESS")})).or(EventSchema.extend({type:zType("FRAME_IS_CONNECTED_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_IS_CONNECTED_SUCCESS"),payload:FrameIsConnectedResponse})).or(EventSchema.extend({type:zType("FRAME_GET_CHAIN_ID_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_GET_CHAIN_ID_SUCCESS"),payload:FrameGetChainIdResponse})).or(EventSchema.extend({type:zType("FRAME_RPC_REQUEST_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_RPC_REQUEST_SUCCESS"),payload:RpcResponse})).or(EventSchema.extend({type:zType("FRAME_SESSION_UPDATE"),payload:FrameSession})).or(EventSchema.extend({type:zType("FRAME_UPDATE_EMAIL_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_UPDATE_EMAIL_SUCCESS"),payload:FrameUpdateEmailResponse})).or(EventSchema.extend({type:zType("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(EventSchema.extend({type:zType("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:FrameUpdateEmailSecondaryOtpResponse})).or(EventSchema.extend({type:zType("FRAME_SYNC_THEME_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_SYNC_THEME_SUCCESS")})).or(EventSchema.extend({type:zType("FRAME_SYNC_DAPP_DATA_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(EventSchema.extend({type:zType("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:FrameGetSmartAccountEnabledNetworksResponse})).or(EventSchema.extend({type:zType("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:FrameSetPreferredAccountResponse})).or(EventSchema.extend({type:zType("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:zError})).or(EventSchema.extend({type:zType("FRAME_READY"),payload:FrameReadyResponse}))},W3mFrameStorage={set(Fn,Mn){W3mFrameHelpers.isClient&&localStorage.setItem(`${W3mFrameConstants.STORAGE_KEY}${Fn}`,Mn)},get(Fn){return W3mFrameHelpers.isClient?localStorage.getItem(`${W3mFrameConstants.STORAGE_KEY}${Fn}`):null},delete(Fn,Mn){W3mFrameHelpers.isClient&&(Mn?localStorage.removeItem(Fn):localStorage.removeItem(`${W3mFrameConstants.STORAGE_KEY}${Fn}`))}},RegexUtil={address:/^0x(?:[A-Fa-f0-9]{40})$/u,transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u},EMAIL_MINIMUM_TIMEOUT=30*1e3,W3mFrameHelpers={checkIfAllowedToTriggerEmail(){const Fn=W3mFrameStorage.get(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME);if(Fn){const Mn=Date.now()-Number(Fn);if(Mn<EMAIL_MINIMUM_TIMEOUT){const rs=Math.ceil((EMAIL_MINIMUM_TIMEOUT-Mn)/1e3);throw new Error(`Please try again after ${rs} seconds`)}}},getTimeToNextEmailLogin(){const Fn=W3mFrameStorage.get(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME);if(Fn){const Mn=Date.now()-Number(Fn);if(Mn<EMAIL_MINIMUM_TIMEOUT)return Math.ceil((EMAIL_MINIMUM_TIMEOUT-Mn)/1e3)}return 0},checkIfRequestExists(Fn){return W3mFrameRpcConstants.NOT_SAFE_RPC_METHODS.includes(Fn.method)||W3mFrameRpcConstants.SAFE_RPC_METHODS.includes(Fn.method)},getResponseType(Fn){return typeof Fn=="string"&&((Fn==null?void 0:Fn.match(RegexUtil.transactionHash))||(Fn==null?void 0:Fn.match(RegexUtil.signedMessage)))?W3mFrameConstants.RPC_RESPONSE_TYPE_TX:W3mFrameConstants.RPC_RESPONSE_TYPE_OBJECT},checkIfRequestIsSafe(Fn){return W3mFrameRpcConstants.SAFE_RPC_METHODS.includes(Fn.method)},isClient:typeof window<"u"};class W3mFrame{constructor(Mn,rs=!1,is="eip155:1"){if(this.iframe=null,this.rpcUrl=ConstantsUtil$3.BLOCKCHAIN_API_RPC_URL,this.events={registerFrameEventHandler:(os,as,us)=>{function ds({data:hs}){var io;if(!((io=hs.type)!=null&&io.includes(W3mFrameConstants.FRAME_EVENT_KEY)))return;const ps=W3mFrameSchema.frameEvent.parse(hs);ps.id===os&&(as(ps),window.removeEventListener("message",ds))}W3mFrameHelpers.isClient&&(window.addEventListener("message",ds),us.addEventListener("abort",()=>{window.removeEventListener("message",ds)}))},onFrameEvent:os=>{W3mFrameHelpers.isClient&&window.addEventListener("message",({data:as})=>{var ds;if(!((ds=as.type)!=null&&ds.includes(W3mFrameConstants.FRAME_EVENT_KEY)))return;const us=W3mFrameSchema.frameEvent.parse(as);os(us)})},onAppEvent:os=>{W3mFrameHelpers.isClient&&window.addEventListener("message",({data:as})=>{var ds;if(!((ds=as.type)!=null&&ds.includes(W3mFrameConstants.APP_EVENT_KEY)))return;const us=W3mFrameSchema.appEvent.parse(as);os(us)})},postAppEvent:os=>{var as;if(W3mFrameHelpers.isClient){if(!((as=this.iframe)!=null&&as.contentWindow))throw new Error("W3mFrame: iframe is not set");W3mFrameSchema.appEvent.parse(os),this.iframe.contentWindow.postMessage(os,"*")}},postFrameEvent:os=>{if(W3mFrameHelpers.isClient){if(!parent)throw new Error("W3mFrame: parent is not set");W3mFrameSchema.frameEvent.parse(os),parent.postMessage(os,"*")}}},this.projectId=Mn,this.frameLoadPromise=new Promise((os,as)=>{this.frameLoadPromiseResolver={resolve:os,reject:as}}),rs&&(this.frameLoadPromise=new Promise((os,as)=>{this.frameLoadPromiseResolver={resolve:os,reject:as}}),W3mFrameHelpers.isClient)){const os=document.createElement("iframe");os.id="w3m-iframe",os.src=`${SECURE_SITE_SDK}?projectId=${Mn}&chainId=${is}`,os.name="w3m-secure-iframe",os.style.position="fixed",os.style.zIndex="999999",os.style.display="none",os.style.animationDelay="0s, 50ms",os.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",os.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",document.body.appendChild(os),this.iframe=os,this.iframe.onload=()=>{var as;(as=this.frameLoadPromiseResolver)==null||as.resolve(void 0)},this.iframe.onerror=()=>{var as;(as=this.frameLoadPromiseResolver)==null||as.reject("Unable to load email login dependency")}}}get networks(){const Mn=["eip155:1","eip155:5","eip155:11155111","eip155:10","eip155:420","eip155:42161","eip155:421613","eip155:137","eip155:80001","eip155:42220","eip155:1313161554","eip155:1313161555","eip155:56","eip155:97","eip155:43114","eip155:43113","eip155:324","eip155:280","eip155:100","eip155:8453","eip155:84531","eip155:84532","eip155:7777777","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(rs=>({[rs]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=${rs}&projectId=${this.projectId}`,chainId:rs}}));return Object.assign({},...Mn)}}function tryStringify(Fn){try{return JSON.stringify(Fn)}catch{return'"[Circular]"'}}var quickFormatUnescaped=format$1;function format$1(Fn,Mn,rs){var is=rs&&rs.stringify||tryStringify,os=1;if(typeof Fn=="object"&&Fn!==null){var as=Mn.length+os;if(as===1)return Fn;var us=new Array(as);us[0]=is(Fn);for(var ds=1;ds<as;ds++)us[ds]=is(Mn[ds]);return us.join(" ")}if(typeof Fn!="string")return Fn;var hs=Mn.length;if(hs===0)return Fn;for(var ps="",io=1-os,fo=-1,mo=Fn&&Fn.length||0,Ao=0;Ao<mo;){if(Fn.charCodeAt(Ao)===37&&Ao+1<mo){switch(fo=fo>-1?fo:0,Fn.charCodeAt(Ao+1)){case 100:case 102:if(io>=hs||Mn[io]==null)break;fo<Ao&&(ps+=Fn.slice(fo,Ao)),ps+=Number(Mn[io]),fo=Ao+2,Ao++;break;case 105:if(io>=hs||Mn[io]==null)break;fo<Ao&&(ps+=Fn.slice(fo,Ao)),ps+=Math.floor(Number(Mn[io])),fo=Ao+2,Ao++;break;case 79:case 111:case 106:if(io>=hs||Mn[io]===void 0)break;fo<Ao&&(ps+=Fn.slice(fo,Ao));var $o=typeof Mn[io];if($o==="string"){ps+="'"+Mn[io]+"'",fo=Ao+2,Ao++;break}if($o==="function"){ps+=Mn[io].name||"<anonymous>",fo=Ao+2,Ao++;break}ps+=is(Mn[io]),fo=Ao+2,Ao++;break;case 115:if(io>=hs)break;fo<Ao&&(ps+=Fn.slice(fo,Ao)),ps+=String(Mn[io]),fo=Ao+2,Ao++;break;case 37:fo<Ao&&(ps+=Fn.slice(fo,Ao)),ps+="%",fo=Ao+2,Ao++,io--;break}++io}++Ao}return fo===-1?Fn:(fo<mo&&(ps+=Fn.slice(fo)),ps)}const format=quickFormatUnescaped;var browser$2=pino;const _console=pfGlobalThisOrFallback().console||{},stdSerializers={mapHttpRequest:mock,mapHttpResponse:mock,wrapRequestSerializer:passthrough,wrapResponseSerializer:passthrough,wrapErrorSerializer:passthrough,req:mock,res:mock,err:asErrValue};function shouldSerialize(Fn,Mn){return Array.isArray(Fn)?Fn.filter(function(is){return is!=="!stdSerializers.err"}):Fn===!0?Object.keys(Mn):!1}function pino(Fn){Fn=Fn||{},Fn.browser=Fn.browser||{};const Mn=Fn.browser.transmit;if(Mn&&typeof Mn.send!="function")throw Error("pino: transmit option must have a send function");const rs=Fn.browser.write||_console;Fn.browser.write&&(Fn.browser.asObject=!0);const is=Fn.serializers||{},os=shouldSerialize(Fn.browser.serialize,is);let as=Fn.browser.serialize;Array.isArray(Fn.browser.serialize)&&Fn.browser.serialize.indexOf("!stdSerializers.err")>-1&&(as=!1);const us=["error","fatal","warn","info","debug","trace"];typeof rs=="function"&&(rs.error=rs.fatal=rs.warn=rs.info=rs.debug=rs.trace=rs),Fn.enabled===!1&&(Fn.level="silent");const ds=Fn.level||"info",hs=Object.create(rs);hs.log||(hs.log=noop$3),Object.defineProperty(hs,"levelVal",{get:io}),Object.defineProperty(hs,"level",{get:fo,set:mo});const ps={transmit:Mn,serialize:os,asObject:Fn.browser.asObject,levels:us,timestamp:getTimeFunction(Fn)};hs.levels=pino.levels,hs.level=ds,hs.setMaxListeners=hs.getMaxListeners=hs.emit=hs.addListener=hs.on=hs.prependListener=hs.once=hs.prependOnceListener=hs.removeListener=hs.removeAllListeners=hs.listeners=hs.listenerCount=hs.eventNames=hs.write=hs.flush=noop$3,hs.serializers=is,hs._serialize=os,hs._stdErrSerialize=as,hs.child=Ao,Mn&&(hs._logEvent=createLogEventShape());function io(){return this.level==="silent"?1/0:this.levels.values[this.level]}function fo(){return this._level}function mo($o){if($o!=="silent"&&!this.levels.values[$o])throw Error("unknown level "+$o);this._level=$o,set$2(ps,hs,"error","log"),set$2(ps,hs,"fatal","error"),set$2(ps,hs,"warn","error"),set$2(ps,hs,"info","log"),set$2(ps,hs,"debug","log"),set$2(ps,hs,"trace","log")}function Ao($o,Lo){if(!$o)throw new Error("missing bindings for child Pino");Lo=Lo||{},os&&$o.serializers&&(Lo.serializers=$o.serializers);const Go=Lo.serializers;if(os&&Go){var Yo=Object.assign({},is,Go),Wo=Fn.browser.serialize===!0?Object.keys(Yo):os;delete $o.serializers,applySerializers([$o],Wo,Yo,this._stdErrSerialize)}function Jo(xl){this._childLevel=(xl._childLevel|0)+1,this.error=bind(xl,$o,"error"),this.fatal=bind(xl,$o,"fatal"),this.warn=bind(xl,$o,"warn"),this.info=bind(xl,$o,"info"),this.debug=bind(xl,$o,"debug"),this.trace=bind(xl,$o,"trace"),Yo&&(this.serializers=Yo,this._serialize=Wo),Mn&&(this._logEvent=createLogEventShape([].concat(xl._logEvent.bindings,$o)))}return Jo.prototype=this,new Jo(this)}return hs}pino.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};pino.stdSerializers=stdSerializers;pino.stdTimeFunctions=Object.assign({},{nullTime,epochTime,unixTime,isoTime});function set$2(Fn,Mn,rs,is){const os=Object.getPrototypeOf(Mn);Mn[rs]=Mn.levelVal>Mn.levels.values[rs]?noop$3:os[rs]?os[rs]:_console[rs]||_console[is]||noop$3,wrap(Fn,Mn,rs)}function wrap(Fn,Mn,rs){!Fn.transmit&&Mn[rs]===noop$3||(Mn[rs]=function(is){return function(){const as=Fn.timestamp(),us=new Array(arguments.length),ds=Object.getPrototypeOf&&Object.getPrototypeOf(this)===_console?_console:this;for(var hs=0;hs<us.length;hs++)us[hs]=arguments[hs];if(Fn.serialize&&!Fn.asObject&&applySerializers(us,this._serialize,this.serializers,this._stdErrSerialize),Fn.asObject?is.call(ds,asObject(this,rs,us,as)):is.apply(ds,us),Fn.transmit){const ps=Fn.transmit.level||Mn.level,io=pino.levels.values[ps],fo=pino.levels.values[rs];if(fo<io)return;transmit(this,{ts:as,methodLevel:rs,methodValue:fo,transmitLevel:ps,transmitValue:pino.levels.values[Fn.transmit.level||Mn.level],send:Fn.transmit.send,val:Mn.levelVal},us)}}}(Mn[rs]))}function asObject(Fn,Mn,rs,is){Fn._serialize&&applySerializers(rs,Fn._serialize,Fn.serializers,Fn._stdErrSerialize);const os=rs.slice();let as=os[0];const us={};is&&(us.time=is),us.level=pino.levels.values[Mn];let ds=(Fn._childLevel|0)+1;if(ds<1&&(ds=1),as!==null&&typeof as=="object"){for(;ds--&&typeof os[0]=="object";)Object.assign(us,os.shift());as=os.length?format(os.shift(),os):void 0}else typeof as=="string"&&(as=format(os.shift(),os));return as!==void 0&&(us.msg=as),us}function applySerializers(Fn,Mn,rs,is){for(const os in Fn)if(is&&Fn[os]instanceof Error)Fn[os]=pino.stdSerializers.err(Fn[os]);else if(typeof Fn[os]=="object"&&!Array.isArray(Fn[os]))for(const as in Fn[os])Mn&&Mn.indexOf(as)>-1&&as in rs&&(Fn[os][as]=rs[as](Fn[os][as]))}function bind(Fn,Mn,rs){return function(){const is=new Array(1+arguments.length);is[0]=Mn;for(var os=1;os<is.length;os++)is[os]=arguments[os-1];return Fn[rs].apply(this,is)}}function transmit(Fn,Mn,rs){const is=Mn.send,os=Mn.ts,as=Mn.methodLevel,us=Mn.methodValue,ds=Mn.val,hs=Fn._logEvent.bindings;applySerializers(rs,Fn._serialize||Object.keys(Fn.serializers),Fn.serializers,Fn._stdErrSerialize===void 0?!0:Fn._stdErrSerialize),Fn._logEvent.ts=os,Fn._logEvent.messages=rs.filter(function(ps){return hs.indexOf(ps)===-1}),Fn._logEvent.level.label=as,Fn._logEvent.level.value=us,is(as,Fn._logEvent,ds),Fn._logEvent=createLogEventShape(hs)}function createLogEventShape(Fn){return{ts:0,messages:[],bindings:Fn||[],level:{label:"",value:0}}}function asErrValue(Fn){const Mn={type:Fn.constructor.name,msg:Fn.message,stack:Fn.stack};for(const rs in Fn)Mn[rs]===void 0&&(Mn[rs]=Fn[rs]);return Mn}function getTimeFunction(Fn){return typeof Fn.timestamp=="function"?Fn.timestamp:Fn.timestamp===!1?nullTime:epochTime}function mock(){return{}}function passthrough(Fn){return Fn}function noop$3(){}function nullTime(){return!1}function epochTime(){return Date.now()}function unixTime(){return Math.round(Date.now()/1e3)}function isoTime(){return new Date(Date.now()).toISOString()}function pfGlobalThisOrFallback(){function Fn(Mn){return typeof Mn<"u"&&Mn}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return Fn(self)||Fn(window)||Fn(this)||{}}}const Mg=getDefaultExportFromCjs(browser$2),JSONStringify=Fn=>JSON.stringify(Fn,(Mn,rs)=>typeof rs=="bigint"?rs.toString()+"n":rs),JSONParse=Fn=>{const Mn=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,rs=Fn.replace(Mn,'$1"$2n"$3');return JSON.parse(rs,(is,os)=>typeof os=="string"&&os.match(/^\d+n$/)?BigInt(os.substring(0,os.length-1)):os)};function safeJsonParse(Fn){if(typeof Fn!="string")throw new Error(`Cannot safe json parse value of type ${typeof Fn}`);try{return JSONParse(Fn)}catch{return Fn}}function safeJsonStringify(Fn){return typeof Fn=="string"?Fn:JSONStringify(Fn)||""}const c$5={level:"info"},n$8="custom_context",l$3=1e3*1024;let O$4=class{constructor(Mn){this.nodeValue=Mn,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},d$3=class{constructor(Mn){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=Mn,this.sizeInBytes=0}append(Mn){const rs=new O$4(Mn);if(rs.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${Mn} with size ${rs.size}`);for(;this.size+rs.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=rs),this.tail=rs):(this.head=rs,this.tail=rs),this.lengthInNodes++,this.sizeInBytes+=rs.size}shift(){if(!this.head)return;const Mn=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=Mn.size}toArray(){const Mn=[];let rs=this.head;for(;rs!==null;)Mn.push(rs.value),rs=rs.next;return Mn}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let Mn=this.head;return{next:()=>{if(!Mn)return{done:!0,value:null};const rs=Mn.value;return Mn=Mn.next,{done:!1,value:rs}}}}},L$1=class{constructor(Mn,rs=l$3){this.level=Mn??"error",this.levelValue=browser$2.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=rs,this.logs=new d$3(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(Mn,rs){rs===browser$2.levels.values.error?console.error(Mn):rs===browser$2.levels.values.warn?console.warn(Mn):rs===browser$2.levels.values.debug?console.debug(Mn):rs===browser$2.levels.values.trace?console.trace(Mn):console.log(Mn)}appendToLogs(Mn){this.logs.append(safeJsonStringify({timestamp:new Date().toISOString(),log:Mn}));const rs=typeof Mn=="string"?JSON.parse(Mn).level:Mn.level;rs>=this.levelValue&&this.forwardToConsole(Mn,rs)}getLogs(){return this.logs}clearLogs(){this.logs=new d$3(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(Mn){const rs=this.getLogArray();return rs.push(safeJsonStringify({extraMetadata:Mn})),new Blob(rs,{type:"application/json"})}},m$1=class{constructor(Mn,rs=l$3){this.baseChunkLogger=new L$1(Mn,rs)}write(Mn){this.baseChunkLogger.appendToLogs(Mn)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(Mn){return this.baseChunkLogger.logsToBlob(Mn)}downloadLogsBlobInBrowser(Mn){const rs=URL.createObjectURL(this.logsToBlob(Mn)),is=document.createElement("a");is.href=rs,is.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(is),is.click(),document.body.removeChild(is),URL.revokeObjectURL(rs)}},B$1=class{constructor(Mn,rs=l$3){this.baseChunkLogger=new L$1(Mn,rs)}write(Mn){this.baseChunkLogger.appendToLogs(Mn)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(Mn){return this.baseChunkLogger.logsToBlob(Mn)}};var x$4=Object.defineProperty,S$4=Object.defineProperties,_$3=Object.getOwnPropertyDescriptors,p$3=Object.getOwnPropertySymbols,T$3=Object.prototype.hasOwnProperty,z$5=Object.prototype.propertyIsEnumerable,f$5=(Fn,Mn,rs)=>Mn in Fn?x$4(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,i$5=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))T$3.call(Mn,rs)&&f$5(Fn,rs,Mn[rs]);if(p$3)for(var rs of p$3(Mn))z$5.call(Mn,rs)&&f$5(Fn,rs,Mn[rs]);return Fn},g$3=(Fn,Mn)=>S$4(Fn,_$3(Mn));function k$2(Fn){return g$3(i$5({},Fn),{level:(Fn==null?void 0:Fn.level)||c$5.level})}function v$4(Fn,Mn=n$8){return Fn[Mn]||""}function b$2(Fn,Mn,rs=n$8){return Fn[rs]=Mn,Fn}function y$4(Fn,Mn=n$8){let rs="";return typeof Fn.bindings>"u"?rs=v$4(Fn,Mn):rs=Fn.bindings().context||"",rs}function w$4(Fn,Mn,rs=n$8){const is=y$4(Fn,rs);return is.trim()?`${is}/${Mn}`:Mn}function E$3(Fn,Mn,rs=n$8){const is=w$4(Fn,Mn,rs),os=Fn.child({context:is});return b$2(os,is,rs)}function C$2(Fn){var Mn,rs;const is=new m$1((Mn=Fn.opts)==null?void 0:Mn.level,Fn.maxSizeInBytes);return{logger:Mg(g$3(i$5({},Fn.opts),{level:"trace",browser:g$3(i$5({},(rs=Fn.opts)==null?void 0:rs.browser),{write:os=>is.write(os)})})),chunkLoggerController:is}}function I$2(Fn){var Mn;const rs=new B$1((Mn=Fn.opts)==null?void 0:Mn.level,Fn.maxSizeInBytes);return{logger:Mg(g$3(i$5({},Fn.opts),{level:"trace"}),rs),chunkLoggerController:rs}}function A$1(Fn){return typeof Fn.loggerOverride<"u"&&typeof Fn.loggerOverride!="string"?{logger:Fn.loggerOverride,chunkLoggerController:null}:typeof window<"u"?C$2(Fn):I$2(Fn)}class W3mFrameLogger{constructor(Mn){var as;const rs=k$2({level:DEFAULT_LOG_LEVEL}),{logger:is,chunkLoggerController:os}=A$1({opts:rs});this.logger=E$3(is,this.constructor.name),this.chunkLoggerController=os,typeof window<"u"&&((as=this.chunkLoggerController)!=null&&as.downloadLogsBlobInBrowser)&&(window.downloadAppKitLogsBlob||(window.downloadAppKitLogsBlob={}),window.downloadAppKitLogsBlob.sdk=()=>{var us;(us=this.chunkLoggerController)!=null&&us.downloadLogsBlobInBrowser&&this.chunkLoggerController.downloadLogsBlobInBrowser({projectId:Mn})})}}class W3mFrameProvider{constructor({projectId:Mn,chainId:rs,onTimeout:is}){this.openRpcRequests=[],this.w3mLogger=new W3mFrameLogger(Mn),this.w3mFrame=new W3mFrame(Mn,!0,rs),this.onTimeout=is}getLoginEmailUsed(){return!!W3mFrameStorage.get(W3mFrameConstants.EMAIL_LOGIN_USED_KEY)}getEmail(){return W3mFrameStorage.get(W3mFrameConstants.EMAIL)}async connectEmail(Mn){try{W3mFrameHelpers.checkIfAllowedToTriggerEmail();const rs=await this.appEvent({type:W3mFrameConstants.APP_CONNECT_EMAIL,payload:Mn});return this.setNewLastEmailLoginTime(),rs}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error connecting email"),rs}}async connectDevice(){try{return this.appEvent({type:W3mFrameConstants.APP_CONNECT_DEVICE})}catch(Mn){throw this.w3mLogger.logger.error({error:Mn},"Error connecting device"),Mn}}async connectOtp(Mn){try{return this.appEvent({type:W3mFrameConstants.APP_CONNECT_OTP,payload:Mn})}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error connecting otp"),rs}}async isConnected(){try{const Mn=await this.appEvent({type:W3mFrameConstants.APP_IS_CONNECTED});return Mn.isConnected||this.deleteAuthLoginCache(),Mn}catch(Mn){throw this.deleteAuthLoginCache(),this.w3mLogger.logger.error({error:Mn},"Error checking connection"),Mn}}async getChainId(){try{const Mn=await this.appEvent({type:W3mFrameConstants.APP_GET_CHAIN_ID});return this.setLastUsedChainId(Mn.chainId),Mn}catch(Mn){throw this.w3mLogger.logger.error({error:Mn},"Error getting chain id"),Mn}}async getSocialRedirectUri(Mn){try{return this.appEvent({type:W3mFrameConstants.APP_GET_SOCIAL_REDIRECT_URI,payload:Mn})}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error getting social redirect uri"),rs}}async updateEmail(Mn){try{const rs=await this.appEvent({type:W3mFrameConstants.APP_UPDATE_EMAIL,payload:Mn});return this.setNewLastEmailLoginTime(),rs}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error updating email"),rs}}async updateEmailPrimaryOtp(Mn){try{return this.appEvent({type:W3mFrameConstants.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:Mn})}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error updating email primary otp"),rs}}async updateEmailSecondaryOtp(Mn){try{const rs=await this.appEvent({type:W3mFrameConstants.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:Mn});return this.setLoginSuccess(rs.newEmail),rs}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error updating email secondary otp"),rs}}async syncTheme(Mn){try{return this.appEvent({type:W3mFrameConstants.APP_SYNC_THEME,payload:Mn})}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error syncing theme"),rs}}async syncDappData(Mn){try{return this.appEvent({type:W3mFrameConstants.APP_SYNC_DAPP_DATA,payload:Mn})}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error syncing dapp data"),rs}}async getSmartAccountEnabledNetworks(){try{const Mn=await this.appEvent({type:W3mFrameConstants.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS});return this.persistSmartAccountEnabledNetworks(Mn.smartAccountEnabledNetworks),Mn}catch(Mn){throw this.persistSmartAccountEnabledNetworks([]),this.w3mLogger.logger.error({error:Mn},"Error getting smart account enabled networks"),Mn}}async setPreferredAccount(Mn){try{return this.appEvent({type:W3mFrameConstants.APP_SET_PREFERRED_ACCOUNT,payload:{type:Mn}})}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error setting preferred account"),rs}}async connect(Mn){try{const rs=(Mn==null?void 0:Mn.chainId)||this.getLastUsedChainId()||1,is=await this.appEvent({type:W3mFrameConstants.APP_GET_USER,payload:{...Mn,chainId:rs}});return this.setLoginSuccess(is.email),this.setLastUsedChainId(is.chainId),is}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error connecting"),rs}}async getUser(Mn){try{const rs=(Mn==null?void 0:Mn.chainId)||this.getLastUsedChainId()||1;return await this.appEvent({type:W3mFrameConstants.APP_GET_USER,payload:{...Mn,chainId:rs}})}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error connecting"),rs}}async connectSocial(Mn){try{const rs=await this.appEvent({type:W3mFrameConstants.APP_CONNECT_SOCIAL,payload:{uri:Mn}});return rs.userName&&this.setSocialLoginSuccess(rs.userName),rs}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error connecting social"),rs}}async getFarcasterUri(){try{return await this.appEvent({type:W3mFrameConstants.APP_GET_FARCASTER_URI})}catch(Mn){throw this.w3mLogger.logger.error({error:Mn},"Error getting farcaster uri"),Mn}}async connectFarcaster(){try{const Mn=await this.appEvent({type:W3mFrameConstants.APP_CONNECT_FARCASTER});return Mn.userName&&this.setSocialLoginSuccess(Mn.userName),Mn}catch(Mn){throw this.w3mLogger.logger.error({error:Mn},"Error connecting farcaster"),Mn}}async switchNetwork(Mn){try{const rs=await this.appEvent({type:W3mFrameConstants.APP_SWITCH_NETWORK,payload:{chainId:Mn}});return this.setLastUsedChainId(rs.chainId),rs}catch(rs){throw this.w3mLogger.logger.error({error:rs},"Error switching network"),rs}}async disconnect(){try{const Mn=await this.appEvent({type:W3mFrameConstants.APP_SIGN_OUT});return this.deleteAuthLoginCache(),Mn}catch(Mn){throw this.w3mLogger.logger.error({error:Mn},"Error disconnecting"),Mn}}async request(Mn){var rs,is,os;try{if(W3mFrameRpcConstants.GET_CHAIN_ID===Mn.method)return this.getLastUsedChainId();(rs=this.rpcRequestHandler)==null||rs.call(this,Mn);const as=await this.appEvent({type:W3mFrameConstants.APP_RPC_REQUEST,payload:Mn});return(is=this.rpcSuccessHandler)==null||is.call(this,as,Mn),as}catch(as){throw(os=this.rpcErrorHandler)==null||os.call(this,as,Mn),this.w3mLogger.logger.error({error:as},"Error requesting"),as}}onRpcRequest(Mn){this.rpcRequestHandler=Mn}onRpcSuccess(Mn){this.rpcSuccessHandler=Mn}onRpcError(Mn){this.rpcErrorHandler=Mn}onIsConnected(Mn){this.w3mFrame.events.onFrameEvent(rs=>{rs.type===W3mFrameConstants.FRAME_IS_CONNECTED_SUCCESS&&rs.payload.isConnected&&Mn()})}onNotConnected(Mn){this.w3mFrame.events.onFrameEvent(rs=>{rs.type===W3mFrameConstants.FRAME_IS_CONNECTED_ERROR&&Mn(),rs.type===W3mFrameConstants.FRAME_IS_CONNECTED_SUCCESS&&!rs.payload.isConnected&&Mn()})}onConnect(Mn){this.w3mFrame.events.onFrameEvent(rs=>{rs.type===W3mFrameConstants.FRAME_GET_USER_SUCCESS&&Mn(rs.payload)})}async getCapabilities(){try{return await this.request({method:"wallet_getCapabilities"})||{}}catch{return{}}}onSetPreferredAccount(Mn){this.w3mFrame.events.onFrameEvent(rs=>{rs.type===W3mFrameConstants.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?Mn(rs.payload):rs.type===W3mFrameConstants.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&Mn({type:W3mFrameRpcConstants.ACCOUNT_TYPES.EOA})})}onGetSmartAccountEnabledNetworks(Mn){this.w3mFrame.events.onFrameEvent(rs=>{rs.type===W3mFrameConstants.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS?Mn(rs.payload.smartAccountEnabledNetworks):rs.type===W3mFrameConstants.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR&&Mn([])})}getAvailableChainIds(){return Object.keys(this.w3mFrame.networks)}rejectRpcRequests(){try{this.openRpcRequests.forEach(({abortController:Mn,method:rs})=>{W3mFrameRpcConstants.SAFE_RPC_METHODS.includes(rs)||Mn.abort()}),this.openRpcRequests=[]}catch(Mn){this.w3mLogger.logger.error({error:Mn},"Error aborting RPC request")}}async appEvent(Mn){await this.w3mFrame.frameLoadPromise;let rs;function is(ds){return ds.replace("@w3m-app/","")}const os=new AbortController,as=is(Mn.type);return[W3mFrameConstants.APP_CONNECT_EMAIL,W3mFrameConstants.APP_CONNECT_DEVICE,W3mFrameConstants.APP_CONNECT_OTP,W3mFrameConstants.APP_CONNECT_SOCIAL,W3mFrameConstants.APP_GET_SOCIAL_REDIRECT_URI,W3mFrameConstants.APP_GET_FARCASTER_URI].map(is).includes(as)&&(rs=setTimeout(()=>{var ds;(ds=this.onTimeout)==null||ds.call(this),os.abort()},3e4)),new Promise((ds,hs)=>{var fo,mo;const ps=Math.random().toString(36).substring(7);if((mo=(fo=this.w3mLogger.logger).info)==null||mo.call(fo,{event:Mn,id:ps},"Sending app event"),this.w3mFrame.events.postAppEvent({...Mn,id:ps}),as==="RPC_REQUEST"){const Ao=Mn;this.openRpcRequests=[...this.openRpcRequests,{...Ao.payload,abortController:os}]}os.signal.addEventListener("abort",()=>{hs(as==="RPC_REQUEST"?new Error("Request was aborted"):new Error("Something went wrong"))});function io(Ao,$o){var Lo,Go,Yo;Ao.id===ps&&((Go=(Lo=$o.logger).info)==null||Go.call(Lo,{framEvent:Ao,id:ps},"Received frame response"),Ao.type===`@w3m-frame/${as}_SUCCESS`?(rs&&clearTimeout(rs),"payload"in Ao&&ds(Ao.payload),ds(void 0)):Ao.type===`@w3m-frame/${as}_ERROR`&&(rs&&clearTimeout(rs),"payload"in Ao&&hs(new Error(((Yo=Ao.payload)==null?void 0:Yo.message)||"An error occurred")),hs(new Error("An error occurred"))))}this.w3mFrame.events.registerFrameEventHandler(ps,Ao=>io(Ao,this.w3mLogger),os.signal)})}setNewLastEmailLoginTime(){W3mFrameStorage.set(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(Mn){W3mFrameStorage.set(W3mFrameConstants.SOCIAL_USERNAME,Mn)}setLoginSuccess(Mn){Mn&&W3mFrameStorage.set(W3mFrameConstants.EMAIL,Mn),W3mFrameStorage.set(W3mFrameConstants.EMAIL_LOGIN_USED_KEY,"true"),W3mFrameStorage.delete(W3mFrameConstants.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){W3mFrameStorage.delete(W3mFrameConstants.EMAIL_LOGIN_USED_KEY),W3mFrameStorage.delete(W3mFrameConstants.EMAIL),W3mFrameStorage.delete(W3mFrameConstants.LAST_USED_CHAIN_KEY),W3mFrameStorage.delete(W3mFrameConstants.SOCIAL_USERNAME)}setLastUsedChainId(Mn){Mn&&W3mFrameStorage.set(W3mFrameConstants.LAST_USED_CHAIN_KEY,String(Mn))}getLastUsedChainId(){return Number(W3mFrameStorage.get(W3mFrameConstants.LAST_USED_CHAIN_KEY))}persistSmartAccountEnabledNetworks(Mn){W3mFrameStorage.set(W3mFrameConstants.SMART_ACCOUNT_ENABLED_NETWORKS,Mn.join(","))}}const state$h=proxy({transactions:[],coinbaseTransactions:{},transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),TransactionsController={state:state$h,subscribe(Fn){return subscribe(state$h,()=>Fn(state$h))},setLastNetworkInView(Fn){state$h.lastNetworkInView=Fn},async fetchTransactions(Fn,Mn){var is;const{projectId:rs}=OptionsController.state;if(!rs||!Fn)throw new Error("Transactions can't be fetched without a projectId and an accountAddress");state$h.loading=!0;try{const os=await BlockchainApiController.fetchTransactions({account:Fn,projectId:rs,cursor:state$h.next,onramp:Mn,cache:Mn==="coinbase"?"no-cache":void 0,chainId:(is=ChainController.state.activeCaipNetwork)==null?void 0:is.caipNetworkId}),as=this.filterSpamTransactions(os.data),us=this.filterByConnectedChain(as),ds=[...state$h.transactions,...us];state$h.loading=!1,Mn==="coinbase"?state$h.coinbaseTransactions=this.groupTransactionsByYearAndMonth(state$h.coinbaseTransactions,os.data):(state$h.transactions=ds,state$h.transactionsByYear=this.groupTransactionsByYearAndMonth(state$h.transactionsByYear,us)),state$h.empty=ds.length===0,state$h.next=os.next?os.next:void 0}catch{EventsController.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:Fn,projectId:rs,cursor:state$h.next,isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),SnackController.showError("Failed to fetch transactions"),state$h.loading=!1,state$h.empty=!0,state$h.next=void 0}},groupTransactionsByYearAndMonth(Fn={},Mn=[]){const rs=Fn;return Mn.forEach(is=>{const os=new Date(is.metadata.minedAt).getFullYear(),as=new Date(is.metadata.minedAt).getMonth(),us=rs[os]??{},hs=(us[as]??[]).filter(ps=>ps.id!==is.id);rs[os]={...us,[as]:[...hs,is].sort((ps,io)=>new Date(io.metadata.minedAt).getTime()-new Date(ps.metadata.minedAt).getTime())}}),rs},filterSpamTransactions(Fn){return Fn.filter(Mn=>!Mn.transfers.every(is=>{var os;return((os=is.nft_info)==null?void 0:os.flags.is_spam)===!0}))},filterByConnectedChain(Fn){var is;const Mn=(is=ChainController.state.activeCaipNetwork)==null?void 0:is.caipNetworkId;return Fn.filter(os=>os.metadata.chain===Mn)},clearCursor(){state$h.next=void 0},resetTransactions(){state$h.transactions=[],state$h.transactionsByYear={},state$h.lastNetworkInView=void 0,state$h.loading=!1,state$h.empty=!1,state$h.next=void 0}},state$g=proxy({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),ThemeController={state:state$g,subscribe(Fn){return subscribe(state$g,()=>Fn(state$g))},setThemeMode(Fn){state$g.themeMode=Fn;try{const Mn=ConnectorController.getAuthConnector();if(Mn){const rs=ThemeController.getSnapshot().themeVariables;Mn.provider.syncTheme({themeMode:Fn,themeVariables:rs,w3mThemeVariables:getW3mThemeVariables(rs,Fn)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(Fn){state$g.themeVariables={...state$g.themeVariables,...Fn};try{const Mn=ConnectorController.getAuthConnector();if(Mn){const rs=ThemeController.getSnapshot().themeVariables;Mn.provider.syncTheme({themeVariables:rs,w3mThemeVariables:getW3mThemeVariables(state$g.themeVariables,state$g.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot(){return snapshot(state$g)}},state$f=proxy({allConnectors:[],connectors:[]}),ConnectorController={state:state$f,subscribeKey(Fn,Mn){return subscribeKey(state$f,Fn,Mn)},setConnectors(Fn){const Mn=Fn.filter(rs=>{try{proxy(rs)}catch(is){return console.error("ConnectorController.setConnectors: Not possible to add connector",{newConnector:rs,error:is}),!1}return!state$f.allConnectors.some(is=>is.id===rs.id&&this.getConnectorName(is.name)===this.getConnectorName(rs.name)&&is.chain===rs.chain)});state$f.allConnectors=[...state$f.connectors,...Mn],state$f.connectors=this.mergeMultiChainConnectors(state$f.allConnectors)},mergeMultiChainConnectors(Fn){const Mn=this.generateConnectorMapByName(Fn),rs=[];return Mn.forEach(is=>{const os=is[0],as=(os==null?void 0:os.id)==="w3mAuth";is.length>1?rs.push({name:os==null?void 0:os.name,imageUrl:os==null?void 0:os.imageUrl,imageId:os==null?void 0:os.imageId,connectors:[...is],type:as?"AUTH":"MULTI_CHAIN",chain:"eip155",id:(os==null?void 0:os.id)||""}):os&&rs.push(os)}),rs},generateConnectorMapByName(Fn){const Mn=new Map;return Fn.forEach(rs=>{const{name:is}=rs,os=this.getConnectorName(is);if(!os)return;const as=Mn.get(os)||[];as.find(ds=>ds.chain===rs.chain)||as.push(rs),Mn.set(os,as)}),Mn},getConnectorName(Fn){return Fn&&({"Trust Wallet":"Trust"}[Fn]||Fn)},getUniqueConnectorsByName(Fn){const Mn=[];return Fn.forEach(rs=>{Mn.find(is=>is.chain===rs.chain)||Mn.push(rs)}),Mn},addConnector(Fn){var Mn,rs;if(Fn.id==="w3mAuth"){const is=Fn,os=snapshot(OptionsController.state),as=ThemeController.getSnapshot().themeMode,us=ThemeController.getSnapshot().themeVariables;(rs=(Mn=is==null?void 0:is.provider)==null?void 0:Mn.syncDappData)==null||rs.call(Mn,{metadata:os.metadata,sdkVersion:os.sdkVersion,projectId:os.projectId,sdkType:os.sdkType}),is.provider.syncTheme({themeMode:as,themeVariables:us,w3mThemeVariables:getW3mThemeVariables(us,as)}),this.setConnectors([Fn])}else this.setConnectors([Fn])},getAuthConnector(){var rs;const Fn=ChainController.state.activeChain,Mn=state$f.connectors.find(is=>is.id==="w3mAuth");if(Mn)return(rs=Mn==null?void 0:Mn.connectors)!=null&&rs.length?Mn.connectors.find(os=>os.chain===Fn):Mn},getAnnouncedConnectorRdns(){return state$f.connectors.filter(Fn=>Fn.type==="ANNOUNCED").map(Fn=>{var Mn;return(Mn=Fn.info)==null?void 0:Mn.rdns})},getConnectors(){return state$f.connectors},getConnector(Fn,Mn){return state$f.connectors.find(rs=>{var is;return rs.explorerId===Fn||((is=rs.info)==null?void 0:is.rdns)===Mn})},syncIfAuthConnector(Fn){var as,us;if(Fn.id!=="w3mAuth")return;const Mn=Fn,rs=snapshot(OptionsController.state),is=ThemeController.getSnapshot().themeMode,os=ThemeController.getSnapshot().themeVariables;(us=(as=Mn==null?void 0:Mn.provider)==null?void 0:as.syncDappData)==null||us.call(as,{metadata:rs.metadata,sdkVersion:rs.sdkVersion,sdkType:rs.sdkType,projectId:rs.projectId}),Mn.provider.syncTheme({themeMode:is,themeVariables:os,w3mThemeVariables:getW3mThemeVariables(os,is)})}},state$e=proxy({wcError:!1,buffering:!1,status:"disconnected"});let wcConnectionPromise;const ConnectionController={state:state$e,subscribeKey(Fn,Mn){return subscribeKey(state$e,Fn,Mn)},_getClient(Fn){return ChainController.getConnectionControllerClient(Fn)},setClient(Fn){state$e._client=ref(Fn)},async connectWalletConnect(){var Fn,Mn,rs,is;if(StorageUtil.setConnectedConnector("WALLET_CONNECT"),CoreHelperUtil.isTelegram()){if(wcConnectionPromise){try{await wcConnectionPromise}catch{}wcConnectionPromise=void 0;return}if(!CoreHelperUtil.isPairingExpired(state$e==null?void 0:state$e.wcPairingExpiry)){const os=state$e.wcUri;state$e.wcUri=os;return}wcConnectionPromise=new Promise(async(os,as)=>{var us,ds,hs,ps;await((ps=(hs=(ds=(us=ChainController.state)==null?void 0:us.universalAdapter)==null?void 0:ds.connectionControllerClient)==null?void 0:hs.connectWalletConnect)==null?void 0:ps.call(hs,io=>{state$e.wcUri=io,state$e.wcPairingExpiry=CoreHelperUtil.getPairingExpiry()}).catch(as)),os()}),this.state.status="connecting",await wcConnectionPromise,wcConnectionPromise=void 0,state$e.wcPairingExpiry=void 0,this.state.status="connected"}else await((is=(rs=(Mn=(Fn=ChainController.state)==null?void 0:Fn.universalAdapter)==null?void 0:Mn.connectionControllerClient)==null?void 0:rs.connectWalletConnect)==null?void 0:is.call(rs,os=>{state$e.wcUri=os,state$e.wcPairingExpiry=CoreHelperUtil.getPairingExpiry()}))},async connectExternal(Fn,Mn,rs=!0){var is,os;await((os=(is=this._getClient(Mn)).connectExternal)==null?void 0:os.call(is,Fn)),rs&&(ChainController.setActiveNamespace(Mn),StorageUtil.setConnectedConnector(Fn.type))},async reconnectExternal(Fn){var Mn,rs;await((rs=(Mn=this._getClient()).reconnectExternal)==null?void 0:rs.call(Mn,Fn)),StorageUtil.setConnectedConnector(Fn.type)},async setPreferredAccountType(Fn){var rs;ModalController.setLoading(!0);const Mn=ConnectorController.getAuthConnector();Mn&&(await(Mn==null?void 0:Mn.provider.setPreferredAccount(Fn)),await this.reconnectExternal(Mn),ModalController.setLoading(!1),EventsController.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:Fn,network:((rs=ChainController.state.activeCaipNetwork)==null?void 0:rs.caipNetworkId)||""}}))},async signMessage(Fn){return this._getClient().signMessage(Fn)},parseUnits(Fn,Mn){return this._getClient().parseUnits(Fn,Mn)},formatUnits(Fn,Mn){return this._getClient().formatUnits(Fn,Mn)},async sendTransaction(Fn){return this._getClient().sendTransaction(Fn)},async getCapabilities(Fn){return this._getClient().getCapabilities(Fn)},async grantPermissions(Fn){return this._getClient().grantPermissions(Fn)},async estimateGas(Fn){return this._getClient().estimateGas(Fn)},async writeContract(Fn){return this._getClient().writeContract(Fn)},async getEnsAddress(Fn){return this._getClient().getEnsAddress(Fn)},async getEnsAvatar(Fn){return this._getClient().getEnsAvatar(Fn)},checkInstalled(Fn,Mn){var rs,is;return((is=(rs=this._getClient(Mn)).checkInstalled)==null?void 0:is.call(rs,Fn))||!1},resetWcConnection(){state$e.wcUri=void 0,state$e.wcPairingExpiry=void 0,state$e.wcLinking=void 0,state$e.recentWallet=void 0,state$e.status="disconnected",TransactionsController.resetTransactions(),StorageUtil.deleteWalletConnectDeepLink()},setWcLinking(Fn){state$e.wcLinking=Fn},setWcError(Fn){state$e.wcError=Fn,state$e.buffering=!1},setRecentWallet(Fn){state$e.recentWallet=Fn},setBuffering(Fn){state$e.buffering=Fn},setStatus(Fn){state$e.status=Fn},async disconnect(){const Fn=this._getClient();try{await(Fn==null?void 0:Fn.disconnect()),this.resetWcConnection()}catch{throw new Error("Failed to disconnect")}}},SwapApiUtil={async getTokenList(){var is;const Fn=ChainController.state.activeCaipNetwork,Mn=await BlockchainApiController.fetchSwapTokens({chainId:Fn==null?void 0:Fn.caipNetworkId,projectId:OptionsController.state.projectId});return((is=Mn==null?void 0:Mn.tokens)==null?void 0:is.map(os=>({...os,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0})))||[]},async fetchGasPrice(){const Fn=OptionsController.state.projectId,Mn=ChainController.state.activeCaipNetwork;if(!Mn)return null;try{switch(Mn.chainNamespace){case"solana":const rs=(await ConnectionController.estimateGas({chainNamespace:"solana"})).toString();return{standard:rs,fast:rs,instant:rs};case"eip155":default:return await BlockchainApiController.fetchGasPrice({projectId:Fn,chainId:Mn.caipNetworkId})}}catch{return null}},async fetchSwapAllowance({tokenAddress:Fn,userAddress:Mn,sourceTokenAmount:rs,sourceTokenDecimals:is}){const os=OptionsController.state.projectId,as=await BlockchainApiController.fetchSwapAllowance({projectId:os,tokenAddress:Fn,userAddress:Mn});if(as!=null&&as.allowance&&rs&&is){const us=ConnectionController.parseUnits(rs,is)||0;return BigInt(as.allowance)>=us}return!1},async getMyTokensWithBalance(Fn){const Mn=AccountController.state.address,rs=ChainController.state.activeCaipNetwork;if(!Mn||!rs)return[];const os=(await BlockchainApiController.getBalance(Mn,rs.caipNetworkId,Fn)).balances.filter(as=>as.quantity.decimals!=="0");return AccountController.setTokenBalance(os,ChainController.state.activeChain),this.mapBalancesToSwapTokens(os)},mapBalancesToSwapTokens(Fn){return(Fn==null?void 0:Fn.map(Mn=>({...Mn,address:Mn!=null&&Mn.address?Mn.address:ChainController.getActiveNetworkTokenAddress(),decimals:parseInt(Mn.quantity.decimals,10),logoUri:Mn.iconUrl,eip2612:!1})))||[]}},state$d=proxy({view:"Connect",history:["Connect"],transactionStack:[]}),RouterController={state:state$d,subscribeKey(Fn,Mn){return subscribeKey(state$d,Fn,Mn)},pushTransactionStack(Fn){state$d.transactionStack.push(Fn)},popTransactionStack(Fn){var rs,is;const Mn=state$d.transactionStack.pop();if(Mn)if(Fn)this.goBack(),(rs=Mn==null?void 0:Mn.onCancel)==null||rs.call(Mn);else{if(Mn.goBack)this.goBack();else if(Mn.replace){const as=state$d.history.indexOf("ConnectingSiwe");as>0?this.goBackToIndex(as-1):(ModalController.close(),state$d.history=[])}else Mn.view&&this.reset(Mn.view);(is=Mn==null?void 0:Mn.onSuccess)==null||is.call(Mn)}},push(Fn,Mn){Fn!==state$d.view&&(state$d.view=Fn,state$d.history.push(Fn),state$d.data=Mn)},reset(Fn){state$d.view=Fn,state$d.history=[Fn]},replace(Fn,Mn){state$d.history.at(-1)===Fn||(state$d.view=Fn,state$d.history[state$d.history.length-1]=Fn,state$d.data=Mn)},goBack(){if(state$d.history.length>1){state$d.history.pop();const[Fn]=state$d.history.slice(-1);Fn&&(state$d.view=Fn)}else ModalController.close()},goBackToIndex(Fn){if(state$d.history.length>1){state$d.history=state$d.history.slice(0,Fn+1);const[Mn]=state$d.history.slice(-1);Mn&&(state$d.view=Mn)}}},SwapCalculationUtil={getGasPriceInEther(Fn,Mn){const rs=Mn*Fn;return Number(rs)/1e18},getGasPriceInUSD(Fn,Mn,rs){const is=SwapCalculationUtil.getGasPriceInEther(Mn,rs);return NumberUtil.bigNumber(Fn).multipliedBy(is).toNumber()},getPriceImpact({sourceTokenAmount:Fn,sourceTokenPriceInUSD:Mn,toTokenPriceInUSD:rs,toTokenAmount:is}){const os=NumberUtil.bigNumber(Fn).multipliedBy(Mn),as=NumberUtil.bigNumber(is).multipliedBy(rs);return os.minus(as).dividedBy(os).multipliedBy(100).toNumber()},getMaxSlippage(Fn,Mn){const rs=NumberUtil.bigNumber(Fn).dividedBy(100);return NumberUtil.multiply(Mn,rs).toNumber()},getProviderFee(Fn,Mn=.0085){return NumberUtil.bigNumber(Fn).multipliedBy(Mn).toString()},isInsufficientNetworkTokenForGas(Fn,Mn){const rs=Mn||"0";return NumberUtil.bigNumber(Fn).isZero()?!0:NumberUtil.bigNumber(NumberUtil.bigNumber(rs)).isGreaterThan(Fn)},isInsufficientSourceTokenForSwap(Fn,Mn,rs){var as,us;const is=(us=(as=rs==null?void 0:rs.find(ds=>ds.address===Mn))==null?void 0:as.quantity)==null?void 0:us.numeric;return NumberUtil.bigNumber(is||"0").isLessThan(Fn)},getToTokenAmount({sourceToken:Fn,toToken:Mn,sourceTokenPrice:rs,toTokenPrice:is,sourceTokenAmount:os}){if(os==="0"||!Fn||!Mn)return"0";const as=Fn.decimals,us=rs,ds=Mn.decimals,hs=is;if(hs<=0)return"0";const ps=NumberUtil.bigNumber(os).multipliedBy(.0085),fo=NumberUtil.bigNumber(os).minus(ps).multipliedBy(NumberUtil.bigNumber(10).pow(as)),mo=NumberUtil.bigNumber(us).dividedBy(hs),Ao=as-ds;return fo.multipliedBy(mo).dividedBy(NumberUtil.bigNumber(10).pow(Ao)).dividedBy(NumberUtil.bigNumber(10).pow(ds)).toFixed(ds).toString()}},INITIAL_GAS_LIMIT=15e4,TO_AMOUNT_DECIMALS=6,initialState$1={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:ConstantsUtil$2.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},state$c=proxy(initialState$1),SwapController={state:state$c,subscribe(Fn){return subscribe(state$c,()=>Fn(state$c))},subscribeKey(Fn,Mn){return subscribeKey(state$c,Fn,Mn)},getParams(){var ds,hs,ps,io,fo,mo,Ao,$o;const Fn=ChainController.state.activeCaipAddress,Mn=CoreHelperUtil.getPlainAddress(Fn),rs=ChainController.getActiveNetworkTokenAddress(),is=StorageUtil.getConnectedConnector();if(!Mn)throw new Error("No address found to swap the tokens from.");const os=!((ds=state$c.toToken)!=null&&ds.address)||!((hs=state$c.toToken)!=null&&hs.decimals),as=!((ps=state$c.sourceToken)!=null&&ps.address)||!((io=state$c.sourceToken)!=null&&io.decimals)||!NumberUtil.bigNumber(state$c.sourceTokenAmount).isGreaterThan(0),us=!state$c.sourceTokenAmount;return{networkAddress:rs,fromAddress:Mn,fromCaipAddress:Fn,sourceTokenAddress:(fo=state$c.sourceToken)==null?void 0:fo.address,toTokenAddress:(mo=state$c.toToken)==null?void 0:mo.address,toTokenAmount:state$c.toTokenAmount,toTokenDecimals:(Ao=state$c.toToken)==null?void 0:Ao.decimals,sourceTokenAmount:state$c.sourceTokenAmount,sourceTokenDecimals:($o=state$c.sourceToken)==null?void 0:$o.decimals,invalidToToken:os,invalidSourceToken:as,invalidSourceTokenAmount:us,availableToSwap:Fn&&!os&&!as&&!us,isAuthConnector:is==="AUTH"}},setSourceToken(Fn){if(!Fn){state$c.sourceToken=Fn,state$c.sourceTokenAmount="",state$c.sourceTokenPriceInUSD=0;return}state$c.sourceToken=Fn,this.setTokenPrice(Fn.address,"sourceToken")},setSourceTokenAmount(Fn){state$c.sourceTokenAmount=Fn},setToToken(Fn){if(!Fn){state$c.toToken=Fn,state$c.toTokenAmount="",state$c.toTokenPriceInUSD=0;return}state$c.toToken=Fn,this.setTokenPrice(Fn.address,"toToken")},setToTokenAmount(Fn){state$c.toTokenAmount=Fn?NumberUtil.formatNumberToLocalString(Fn,TO_AMOUNT_DECIMALS):""},async setTokenPrice(Fn,Mn){const{availableToSwap:rs}=this.getParams();let is=state$c.tokensPriceMap[Fn]||0;is||(state$c.loadingPrices=!0,is=await this.getAddressPrice(Fn)),Mn==="sourceToken"?state$c.sourceTokenPriceInUSD=is:Mn==="toToken"&&(state$c.toTokenPriceInUSD=is),state$c.loadingPrices&&(state$c.loadingPrices=!1,rs&&this.swapTokens())},switchTokens(){if(state$c.initializing||!state$c.initialized)return;const Fn=state$c.toToken?{...state$c.toToken}:void 0,Mn=state$c.sourceToken?{...state$c.sourceToken}:void 0,rs=Fn&&state$c.toTokenAmount===""?"1":state$c.toTokenAmount;this.setSourceToken(Fn),this.setToToken(Mn),this.setSourceTokenAmount(rs),this.setToTokenAmount(""),this.swapTokens()},resetState(){state$c.myTokensWithBalance=initialState$1.myTokensWithBalance,state$c.tokensPriceMap=initialState$1.tokensPriceMap,state$c.initialized=initialState$1.initialized,state$c.sourceToken=initialState$1.sourceToken,state$c.sourceTokenAmount=initialState$1.sourceTokenAmount,state$c.sourceTokenPriceInUSD=initialState$1.sourceTokenPriceInUSD,state$c.toToken=initialState$1.toToken,state$c.toTokenAmount=initialState$1.toTokenAmount,state$c.toTokenPriceInUSD=initialState$1.toTokenPriceInUSD,state$c.networkPrice=initialState$1.networkPrice,state$c.networkTokenSymbol=initialState$1.networkTokenSymbol,state$c.networkBalanceInUSD=initialState$1.networkBalanceInUSD,state$c.inputError=initialState$1.inputError},resetValues(){var rs;const{networkAddress:Fn}=this.getParams(),Mn=(rs=state$c.tokens)==null?void 0:rs.find(is=>is.address===Fn);this.setSourceToken(Mn),this.setToToken(void 0)},getApprovalLoadingState(){return state$c.loadingApprovalTransaction},clearError(){state$c.transactionError=void 0},async initializeState(){if(!state$c.initializing){if(state$c.initializing=!0,!state$c.initialized)try{await this.fetchTokens(),state$c.initialized=!0}catch{state$c.initialized=!1,SnackController.showError("Failed to initialize swap"),RouterController.goBack()}state$c.initializing=!1}},async fetchTokens(){var rs;const{networkAddress:Fn}=this.getParams();await this.getTokenList(),await this.getNetworkTokenPrice(),await this.getMyTokensWithBalance();const Mn=(rs=state$c.tokens)==null?void 0:rs.find(is=>is.address===Fn);Mn&&(state$c.networkTokenSymbol=Mn.symbol,this.setSourceToken(Mn),this.setSourceTokenAmount("1"))},async getTokenList(){const Fn=await SwapApiUtil.getTokenList();state$c.tokens=Fn,state$c.popularTokens=Fn.sort((Mn,rs)=>Mn.symbol<rs.symbol?-1:Mn.symbol>rs.symbol?1:0),state$c.suggestedTokens=Fn.filter(Mn=>!!ConstantsUtil$2.SWAP_SUGGESTED_TOKENS.includes(Mn.symbol),{})},async getAddressPrice(Fn){var hs,ps;const Mn=state$c.tokensPriceMap[Fn];if(Mn)return Mn;const is=(await BlockchainApiController.fetchTokenPrice({projectId:OptionsController.state.projectId,addresses:[Fn]})).fungibles||[],os=[...state$c.tokens||[],...state$c.myTokensWithBalance||[]],as=(hs=os==null?void 0:os.find(io=>io.address===Fn))==null?void 0:hs.symbol,us=((ps=is.find(io=>io.symbol.toLowerCase()===(as==null?void 0:as.toLowerCase())))==null?void 0:ps.price)||0,ds=parseFloat(us.toString());return state$c.tokensPriceMap[Fn]=ds,ds},async getNetworkTokenPrice(){var os;const{networkAddress:Fn}=this.getParams(),rs=(os=(await BlockchainApiController.fetchTokenPrice({projectId:OptionsController.state.projectId,addresses:[Fn]}).catch(()=>(SnackController.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:os[0],is=(rs==null?void 0:rs.price.toString())||"0";state$c.tokensPriceMap[Fn]=parseFloat(is),state$c.networkTokenSymbol=(rs==null?void 0:rs.symbol)||"",state$c.networkPrice=is},async getMyTokensWithBalance(Fn){const Mn=await SwapApiUtil.getMyTokensWithBalance(Fn);Mn&&(await this.getInitialGasPrice(),this.setBalances(Mn))},setBalances(Fn){const{networkAddress:Mn}=this.getParams(),rs=ChainController.state.activeCaipNetwork;if(!rs)return;const is=Fn.find(os=>os.address===Mn);Fn.forEach(os=>{state$c.tokensPriceMap[os.address]=os.price||0}),state$c.myTokensWithBalance=Fn.filter(os=>os.address.startsWith(rs.caipNetworkId)),state$c.networkBalanceInUSD=is?NumberUtil.multiply(is.quantity.numeric,is.price).toString():"0"},async getInitialGasPrice(){var Mn,rs;const Fn=await SwapApiUtil.fetchGasPrice();if(!Fn)return{gasPrice:null,gasPriceInUSD:null};switch((rs=(Mn=ChainController.state)==null?void 0:Mn.activeCaipNetwork)==null?void 0:rs.chainNamespace){case"solana":return state$c.gasFee=Fn.standard,state$c.gasPriceInUSD=NumberUtil.multiply(Fn.standard,state$c.networkPrice).dividedBy(1e9).toNumber(),{gasPrice:BigInt(state$c.gasFee),gasPriceInUSD:Number(state$c.gasPriceInUSD)};case"eip155":default:const is=Fn.standard,os=BigInt(is),as=BigInt(INITIAL_GAS_LIMIT),us=SwapCalculationUtil.getGasPriceInUSD(state$c.networkPrice,as,os);return state$c.gasFee=is,state$c.gasPriceInUSD=us,{gasPrice:os,gasPriceInUSD:us}}},async swapTokens(){var ps,io;const Fn=AccountController.state.address,Mn=state$c.sourceToken,rs=state$c.toToken,is=NumberUtil.bigNumber(state$c.sourceTokenAmount).isGreaterThan(0);if(!rs||!Mn||state$c.loadingPrices||!is)return;state$c.loadingQuote=!0;const os=NumberUtil.bigNumber(state$c.sourceTokenAmount).multipliedBy(10**Mn.decimals).integerValue(),as=await BlockchainApiController.fetchSwapQuote({userAddress:Fn,projectId:OptionsController.state.projectId,from:Mn.address,to:rs.address,gasPrice:state$c.gasFee,amount:os.toString()});state$c.loadingQuote=!1;const us=(io=(ps=as==null?void 0:as.quotes)==null?void 0:ps[0])==null?void 0:io.toAmount;if(!us)return;const ds=NumberUtil.bigNumber(us).dividedBy(10**rs.decimals).toString();this.setToTokenAmount(ds),this.hasInsufficientToken(state$c.sourceTokenAmount,Mn.address)?state$c.inputError="Insufficient balance":(state$c.inputError=void 0,this.setTransactionDetails())},async getTransaction(){const{fromCaipAddress:Fn,availableToSwap:Mn}=this.getParams(),rs=state$c.sourceToken,is=state$c.toToken;if(!(!Fn||!Mn||!rs||!is||state$c.loadingQuote))try{state$c.loadingBuildTransaction=!0;const os=await SwapApiUtil.fetchSwapAllowance({userAddress:Fn,tokenAddress:rs.address,sourceTokenAmount:state$c.sourceTokenAmount,sourceTokenDecimals:rs.decimals});let as;return os?as=await this.createSwapTransaction():as=await this.createAllowanceTransaction(),state$c.loadingBuildTransaction=!1,state$c.fetchError=!1,as}catch{RouterController.goBack(),SnackController.showError("Failed to check allowance"),state$c.loadingBuildTransaction=!1,state$c.approvalTransaction=void 0,state$c.swapTransaction=void 0,state$c.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:Fn,fromAddress:Mn,sourceTokenAddress:rs,toTokenAddress:is}=this.getParams();if(!(!Fn||!is)){if(!rs)throw new Error("createAllowanceTransaction - No source token address found.");try{const os=await BlockchainApiController.generateApproveCalldata({projectId:OptionsController.state.projectId,from:rs,to:is,userAddress:Fn}),as=await ConnectionController.estimateGas({address:Mn,to:CoreHelperUtil.getPlainAddress(os.tx.to),data:os.tx.data}),us={data:os.tx.data,to:CoreHelperUtil.getPlainAddress(os.tx.from),gas:as,gasPrice:BigInt(os.tx.eip155.gasPrice),value:BigInt(os.tx.value),toAmount:state$c.toTokenAmount};return state$c.swapTransaction=void 0,state$c.approvalTransaction=us,us}catch{RouterController.goBack(),SnackController.showError("Failed to create approval transaction"),state$c.approvalTransaction=void 0,state$c.swapTransaction=void 0,state$c.fetchError=!0;return}}},async createSwapTransaction(){const{networkAddress:Fn,fromCaipAddress:Mn,sourceTokenAmount:rs}=this.getParams(),is=state$c.sourceToken,os=state$c.toToken;if(!Mn||!rs||!is||!os)return;const as=ConnectionController.parseUnits(rs,is.decimals).toString();try{const us=await BlockchainApiController.generateSwapCalldata({projectId:OptionsController.state.projectId,userAddress:Mn,from:is.address,to:os.address,amount:as}),ds=is.address===Fn,hs=BigInt(us.tx.eip155.gas),ps=BigInt(us.tx.eip155.gasPrice),io={data:us.tx.data,to:CoreHelperUtil.getPlainAddress(us.tx.to),gas:hs,gasPrice:ps,value:BigInt(ds?as:"0"),toAmount:state$c.toTokenAmount};return state$c.gasPriceInUSD=SwapCalculationUtil.getGasPriceInUSD(state$c.networkPrice,hs,ps),state$c.approvalTransaction=void 0,state$c.swapTransaction=io,io}catch{RouterController.goBack(),SnackController.showError("Failed to create transaction"),state$c.approvalTransaction=void 0,state$c.swapTransaction=void 0,state$c.fetchError=!0;return}},async sendTransactionForApproval(Fn){const{fromAddress:Mn,isAuthConnector:rs}=this.getParams();state$c.loadingApprovalTransaction=!0;const is="Approve limit increase in your wallet";rs?RouterController.pushTransactionStack({view:null,goBack:!0,onSuccess(){SnackController.showLoading(is)}}):SnackController.showLoading(is);try{await ConnectionController.sendTransaction({address:Mn,to:Fn.to,data:Fn.data,value:BigInt(Fn.value),gasPrice:BigInt(Fn.gasPrice)}),await this.swapTokens(),await this.getTransaction(),state$c.approvalTransaction=void 0,state$c.loadingApprovalTransaction=!1}catch(os){const as=os;state$c.transactionError=as==null?void 0:as.shortMessage,state$c.loadingApprovalTransaction=!1,SnackController.showError((as==null?void 0:as.shortMessage)||"Transaction error")}},async sendTransactionForSwap(Fn){var us,ds,hs,ps,io,fo,mo,Ao,$o,Lo,Go,Yo;if(!Fn)return;const{fromAddress:Mn,toTokenAmount:rs,isAuthConnector:is}=this.getParams();state$c.loadingTransaction=!0;const os=`Swapping ${(us=state$c.sourceToken)==null?void 0:us.symbol} to ${NumberUtil.formatNumberToLocalString(rs,3)} ${(ds=state$c.toToken)==null?void 0:ds.symbol}`,as=`Swapped ${(hs=state$c.sourceToken)==null?void 0:hs.symbol} to ${NumberUtil.formatNumberToLocalString(rs,3)} ${(ps=state$c.toToken)==null?void 0:ps.symbol}`;is?RouterController.pushTransactionStack({view:"Account",goBack:!1,onSuccess(){SnackController.showLoading(os),SwapController.resetState()}}):SnackController.showLoading("Confirm transaction in your wallet");try{const Wo=[(io=state$c.sourceToken)==null?void 0:io.address,(fo=state$c.toToken)==null?void 0:fo.address].join(","),Jo=await ConnectionController.sendTransaction({address:Mn,to:Fn.to,data:Fn.data,gas:Fn.gas,gasPrice:BigInt(Fn.gasPrice),value:Fn.value});return state$c.loadingTransaction=!1,SnackController.showSuccess(as),EventsController.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((mo=ChainController.state.activeCaipNetwork)==null?void 0:mo.caipNetworkId)||"",swapFromToken:((Ao=this.state.sourceToken)==null?void 0:Ao.symbol)||"",swapToToken:(($o=this.state.toToken)==null?void 0:$o.symbol)||"",swapFromAmount:this.state.sourceTokenAmount||"",swapToAmount:this.state.toTokenAmount||"",isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),SwapController.resetState(),is||RouterController.replace("Account"),SwapController.getMyTokensWithBalance(Wo),Jo}catch(Wo){const Jo=Wo;state$c.transactionError=Jo==null?void 0:Jo.shortMessage,state$c.loadingTransaction=!1,SnackController.showError((Jo==null?void 0:Jo.shortMessage)||"Transaction error"),EventsController.sendEvent({type:"track",event:"SWAP_ERROR",properties:{network:((Lo=ChainController.state.activeCaipNetwork)==null?void 0:Lo.caipNetworkId)||"",swapFromToken:((Go=this.state.sourceToken)==null?void 0:Go.symbol)||"",swapToToken:((Yo=this.state.toToken)==null?void 0:Yo.symbol)||"",swapFromAmount:this.state.sourceTokenAmount||"",swapToAmount:this.state.toTokenAmount||"",isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(Fn,Mn){const rs=SwapCalculationUtil.isInsufficientSourceTokenForSwap(Fn,Mn,state$c.myTokensWithBalance);return AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT?!0:SwapCalculationUtil.isInsufficientNetworkTokenForGas(state$c.networkBalanceInUSD,state$c.gasPriceInUSD)||rs},setTransactionDetails(){const{toTokenAddress:Fn,toTokenDecimals:Mn}=this.getParams();!Fn||!Mn||(state$c.gasPriceInUSD=SwapCalculationUtil.getGasPriceInUSD(state$c.networkPrice,BigInt(state$c.gasFee),BigInt(INITIAL_GAS_LIMIT)),state$c.priceImpact=SwapCalculationUtil.getPriceImpact({sourceTokenAmount:state$c.sourceTokenAmount,sourceTokenPriceInUSD:state$c.sourceTokenPriceInUSD,toTokenPriceInUSD:state$c.toTokenPriceInUSD,toTokenAmount:state$c.toTokenAmount}),state$c.maxSlippage=SwapCalculationUtil.getMaxSlippage(state$c.slippage,state$c.toTokenAmount),state$c.providerFee=SwapCalculationUtil.getProviderFee(state$c.sourceTokenAmount))}},state$b=proxy({currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]}),AccountController={state:state$b,replaceState(Fn){Fn&&Object.assign(state$b,ref(Fn))},subscribe(Fn){return ChainController.subscribeChainProp("accountState",Mn=>{if(Mn)return Fn(Mn)})},subscribeKey(Fn,Mn,rs){let is;return ChainController.subscribeChainProp("accountState",os=>{if(os){const as=os[Fn];is!==as&&(is=as,Mn(as))}},rs)},setStatus(Fn,Mn){ChainController.setAccountProp("status",Fn,Mn)},getCaipAddress(Fn){return ChainController.getAccountProp("caipAddress",Fn)},setProvider(Fn,Mn){Fn&&ChainController.setAccountProp("provider",Fn,Mn)},setCaipAddress(Fn,Mn){const rs=Fn?CoreHelperUtil.getPlainAddress(Fn):void 0;ChainController.state.activeCaipAddress=Fn,ChainController.setAccountProp("caipAddress",Fn,Mn),ChainController.setAccountProp("address",rs,Mn)},setBalance(Fn,Mn,rs){ChainController.setAccountProp("balance",Fn,rs),ChainController.setAccountProp("balanceSymbol",Mn,rs)},setProfileName(Fn,Mn){ChainController.setAccountProp("profileName",Fn,Mn)},setProfileImage(Fn,Mn){ChainController.setAccountProp("profileImage",Fn,Mn)},setAddressExplorerUrl(Fn,Mn){ChainController.setAccountProp("addressExplorerUrl",Fn,Mn)},setSmartAccountDeployed(Fn,Mn){ChainController.setAccountProp("smartAccountDeployed",Fn,Mn)},setCurrentTab(Fn){ChainController.setAccountProp("currentTab",Fn,ChainController.state.activeChain)},setTokenBalance(Fn,Mn){Fn&&ChainController.setAccountProp("tokenBalance",Fn,Mn)},setShouldUpdateToAddress(Fn,Mn){ChainController.setAccountProp("shouldUpdateToAddress",Fn,Mn)},setAllAccounts(Fn,Mn){ChainController.setAccountProp("allAccounts",Fn,Mn)},addAddressLabel(Fn,Mn,rs){const is=ChainController.getAccountProp("addressLabels",rs)||new Map;is.set(Fn,Mn),ChainController.setAccountProp("addressLabels",is,rs)},removeAddressLabel(Fn,Mn){const rs=ChainController.getAccountProp("addressLabels",Mn)||new Map;rs.delete(Fn),ChainController.setAccountProp("addressLabels",rs,Mn)},setConnectedWalletInfo(Fn,Mn){ChainController.setAccountProp("connectedWalletInfo",Fn,Mn,!1)},setPreferredAccountType(Fn,Mn){ChainController.setAccountProp("preferredAccountType",Fn,Mn)},setSocialProvider(Fn,Mn){Fn&&ChainController.setAccountProp("socialProvider",Fn,Mn)},setSocialWindow(Fn,Mn){Fn&&ChainController.setAccountProp("socialWindow",ref(Fn),Mn)},setFarcasterUrl(Fn,Mn){Fn&&ChainController.setAccountProp("farcasterUrl",Fn,Mn)},async fetchTokenBalance(){var os,as;const Fn=(os=ChainController.state.activeCaipNetwork)==null?void 0:os.caipNetworkId,Mn=(as=ChainController.state.activeCaipNetwork)==null?void 0:as.chainNamespace,rs=ChainController.state.activeCaipAddress,is=rs?CoreHelperUtil.getPlainAddress(rs):void 0;if(!(state$b.lastRetry&&!CoreHelperUtil.isAllowedRetry(state$b.lastRetry,30*ConstantsUtil$2.ONE_SEC_MS)))try{if(is&&Fn&&Mn){const us=await BlockchainApiController.getBalance(is,Fn),ds=us.balances.filter(hs=>hs.quantity.decimals!=="0");this.setTokenBalance(ds,Mn),SwapController.setBalances(SwapApiUtil.mapBalancesToSwapTokens(us.balances)),state$b.lastRetry=void 0}}catch{state$b.lastRetry=Date.now(),SnackController.showError("Token Balance Unavailable")}},resetAccount(Fn){ChainController.resetAccount(Fn)},setSiweStatus(Fn){ChainController.setAccountProp("siweStatus",Fn,ChainController.state.activeChain)}},state$a=proxy({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0}),PublicStateController={state:state$a,subscribe(Fn){return subscribe(state$a,()=>Fn(state$a))},set(Fn){Object.assign(state$a,{...state$a,...Fn})}},accountState={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,allAccounts:[]},networkState={supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},state$9=proxy({chains:proxyMap(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{networkControllerClient:void 0,connectionControllerClient:void 0}}),ChainController={state:state$9,subscribe(Fn){return subscribe(state$9,()=>{Fn(state$9)})},subscribeKey(Fn,Mn){return subscribeKey(state$9,Fn,Mn)},subscribeChainProp(Fn,Mn,rs){let is;return subscribe(state$9.chains,()=>{var as;const os=rs||state$9.activeChain;if(os){const us=(as=state$9.chains.get(os))==null?void 0:as[Fn];is!==us&&(is=us,Mn(us))}})},initialize(Fn){const Mn=Fn==null?void 0:Fn[0];(Fn==null?void 0:Fn.length)===0&&(state$9.noAdapters=!0),state$9.noAdapters||(state$9.activeChain=Mn==null?void 0:Mn.chainNamespace,PublicStateController.set({activeChain:Mn==null?void 0:Mn.chainNamespace}),Fn.forEach(rs=>{state$9.chains.set(rs.chainNamespace,{chainNamespace:rs.chainNamespace,connectionControllerClient:rs.connectionControllerClient,networkControllerClient:rs.networkControllerClient,adapterType:rs.adapterType,accountState,networkState,caipNetworks:rs.caipNetworks})}))},initializeUniversalAdapter(Fn,Mn){var is,os;if(state$9.universalAdapter=Fn,Mn.length===0){const as=StorageUtil.getStoredActiveCaipNetwork();try{as?state$9.activeChain=as.chainNamespace:state$9.activeChain=((is=Fn==null?void 0:Fn.defaultNetwork)==null?void 0:is.chainNamespace)??((os=Fn.caipNetworks[0])==null?void 0:os.chainNamespace)}catch(us){console.warn(">>> Error setting active caip network",us)}}[...new Set(Fn.caipNetworks.map(as=>as.chainNamespace))].forEach(as=>{state$9.chains.set(as,{chainNamespace:as,connectionControllerClient:void 0,networkControllerClient:void 0,adapterType:Fn.adapterType,accountState,networkState,caipNetworks:Fn.caipNetworks})})},setAdapterNetworkState(Fn,Mn){const rs=state$9.chains.get(Fn);rs&&(rs.networkState=ref({...rs.networkState,...Mn}),state$9.chains.set(Fn,ref(rs)))},setChainAccountData(Fn,Mn,rs=!0){if(!Fn)throw new Error("Chain is required to update chain account data");const is=state$9.chains.get(Fn);is&&(is.accountState=ref({...is.accountState,...Mn}),state$9.chains.set(Fn,is),(rs||state$9.chains.size===1||state$9.activeChain===Fn)&&(Mn.caipAddress&&(state$9.activeCaipAddress=Mn.caipAddress),AccountController.replaceState(is.accountState)))},setAccountProp(Fn,Mn,rs,is=!0){this.setChainAccountData(rs,{[Fn]:Mn},is)},setActiveNamespace(Fn){var is,os;state$9.activeChain=Fn;const Mn=Fn?state$9.chains.get(Fn):void 0,rs=(is=Mn==null?void 0:Mn.networkState)==null?void 0:is.caipNetwork;rs!=null&&rs.id&&(state$9.activeCaipAddress=(os=Mn==null?void 0:Mn.accountState)==null?void 0:os.caipAddress,state$9.activeCaipNetwork=rs,SafeLocalStorage.setItem(SafeLocalStorageKeys.ACTIVE_CAIP_NETWORK_ID,rs==null?void 0:rs.caipNetworkId),PublicStateController.set({activeChain:Fn,selectedNetworkId:rs==null?void 0:rs.caipNetworkId}))},setActiveCaipNetwork(Fn){var is,os;if(!Fn)return;const Mn=state$9.chains.get(Fn.chainNamespace);state$9.activeChain=Fn.chainNamespace,state$9.activeCaipNetwork=Fn,state$9.activeCaipAddress=(is=Mn==null?void 0:Mn.accountState)==null?void 0:is.caipAddress,Mn&&AccountController.replaceState(Mn.accountState),PublicStateController.set({activeChain:state$9.activeChain,selectedNetworkId:(os=state$9.activeCaipNetwork)==null?void 0:os.caipNetworkId}),SafeLocalStorage.setItem(SafeLocalStorageKeys.ACTIVE_CAIP_NETWORK_ID,Fn.caipNetworkId),this.checkIfSupportedNetwork(Fn.chainNamespace)||this.showUnsupportedChainUI()},async switchActiveNetwork(Fn){const Mn=this.getNetworkControllerClient(Fn.chainNamespace);Mn&&await Mn.switchCaipNetwork(Fn),this.setActiveCaipNetwork(Fn),Fn&&EventsController.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:Fn.caipNetworkId}})},setActiveConnector(Fn){Fn&&(state$9.activeConnector=ref(Fn))},getNetworkControllerClient(Fn){const Mn=SafeLocalStorage.getItem(SafeLocalStorageKeys.WALLET_ID),rs=Fn||state$9.activeChain,is=Mn==="walletConnect",os=state$9.universalAdapter.networkControllerClient;if(is||state$9.noAdapters){if(!os)throw new Error("Universal Adapter's networkControllerClient is not set");return os}if(!rs)throw new Error("Chain is required to get network controller client");const us=state$9.chains.get(rs);if(!us)throw new Error("Chain adapter not found");if(!us.networkControllerClient)throw new Error("NetworkController client not set");return us.networkControllerClient},getConnectionControllerClient(Fn){var ds;const Mn=Fn||state$9.activeChain,rs=SafeLocalStorage.getItem(SafeLocalStorageKeys.CONNECTED_CONNECTOR)==="WALLET_CONNECT",is=state$9.universalAdapter.connectionControllerClient,os=((ds=state$9.chains.get("eip155"))==null?void 0:ds.adapterType)==="wagmi";if(rs&&!os||state$9.noAdapters){if(!is)throw new Error("Universal Adapter's ConnectionControllerClient is not set");return is}if(!Mn)throw new Error("Chain is required to get connection controller client");const us=state$9.chains.get(Mn);if(!us)throw new Error("Chain adapter not found");if(!us.connectionControllerClient)throw new Error("ConnectionController client not set");return us.connectionControllerClient},getAccountProp(Fn,Mn){var os;let rs=state$9.activeChain;if(Mn&&(rs=Mn),!rs)return;const is=(os=state$9.chains.get(rs))==null?void 0:os.accountState;if(is)return is[Fn]},getNetworkProp(Fn,Mn){var is;const rs=(is=state$9.chains.get(Mn))==null?void 0:is.networkState;if(rs)return rs[Fn]},getRequestedCaipNetworks(Fn){const Mn=state$9.chains.get(Fn),{approvedCaipNetworkIds:rs=[],requestedCaipNetworks:is=[]}=(Mn==null?void 0:Mn.networkState)||{};return CoreHelperUtil.sortRequestedNetworks(rs,is)},getAllRequestedCaipNetworks(){const Fn=[];return state$9.chains.forEach(Mn=>{const rs=this.getRequestedCaipNetworks(Mn.chainNamespace);Fn.push(...rs)}),Fn},setRequestedCaipNetworks(Fn,Mn){this.setAdapterNetworkState(Mn,{requestedCaipNetworks:Fn})},getAllApprovedCaipNetworkIds(){const Fn=[];return state$9.chains.forEach(Mn=>{const rs=this.getApprovedCaipNetworkIds(Mn.chainNamespace);Fn.push(...rs)}),Fn},getActiveCaipNetwork(){return state$9.activeCaipNetwork},getActiveCaipAddress(){return state$9.activeCaipAddress},getApprovedCaipNetworkIds(Fn){var is;const Mn=state$9.chains.get(Fn);return((is=Mn==null?void 0:Mn.networkState)==null?void 0:is.approvedCaipNetworkIds)||[]},async setApprovedCaipNetworksData(Fn){const Mn=this.getNetworkControllerClient(),rs=await(Mn==null?void 0:Mn.getApprovedCaipNetworksData());this.setAdapterNetworkState(Fn,{approvedCaipNetworkIds:rs==null?void 0:rs.approvedCaipNetworkIds,supportsAllNetworks:rs==null?void 0:rs.supportsAllNetworks})},checkIfSupportedNetwork(Fn){const Mn=this.state.activeCaipNetwork,rs=this.getRequestedCaipNetworks(Fn);return rs.length?rs==null?void 0:rs.some(is=>is.id===(Mn==null?void 0:Mn.id)):!0},setSmartAccountEnabledNetworks(Fn,Mn){this.setAdapterNetworkState(Mn,{smartAccountEnabledNetworks:Fn})},checkIfSmartAccountEnabled(){var is;const Fn=NetworkUtil.caipNetworkIdToNumber((is=state$9.activeCaipNetwork)==null?void 0:is.caipNetworkId),Mn=this.state.activeChain;if(!Mn||!Fn)return!1;const rs=this.getNetworkProp("smartAccountEnabledNetworks",Mn);return!!(rs!=null&&rs.includes(Number(Fn)))},getActiveNetworkTokenAddress(){var is,os;const Fn=((is=this.state.activeCaipNetwork)==null?void 0:is.chainNamespace)||"eip155",Mn=((os=this.state.activeCaipNetwork)==null?void 0:os.id)||1,rs=ConstantsUtil$2.NATIVE_TOKEN_ADDRESS[Fn];return`${Fn}:${Mn}:${rs}`},showUnsupportedChainUI(){setTimeout(()=>{ModalController.open({view:"UnsupportedChain"})},300)},checkIfNamesSupported(){const Fn=state$9.activeCaipNetwork;return!!(Fn!=null&&Fn.chainNamespace&&ConstantsUtil$2.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(Fn.chainNamespace))},resetNetwork(Fn){this.setAdapterNetworkState(Fn,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]})},resetAccount(Fn){const Mn=Fn;if(!Mn)throw new Error("Chain is required to set account prop");this.state.activeCaipAddress=void 0,this.setChainAccountData(Mn,ref({smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:void 0,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,provider:void 0}))}},StorageUtil={setWalletConnectDeepLink({name:Fn,href:Mn}){try{SafeLocalStorage.setItem(SafeLocalStorageKeys.DEEPLINK_CHOICE,JSON.stringify({href:Mn,name:Fn}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{const Fn=SafeLocalStorage.getItem(SafeLocalStorageKeys.DEEPLINK_CHOICE);if(Fn)return JSON.parse(Fn)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{SafeLocalStorage.removeItem(SafeLocalStorageKeys.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setAppKitRecent(Fn){try{const Mn=StorageUtil.getRecentWallets();Mn.find(is=>is.id===Fn.id)||(Mn.unshift(Fn),Mn.length>2&&Mn.pop(),SafeLocalStorage.setItem(SafeLocalStorageKeys.RECENT_WALLETS,JSON.stringify(Mn)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{const Fn=SafeLocalStorage.getItem(SafeLocalStorageKeys.RECENT_WALLETS);return Fn?JSON.parse(Fn):[]}catch{console.info("Unable to get AppKit recent")}return[]},setConnectedConnector(Fn){try{SafeLocalStorage.setItem(SafeLocalStorageKeys.CONNECTED_CONNECTOR,Fn)}catch{console.info("Unable to set Connected Connector")}},getConnectedConnector(){try{return SafeLocalStorage.getItem(SafeLocalStorageKeys.CONNECTED_CONNECTOR)}catch{console.info("Unable to get Connected Connector")}},setConnectedSocialProvider(Fn){try{SafeLocalStorage.setItem(SafeLocalStorageKeys.CONNECTED_SOCIAL,Fn)}catch{console.info("Unable to set Connected Social Provider")}},getConnectedSocialProvider(){try{return SafeLocalStorage.getItem(SafeLocalStorageKeys.CONNECTED_SOCIAL)}catch{console.info("Unable to get Connected Social Provider")}},getConnectedSocialUsername(){try{return SafeLocalStorage.getItem(SafeLocalStorageKeys.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get Connected Social Username")}},getStoredActiveCaipNetwork(){const Fn=SafeLocalStorage.getItem(SafeLocalStorageKeys.ACTIVE_CAIP_NETWORK_ID),Mn=ChainController.getAllRequestedCaipNetworks();return Mn==null?void 0:Mn.find(is=>is.caipNetworkId===Fn)}},state$8=proxy({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),AssetController={state:state$8,subscribeNetworkImages(Fn){return subscribe(state$8.networkImages,()=>Fn(state$8.networkImages))},subscribeKey(Fn,Mn){return subscribeKey(state$8,Fn,Mn)},subscribe(Fn){return subscribe(state$8,()=>Fn(state$8))},setWalletImage(Fn,Mn){state$8.walletImages[Fn]=Mn},setNetworkImage(Fn,Mn){state$8.networkImages[Fn]=Mn},setChainImage(Fn,Mn){state$8.chainImages[Fn]=Mn},setConnectorImage(Fn,Mn){state$8.connectorImages[Fn]=Mn},setTokenImage(Fn,Mn){state$8.tokenImages[Fn]=Mn},setCurrencyImage(Fn,Mn){state$8.currencyImages[Fn]=Mn}},baseUrl=CoreHelperUtil.getApiUrl(),api=new FetchUtil({baseUrl,clientId:null}),entries="40",recommendedEntries="4",imageCountToFetch=20,state$7=proxy({page:1,count:0,featured:[],recommended:[],wallets:[],search:[],isAnalyticsEnabled:!1,excludedRDNS:[]}),ApiController={state:state$7,subscribeKey(Fn,Mn){return subscribeKey(state$7,Fn,Mn)},_getApiHeaders(){const{projectId:Fn,sdkType:Mn,sdkVersion:rs}=OptionsController.state;return{"x-project-id":Fn,"x-sdk-type":Mn||"appkit","x-sdk-version":rs||"html-wagmi-4.2.2"}},_filterOutExtensions(Fn){return OptionsController.state.isUniversalProvider?Fn.filter(Mn=>!!(Mn.mobile_link||Mn.desktop_link||Mn.webapp_link)):Fn},async _fetchWalletImage(Fn){const Mn=`${api.baseUrl}/getWalletImage/${Fn}`,rs=await api.getBlob({path:Mn,headers:ApiController._getApiHeaders()});AssetController.setWalletImage(Fn,URL.createObjectURL(rs))},async _fetchNetworkImage(Fn){const Mn=`${api.baseUrl}/public/getAssetImage/${Fn}`,rs=await api.getBlob({path:Mn,headers:ApiController._getApiHeaders()});AssetController.setNetworkImage(Fn,URL.createObjectURL(rs))},async _fetchConnectorImage(Fn){const Mn=`${api.baseUrl}/public/getAssetImage/${Fn}`,rs=await api.getBlob({path:Mn,headers:ApiController._getApiHeaders()});AssetController.setConnectorImage(Fn,URL.createObjectURL(rs))},async _fetchCurrencyImage(Fn){const Mn=`${api.baseUrl}/public/getCurrencyImage/${Fn}`,rs=await api.getBlob({path:Mn,headers:ApiController._getApiHeaders()});AssetController.setCurrencyImage(Fn,URL.createObjectURL(rs))},async _fetchTokenImage(Fn){const Mn=`${api.baseUrl}/public/getTokenImage/${Fn}`,rs=await api.getBlob({path:Mn,headers:ApiController._getApiHeaders()});AssetController.setTokenImage(Fn,URL.createObjectURL(rs))},async fetchNetworkImages(){const Fn=ChainController.getAllRequestedCaipNetworks(),Mn=Fn==null?void 0:Fn.map(({assets:rs})=>rs==null?void 0:rs.imageId).filter(Boolean);Mn&&await Promise.allSettled(Mn.map(rs=>ApiController._fetchNetworkImage(rs)))},async fetchConnectorImages(){const{connectors:Fn}=ConnectorController.state,Mn=Fn.map(({imageId:rs})=>rs).filter(Boolean);await Promise.allSettled(Mn.map(rs=>ApiController._fetchConnectorImage(rs)))},async fetchCurrencyImages(Fn=[]){await Promise.allSettled(Fn.map(Mn=>ApiController._fetchCurrencyImage(Mn)))},async fetchTokenImages(Fn=[]){await Promise.allSettled(Fn.map(Mn=>ApiController._fetchTokenImage(Mn)))},async fetchFeaturedWallets(){const{featuredWalletIds:Fn}=OptionsController.state;if(Fn!=null&&Fn.length){const{data:Mn}=await api.get({path:"/getWallets",headers:ApiController._getApiHeaders(),params:{page:"1",entries:Fn!=null&&Fn.length?String(Fn.length):recommendedEntries,include:Fn==null?void 0:Fn.join(",")}});Mn.sort((is,os)=>Fn.indexOf(is.id)-Fn.indexOf(os.id));const rs=Mn.map(is=>is.image_id).filter(Boolean);await Promise.allSettled(rs.map(is=>ApiController._fetchWalletImage(is))),state$7.featured=Mn}},async fetchRecommendedWallets(){var Fn;try{const{includeWalletIds:Mn,excludeWalletIds:rs,featuredWalletIds:is}=OptionsController.state,os=[...rs??[],...is??[]].filter(Boolean),{data:as,count:us}=await api.get({path:"/getWallets",headers:ApiController._getApiHeaders(),params:{page:"1",chains:(Fn=ChainController.state.activeCaipNetwork)==null?void 0:Fn.caipNetworkId,entries:recommendedEntries,include:Mn==null?void 0:Mn.join(","),exclude:os==null?void 0:os.join(",")}}),ds=StorageUtil.getRecentWallets(),hs=as.map(io=>io.image_id).filter(Boolean),ps=ds.map(io=>io.image_id).filter(Boolean);await Promise.allSettled([...hs,...ps].map(io=>ApiController._fetchWalletImage(io))),state$7.recommended=as,state$7.count=us??0}catch{}},async fetchWallets({page:Fn}){var hs;const{includeWalletIds:Mn,excludeWalletIds:rs,featuredWalletIds:is}=OptionsController.state,os=[...state$7.recommended.map(({id:ps})=>ps),...rs??[],...is??[]].filter(Boolean),{data:as,count:us}=await api.get({path:"/getWallets",headers:ApiController._getApiHeaders(),params:{page:String(Fn),entries,chains:(hs=ChainController.state.activeCaipNetwork)==null?void 0:hs.caipNetworkId,include:Mn==null?void 0:Mn.join(","),exclude:os.join(",")}}),ds=as.slice(0,imageCountToFetch).map(ps=>ps.image_id).filter(Boolean);await Promise.allSettled(ds.map(ps=>ApiController._fetchWalletImage(ps))),state$7.wallets=CoreHelperUtil.uniqueBy([...state$7.wallets,...ApiController._filterOutExtensions(as)],"id"),state$7.count=us>state$7.count?us:state$7.count,state$7.page=Fn},async searchWalletByIds({ids:Fn}){var rs;const{data:Mn}=await api.get({path:"/getWallets",headers:ApiController._getApiHeaders(),params:{page:"1",entries:String(Fn.length),chains:(rs=ChainController.state.activeCaipNetwork)==null?void 0:rs.caipNetworkId,include:Fn==null?void 0:Fn.join(",")}});Mn&&Mn.forEach(is=>{is!=null&&is.rdns&&state$7.excludedRDNS.push(is.rdns)})},async searchWallet({search:Fn}){var as;const{includeWalletIds:Mn,excludeWalletIds:rs}=OptionsController.state;state$7.search=[];const{data:is}=await api.get({path:"/getWallets",headers:ApiController._getApiHeaders(),params:{page:"1",entries:"100",search:Fn==null?void 0:Fn.trim(),chains:(as=ChainController.state.activeCaipNetwork)==null?void 0:as.caipNetworkId,include:Mn==null?void 0:Mn.join(","),exclude:rs==null?void 0:rs.join(",")}}),os=is.map(us=>us.image_id).filter(Boolean);await Promise.allSettled([...os.map(us=>ApiController._fetchWalletImage(us)),CoreHelperUtil.wait(300)]),state$7.search=ApiController._filterOutExtensions(is)},async reFetchWallets(){state$7.page=1,state$7.wallets=[],await ApiController.fetchFeaturedWallets(),await ApiController.fetchRecommendedWallets()},prefetch(){var Mn;const Fn=[ApiController.fetchFeaturedWallets(),ApiController.fetchRecommendedWallets(),ApiController.fetchNetworkImages(),ApiController.fetchConnectorImages()];(Mn=OptionsController.state.features)!=null&&Mn.analytics&&Fn.push(ApiController.fetchAnalyticsConfig()),state$7.prefetchPromise=Promise.race([Promise.allSettled(Fn)])},async fetchAnalyticsConfig(){const{isAnalyticsEnabled:Fn}=await api.get({path:"/getAnalyticsConfig",headers:ApiController._getApiHeaders()});OptionsController.setFeatures({analytics:Fn})}},state$6=proxy({loading:!1,open:!1,shake:!1}),ModalController={state:state$6,subscribe(Fn){return subscribe(state$6,()=>Fn(state$6))},subscribeKey(Fn,Mn){return subscribeKey(state$6,Fn,Mn)},async open(Fn){await ApiController.state.prefetchPromise;const Mn=ChainController.state.activeCaipAddress,rs=ChainController.state.noAdapters;Fn!=null&&Fn.view?RouterController.reset(Fn.view):Mn?RouterController.reset("Account"):rs&&!CoreHelperUtil.isMobile()?RouterController.reset("ConnectingWalletConnect"):RouterController.reset("Connect"),state$6.open=!0,PublicStateController.set({open:!0}),EventsController.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!Mn}})},close(){const Fn=!!ChainController.state.activeCaipAddress;state$6.open=!1,PublicStateController.set({open:!1}),EventsController.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:Fn}})},setLoading(Fn){state$6.loading=Fn,PublicStateController.set({loading:Fn})},shake(){state$6.shake||(state$6.shake=!0,setTimeout(()=>{state$6.shake=!1},500))}},USDC_CURRENCY_DEFAULT={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},USD_CURRENCY_DEFAULT={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},defaultState={providers:ONRAMP_PROVIDERS,selectedProvider:null,error:null,purchaseCurrency:USDC_CURRENCY_DEFAULT,paymentCurrency:USD_CURRENCY_DEFAULT,purchaseCurrencies:[USDC_CURRENCY_DEFAULT],paymentCurrencies:[],quotesLoading:!1},state$5=proxy(defaultState),OnRampController={state:state$5,subscribe(Fn){return subscribe(state$5,()=>Fn(state$5))},subscribeKey(Fn,Mn){return subscribeKey(state$5,Fn,Mn)},setSelectedProvider(Fn){if(Fn&&Fn.name==="meld"){const Mn=MELD_PROD_PUBLIC_KEY,rs=ChainController.state.activeChain===ConstantsUtil$3.CHAIN.SOLANA?"SOL":"USDC",is=AccountController.state.address??"",os=new URL(Fn.url);os.searchParams.append("publicKey",Mn),os.searchParams.append("destinationCurrencyCode",rs),os.searchParams.append("walletAddress",is),Fn.url=os.toString()}state$5.selectedProvider=Fn},setPurchaseCurrency(Fn){state$5.purchaseCurrency=Fn},setPaymentCurrency(Fn){state$5.paymentCurrency=Fn},setPurchaseAmount(Fn){this.state.purchaseAmount=Fn},setPaymentAmount(Fn){this.state.paymentAmount=Fn},async getAvailableCurrencies(){const Fn=await BlockchainApiController.getOnrampOptions();state$5.purchaseCurrencies=Fn.purchaseCurrencies,state$5.paymentCurrencies=Fn.paymentCurrencies,state$5.paymentCurrency=Fn.paymentCurrencies[0]||USD_CURRENCY_DEFAULT,state$5.purchaseCurrency=Fn.purchaseCurrencies[0]||USDC_CURRENCY_DEFAULT,await ApiController.fetchCurrencyImages(Fn.paymentCurrencies.map(Mn=>Mn.id)),await ApiController.fetchTokenImages(Fn.purchaseCurrencies.map(Mn=>Mn.symbol))},async getQuote(){var Fn,Mn;state$5.quotesLoading=!0;try{const rs=await BlockchainApiController.getOnrampQuote({purchaseCurrency:state$5.purchaseCurrency,paymentCurrency:state$5.paymentCurrency,amount:((Fn=state$5.paymentAmount)==null?void 0:Fn.toString())||"0",network:(Mn=state$5.purchaseCurrency)==null?void 0:Mn.symbol});return state$5.quotesLoading=!1,state$5.purchaseAmount=Number(rs.purchaseAmount.amount),rs}catch(rs){return state$5.error=rs.message,state$5.quotesLoading=!1,null}finally{state$5.quotesLoading=!1}},resetState(){state$5.providers=ONRAMP_PROVIDERS,state$5.selectedProvider=null,state$5.error=null,state$5.purchaseCurrency=USDC_CURRENCY_DEFAULT,state$5.paymentCurrency=USD_CURRENCY_DEFAULT,state$5.purchaseCurrencies=[USDC_CURRENCY_DEFAULT],state$5.paymentCurrencies=[],state$5.paymentAmount=void 0,state$5.purchaseAmount=void 0,state$5.quotesLoading=!1}},state$4=proxy({loading:!1}),SendController={state:state$4,subscribe(Fn){return subscribe(state$4,()=>Fn(state$4))},subscribeKey(Fn,Mn){return subscribeKey(state$4,Fn,Mn)},setToken(Fn){Fn&&(state$4.token=ref(Fn))},setTokenAmount(Fn){state$4.sendTokenAmount=Fn},setReceiverAddress(Fn){state$4.receiverAddress=Fn},setReceiverProfileImageUrl(Fn){state$4.receiverProfileImageUrl=Fn},setReceiverProfileName(Fn){state$4.receiverProfileName=Fn},setGasPrice(Fn){state$4.gasPrice=Fn},setGasPriceInUsd(Fn){state$4.gasPriceInUSD=Fn},setLoading(Fn){state$4.loading=Fn},sendToken(){var Fn;switch((Fn=ChainController.state.activeCaipNetwork)==null?void 0:Fn.chainNamespace){case"eip155":this.sendEvmToken();return;case"solana":this.sendSolanaToken();return;default:throw new Error("Unsupported chain")}},sendEvmToken(){var Fn,Mn,rs,is,os;(Fn=this.state.token)!=null&&Fn.address&&this.state.sendTokenAmount&&this.state.receiverAddress?(EventsController.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT,token:this.state.token.address,amount:this.state.sendTokenAmount,network:((Mn=ChainController.state.activeCaipNetwork)==null?void 0:Mn.caipNetworkId)||""}}),this.sendERC20Token({receiverAddress:this.state.receiverAddress,tokenAddress:this.state.token.address,sendTokenAmount:this.state.sendTokenAmount,decimals:this.state.token.quantity.decimals})):this.state.receiverAddress&&this.state.sendTokenAmount&&this.state.gasPrice&&((rs=this.state.token)!=null&&rs.quantity.decimals)&&(EventsController.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT,token:(is=this.state.token)==null?void 0:is.symbol,amount:this.state.sendTokenAmount,network:((os=ChainController.state.activeCaipNetwork)==null?void 0:os.caipNetworkId)||""}}),this.sendNativeToken({receiverAddress:this.state.receiverAddress,sendTokenAmount:this.state.sendTokenAmount,gasPrice:this.state.gasPrice,decimals:this.state.token.quantity.decimals}))},async sendNativeToken(Fn){var as,us,ds,hs;RouterController.pushTransactionStack({view:"Account",goBack:!1});const Mn=Fn.receiverAddress,rs=AccountController.state.address,is=ConnectionController.parseUnits(Fn.sendTokenAmount.toString(),Number(Fn.decimals)),os="0x";try{await ConnectionController.sendTransaction({to:Mn,address:rs,data:os,value:is,gasPrice:Fn.gasPrice}),SnackController.showSuccess("Transaction started"),EventsController.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT,token:((as=this.state.token)==null?void 0:as.symbol)||"",amount:Fn.sendTokenAmount,network:((us=ChainController.state.activeCaipNetwork)==null?void 0:us.caipNetworkId)||""}}),this.resetSend()}catch{EventsController.sendEvent({type:"track",event:"SEND_ERROR",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT,token:((ds=this.state.token)==null?void 0:ds.symbol)||"",amount:Fn.sendTokenAmount,network:((hs=ChainController.state.activeCaipNetwork)==null?void 0:hs.caipNetworkId)||""}}),SnackController.showError("Something went wrong")}},async sendERC20Token(Fn){RouterController.pushTransactionStack({view:"Account",goBack:!1});const Mn=ConnectionController.parseUnits(Fn.sendTokenAmount.toString(),Number(Fn.decimals));try{if(AccountController.state.address&&Fn.sendTokenAmount&&Fn.receiverAddress&&Fn.tokenAddress){const rs=CoreHelperUtil.getPlainAddress(Fn.tokenAddress);await ConnectionController.writeContract({fromAddress:AccountController.state.address,tokenAddress:rs,receiverAddress:Fn.receiverAddress,tokenAmount:Mn,method:"transfer",abi:ContractUtil.getERC20Abi(rs)}),SnackController.showSuccess("Transaction started"),this.resetSend()}}catch{SnackController.showError("Something went wrong")}},sendSolanaToken(){if(!this.state.sendTokenAmount||!this.state.receiverAddress){SnackController.showError("Please enter a valid amount and receiver address");return}RouterController.pushTransactionStack({view:"Account",goBack:!1}),ConnectionController.sendTransaction({chainNamespace:"solana",to:this.state.receiverAddress,value:this.state.sendTokenAmount}).then(()=>{this.resetSend(),AccountController.fetchTokenBalance()}).catch(Fn=>{SnackController.showError("Failed to send transaction. Please try again."),console.error("SendController:sendToken - failed to send solana transaction",Fn)})},resetSend(){state$4.token=void 0,state$4.sendTokenAmount=void 0,state$4.receiverAddress=void 0,state$4.receiverProfileImageUrl=void 0,state$4.receiverProfileName=void 0,state$4.loading=!1}},state$3=proxy({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),TooltipController={state:state$3,subscribe(Fn){return subscribe(state$3,()=>Fn(state$3))},subscribeKey(Fn,Mn){return subscribeKey(state$3,Fn,Mn)},showTooltip({message:Fn,triggerRect:Mn,variant:rs}){state$3.open=!0,state$3.message=Fn,state$3.triggerRect=Mn,state$3.variant=rs},hide(){state$3.open=!1,state$3.message="",state$3.triggerRect={width:0,height:0,top:0,left:0}}},SLIP44_MSB=2147483648,EnsUtil={convertEVMChainIdToCoinType(Fn){if(Fn>=SLIP44_MSB)throw new Error("Invalid chainId");return(SLIP44_MSB|Fn)>>>0}},state$2=proxy({suggestions:[],loading:!1}),EnsController={state:state$2,subscribe(Fn){return subscribe(state$2,()=>Fn(state$2))},subscribeKey(Fn,Mn){return subscribeKey(state$2,Fn,Mn)},async resolveName(Fn){var Mn,rs;try{return await BlockchainApiController.lookupEnsName(Fn)}catch(is){const os=is;throw new Error(((rs=(Mn=os==null?void 0:os.reasons)==null?void 0:Mn[0])==null?void 0:rs.description)||"Error resolving name")}},async isNameRegistered(Fn){try{return await BlockchainApiController.lookupEnsName(Fn),!0}catch{return!1}},async getSuggestions(Fn){try{state$2.loading=!0,state$2.suggestions=[];const Mn=await BlockchainApiController.getEnsNameSuggestions(Fn);return state$2.suggestions=Mn.suggestions.map(rs=>({...rs,name:rs.name}))||[],state$2.suggestions}catch(Mn){const rs=this.parseEnsApiError(Mn,"Error fetching name suggestions");throw new Error(rs)}finally{state$2.loading=!1}},async getNamesForAddress(Fn){try{return ChainController.state.activeCaipNetwork?await BlockchainApiController.reverseLookupEnsName({address:Fn}):[]}catch(Mn){const rs=this.parseEnsApiError(Mn,"Error fetching names for address");throw new Error(rs)}},async registerName(Fn){const Mn=ChainController.state.activeCaipNetwork;if(!Mn)throw new Error("Network not found");const rs=AccountController.state.address,is=ConnectorController.getAuthConnector();if(!rs||!is)throw new Error("Address or auth connector not found");state$2.loading=!0;try{const os=JSON.stringify({name:Fn,attributes:{},timestamp:Math.floor(Date.now()/1e3)});RouterController.pushTransactionStack({view:"RegisterAccountNameSuccess",goBack:!1,replace:!0,onCancel(){state$2.loading=!1}});const as=await ConnectionController.signMessage(os),us=Mn.id;if(!us)throw new Error("Network not found");const ds=EnsUtil.convertEVMChainIdToCoinType(Number(us));await BlockchainApiController.registerEnsName({coinType:ds,address:rs,signature:as,message:os}),AccountController.setProfileName(Fn,Mn.chainNamespace),RouterController.replace("RegisterAccountNameSuccess")}catch(os){const as=this.parseEnsApiError(os,`Error registering name ${Fn}`);throw RouterController.replace("RegisterAccountName"),new Error(as)}finally{state$2.loading=!1}},validateName(Fn){return/^[a-zA-Z0-9-]{4,}$/u.test(Fn)},parseEnsApiError(Fn,Mn){var is,os;const rs=Fn;return((os=(is=rs==null?void 0:rs.reasons)==null?void 0:is[0])==null?void 0:os.description)||Mn}},state$1=proxy({message:"",variant:"info",open:!1}),AlertController={state:state$1,subscribeKey(Fn,Mn){return subscribeKey(state$1,Fn,Mn)},open(Fn,Mn){const{debug:rs}=OptionsController.state,{shortMessage:is,longMessage:os}=Fn;rs&&(state$1.message=is,state$1.variant=Mn,state$1.open=!0),os&&console.error(typeof os=="function"?os():os)},close(){state$1.open=!1,state$1.message="",state$1.variant="info"}},namespaceImageIds={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:""},AssetUtil={async fetchWalletImage(Fn){if(Fn)return await ApiController._fetchWalletImage(Fn),this.getWalletImageById(Fn)},getWalletImageById(Fn){if(Fn)return AssetController.state.walletImages[Fn]},getWalletImage(Fn){if(Fn!=null&&Fn.image_url)return Fn==null?void 0:Fn.image_url;if(Fn!=null&&Fn.image_id)return AssetController.state.walletImages[Fn.image_id]},getNetworkImage(Fn){var Mn,rs,is;if((Mn=Fn==null?void 0:Fn.assets)!=null&&Mn.imageUrl)return(rs=Fn==null?void 0:Fn.assets)==null?void 0:rs.imageUrl;if((is=Fn==null?void 0:Fn.assets)!=null&&is.imageId)return AssetController.state.networkImages[Fn.assets.imageId]},getNetworkImageById(Fn){if(Fn)return AssetController.state.networkImages[Fn]},getConnectorImage(Fn){if(Fn!=null&&Fn.imageUrl)return Fn.imageUrl;if(Fn!=null&&Fn.imageId)return AssetController.state.connectorImages[Fn.imageId]},getChainImage(Fn){return AssetController.state.networkImages[namespaceImageIds[Fn]]}};/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const t$2=globalThis,e$4=t$2.ShadowRoot&&(t$2.ShadyCSS===void 0||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$5=new WeakMap;let n$7=class{constructor(Mn,rs,is){if(this._$cssResult$=!0,is!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=Mn,this.t=rs}get styleSheet(){let Mn=this.o;const rs=this.t;if(e$4&&Mn===void 0){const is=rs!==void 0&&rs.length===1;is&&(Mn=o$5.get(rs)),Mn===void 0&&((this.o=Mn=new CSSStyleSheet).replaceSync(this.cssText),is&&o$5.set(rs,Mn))}return Mn}toString(){return this.cssText}};const r$8=Fn=>new n$7(typeof Fn=="string"?Fn:Fn+"",void 0,s$2),i$4=(Fn,...Mn)=>{const rs=Fn.length===1?Fn[0]:Mn.reduce((is,os,as)=>is+(us=>{if(us._$cssResult$===!0)return us.cssText;if(typeof us=="number")return us;throw Error("Value passed to 'css' function must be a 'css' function result: "+us+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(os)+Fn[as+1],Fn[0]);return new n$7(rs,Fn,s$2)},S$3=(Fn,Mn)=>{if(e$4)Fn.adoptedStyleSheets=Mn.map(rs=>rs instanceof CSSStyleSheet?rs:rs.styleSheet);else for(const rs of Mn){const is=document.createElement("style"),os=t$2.litNonce;os!==void 0&&is.setAttribute("nonce",os),is.textContent=rs.cssText,Fn.appendChild(is)}},c$4=e$4?Fn=>Fn:Fn=>Fn instanceof CSSStyleSheet?(Mn=>{let rs="";for(const is of Mn.cssRules)rs+=is.cssText;return r$8(rs)})(Fn):Fn;/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const{is:i$3,defineProperty:e$3,getOwnPropertyDescriptor:r$7,getOwnPropertyNames:h$5,getOwnPropertySymbols:o$4,getPrototypeOf:n$6}=Object,a$2=globalThis,c$3=a$2.trustedTypes,l$2=c$3?c$3.emptyScript:"",p$2=a$2.reactiveElementPolyfillSupport,d$2=(Fn,Mn)=>Fn,u$1={toAttribute(Fn,Mn){switch(Mn){case Boolean:Fn=Fn?l$2:null;break;case Object:case Array:Fn=Fn==null?Fn:JSON.stringify(Fn)}return Fn},fromAttribute(Fn,Mn){let rs=Fn;switch(Mn){case Boolean:rs=Fn!==null;break;case Number:rs=Fn===null?null:Number(Fn);break;case Object:case Array:try{rs=JSON.parse(Fn)}catch{rs=null}}return rs}},f$4=(Fn,Mn)=>!i$3(Fn,Mn),y$3={attribute:!0,type:String,converter:u$1,reflect:!1,hasChanged:f$4};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),a$2.litPropertyMetadata??(a$2.litPropertyMetadata=new WeakMap);let b$1=class extends HTMLElement{static addInitializer(Mn){this._$Ei(),(this.l??(this.l=[])).push(Mn)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(Mn,rs=y$3){if(rs.state&&(rs.attribute=!1),this._$Ei(),this.elementProperties.set(Mn,rs),!rs.noAccessor){const is=Symbol(),os=this.getPropertyDescriptor(Mn,is,rs);os!==void 0&&e$3(this.prototype,Mn,os)}}static getPropertyDescriptor(Mn,rs,is){const{get:os,set:as}=r$7(this.prototype,Mn)??{get(){return this[rs]},set(us){this[rs]=us}};return{get(){return os==null?void 0:os.call(this)},set(us){const ds=os==null?void 0:os.call(this);as.call(this,us),this.requestUpdate(Mn,ds,is)},configurable:!0,enumerable:!0}}static getPropertyOptions(Mn){return this.elementProperties.get(Mn)??y$3}static _$Ei(){if(this.hasOwnProperty(d$2("elementProperties")))return;const Mn=n$6(this);Mn.finalize(),Mn.l!==void 0&&(this.l=[...Mn.l]),this.elementProperties=new Map(Mn.elementProperties)}static finalize(){if(this.hasOwnProperty(d$2("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d$2("properties"))){const rs=this.properties,is=[...h$5(rs),...o$4(rs)];for(const os of is)this.createProperty(os,rs[os])}const Mn=this[Symbol.metadata];if(Mn!==null){const rs=litPropertyMetadata.get(Mn);if(rs!==void 0)for(const[is,os]of rs)this.elementProperties.set(is,os)}this._$Eh=new Map;for(const[rs,is]of this.elementProperties){const os=this._$Eu(rs,is);os!==void 0&&this._$Eh.set(os,rs)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(Mn){const rs=[];if(Array.isArray(Mn)){const is=new Set(Mn.flat(1/0).reverse());for(const os of is)rs.unshift(c$4(os))}else Mn!==void 0&&rs.push(c$4(Mn));return rs}static _$Eu(Mn,rs){const is=rs.attribute;return is===!1?void 0:typeof is=="string"?is:typeof Mn=="string"?Mn.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var Mn;this._$ES=new Promise(rs=>this.enableUpdating=rs),this._$AL=new Map,this._$E_(),this.requestUpdate(),(Mn=this.constructor.l)==null||Mn.forEach(rs=>rs(this))}addController(Mn){var rs;(this._$EO??(this._$EO=new Set)).add(Mn),this.renderRoot!==void 0&&this.isConnected&&((rs=Mn.hostConnected)==null||rs.call(Mn))}removeController(Mn){var rs;(rs=this._$EO)==null||rs.delete(Mn)}_$E_(){const Mn=new Map,rs=this.constructor.elementProperties;for(const is of rs.keys())this.hasOwnProperty(is)&&(Mn.set(is,this[is]),delete this[is]);Mn.size>0&&(this._$Ep=Mn)}createRenderRoot(){const Mn=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$3(Mn,this.constructor.elementStyles),Mn}connectedCallback(){var Mn;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(Mn=this._$EO)==null||Mn.forEach(rs=>{var is;return(is=rs.hostConnected)==null?void 0:is.call(rs)})}enableUpdating(Mn){}disconnectedCallback(){var Mn;(Mn=this._$EO)==null||Mn.forEach(rs=>{var is;return(is=rs.hostDisconnected)==null?void 0:is.call(rs)})}attributeChangedCallback(Mn,rs,is){this._$AK(Mn,is)}_$EC(Mn,rs){var as;const is=this.constructor.elementProperties.get(Mn),os=this.constructor._$Eu(Mn,is);if(os!==void 0&&is.reflect===!0){const us=(((as=is.converter)==null?void 0:as.toAttribute)!==void 0?is.converter:u$1).toAttribute(rs,is.type);this._$Em=Mn,us==null?this.removeAttribute(os):this.setAttribute(os,us),this._$Em=null}}_$AK(Mn,rs){var as;const is=this.constructor,os=is._$Eh.get(Mn);if(os!==void 0&&this._$Em!==os){const us=is.getPropertyOptions(os),ds=typeof us.converter=="function"?{fromAttribute:us.converter}:((as=us.converter)==null?void 0:as.fromAttribute)!==void 0?us.converter:u$1;this._$Em=os,this[os]=ds.fromAttribute(rs,us.type),this._$Em=null}}requestUpdate(Mn,rs,is){if(Mn!==void 0){if(is??(is=this.constructor.getPropertyOptions(Mn)),!(is.hasChanged??f$4)(this[Mn],rs))return;this.P(Mn,rs,is)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(Mn,rs,is){this._$AL.has(Mn)||this._$AL.set(Mn,rs),is.reflect===!0&&this._$Em!==Mn&&(this._$Ej??(this._$Ej=new Set)).add(Mn)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(rs){Promise.reject(rs)}const Mn=this.scheduleUpdate();return Mn!=null&&await Mn,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var is;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[as,us]of this._$Ep)this[as]=us;this._$Ep=void 0}const os=this.constructor.elementProperties;if(os.size>0)for(const[as,us]of os)us.wrapped!==!0||this._$AL.has(as)||this[as]===void 0||this.P(as,this[as],us)}let Mn=!1;const rs=this._$AL;try{Mn=this.shouldUpdate(rs),Mn?(this.willUpdate(rs),(is=this._$EO)==null||is.forEach(os=>{var as;return(as=os.hostUpdate)==null?void 0:as.call(os)}),this.update(rs)):this._$EU()}catch(os){throw Mn=!1,this._$EU(),os}Mn&&this._$AE(rs)}willUpdate(Mn){}_$AE(Mn){var rs;(rs=this._$EO)==null||rs.forEach(is=>{var os;return(os=is.hostUpdated)==null?void 0:os.call(is)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(Mn)),this.updated(Mn)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(Mn){return!0}update(Mn){this._$Ej&&(this._$Ej=this._$Ej.forEach(rs=>this._$EC(rs,this[rs]))),this._$EU()}updated(Mn){}firstUpdated(Mn){}};b$1.elementStyles=[],b$1.shadowRootOptions={mode:"open"},b$1[d$2("elementProperties")]=new Map,b$1[d$2("finalized")]=new Map,p$2==null||p$2({ReactiveElement:b$1}),(a$2.reactiveElementVersions??(a$2.reactiveElementVersions=[])).push("2.0.4");/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const n$5=globalThis,c$2=n$5.trustedTypes,h$4=c$2?c$2.createPolicy("lit-html",{createHTML:Fn=>Fn}):void 0,f$3="$lit$",v$3=`lit$${Math.random().toFixed(9).slice(2)}$`,m="?"+v$3,_$2=`<${m}>`,w$3=document,lt$2=()=>w$3.createComment(""),st$2=Fn=>Fn===null||typeof Fn!="object"&&typeof Fn!="function",g$2=Array.isArray,$=Fn=>g$2(Fn)||typeof(Fn==null?void 0:Fn[Symbol.iterator])=="function",x$3=`[ 	
\f\r]`,T$2=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,E$2=/-->/g,k$1=/>/g,O$3=RegExp(`>|${x$3}(?:([^\\s"'>=/]+)(${x$3}*=${x$3}*(?:[^ 	
\f\r"'\`<>=]|("|')|))|$)`,"g"),S$2=/'/g,j$4=/"/g,M$2=/^(?:script|style|textarea|title)$/i,P$2=Fn=>(Mn,...rs)=>({_$litType$:Fn,strings:Mn,values:rs}),ke=P$2(1),Oe$1=P$2(2),R$2=Symbol.for("lit-noChange"),D$2=Symbol.for("lit-nothing"),V$1=new WeakMap,I$1=w$3.createTreeWalker(w$3,129);function N$1(Fn,Mn){if(!g$2(Fn)||!Fn.hasOwnProperty("raw"))throw Error("invalid template strings array");return h$4!==void 0?h$4.createHTML(Mn):Mn}const U$1=(Fn,Mn)=>{const rs=Fn.length-1,is=[];let os,as=Mn===2?"<svg>":Mn===3?"<math>":"",us=T$2;for(let ds=0;ds<rs;ds++){const hs=Fn[ds];let ps,io,fo=-1,mo=0;for(;mo<hs.length&&(us.lastIndex=mo,io=us.exec(hs),io!==null);)mo=us.lastIndex,us===T$2?io[1]==="!--"?us=E$2:io[1]!==void 0?us=k$1:io[2]!==void 0?(M$2.test(io[2])&&(os=RegExp("</"+io[2],"g")),us=O$3):io[3]!==void 0&&(us=O$3):us===O$3?io[0]===">"?(us=os??T$2,fo=-1):io[1]===void 0?fo=-2:(fo=us.lastIndex-io[2].length,ps=io[1],us=io[3]===void 0?O$3:io[3]==='"'?j$4:S$2):us===j$4||us===S$2?us=O$3:us===E$2||us===k$1?us=T$2:(us=O$3,os=void 0);const Ao=us===O$3&&Fn[ds+1].startsWith("/>")?" ":"";as+=us===T$2?hs+_$2:fo>=0?(is.push(ps),hs.slice(0,fo)+f$3+hs.slice(fo)+v$3+Ao):hs+v$3+(fo===-2?ds:Ao)}return[N$1(Fn,as+(Fn[rs]||"<?>")+(Mn===2?"</svg>":Mn===3?"</math>":"")),is]};class B{constructor({strings:Mn,_$litType$:rs},is){let os;this.parts=[];let as=0,us=0;const ds=Mn.length-1,hs=this.parts,[ps,io]=U$1(Mn,rs);if(this.el=B.createElement(ps,is),I$1.currentNode=this.el.content,rs===2||rs===3){const fo=this.el.content.firstChild;fo.replaceWith(...fo.childNodes)}for(;(os=I$1.nextNode())!==null&&hs.length<ds;){if(os.nodeType===1){if(os.hasAttributes())for(const fo of os.getAttributeNames())if(fo.endsWith(f$3)){const mo=io[us++],Ao=os.getAttribute(fo).split(v$3),$o=/([.?@])?(.*)/.exec(mo);hs.push({type:1,index:as,name:$o[2],strings:Ao,ctor:$o[1]==="."?Y:$o[1]==="?"?Z$1:$o[1]==="@"?q$1:G$1}),os.removeAttribute(fo)}else fo.startsWith(v$3)&&(hs.push({type:6,index:as}),os.removeAttribute(fo));if(M$2.test(os.tagName)){const fo=os.textContent.split(v$3),mo=fo.length-1;if(mo>0){os.textContent=c$2?c$2.emptyScript:"";for(let Ao=0;Ao<mo;Ao++)os.append(fo[Ao],lt$2()),I$1.nextNode(),hs.push({type:2,index:++as});os.append(fo[mo],lt$2())}}}else if(os.nodeType===8)if(os.data===m)hs.push({type:2,index:as});else{let fo=-1;for(;(fo=os.data.indexOf(v$3,fo+1))!==-1;)hs.push({type:7,index:as}),fo+=v$3.length-1}as++}}static createElement(Mn,rs){const is=w$3.createElement("template");return is.innerHTML=Mn,is}}function z$4(Fn,Mn,rs=Fn,is){var us,ds;if(Mn===R$2)return Mn;let os=is!==void 0?(us=rs.o)==null?void 0:us[is]:rs.l;const as=st$2(Mn)?void 0:Mn._$litDirective$;return(os==null?void 0:os.constructor)!==as&&((ds=os==null?void 0:os._$AO)==null||ds.call(os,!1),as===void 0?os=void 0:(os=new as(Fn),os._$AT(Fn,rs,is)),is!==void 0?(rs.o??(rs.o=[]))[is]=os:rs.l=os),os!==void 0&&(Mn=z$4(Fn,os._$AS(Fn,Mn.values),os,is)),Mn}let F$2=class{constructor(Mn,rs){this._$AV=[],this._$AN=void 0,this._$AD=Mn,this._$AM=rs}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(Mn){const{el:{content:rs},parts:is}=this._$AD,os=((Mn==null?void 0:Mn.creationScope)??w$3).importNode(rs,!0);I$1.currentNode=os;let as=I$1.nextNode(),us=0,ds=0,hs=is[0];for(;hs!==void 0;){if(us===hs.index){let ps;hs.type===2?ps=new et$1(as,as.nextSibling,this,Mn):hs.type===1?ps=new hs.ctor(as,hs.name,hs.strings,this,Mn):hs.type===6&&(ps=new K$2(as,this,Mn)),this._$AV.push(ps),hs=is[++ds]}us!==(hs==null?void 0:hs.index)&&(as=I$1.nextNode(),us++)}return I$1.currentNode=w$3,os}p(Mn){let rs=0;for(const is of this._$AV)is!==void 0&&(is.strings!==void 0?(is._$AI(Mn,is,rs),rs+=is.strings.length-2):is._$AI(Mn[rs])),rs++}},et$1=class r_{get _$AU(){var Mn;return((Mn=this._$AM)==null?void 0:Mn._$AU)??this.v}constructor(Mn,rs,is,os){this.type=2,this._$AH=D$2,this._$AN=void 0,this._$AA=Mn,this._$AB=rs,this._$AM=is,this.options=os,this.v=(os==null?void 0:os.isConnected)??!0}get parentNode(){let Mn=this._$AA.parentNode;const rs=this._$AM;return rs!==void 0&&(Mn==null?void 0:Mn.nodeType)===11&&(Mn=rs.parentNode),Mn}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(Mn,rs=this){Mn=z$4(this,Mn,rs),st$2(Mn)?Mn===D$2||Mn==null||Mn===""?(this._$AH!==D$2&&this._$AR(),this._$AH=D$2):Mn!==this._$AH&&Mn!==R$2&&this._(Mn):Mn._$litType$!==void 0?this.$(Mn):Mn.nodeType!==void 0?this.T(Mn):$(Mn)?this.k(Mn):this._(Mn)}O(Mn){return this._$AA.parentNode.insertBefore(Mn,this._$AB)}T(Mn){this._$AH!==Mn&&(this._$AR(),this._$AH=this.O(Mn))}_(Mn){this._$AH!==D$2&&st$2(this._$AH)?this._$AA.nextSibling.data=Mn:this.T(w$3.createTextNode(Mn)),this._$AH=Mn}$(Mn){var as;const{values:rs,_$litType$:is}=Mn,os=typeof is=="number"?this._$AC(Mn):(is.el===void 0&&(is.el=B.createElement(N$1(is.h,is.h[0]),this.options)),is);if(((as=this._$AH)==null?void 0:as._$AD)===os)this._$AH.p(rs);else{const us=new F$2(os,this),ds=us.u(this.options);us.p(rs),this.T(ds),this._$AH=us}}_$AC(Mn){let rs=V$1.get(Mn.strings);return rs===void 0&&V$1.set(Mn.strings,rs=new B(Mn)),rs}k(Mn){g$2(this._$AH)||(this._$AH=[],this._$AR());const rs=this._$AH;let is,os=0;for(const as of Mn)os===rs.length?rs.push(is=new r_(this.O(lt$2()),this.O(lt$2()),this,this.options)):is=rs[os],is._$AI(as),os++;os<rs.length&&(this._$AR(is&&is._$AB.nextSibling,os),rs.length=os)}_$AR(Mn=this._$AA.nextSibling,rs){var is;for((is=this._$AP)==null?void 0:is.call(this,!1,!0,rs);Mn&&Mn!==this._$AB;){const os=Mn.nextSibling;Mn.remove(),Mn=os}}setConnected(Mn){var rs;this._$AM===void 0&&(this.v=Mn,(rs=this._$AP)==null||rs.call(this,Mn))}},G$1=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(Mn,rs,is,os,as){this.type=1,this._$AH=D$2,this._$AN=void 0,this.element=Mn,this.name=rs,this._$AM=os,this.options=as,is.length>2||is[0]!==""||is[1]!==""?(this._$AH=Array(is.length-1).fill(new String),this.strings=is):this._$AH=D$2}_$AI(Mn,rs=this,is,os){const as=this.strings;let us=!1;if(as===void 0)Mn=z$4(this,Mn,rs,0),us=!st$2(Mn)||Mn!==this._$AH&&Mn!==R$2,us&&(this._$AH=Mn);else{const ds=Mn;let hs,ps;for(Mn=as[0],hs=0;hs<as.length-1;hs++)ps=z$4(this,ds[is+hs],rs,hs),ps===R$2&&(ps=this._$AH[hs]),us||(us=!st$2(ps)||ps!==this._$AH[hs]),ps===D$2?Mn=D$2:Mn!==D$2&&(Mn+=(ps??"")+as[hs+1]),this._$AH[hs]=ps}us&&!os&&this.j(Mn)}j(Mn){Mn===D$2?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,Mn??"")}};class Y extends G$1{constructor(){super(...arguments),this.type=3}j(Mn){this.element[this.name]=Mn===D$2?void 0:Mn}}let Z$1=class extends G$1{constructor(){super(...arguments),this.type=4}j(Mn){this.element.toggleAttribute(this.name,!!Mn&&Mn!==D$2)}},q$1=class extends G$1{constructor(Mn,rs,is,os,as){super(Mn,rs,is,os,as),this.type=5}_$AI(Mn,rs=this){if((Mn=z$4(this,Mn,rs,0)??D$2)===R$2)return;const is=this._$AH,os=Mn===D$2&&is!==D$2||Mn.capture!==is.capture||Mn.once!==is.once||Mn.passive!==is.passive,as=Mn!==D$2&&(is===D$2||os);os&&this.element.removeEventListener(this.name,this,is),as&&this.element.addEventListener(this.name,this,Mn),this._$AH=Mn}handleEvent(Mn){var rs;typeof this._$AH=="function"?this._$AH.call(((rs=this.options)==null?void 0:rs.host)??this.element,Mn):this._$AH.handleEvent(Mn)}},K$2=class{constructor(Mn,rs,is){this.element=Mn,this.type=6,this._$AN=void 0,this._$AM=rs,this.options=is}get _$AU(){return this._$AM._$AU}_$AI(Mn){z$4(this,Mn)}};const Re$1=n$5.litHtmlPolyfillSupport;Re$1==null||Re$1(B,et$1),(n$5.litHtmlVersions??(n$5.litHtmlVersions=[])).push("3.2.0");const Q$2=(Fn,Mn,rs)=>{const is=(rs==null?void 0:rs.renderBefore)??Mn;let os=is._$litPart$;if(os===void 0){const as=(rs==null?void 0:rs.renderBefore)??null;is._$litPart$=os=new et$1(Mn.insertBefore(lt$2(),as),as,void 0,rs??{})}return os._$AI(Fn),os};/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */let h$3=class extends b$1{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var rs;const Mn=super.createRenderRoot();return(rs=this.renderOptions).renderBefore??(rs.renderBefore=Mn.firstChild),Mn}update(Mn){const rs=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(Mn),this.o=Q$2(rs,this.renderRoot,this.renderOptions)}connectedCallback(){var Mn;super.connectedCallback(),(Mn=this.o)==null||Mn.setConnected(!0)}disconnectedCallback(){var Mn;super.disconnectedCallback(),(Mn=this.o)==null||Mn.setConnected(!1)}render(){return R$2}};var t_;h$3._$litElement$=!0,h$3.finalized=!0,(t_=globalThis.litElementHydrateSupport)==null||t_.call(globalThis,{LitElement:h$3});const f$2=globalThis.litElementPolyfillSupport;f$2==null||f$2({LitElement:h$3});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");let themeTag,darkModeTag,lightModeTag;function initializeTheming(Fn,Mn){themeTag=document.createElement("style"),darkModeTag=document.createElement("style"),lightModeTag=document.createElement("style"),themeTag.textContent=createRootStyles(Fn).core.cssText,darkModeTag.textContent=createRootStyles(Fn).dark.cssText,lightModeTag.textContent=createRootStyles(Fn).light.cssText,document.head.appendChild(themeTag),document.head.appendChild(darkModeTag),document.head.appendChild(lightModeTag),setColorTheme(Mn)}function setColorTheme(Fn){darkModeTag&&lightModeTag&&(Fn==="light"?(darkModeTag.removeAttribute("media"),lightModeTag.media="enabled"):(lightModeTag.removeAttribute("media"),darkModeTag.media="enabled"))}function setThemeVariables(Fn){themeTag&&darkModeTag&&lightModeTag&&(themeTag.textContent=createRootStyles(Fn).core.cssText,darkModeTag.textContent=createRootStyles(Fn).dark.cssText,lightModeTag.textContent=createRootStyles(Fn).light.cssText)}function createRootStyles(Fn){return{core:i$4`
      @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
      @keyframes w3m-shake {
        0% {
          transform: scale(1) rotate(0deg);
        }
        20% {
          transform: scale(1) rotate(-1deg);
        }
        40% {
          transform: scale(1) rotate(1.5deg);
        }
        60% {
          transform: scale(1) rotate(-1.5deg);
        }
        80% {
          transform: scale(1) rotate(1deg);
        }
        100% {
          transform: scale(1) rotate(0deg);
        }
      }
      @keyframes w3m-iframe-fade-out {
        0% {
          opacity: 1;
        }
        100% {
          opacity: 0;
        }
      }
      @keyframes w3m-iframe-zoom-in {
        0% {
          transform: translateY(50px);
          opacity: 0;
        }
        100% {
          transform: translateY(0px);
          opacity: 1;
        }
      }
      @keyframes w3m-iframe-zoom-in-mobile {
        0% {
          transform: scale(0.95);
          opacity: 0;
        }
        100% {
          transform: scale(1);
          opacity: 1;
        }
      }
      :root {
        --w3m-modal-width: 360px;
        --w3m-color-mix-strength: ${r$8(Fn!=null&&Fn["--w3m-color-mix-strength"]?`${Fn["--w3m-color-mix-strength"]}%`:"0%")};
        --w3m-font-family: ${r$8((Fn==null?void 0:Fn["--w3m-font-family"])||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")};
        --w3m-font-size-master: ${r$8((Fn==null?void 0:Fn["--w3m-font-size-master"])||"10px")};
        --w3m-border-radius-master: ${r$8((Fn==null?void 0:Fn["--w3m-border-radius-master"])||"4px")};
        --w3m-z-index: ${r$8((Fn==null?void 0:Fn["--w3m-z-index"])||999)};

        --wui-font-family: var(--w3m-font-family);

        --wui-font-size-mini: calc(var(--w3m-font-size-master) * 0.8);
        --wui-font-size-micro: var(--w3m-font-size-master);
        --wui-font-size-tiny: calc(var(--w3m-font-size-master) * 1.2);
        --wui-font-size-small: calc(var(--w3m-font-size-master) * 1.4);
        --wui-font-size-paragraph: calc(var(--w3m-font-size-master) * 1.6);
        --wui-font-size-medium: calc(var(--w3m-font-size-master) * 1.8);
        --wui-font-size-large: calc(var(--w3m-font-size-master) * 2);
        --wui-font-size-title-6: calc(var(--w3m-font-size-master) * 2.2);
        --wui-font-size-medium-title: calc(var(--w3m-font-size-master) * 2.4);
        --wui-font-size-2xl: calc(var(--w3m-font-size-master) * 4);

        --wui-border-radius-5xs: var(--w3m-border-radius-master);
        --wui-border-radius-4xs: calc(var(--w3m-border-radius-master) * 1.5);
        --wui-border-radius-3xs: calc(var(--w3m-border-radius-master) * 2);
        --wui-border-radius-xxs: calc(var(--w3m-border-radius-master) * 3);
        --wui-border-radius-xs: calc(var(--w3m-border-radius-master) * 4);
        --wui-border-radius-s: calc(var(--w3m-border-radius-master) * 5);
        --wui-border-radius-m: calc(var(--w3m-border-radius-master) * 7);
        --wui-border-radius-l: calc(var(--w3m-border-radius-master) * 9);
        --wui-border-radius-3xl: calc(var(--w3m-border-radius-master) * 20);

        --wui-font-weight-light: 400;
        --wui-font-weight-regular: 500;
        --wui-font-weight-medium: 600;
        --wui-font-weight-bold: 700;

        --wui-letter-spacing-2xl: -1.6px;
        --wui-letter-spacing-medium-title: -0.96px;
        --wui-letter-spacing-title-6: -0.88px;
        --wui-letter-spacing-large: -0.8px;
        --wui-letter-spacing-medium: -0.72px;
        --wui-letter-spacing-paragraph: -0.64px;
        --wui-letter-spacing-small: -0.56px;
        --wui-letter-spacing-tiny: -0.48px;
        --wui-letter-spacing-micro: -0.2px;
        --wui-letter-spacing-mini: -0.16px;

        --wui-spacing-0: 0px;
        --wui-spacing-4xs: 2px;
        --wui-spacing-3xs: 4px;
        --wui-spacing-xxs: 6px;
        --wui-spacing-2xs: 7px;
        --wui-spacing-xs: 8px;
        --wui-spacing-1xs: 10px;
        --wui-spacing-s: 12px;
        --wui-spacing-m: 14px;
        --wui-spacing-l: 16px;
        --wui-spacing-2l: 18px;
        --wui-spacing-xl: 20px;
        --wui-spacing-xxl: 24px;
        --wui-spacing-2xl: 32px;
        --wui-spacing-3xl: 40px;
        --wui-spacing-4xl: 90px;
        --wui-spacing-5xl: 95px;

        --wui-icon-box-size-xxs: 14px;
        --wui-icon-box-size-xs: 20px;
        --wui-icon-box-size-sm: 24px;
        --wui-icon-box-size-md: 32px;
        --wui-icon-box-size-lg: 40px;
        --wui-icon-box-size-2lg: 48px;
        --wui-icon-box-size-xl: 64px;

        --wui-icon-size-inherit: inherit;
        --wui-icon-size-xxs: 10px;
        --wui-icon-size-xs: 12px;
        --wui-icon-size-sm: 14px;
        --wui-icon-size-md: 16px;
        --wui-icon-size-mdl: 18px;
        --wui-icon-size-lg: 20px;
        --wui-icon-size-xl: 24px;
        --wui-icon-size-xxl: 28px;

        --wui-wallet-image-size-inherit: inherit;
        --wui-wallet-image-size-sm: 40px;
        --wui-wallet-image-size-md: 56px;
        --wui-wallet-image-size-lg: 80px;

        --wui-visual-size-size-inherit: inherit;
        --wui-visual-size-sm: 40px;
        --wui-visual-size-md: 55px;
        --wui-visual-size-lg: 80px;

        --wui-box-size-md: 100px;
        --wui-box-size-lg: 120px;

        --wui-ease-out-power-2: cubic-bezier(0, 0, 0.22, 1);
        --wui-ease-out-power-1: cubic-bezier(0, 0, 0.55, 1);

        --wui-ease-in-power-3: cubic-bezier(0.66, 0, 1, 1);
        --wui-ease-in-power-2: cubic-bezier(0.45, 0, 1, 1);
        --wui-ease-in-power-1: cubic-bezier(0.3, 0, 1, 1);

        --wui-ease-inout-power-1: cubic-bezier(0.45, 0, 0.55, 1);

        --wui-duration-lg: 200ms;
        --wui-duration-md: 125ms;
        --wui-duration-sm: 75ms;

        --wui-path-network-sm: path(
          'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z'
        );

        --wui-path-network-md: path(
          'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z'
        );

        --wui-path-network-lg: path(
          'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z'
        );

        --wui-width-network-sm: 36px;
        --wui-width-network-md: 48px;
        --wui-width-network-lg: 86px;

        --wui-height-network-sm: 40px;
        --wui-height-network-md: 54px;
        --wui-height-network-lg: 96px;

        --wui-icon-size-network-xs: 12px;
        --wui-icon-size-network-sm: 16px;
        --wui-icon-size-network-md: 24px;
        --wui-icon-size-network-lg: 42px;

        --wui-color-inherit: inherit;

        --wui-color-inverse-100: #fff;
        --wui-color-inverse-000: #000;

        --wui-cover: rgba(20, 20, 20, 0.8);

        --wui-color-modal-bg: var(--wui-color-modal-bg-base);

        --wui-color-accent-100: var(--wui-color-accent-base-100);
        --wui-color-accent-090: var(--wui-color-accent-base-090);
        --wui-color-accent-080: var(--wui-color-accent-base-080);

        --wui-color-success-100: var(--wui-color-success-base-100);
        --wui-color-success-125: var(--wui-color-success-base-125);

        --wui-color-warning-100: var(--wui-color-warning-base-100);

        --wui-color-error-100: var(--wui-color-error-base-100);
        --wui-color-error-125: var(--wui-color-error-base-125);

        --wui-color-blue-100: var(--wui-color-blue-base-100);

        --wui-icon-box-bg-error-100: var(--wui-icon-box-bg-error-base-100);
        --wui-icon-box-bg-blue-100: var(--wui-icon-box-bg-blue-base-100);
        --wui-icon-box-bg-success-100: var(--wui-icon-box-bg-success-base-100);
        --wui-icon-box-bg-inverse-100: var(--wui-icon-box-bg-inverse-base-100);

        --wui-all-wallets-bg-100: var(--wui-all-wallets-bg-100);

        --wui-avatar-border: var(--wui-avatar-border-base);

        --wui-thumbnail-border: var(--wui-thumbnail-border-base);

        --wui-box-shadow-blue: var(--wui-color-accent-glass-020);
      }

      @supports (background: color-mix(in srgb, white 50%, black)) {
        :root {
          --wui-color-modal-bg: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-modal-bg-base)
          );

          --wui-box-shadow-blue: color-mix(in srgb, var(--wui-color-accent-100) 20%, transparent);

          --wui-color-accent-100: color-mix(
            in srgb,
            var(--wui-color-accent-base-100) 100%,
            transparent
          );
          --wui-color-accent-090: color-mix(
            in srgb,
            var(--wui-color-accent-base-100) 90%,
            transparent
          );
          --wui-color-accent-080: color-mix(
            in srgb,
            var(--wui-color-accent-base-100) 80%,
            transparent
          );
          --wui-color-accent-glass-090: color-mix(
            in srgb,
            var(--wui-color-accent-base-100) 90%,
            transparent
          );
          --wui-color-accent-glass-080: color-mix(
            in srgb,
            var(--wui-color-accent-base-100) 80%,
            transparent
          );
          --wui-color-accent-glass-020: color-mix(
            in srgb,
            var(--wui-color-accent-base-100) 20%,
            transparent
          );
          --wui-color-accent-glass-015: color-mix(
            in srgb,
            var(--wui-color-accent-base-100) 15%,
            transparent
          );
          --wui-color-accent-glass-010: color-mix(
            in srgb,
            var(--wui-color-accent-base-100) 10%,
            transparent
          );
          --wui-color-accent-glass-005: color-mix(
            in srgb,
            var(--wui-color-accent-base-100) 5%,
            transparent
          );
          --wui-color-accent-002: color-mix(
            in srgb,
            var(--wui-color-accent-base-100) 2%,
            transparent
          );

          --wui-color-fg-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-100)
          );
          --wui-color-fg-125: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-125)
          );
          --wui-color-fg-150: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-150)
          );
          --wui-color-fg-175: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-175)
          );
          --wui-color-fg-200: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-200)
          );
          --wui-color-fg-225: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-225)
          );
          --wui-color-fg-250: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-250)
          );
          --wui-color-fg-275: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-275)
          );
          --wui-color-fg-300: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-300)
          );
          --wui-color-fg-325: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-325)
          );
          --wui-color-fg-350: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-fg-350)
          );

          --wui-color-bg-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-100)
          );
          --wui-color-bg-125: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-125)
          );
          --wui-color-bg-150: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-150)
          );
          --wui-color-bg-175: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-175)
          );
          --wui-color-bg-200: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-200)
          );
          --wui-color-bg-225: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-225)
          );
          --wui-color-bg-250: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-250)
          );
          --wui-color-bg-275: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-275)
          );
          --wui-color-bg-300: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-300)
          );
          --wui-color-bg-325: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-325)
          );
          --wui-color-bg-350: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-bg-350)
          );

          --wui-color-success-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-success-base-100)
          );
          --wui-color-success-125: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-success-base-125)
          );

          --wui-color-warning-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-warning-base-100)
          );

          --wui-color-error-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-error-base-100)
          );
          --wui-color-blue-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-blue-base-100)
          );
          --wui-color-error-125: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-color-error-base-125)
          );

          --wui-icon-box-bg-error-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-icon-box-bg-error-base-100)
          );
          --wui-icon-box-bg-accent-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-icon-box-bg-blue-base-100)
          );
          --wui-icon-box-bg-success-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-icon-box-bg-success-base-100)
          );
          --wui-icon-box-bg-inverse-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-icon-box-bg-inverse-base-100)
          );

          --wui-all-wallets-bg-100: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-all-wallets-bg-100)
          );

          --wui-avatar-border: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-avatar-border-base)
          );

          --wui-thumbnail-border: color-mix(
            in srgb,
            var(--w3m-color-mix) var(--w3m-color-mix-strength),
            var(--wui-thumbnail-border-base)
          );
        }
      }
    `,light:i$4`
      :root {
        --w3m-color-mix: ${r$8((Fn==null?void 0:Fn["--w3m-color-mix"])||"#fff")};
        --w3m-accent: ${r$8(getW3mThemeVariables(Fn,"dark")["--w3m-accent"])};
        --w3m-default: #fff;

        --wui-color-modal-bg-base: ${r$8(getW3mThemeVariables(Fn,"dark")["--w3m-background"])};
        --wui-color-accent-base-100: var(--w3m-accent);

        --wui-color-blueberry-100: hsla(230, 100%, 67%, 1);
        --wui-color-blueberry-090: hsla(231, 76%, 61%, 1);
        --wui-color-blueberry-080: hsla(230, 59%, 55%, 1);
        --wui-color-blueberry-050: hsla(231, 100%, 70%, 0.1);

        --wui-color-fg-100: #e4e7e7;
        --wui-color-fg-125: #d0d5d5;
        --wui-color-fg-150: #a8b1b1;
        --wui-color-fg-175: #a8b0b0;
        --wui-color-fg-200: #949e9e;
        --wui-color-fg-225: #868f8f;
        --wui-color-fg-250: #788080;
        --wui-color-fg-275: #788181;
        --wui-color-fg-300: #6e7777;
        --wui-color-fg-325: #9a9a9a;
        --wui-color-fg-350: #363636;

        --wui-color-bg-100: #141414;
        --wui-color-bg-125: #191a1a;
        --wui-color-bg-150: #1e1f1f;
        --wui-color-bg-175: #222525;
        --wui-color-bg-200: #272a2a;
        --wui-color-bg-225: #2c3030;
        --wui-color-bg-250: #313535;
        --wui-color-bg-275: #363b3b;
        --wui-color-bg-300: #3b4040;
        --wui-color-bg-325: #252525;
        --wui-color-bg-350: #ffffff;

        --wui-color-success-base-100: #26d962;
        --wui-color-success-base-125: #30a46b;

        --wui-color-warning-base-100: #f3a13f;

        --wui-color-error-base-100: #f25a67;
        --wui-color-error-base-125: #df4a34;

        --wui-color-blue-base-100: #667dff;

        --wui-color-success-glass-001: rgba(38, 217, 98, 0.01);
        --wui-color-success-glass-002: rgba(38, 217, 98, 0.02);
        --wui-color-success-glass-005: rgba(38, 217, 98, 0.05);
        --wui-color-success-glass-010: rgba(38, 217, 98, 0.1);
        --wui-color-success-glass-015: rgba(38, 217, 98, 0.15);
        --wui-color-success-glass-020: rgba(38, 217, 98, 0.2);
        --wui-color-success-glass-025: rgba(38, 217, 98, 0.25);
        --wui-color-success-glass-030: rgba(38, 217, 98, 0.3);
        --wui-color-success-glass-060: rgba(38, 217, 98, 0.6);
        --wui-color-success-glass-080: rgba(38, 217, 98, 0.8);

        --wui-color-success-glass-reown-020: rgba(48, 164, 107, 0.2);

        --wui-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2);

        --wui-color-error-glass-001: rgba(242, 90, 103, 0.01);
        --wui-color-error-glass-002: rgba(242, 90, 103, 0.02);
        --wui-color-error-glass-005: rgba(242, 90, 103, 0.05);
        --wui-color-error-glass-010: rgba(242, 90, 103, 0.1);
        --wui-color-error-glass-015: rgba(242, 90, 103, 0.15);
        --wui-color-error-glass-020: rgba(242, 90, 103, 0.2);
        --wui-color-error-glass-025: rgba(242, 90, 103, 0.25);
        --wui-color-error-glass-030: rgba(242, 90, 103, 0.3);
        --wui-color-error-glass-060: rgba(242, 90, 103, 0.6);
        --wui-color-error-glass-080: rgba(242, 90, 103, 0.8);

        --wui-color-error-glass-reown-020: rgba(223, 74, 52, 0.2);

        --wui-color-gray-glass-001: rgba(255, 255, 255, 0.01);
        --wui-color-gray-glass-002: rgba(255, 255, 255, 0.02);
        --wui-color-gray-glass-005: rgba(255, 255, 255, 0.05);
        --wui-color-gray-glass-010: rgba(255, 255, 255, 0.1);
        --wui-color-gray-glass-015: rgba(255, 255, 255, 0.15);
        --wui-color-gray-glass-020: rgba(255, 255, 255, 0.2);
        --wui-color-gray-glass-025: rgba(255, 255, 255, 0.25);
        --wui-color-gray-glass-030: rgba(255, 255, 255, 0.3);
        --wui-color-gray-glass-060: rgba(255, 255, 255, 0.6);
        --wui-color-gray-glass-080: rgba(255, 255, 255, 0.8);
        --wui-color-gray-glass-090: rgba(255, 255, 255, 0.9);

        --wui-color-dark-glass-100: rgba(42, 42, 42, 1);

        --wui-icon-box-bg-error-base-100: #3c2426;
        --wui-icon-box-bg-blue-base-100: #20303f;
        --wui-icon-box-bg-success-base-100: #1f3a28;
        --wui-icon-box-bg-inverse-base-100: #243240;

        --wui-all-wallets-bg-100: #222b35;

        --wui-avatar-border-base: #252525;

        --wui-thumbnail-border-base: #252525;
      }
    `,dark:i$4`
      :root {
        --w3m-color-mix: ${r$8((Fn==null?void 0:Fn["--w3m-color-mix"])||"#000")};
        --w3m-accent: ${r$8(getW3mThemeVariables(Fn,"light")["--w3m-accent"])};
        --w3m-default: #000;

        --wui-color-modal-bg-base: ${r$8(getW3mThemeVariables(Fn,"light")["--w3m-background"])};
        --wui-color-accent-base-100: var(--w3m-accent);

        --wui-color-blueberry-100: hsla(231, 100%, 70%, 1);
        --wui-color-blueberry-090: hsla(231, 97%, 72%, 1);
        --wui-color-blueberry-080: hsla(231, 92%, 74%, 1);

        --wui-color-fg-100: #141414;
        --wui-color-fg-125: #2d3131;
        --wui-color-fg-150: #474d4d;
        --wui-color-fg-175: #636d6d;
        --wui-color-fg-200: #798686;
        --wui-color-fg-225: #828f8f;
        --wui-color-fg-250: #8b9797;
        --wui-color-fg-275: #95a0a0;
        --wui-color-fg-300: #9ea9a9;
        --wui-color-fg-325: #9a9a9a;
        --wui-color-fg-350: #d0d0d0;

        --wui-color-bg-100: #ffffff;
        --wui-color-bg-125: #f5fafa;
        --wui-color-bg-150: #f3f8f8;
        --wui-color-bg-175: #eef4f4;
        --wui-color-bg-200: #eaf1f1;
        --wui-color-bg-225: #e5eded;
        --wui-color-bg-250: #e1e9e9;
        --wui-color-bg-275: #dce7e7;
        --wui-color-bg-300: #d8e3e3;
        --wui-color-bg-325: #f3f3f3;
        --wui-color-bg-350: #202020;

        --wui-color-success-base-100: #26b562;
        --wui-color-success-base-125: #30a46b;

        --wui-color-warning-base-100: #f3a13f;

        --wui-color-error-base-100: #f05142;
        --wui-color-error-base-125: #df4a34;

        --wui-color-blue-base-100: #667dff;

        --wui-color-success-glass-001: rgba(38, 181, 98, 0.01);
        --wui-color-success-glass-002: rgba(38, 181, 98, 0.02);
        --wui-color-success-glass-005: rgba(38, 181, 98, 0.05);
        --wui-color-success-glass-010: rgba(38, 181, 98, 0.1);
        --wui-color-success-glass-015: rgba(38, 181, 98, 0.15);
        --wui-color-success-glass-020: rgba(38, 181, 98, 0.2);
        --wui-color-success-glass-025: rgba(38, 181, 98, 0.25);
        --wui-color-success-glass-030: rgba(38, 181, 98, 0.3);
        --wui-color-success-glass-060: rgba(38, 181, 98, 0.6);
        --wui-color-success-glass-080: rgba(38, 181, 98, 0.8);

        --wui-color-success-glass-reown-020: rgba(48, 164, 107, 0.2);

        --wui-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2);

        --wui-color-error-glass-001: rgba(240, 81, 66, 0.01);
        --wui-color-error-glass-002: rgba(240, 81, 66, 0.02);
        --wui-color-error-glass-005: rgba(240, 81, 66, 0.05);
        --wui-color-error-glass-010: rgba(240, 81, 66, 0.1);
        --wui-color-error-glass-015: rgba(240, 81, 66, 0.15);
        --wui-color-error-glass-020: rgba(240, 81, 66, 0.2);
        --wui-color-error-glass-025: rgba(240, 81, 66, 0.25);
        --wui-color-error-glass-030: rgba(240, 81, 66, 0.3);
        --wui-color-error-glass-060: rgba(240, 81, 66, 0.6);
        --wui-color-error-glass-080: rgba(240, 81, 66, 0.8);

        --wui-color-error-glass-reown-020: rgba(223, 74, 52, 0.2);

        --wui-icon-box-bg-error-base-100: #f4dfdd;
        --wui-icon-box-bg-blue-base-100: #d9ecfb;
        --wui-icon-box-bg-success-base-100: #daf0e4;
        --wui-icon-box-bg-inverse-base-100: #dcecfc;

        --wui-all-wallets-bg-100: #e8f1fa;

        --wui-avatar-border-base: #f3f4f4;

        --wui-thumbnail-border-base: #eaefef;

        --wui-color-gray-glass-001: rgba(0, 0, 0, 0.01);
        --wui-color-gray-glass-002: rgba(0, 0, 0, 0.02);
        --wui-color-gray-glass-005: rgba(0, 0, 0, 0.05);
        --wui-color-gray-glass-010: rgba(0, 0, 0, 0.1);
        --wui-color-gray-glass-015: rgba(0, 0, 0, 0.15);
        --wui-color-gray-glass-020: rgba(0, 0, 0, 0.2);
        --wui-color-gray-glass-025: rgba(0, 0, 0, 0.25);
        --wui-color-gray-glass-030: rgba(0, 0, 0, 0.3);
        --wui-color-gray-glass-060: rgba(0, 0, 0, 0.6);
        --wui-color-gray-glass-080: rgba(0, 0, 0, 0.8);
        --wui-color-gray-glass-090: rgba(0, 0, 0, 0.9);

        --wui-color-dark-glass-100: rgba(233, 233, 233, 1);
      }
    `}}const resetStyles=i$4`
  *,
  *::after,
  *::before,
  :host {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-style: normal;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--wui-font-family);
    backface-visibility: hidden;
  }
`,elementStyles=i$4`
  button,
  a {
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition:
      color var(--wui-duration-lg) var(--wui-ease-out-power-1),
      background-color var(--wui-duration-lg) var(--wui-ease-out-power-1),
      border var(--wui-duration-lg) var(--wui-ease-out-power-1),
      box-shadow var(--wui-duration-lg) var(--wui-ease-out-power-1);
    will-change: background-color, color, border, box-shadow;
    outline: none;
    border: none;
    column-gap: var(--wui-spacing-3xs);
    background-color: transparent;
    text-decoration: none;
  }

  button:disabled > wui-wallet-image,
  button:disabled > wui-all-wallets-image,
  button:disabled > wui-network-image,
  button:disabled > wui-image,
  button:disabled > wui-transaction-visual,
  button:disabled > wui-logo {
    filter: grayscale(1);
  }

  @media (hover: hover) and (pointer: fine) {
    button:hover:enabled {
      background-color: var(--wui-color-gray-glass-005);
    }

    button:active:enabled {
      background-color: var(--wui-color-gray-glass-010);
    }
  }

  button:disabled > wui-icon-box {
    opacity: 0.5;
  }

  input {
    border: none;
    outline: none;
    appearance: none;
  }
`,colorStyles=i$4`
  .wui-color-inherit {
    color: var(--wui-color-inherit);
  }

  .wui-color-accent-100 {
    color: var(--wui-color-accent-100);
  }

  .wui-color-error-100 {
    color: var(--wui-color-error-100);
  }

  .wui-color-blue-100 {
    color: var(--wui-color-blue-100);
  }

  .wui-color-error-125 {
    color: var(--wui-color-error-125);
  }

  .wui-color-success-100 {
    color: var(--wui-color-success-100);
  }

  .wui-color-success-125 {
    color: var(--wui-color-success-125);
  }

  .wui-color-inverse-100 {
    color: var(--wui-color-inverse-100);
  }

  .wui-color-inverse-000 {
    color: var(--wui-color-inverse-000);
  }

  .wui-color-fg-100 {
    color: var(--wui-color-fg-100);
  }

  .wui-color-fg-200 {
    color: var(--wui-color-fg-200);
  }

  .wui-color-fg-300 {
    color: var(--wui-color-fg-300);
  }

  .wui-color-fg-325 {
    color: var(--wui-color-fg-325);
  }

  .wui-color-fg-350 {
    color: var(--wui-color-fg-350);
  }

  .wui-bg-color-inherit {
    background-color: var(--wui-color-inherit);
  }

  .wui-bg-color-blue-100 {
    background-color: var(--wui-color-accent-100);
  }

  .wui-bg-color-error-100 {
    background-color: var(--wui-color-error-100);
  }

  .wui-bg-color-error-125 {
    background-color: var(--wui-color-error-125);
  }

  .wui-bg-color-success-100 {
    background-color: var(--wui-color-success-100);
  }

  .wui-bg-color-success-125 {
    background-color: var(--wui-color-success-100);
  }

  .wui-bg-color-inverse-100 {
    background-color: var(--wui-color-inverse-100);
  }

  .wui-bg-color-inverse-000 {
    background-color: var(--wui-color-inverse-000);
  }

  .wui-bg-color-fg-100 {
    background-color: var(--wui-color-fg-100);
  }

  .wui-bg-color-fg-200 {
    background-color: var(--wui-color-fg-200);
  }

  .wui-bg-color-fg-300 {
    background-color: var(--wui-color-fg-300);
  }

  .wui-color-fg-325 {
    background-color: var(--wui-color-fg-325);
  }

  .wui-color-fg-350 {
    background-color: var(--wui-color-fg-350);
  }
`;function standardCustomElement(Fn,Mn){const{kind:rs,elements:is}=Mn;return{kind:rs,elements:is,finisher(os){customElements.get(Fn)||customElements.define(Fn,os)}}}function legacyCustomElement(Fn,Mn){return customElements.get(Fn)||customElements.define(Fn,Mn),Mn}function customElement(Fn){return function(rs){return typeof rs=="function"?legacyCustomElement(Fn,rs):standardCustomElement(Fn,rs)}}const styles$2g=i$4`
  :host {
    display: block;
    border-radius: clamp(0px, var(--wui-border-radius-l), 44px);
    box-shadow: 0 0 0 1px var(--wui-color-gray-glass-005);
    background-color: var(--wui-color-modal-bg);
    overflow: hidden;
  }
`;var __decorate$2S=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiCard=class extends h$3{render(){return ke`<slot></slot>`}};WuiCard.styles=[resetStyles,styles$2g];WuiCard=__decorate$2S([customElement("wui-card")],WuiCard);/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const o$3={attribute:!0,type:String,converter:u$1,reflect:!1,hasChanged:f$4},r$6=(Fn=o$3,Mn,rs)=>{const{kind:is,metadata:os}=rs;let as=globalThis.litPropertyMetadata.get(os);if(as===void 0&&globalThis.litPropertyMetadata.set(os,as=new Map),as.set(rs.name,Fn),is==="accessor"){const{name:us}=rs;return{set(ds){const hs=Mn.get.call(this);Mn.set.call(this,ds),this.requestUpdate(us,hs,Fn)},init(ds){return ds!==void 0&&this.P(us,void 0,Fn),ds}}}if(is==="setter"){const{name:us}=rs;return function(ds){const hs=this[us];Mn.call(this,ds),this.requestUpdate(us,hs,Fn)}}throw Error("Unsupported decorator location: "+is)};function n$4(Fn){return(Mn,rs)=>typeof rs=="object"?r$6(Fn,Mn,rs):((is,os,as)=>{const us=os.hasOwnProperty(as);return os.constructor.createProperty(as,us?{...is,wrapped:!0}:is),us?Object.getOwnPropertyDescriptor(os,as):void 0})(Fn,Mn,rs)}/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function r$5(Fn){return n$4({...Fn,state:!0,attribute:!1})}const styles$2f=i$4`
  :host {
    display: flex;
    aspect-ratio: 1 / 1;
    color: var(--local-color);
    width: var(--local-width);
  }

  svg {
    width: inherit;
    height: inherit;
    object-fit: contain;
    object-position: center;
  }
`,addSvg=Oe$1`<svg
  width="14"
  height="14"
  viewBox="0 0 14 14"
  fill="none"
  xmlns="http://www.w3.org/2000/svg"
>
  <path
    fill="currentColor"
    fill-rule="evenodd"
    clip-rule="evenodd"
    d="M7.0023 0.875C7.48571 0.875 7.8776 1.26675 7.8776 1.75V6.125H12.2541C12.7375 6.125 13.1294 6.51675 13.1294 7C13.1294 7.48325 12.7375 7.875 12.2541 7.875H7.8776V12.25C7.8776 12.7332 7.48571 13.125 7.0023 13.125C6.51889 13.125 6.12701 12.7332 6.12701 12.25V7.875H1.75054C1.26713 7.875 0.875244 7.48325 0.875244 7C0.875244 6.51675 1.26713 6.125 1.75054 6.125H6.12701V1.75C6.12701 1.26675 6.51889 0.875 7.0023 0.875Z"
    fill="#667dff"
  /></svg
>`,allWalletsSvg=Oe$1`<svg fill="none" viewBox="0 0 24 24">
  <path
    style="fill: var(--wui-color-accent-100);"
    d="M10.2 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM10.2 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0Z"
  />
</svg>`,arrowBottomCircleSvg=Oe$1`<svg
  fill="none"
  viewBox="0 0 21 20"
>
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M10.5 2.42908C6.31875 2.42908 2.92859 5.81989 2.92859 10.0034C2.92859 14.1869 6.31875 17.5777 10.5 17.5777C14.6813 17.5777 18.0714 14.1869 18.0714 10.0034C18.0714 5.81989 14.6813 2.42908 10.5 2.42908ZM0.928589 10.0034C0.928589 4.71596 5.21355 0.429077 10.5 0.429077C15.7865 0.429077 20.0714 4.71596 20.0714 10.0034C20.0714 15.2908 15.7865 19.5777 10.5 19.5777C5.21355 19.5777 0.928589 15.2908 0.928589 10.0034ZM10.5 5.75003C11.0523 5.75003 11.5 6.19774 11.5 6.75003L11.5 10.8343L12.7929 9.54137C13.1834 9.15085 13.8166 9.15085 14.2071 9.54137C14.5976 9.9319 14.5976 10.5651 14.2071 10.9556L11.2071 13.9556C10.8166 14.3461 10.1834 14.3461 9.79291 13.9556L6.79291 10.9556C6.40239 10.5651 6.40239 9.9319 6.79291 9.54137C7.18343 9.15085 7.8166 9.15085 8.20712 9.54137L9.50002 10.8343L9.50002 6.75003C9.50002 6.19774 9.94773 5.75003 10.5 5.75003Z"
    clip-rule="evenodd"
  /></svg
>`,appStoreSvg=Oe$1`
<svg width="36" height="36">
  <path
    d="M28.724 0H7.271A7.269 7.269 0 0 0 0 7.272v21.46A7.268 7.268 0 0 0 7.271 36H28.73A7.272 7.272 0 0 0 36 28.728V7.272A7.275 7.275 0 0 0 28.724 0Z"
    fill="url(#a)"
  />
  <path
    d="m17.845 8.271.729-1.26a1.64 1.64 0 1 1 2.843 1.638l-7.023 12.159h5.08c1.646 0 2.569 1.935 1.853 3.276H6.434a1.632 1.632 0 0 1-1.638-1.638c0-.909.73-1.638 1.638-1.638h4.176l5.345-9.265-1.67-2.898a1.642 1.642 0 0 1 2.844-1.638l.716 1.264Zm-6.317 17.5-1.575 2.732a1.64 1.64 0 1 1-2.844-1.638l1.17-2.025c1.323-.41 2.398-.095 3.249.931Zm13.56-4.954h4.262c.909 0 1.638.729 1.638 1.638 0 .909-.73 1.638-1.638 1.638h-2.367l1.597 2.772c.45.788.185 1.782-.602 2.241a1.642 1.642 0 0 1-2.241-.603c-2.69-4.666-4.711-8.159-6.052-10.485-1.372-2.367-.391-4.743.576-5.549 1.075 1.846 2.682 4.631 4.828 8.348Z"
    fill="#fff"
  />
  <defs>
    <linearGradient id="a" x1="18" y1="0" x2="18" y2="36" gradientUnits="userSpaceOnUse">
      <stop stop-color="#18BFFB" />
      <stop offset="1" stop-color="#2072F3" />
    </linearGradient>
  </defs>
</svg>`,appleSvg=Oe$1`<svg fill="none" viewBox="0 0 40 40">
  <g clip-path="url(#a)">
    <g clip-path="url(#b)">
      <circle cx="20" cy="19.89" r="20" fill="#000" />
      <g clip-path="url(#c)">
        <path
          fill="#fff"
          d="M28.77 23.3c-.69 1.99-2.75 5.52-4.87 5.56-1.4.03-1.86-.84-3.46-.84-1.61 0-2.12.81-3.45.86-2.25.1-5.72-5.1-5.72-9.62 0-4.15 2.9-6.2 5.42-6.25 1.36-.02 2.64.92 3.47.92.83 0 2.38-1.13 4.02-.97.68.03 2.6.28 3.84 2.08-3.27 2.14-2.76 6.61.75 8.25ZM24.2 7.88c-2.47.1-4.49 2.69-4.2 4.84 2.28.17 4.47-2.39 4.2-4.84Z"
        />
      </g>
    </g>
  </g>
  <defs>
    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
  </defs>
</svg>`,arrowBottomSvg=Oe$1`<svg fill="none" viewBox="0 0 14 15">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M7 1.99a1 1 0 0 1 1 1v7.58l2.46-2.46a1 1 0 0 1 1.41 1.42L7.7 13.69a1 1 0 0 1-1.41 0L2.12 9.53A1 1 0 0 1 3.54 8.1L6 10.57V3a1 1 0 0 1 1-1Z"
    clip-rule="evenodd"
  />
</svg>`,arrowLeftSvg=Oe$1`<svg fill="none" viewBox="0 0 14 15">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M13 7.99a1 1 0 0 1-1 1H4.4l2.46 2.46a1 1 0 1 1-1.41 1.41L1.29 8.7a1 1 0 0 1 0-1.41L5.46 3.1a1 1 0 0 1 1.41 1.42L4.41 6.99H12a1 1 0 0 1 1 1Z"
    clip-rule="evenodd"
  />
</svg>`,arrowRightSvg=Oe$1`<svg fill="none" viewBox="0 0 14 15">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M1 7.99a1 1 0 0 1 1-1h7.58L7.12 4.53A1 1 0 1 1 8.54 3.1l4.16 4.17a1 1 0 0 1 0 1.41l-4.16 4.17a1 1 0 1 1-1.42-1.41l2.46-2.46H2a1 1 0 0 1-1-1Z"
    clip-rule="evenodd"
  />
</svg>`,arrowTopSvg=Oe$1`<svg fill="none" viewBox="0 0 14 15">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M7 13.99a1 1 0 0 1-1-1V5.4L3.54 7.86a1 1 0 0 1-1.42-1.41L6.3 2.28a1 1 0 0 1 1.41 0l4.17 4.17a1 1 0 1 1-1.41 1.41L8 5.4v7.59a1 1 0 0 1-1 1Z"
    clip-rule="evenodd"
  />
</svg>`,bankSvg=Oe$1`<svg
  xmlns="http://www.w3.org/2000/svg"
  width="12"
  height="13"
  viewBox="0 0 12 13"
  fill="none"
>
  <path
    fill-rule="evenodd"
    clip-rule="evenodd"
    d="M5.61391 1.57124C5.85142 1.42873 6.14813 1.42873 6.38564 1.57124L11.0793 4.38749C11.9179 4.89067 11.5612 6.17864 10.5832 6.17864H9.96398V10.0358H10.2854C10.6996 10.0358 11.0354 10.3716 11.0354 10.7858C11.0354 11.2 10.6996 11.5358 10.2854 11.5358H1.71416C1.29995 11.5358 0.964172 11.2 0.964172 10.7858C0.964172 10.3716 1.29995 10.0358 1.71416 10.0358H2.03558L2.03558 6.17864H1.41637C0.438389 6.17864 0.0816547 4.89066 0.920263 4.38749L5.61391 1.57124ZM3.53554 6.17864V10.0358H5.24979V6.17864H3.53554ZM6.74976 6.17864V10.0358H8.46401V6.17864H6.74976ZM8.64913 4.67864H3.35043L5.99978 3.089L8.64913 4.67864Z"
    fill="currentColor"
  /></svg
>`,browserSvg$1=Oe$1`<svg fill="none" viewBox="0 0 20 20">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M4 6.4a1 1 0 0 1-.46.89 6.98 6.98 0 0 0 .38 6.18A7 7 0 0 0 16.46 7.3a1 1 0 0 1-.47-.92 7 7 0 0 0-12 .03Zm-2.02-.5a9 9 0 1 1 16.03 8.2A9 9 0 0 1 1.98 5.9Z"
    clip-rule="evenodd"
  />
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M6.03 8.63c-1.46-.3-2.72-.75-3.6-1.35l-.02-.01-.14-.11a1 1 0 0 1 1.2-1.6l.1.08c.6.4 1.52.74 2.69 1 .16-.99.39-1.88.67-2.65.3-.79.68-1.5 1.15-2.02A2.58 2.58 0 0 1 9.99 1c.8 0 1.45.44 1.92.97.47.52.84 1.23 1.14 2.02.29.77.52 1.66.68 2.64a8 8 0 0 0 2.7-1l.26-.18h.48a1 1 0 0 1 .12 2c-.86.51-2.01.91-3.34 1.18a22.24 22.24 0 0 1-.03 3.19c1.45.29 2.7.73 3.58 1.31a1 1 0 0 1-1.1 1.68c-.6-.4-1.56-.76-2.75-1-.15.8-.36 1.55-.6 2.2-.3.79-.67 1.5-1.14 2.02-.47.53-1.12.97-1.92.97-.8 0-1.45-.44-1.91-.97a6.51 6.51 0 0 1-1.15-2.02c-.24-.65-.44-1.4-.6-2.2-1.18.24-2.13.6-2.73.99a1 1 0 1 1-1.1-1.67c.88-.58 2.12-1.03 3.57-1.31a22.03 22.03 0 0 1-.04-3.2Zm2.2-1.7c.15-.86.34-1.61.58-2.24.24-.65.51-1.12.76-1.4.25-.28.4-.29.42-.29.03 0 .17.01.42.3.25.27.52.74.77 1.4.23.62.43 1.37.57 2.22a19.96 19.96 0 0 1-3.52 0Zm-.18 4.6a20.1 20.1 0 0 1-.03-2.62 21.95 21.95 0 0 0 3.94 0 20.4 20.4 0 0 1-.03 2.63 21.97 21.97 0 0 0-3.88 0Zm.27 2c.13.66.3 1.26.49 1.78.24.65.51 1.12.76 1.4.25.28.4.29.42.29.03 0 .17-.01.42-.3.25-.27.52-.74.77-1.4.19-.5.36-1.1.49-1.78a20.03 20.03 0 0 0-3.35 0Z"
    clip-rule="evenodd"
  />
</svg>`,cardSvg=Oe$1`<svg
  xmlns="http://www.w3.org/2000/svg"
  width="12"
  height="13"
  viewBox="0 0 12 13"
  fill="none"
>
  <path
    fill-rule="evenodd"
    clip-rule="evenodd"
    d="M4.16072 2C4.17367 2 4.18665 2 4.19968 2L7.83857 2C8.36772 1.99998 8.82398 1.99996 9.19518 2.04018C9.5895 2.0829 9.97577 2.17811 10.3221 2.42971C10.5131 2.56849 10.6811 2.73647 10.8198 2.92749C11.0714 3.27379 11.1666 3.66007 11.2094 4.0544C11.2496 4.42561 11.2496 4.88188 11.2495 5.41105V7.58896C11.2496 8.11812 11.2496 8.57439 11.2094 8.94561C11.1666 9.33994 11.0714 9.72621 10.8198 10.0725C10.6811 10.2635 10.5131 10.4315 10.3221 10.5703C9.97577 10.8219 9.5895 10.9171 9.19518 10.9598C8.82398 11 8.36772 11 7.83856 11H4.16073C3.63157 11 3.17531 11 2.80411 10.9598C2.40979 10.9171 2.02352 10.8219 1.67722 10.5703C1.48621 10.4315 1.31824 10.2635 1.17946 10.0725C0.927858 9.72621 0.832652 9.33994 0.78993 8.94561C0.749713 8.5744 0.749733 8.11813 0.749757 7.58896L0.749758 5.45C0.749758 5.43697 0.749758 5.42399 0.749757 5.41104C0.749733 4.88188 0.749713 4.42561 0.78993 4.0544C0.832652 3.66007 0.927858 3.27379 1.17946 2.92749C1.31824 2.73647 1.48621 2.56849 1.67722 2.42971C2.02352 2.17811 2.40979 2.0829 2.80411 2.04018C3.17531 1.99996 3.63157 1.99998 4.16072 2ZM2.96567 3.53145C2.69897 3.56034 2.60687 3.60837 2.55888 3.64324C2.49521 3.6895 2.43922 3.74549 2.39296 3.80916C2.35809 3.85715 2.31007 3.94926 2.28117 4.21597C2.26629 4.35335 2.25844 4.51311 2.25431 4.70832H9.74498C9.74085 4.51311 9.733 4.35335 9.71812 4.21597C9.68922 3.94926 9.6412 3.85715 9.60633 3.80916C9.56007 3.74549 9.50408 3.6895 9.44041 3.64324C9.39242 3.60837 9.30031 3.56034 9.03362 3.53145C8.75288 3.50103 8.37876 3.5 7.79961 3.5H4.19968C3.62053 3.5 3.24641 3.50103 2.96567 3.53145ZM9.74956 6.20832H2.24973V7.55C2.24973 8.12917 2.25076 8.5033 2.28117 8.78404C2.31007 9.05074 2.35809 9.14285 2.39296 9.19084C2.43922 9.25451 2.49521 9.31051 2.55888 9.35677C2.60687 9.39163 2.69897 9.43966 2.96567 9.46856C3.24641 9.49897 3.62053 9.5 4.19968 9.5H7.79961C8.37876 9.5 8.75288 9.49897 9.03362 9.46856C9.30032 9.43966 9.39242 9.39163 9.44041 9.35677C9.50408 9.31051 9.56007 9.25451 9.60633 9.19084C9.6412 9.14285 9.68922 9.05075 9.71812 8.78404C9.74854 8.5033 9.74956 8.12917 9.74956 7.55V6.20832ZM6.74963 8C6.74963 7.58579 7.08541 7.25 7.49961 7.25H8.2496C8.6638 7.25 8.99958 7.58579 8.99958 8C8.99958 8.41422 8.6638 8.75 8.2496 8.75H7.49961C7.08541 8.75 6.74963 8.41422 6.74963 8Z"
    fill="currentColor"
  /></svg
>`,checkmarkBoldSvg=Oe$1`<svg fill="none" viewBox="0 0 14 14">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M12.9576 2.23383C13.3807 2.58873 13.4361 3.21947 13.0812 3.64263L6.37159 11.6426C6.19161 11.8572 5.92989 11.9865 5.65009 11.999C5.3703 12.0115 5.09808 11.9062 4.89965 11.7085L0.979321 7.80331C0.588042 7.41354 0.586817 6.78038 0.976585 6.3891C1.36635 5.99782 1.99952 5.99659 2.3908 6.38636L5.53928 9.52268L11.5488 2.35742C11.9037 1.93426 12.5344 1.87893 12.9576 2.23383Z"
    clip-rule="evenodd"
  />
</svg>`,checkmarkSvg=Oe$1`<svg
  width="28"
  height="28"
  viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path
    fill-rule="evenodd"
    clip-rule="evenodd"
    d="M25.5297 4.92733C26.1221 5.4242 26.1996 6.30724 25.7027 6.89966L12.2836 22.8997C12.0316 23.2001 11.6652 23.3811 11.2735 23.3986C10.8817 23.4161 10.5006 23.2686 10.2228 22.9919L2.38218 15.1815C1.83439 14.6358 1.83268 13.7494 2.37835 13.2016C2.92403 12.6538 3.81046 12.6521 4.35825 13.1978L11.1183 19.9317L23.5573 5.10036C24.0542 4.50794 24.9372 4.43047 25.5297 4.92733Z"
    fill="currentColor"/>
</svg>
`,chevronBottomSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M1.46 4.96a1 1 0 0 1 1.41 0L8 10.09l5.13-5.13a1 1 0 1 1 1.41 1.41l-5.83 5.84a1 1 0 0 1-1.42 0L1.46 6.37a1 1 0 0 1 0-1.41Z"
    clip-rule="evenodd"
  />
</svg>`,chevronLeftSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M11.04 1.46a1 1 0 0 1 0 1.41L5.91 8l5.13 5.13a1 1 0 1 1-1.41 1.41L3.79 8.71a1 1 0 0 1 0-1.42l5.84-5.83a1 1 0 0 1 1.41 0Z"
    clip-rule="evenodd"
  />
</svg>`,chevronRightSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M4.96 14.54a1 1 0 0 1 0-1.41L10.09 8 4.96 2.87a1 1 0 0 1 1.41-1.41l5.84 5.83a1 1 0 0 1 0 1.42l-5.84 5.83a1 1 0 0 1-1.41 0Z"
    clip-rule="evenodd"
  />
</svg>`,chevronTopSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M14.54 11.04a1 1 0 0 1-1.41 0L8 5.92l-5.13 5.12a1 1 0 1 1-1.41-1.41l5.83-5.84a1 1 0 0 1 1.42 0l5.83 5.84a1 1 0 0 1 0 1.41Z"
    clip-rule="evenodd"
  />
</svg>`,chromeStoreSvg=Oe$1`<svg width="36" height="36" fill="none">
  <path
    fill="#fff"
    fill-opacity=".05"
    d="M0 14.94c0-5.55 0-8.326 1.182-10.4a9 9 0 0 1 3.359-3.358C6.614 0 9.389 0 14.94 0h6.12c5.55 0 8.326 0 10.4 1.182a9 9 0 0 1 3.358 3.359C36 6.614 36 9.389 36 14.94v6.12c0 5.55 0 8.326-1.182 10.4a9 9 0 0 1-3.359 3.358C29.386 36 26.611 36 21.06 36h-6.12c-5.55 0-8.326 0-10.4-1.182a9 9 0 0 1-3.358-3.359C0 29.386 0 26.611 0 21.06v-6.12Z"
  />
  <path
    stroke="#fff"
    stroke-opacity=".05"
    d="M14.94.5h6.12c2.785 0 4.84 0 6.46.146 1.612.144 2.743.43 3.691.97a8.5 8.5 0 0 1 3.172 3.173c.541.948.826 2.08.971 3.692.145 1.62.146 3.675.146 6.459v6.12c0 2.785 0 4.84-.146 6.46-.145 1.612-.43 2.743-.97 3.691a8.5 8.5 0 0 1-3.173 3.172c-.948.541-2.08.826-3.692.971-1.62.145-3.674.146-6.459.146h-6.12c-2.784 0-4.84 0-6.46-.146-1.612-.145-2.743-.43-3.691-.97a8.5 8.5 0 0 1-3.172-3.173c-.541-.948-.827-2.08-.971-3.692C.5 25.9.5 23.845.5 21.06v-6.12c0-2.784 0-4.84.146-6.46.144-1.612.43-2.743.97-3.691A8.5 8.5 0 0 1 4.79 1.617C5.737 1.076 6.869.79 8.48.646 10.1.5 12.156.5 14.94.5Z"
  />
  <path
    fill="url(#a)"
    d="M17.998 10.8h12.469a14.397 14.397 0 0 0-24.938.001l6.234 10.798.006-.001a7.19 7.19 0 0 1 6.23-10.799Z"
  />
  <path
    fill="url(#b)"
    d="m24.237 21.598-6.234 10.798A14.397 14.397 0 0 0 30.47 10.798H18.002l-.002.006a7.191 7.191 0 0 1 6.237 10.794Z"
  />
  <path
    fill="url(#c)"
    d="M11.765 21.601 5.531 10.803A14.396 14.396 0 0 0 18.001 32.4l6.235-10.798-.004-.004a7.19 7.19 0 0 1-12.466.004Z"
  />
  <path fill="#fff" d="M18 25.2a7.2 7.2 0 1 0 0-14.4 7.2 7.2 0 0 0 0 14.4Z" />
  <path fill="#1A73E8" d="M18 23.7a5.7 5.7 0 1 0 0-11.4 5.7 5.7 0 0 0 0 11.4Z" />
  <defs>
    <linearGradient
      id="a"
      x1="6.294"
      x2="41.1"
      y1="5.995"
      y2="5.995"
      gradientUnits="userSpaceOnUse"
    >
      <stop stop-color="#D93025" />
      <stop offset="1" stop-color="#EA4335" />
    </linearGradient>
    <linearGradient
      id="b"
      x1="20.953"
      x2="37.194"
      y1="32.143"
      y2="2.701"
      gradientUnits="userSpaceOnUse"
    >
      <stop stop-color="#FCC934" />
      <stop offset="1" stop-color="#FBBC04" />
    </linearGradient>
    <linearGradient
      id="c"
      x1="25.873"
      x2="9.632"
      y1="31.2"
      y2="1.759"
      gradientUnits="userSpaceOnUse"
    >
      <stop stop-color="#1E8E3E" />
      <stop offset="1" stop-color="#34A853" />
    </linearGradient>
  </defs>
</svg>`,clockSvg=Oe$1`<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
  <path 
    fill-rule="evenodd" 
    clip-rule="evenodd" 
    d="M7.00235 2C4.24 2 2.00067 4.23858 2.00067 7C2.00067 9.76142 4.24 12 7.00235 12C9.7647 12 12.004 9.76142 12.004 7C12.004 4.23858 9.7647 2 7.00235 2ZM0 7C0 3.13401 3.13506 0 7.00235 0C10.8696 0 14.0047 3.13401 14.0047 7C14.0047 10.866 10.8696 14 7.00235 14C3.13506 14 0 10.866 0 7ZM7.00235 3C7.55482 3 8.00269 3.44771 8.00269 4V6.58579L9.85327 8.43575C10.2439 8.82627 10.2439 9.45944 9.85327 9.84996C9.46262 10.2405 8.82924 10.2405 8.43858 9.84996L6.29501 7.70711C6.10741 7.51957 6.00201 7.26522 6.00201 7V4C6.00201 3.44771 6.44988 3 7.00235 3Z" 
    fill="currentColor"
  />
</svg>`,closeSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M2.54 2.54a1 1 0 0 1 1.42 0L8 6.6l4.04-4.05a1 1 0 1 1 1.42 1.42L9.4 8l4.05 4.04a1 1 0 0 1-1.42 1.42L8 9.4l-4.04 4.05a1 1 0 0 1-1.42-1.42L6.6 8 2.54 3.96a1 1 0 0 1 0-1.42Z"
    clip-rule="evenodd"
  />
</svg>`,coinPlaceholderSvg=Oe$1`<svg fill="none" viewBox="0 0 20 20">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M10 3a7 7 0 0 0-6.85 8.44l8.29-8.3C10.97 3.06 10.49 3 10 3Zm3.49.93-9.56 9.56c.32.55.71 1.06 1.16 1.5L15 5.1a7.03 7.03 0 0 0-1.5-1.16Zm2.7 2.8-9.46 9.46a7 7 0 0 0 9.46-9.46ZM1.99 5.9A9 9 0 1 1 18 14.09 9 9 0 0 1 1.98 5.91Z"
    clip-rule="evenodd"
  />
</svg>`,compassSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm10.66-2.65a1 1 0 0 1 .23 1.06L9.83 9.24a1 1 0 0 1-.59.58l-2.83 1.06A1 1 0 0 1 5.13 9.6l1.06-2.82a1 1 0 0 1 .58-.59L9.6 5.12a1 1 0 0 1 1.06.23ZM7.9 7.89l-.13.35.35-.13.12-.35-.34.13Z"
    clip-rule="evenodd"
  />
</svg>`,copySvg=Oe$1`<svg
  xmlns="http://www.w3.org/2000/svg"
  width="16"
  height="16"
  viewBox="0 0 16 16"
  fill="none"
>
  <path
    fill="currentColor"
    fill-rule="evenodd"
    clip-rule="evenodd"
    d="M9.21498 1.28565H10.5944C11.1458 1.28562 11.6246 1.2856 12.0182 1.32093C12.4353 1.35836 12.853 1.44155 13.2486 1.66724C13.7005 1.92498 14.0749 2.29935 14.3326 2.75122C14.5583 3.14689 14.6415 3.56456 14.6789 3.9817C14.7143 4.37531 14.7142 4.85403 14.7142 5.40545V6.78489C14.7142 7.33631 14.7143 7.81503 14.6789 8.20865C14.6415 8.62578 14.5583 9.04345 14.3326 9.43912C14.0749 9.89099 13.7005 10.2654 13.2486 10.5231C12.853 10.7488 12.4353 10.832 12.0182 10.8694C11.7003 10.8979 11.3269 10.9034 10.9045 10.9045C10.9034 11.3269 10.8979 11.7003 10.8694 12.0182C10.832 12.4353 10.7488 12.853 10.5231 13.2486C10.2654 13.7005 9.89099 14.0749 9.43912 14.3326C9.04345 14.5583 8.62578 14.6415 8.20865 14.6789C7.81503 14.7143 7.33631 14.7142 6.78489 14.7142H5.40545C4.85403 14.7142 4.37531 14.7143 3.9817 14.6789C3.56456 14.6415 3.14689 14.5583 2.75122 14.3326C2.29935 14.0749 1.92498 13.7005 1.66724 13.2486C1.44155 12.853 1.35836 12.4353 1.32093 12.0182C1.2856 11.6246 1.28562 11.1458 1.28565 10.5944V9.21498C1.28562 8.66356 1.2856 8.18484 1.32093 7.79122C1.35836 7.37409 1.44155 6.95642 1.66724 6.56074C1.92498 6.10887 2.29935 5.73451 2.75122 5.47677C3.14689 5.25108 3.56456 5.16789 3.9817 5.13045C4.2996 5.10192 4.67301 5.09645 5.09541 5.09541C5.09645 4.67302 5.10192 4.2996 5.13045 3.9817C5.16789 3.56456 5.25108 3.14689 5.47676 2.75122C5.73451 2.29935 6.10887 1.92498 6.56074 1.66724C6.95642 1.44155 7.37409 1.35836 7.79122 1.32093C8.18484 1.2856 8.66356 1.28562 9.21498 1.28565ZM5.09541 7.09552C4.68397 7.09667 4.39263 7.10161 4.16046 7.12245C3.88053 7.14757 3.78516 7.18949 3.74214 7.21403C3.60139 7.29431 3.48478 7.41091 3.4045 7.55166C3.37997 7.59468 3.33804 7.69005 3.31292 7.96999C3.28659 8.26345 3.28565 8.65147 3.28565 9.25708V10.5523C3.28565 11.1579 3.28659 11.5459 3.31292 11.8394C3.33804 12.1193 3.37997 12.2147 3.4045 12.2577C3.48478 12.3985 3.60139 12.5151 3.74214 12.5954C3.78516 12.6199 3.88053 12.6618 4.16046 12.6869C4.45393 12.7133 4.84195 12.7142 5.44755 12.7142H6.74279C7.3484 12.7142 7.73641 12.7133 8.02988 12.6869C8.30981 12.6618 8.40518 12.6199 8.44821 12.5954C8.58895 12.5151 8.70556 12.3985 8.78584 12.2577C8.81038 12.2147 8.8523 12.1193 8.87742 11.8394C8.89825 11.6072 8.90319 11.3159 8.90435 10.9045C8.48219 10.9034 8.10898 10.8979 7.79122 10.8694C7.37409 10.832 6.95641 10.7488 6.56074 10.5231C6.10887 10.2654 5.73451 9.89099 5.47676 9.43912C5.25108 9.04345 5.16789 8.62578 5.13045 8.20865C5.10194 7.89089 5.09645 7.51767 5.09541 7.09552ZM7.96999 3.31292C7.69005 3.33804 7.59468 3.37997 7.55166 3.4045C7.41091 3.48478 7.29431 3.60139 7.21403 3.74214C7.18949 3.78516 7.14757 3.88053 7.12245 4.16046C7.09611 4.45393 7.09517 4.84195 7.09517 5.44755V6.74279C7.09517 7.3484 7.09611 7.73641 7.12245 8.02988C7.14757 8.30981 7.18949 8.40518 7.21403 8.4482C7.29431 8.58895 7.41091 8.70556 7.55166 8.78584C7.59468 8.81038 7.69005 8.8523 7.96999 8.87742C8.26345 8.90376 8.65147 8.9047 9.25708 8.9047H10.5523C11.1579 8.9047 11.5459 8.90376 11.8394 8.87742C12.1193 8.8523 12.2147 8.81038 12.2577 8.78584C12.3985 8.70556 12.5151 8.58895 12.5954 8.4482C12.6199 8.40518 12.6618 8.30981 12.6869 8.02988C12.7133 7.73641 12.7142 7.3484 12.7142 6.74279V5.44755C12.7142 4.84195 12.7133 4.45393 12.6869 4.16046C12.6618 3.88053 12.6199 3.78516 12.5954 3.74214C12.5151 3.60139 12.3985 3.48478 12.2577 3.4045C12.2147 3.37997 12.1193 3.33804 11.8394 3.31292C11.5459 3.28659 11.1579 3.28565 10.5523 3.28565H9.25708C8.65147 3.28565 8.26345 3.28659 7.96999 3.31292Z"
    fill="#788181"
  /></svg
>`,cursorSvg=Oe$1` <svg fill="none" viewBox="0 0 13 4">
  <path fill="currentColor" d="M.5 0h12L8.9 3.13a3.76 3.76 0 0 1-4.8 0L.5 0Z" />
</svg>`,cursorTransparentSvg=Oe$1`<svg fill="none" viewBox="0 0 14 6">
  <path style="fill: var(--wui-color-bg-150);" d="M0 1h14L9.21 5.12a3.31 3.31 0 0 1-4.49 0L0 1Z" />
  <path
    style="stroke: var(--wui-color-inverse-100);"
    stroke-opacity=".05"
    d="M1.33 1.5h11.32L8.88 4.75l-.01.01a2.81 2.81 0 0 1-3.8 0l-.02-.01L1.33 1.5Z"
  />
  <path
    style="fill: var(--wui-color-bg-150);"
    d="M1.25.71h11.5L9.21 3.88a3.31 3.31 0 0 1-4.49 0L1.25.71Z"
  />
</svg> `,desktopSvg=Oe$1`<svg fill="none" viewBox="0 0 20 20">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M13.66 2H6.34c-1.07 0-1.96 0-2.68.08-.74.08-1.42.25-2.01.68a4 4 0 0 0-.89.89c-.43.6-.6 1.27-.68 2.01C0 6.38 0 7.26 0 8.34v.89c0 1.07 0 1.96.08 2.68.08.74.25 1.42.68 2.01a4 4 0 0 0 .89.89c.6.43 1.27.6 2.01.68a27 27 0 0 0 2.68.08h7.32a27 27 0 0 0 2.68-.08 4.03 4.03 0 0 0 2.01-.68 4 4 0 0 0 .89-.89c.43-.6.6-1.27.68-2.01.08-.72.08-1.6.08-2.68v-.89c0-1.07 0-1.96-.08-2.68a4.04 4.04 0 0 0-.68-2.01 4 4 0 0 0-.89-.89c-.6-.43-1.27-.6-2.01-.68C15.62 2 14.74 2 13.66 2ZM2.82 4.38c.2-.14.48-.25 1.06-.31C4.48 4 5.25 4 6.4 4h7.2c1.15 0 1.93 0 2.52.07.58.06.86.17 1.06.31a2 2 0 0 1 .44.44c.14.2.25.48.31 1.06.07.6.07 1.37.07 2.52v.77c0 1.15 0 1.93-.07 2.52-.06.58-.17.86-.31 1.06a2 2 0 0 1-.44.44c-.2.14-.48.25-1.06.32-.6.06-1.37.06-2.52.06H6.4c-1.15 0-1.93 0-2.52-.06-.58-.07-.86-.18-1.06-.32a2 2 0 0 1-.44-.44c-.14-.2-.25-.48-.31-1.06C2 11.1 2 10.32 2 9.17V8.4c0-1.15 0-1.93.07-2.52.06-.58.17-.86.31-1.06a2 2 0 0 1 .44-.44Z"
    clip-rule="evenodd"
  />
  <path fill="currentColor" d="M6.14 17.57a1 1 0 1 0 0 2h7.72a1 1 0 1 0 0-2H6.14Z" />
</svg>`,disconnectSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M6.07 1h.57a1 1 0 0 1 0 2h-.52c-.98 0-1.64 0-2.14.06-.48.05-.7.14-.84.24-.13.1-.25.22-.34.35-.1.14-.2.35-.25.83-.05.5-.05 1.16-.05 2.15v2.74c0 .99 0 1.65.05 2.15.05.48.14.7.25.83.1.14.2.25.34.35.14.1.36.2.84.25.5.05 1.16.05 2.14.05h.52a1 1 0 0 1 0 2h-.57c-.92 0-1.69 0-2.3-.07a3.6 3.6 0 0 1-1.8-.61c-.3-.22-.57-.49-.8-.8a3.6 3.6 0 0 1-.6-1.79C.5 11.11.5 10.35.5 9.43V6.58c0-.92 0-1.7.06-2.31a3.6 3.6 0 0 1 .62-1.8c.22-.3.48-.57.79-.79a3.6 3.6 0 0 1 1.8-.61C4.37 1 5.14 1 6.06 1ZM9.5 3a1 1 0 0 1 1.42 0l4.28 4.3a1 1 0 0 1 0 1.4L10.93 13a1 1 0 0 1-1.42-1.42L12.1 9H6.8a1 1 0 1 1 0-2h5.3L9.51 4.42a1 1 0 0 1 0-1.41Z"
    clip-rule="evenodd"
  />
</svg>`,discordSvg=Oe$1`<svg fill="none" viewBox="0 0 40 40">
  <g clip-path="url(#a)">
    <g clip-path="url(#b)">
      <circle cx="20" cy="19.89" r="20" fill="#5865F2" />
      <path
        fill="#fff"
        fill-rule="evenodd"
        d="M25.71 28.15C30.25 28 32 25.02 32 25.02c0-6.61-2.96-11.98-2.96-11.98-2.96-2.22-5.77-2.15-5.77-2.15l-.29.32c3.5 1.07 5.12 2.61 5.12 2.61a16.75 16.75 0 0 0-10.34-1.93l-.35.04a15.43 15.43 0 0 0-5.88 1.9s1.71-1.63 5.4-2.7l-.2-.24s-2.81-.07-5.77 2.15c0 0-2.96 5.37-2.96 11.98 0 0 1.73 2.98 6.27 3.13l1.37-1.7c-2.6-.79-3.6-2.43-3.6-2.43l.58.35.09.06.08.04.02.01.08.05a17.25 17.25 0 0 0 4.52 1.58 14.4 14.4 0 0 0 8.3-.86c.72-.27 1.52-.66 2.37-1.21 0 0-1.03 1.68-3.72 2.44.61.78 1.35 1.67 1.35 1.67Zm-9.55-9.6c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28.01-1.25-.93-2.28-2.1-2.28Zm7.5 0c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28 0-1.25-.93-2.28-2.1-2.28Z"
        clip-rule="evenodd"
      />
    </g>
  </g>
  <defs>
    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
  </defs>
</svg>`,etherscanSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    d="M4.25 7a.63.63 0 0 0-.63.63v3.97c0 .28-.2.51-.47.54l-.75.07a.93.93 0 0 1-.9-.47A7.51 7.51 0 0 1 5.54.92a7.5 7.5 0 0 1 9.54 4.62c.12.35.06.72-.16 1-.74.97-1.68 1.78-2.6 2.44V4.44a.64.64 0 0 0-.63-.64h-1.06c-.35 0-.63.3-.63.64v5.5c0 .23-.12.42-.32.5l-.52.23V6.05c0-.36-.3-.64-.64-.64H7.45c-.35 0-.64.3-.64.64v4.97c0 .25-.17.46-.4.52a5.8 5.8 0 0 0-.45.11v-4c0-.36-.3-.65-.64-.65H4.25ZM14.07 12.4A7.49 7.49 0 0 1 3.6 14.08c4.09-.58 9.14-2.5 11.87-6.6v.03a7.56 7.56 0 0 1-1.41 4.91Z"
  />
</svg>`,extensionSvg=Oe$1`<svg fill="none" viewBox="0 0 14 15">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M6.71 2.99a.57.57 0 0 0-.57.57 1 1 0 0 1-1 1c-.58 0-.96 0-1.24.03-.27.03-.37.07-.42.1a.97.97 0 0 0-.36.35c-.04.08-.09.21-.11.67a2.57 2.57 0 0 1 0 5.13c.02.45.07.6.11.66.09.15.21.28.36.36.07.04.21.1.67.12a2.57 2.57 0 0 1 5.12 0c.46-.03.6-.08.67-.12a.97.97 0 0 0 .36-.36c.03-.04.07-.14.1-.41.02-.29.03-.66.03-1.24a1 1 0 0 1 1-1 .57.57 0 0 0 0-1.15 1 1 0 0 1-1-1c0-.58 0-.95-.03-1.24a1.04 1.04 0 0 0-.1-.42.97.97 0 0 0-.36-.36 1.04 1.04 0 0 0-.42-.1c-.28-.02-.65-.02-1.24-.02a1 1 0 0 1-1-1 .57.57 0 0 0-.57-.57ZM5.15 13.98a1 1 0 0 0 .99-1v-.78a.57.57 0 0 1 1.14 0v.78a1 1 0 0 0 .99 1H8.36a66.26 66.26 0 0 0 .73 0 3.78 3.78 0 0 0 1.84-.38c.46-.26.85-.64 1.1-1.1.23-.4.32-.8.36-1.22.02-.2.03-.4.03-.63a2.57 2.57 0 0 0 0-4.75c0-.23-.01-.44-.03-.63a2.96 2.96 0 0 0-.35-1.22 2.97 2.97 0 0 0-1.1-1.1c-.4-.22-.8-.31-1.22-.35a8.7 8.7 0 0 0-.64-.04 2.57 2.57 0 0 0-4.74 0c-.23 0-.44.02-.63.04-.42.04-.83.13-1.22.35-.46.26-.84.64-1.1 1.1-.33.57-.37 1.2-.39 1.84a21.39 21.39 0 0 0 0 .72v.1a1 1 0 0 0 1 .99h.78a.57.57 0 0 1 0 1.15h-.77a1 1 0 0 0-1 .98v.1a63.87 63.87 0 0 0 0 .73c0 .64.05 1.27.38 1.83.26.47.64.85 1.1 1.11.56.32 1.2.37 1.84.38a20.93 20.93 0 0 0 .72 0h.1Z"
    clip-rule="evenodd"
  />
</svg>`,externalLinkSvg=Oe$1`<svg fill="none" viewBox="0 0 14 15">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M3.74 3.99a1 1 0 0 1 1-1H11a1 1 0 0 1 1 1v6.26a1 1 0 0 1-2 0V6.4l-6.3 6.3a1 1 0 0 1-1.4-1.42l6.29-6.3H4.74a1 1 0 0 1-1-1Z"
    clip-rule="evenodd"
  />
</svg>`,facebookSvg=Oe$1`<svg fill="none" viewBox="0 0 40 40">
  <g clip-path="url(#a)">
    <g clip-path="url(#b)">
      <circle cx="20" cy="19.89" r="20" fill="#1877F2" />
      <g clip-path="url(#c)">
        <path
          fill="#fff"
          d="M26 12.38h-2.89c-.92 0-1.61.38-1.61 1.34v1.66H26l-.36 4.5H21.5v12H17v-12h-3v-4.5h3V12.5c0-3.03 1.6-4.62 5.2-4.62H26v4.5Z"
        />
      </g>
    </g>
    <path
      fill="#1877F2"
      d="M40 20a20 20 0 1 0-23.13 19.76V25.78H11.8V20h5.07v-4.4c0-5.02 3-7.79 7.56-7.79 2.19 0 4.48.4 4.48.4v4.91h-2.53c-2.48 0-3.25 1.55-3.25 3.13V20h5.54l-.88 5.78h-4.66v13.98A20 20 0 0 0 40 20Z"
    />
    <path
      fill="#fff"
      d="m27.79 25.78.88-5.78h-5.55v-3.75c0-1.58.78-3.13 3.26-3.13h2.53V8.2s-2.3-.39-4.48-.39c-4.57 0-7.55 2.77-7.55 7.78V20H11.8v5.78h5.07v13.98a20.15 20.15 0 0 0 6.25 0V25.78h4.67Z"
    />
  </g>
  <defs>
    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
  </defs>
</svg>`,farcasterSvg=Oe$1`<svg style="border-radius: 9999px; overflow: hidden;"  fill="none" viewBox="0 0 1000 1000">
  <rect width="1000" height="1000" rx="9999" ry="9999" fill="#855DCD"/>
  <path fill="#855DCD" d="M0 0h1000v1000H0V0Z" />
  <path
    fill="#fff"
    d="M320 248h354v504h-51.96V521.13h-.5c-5.76-63.8-59.31-113.81-124.54-113.81s-118.78 50-124.53 113.81h-.5V752H320V248Z"
  />
  <path
    fill="#fff"
    d="m225 320 21.16 71.46h17.9v289.09a16.29 16.29 0 0 0-16.28 16.24v19.49h-3.25a16.3 16.3 0 0 0-16.28 16.24V752h182.26v-19.48a16.22 16.22 0 0 0-16.28-16.24h-3.25v-19.5a16.22 16.22 0 0 0-16.28-16.23h-19.52V320H225Zm400.3 360.55a16.3 16.3 0 0 0-15.04 10.02 16.2 16.2 0 0 0-1.24 6.22v19.49h-3.25a16.29 16.29 0 0 0-16.27 16.24V752h182.24v-19.48a16.23 16.23 0 0 0-16.27-16.24h-3.25v-19.5a16.2 16.2 0 0 0-10.04-15 16.3 16.3 0 0 0-6.23-1.23v-289.1h17.9L775 320H644.82v360.55H625.3Z"
  />
</svg>`,filtersSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M0 3a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H1a1 1 0 0 1-1-1Zm2.63 5.25a1 1 0 0 1 1-1h8.75a1 1 0 1 1 0 2H3.63a1 1 0 0 1-1-1Zm2.62 5.25a1 1 0 0 1 1-1h3.5a1 1 0 0 1 0 2h-3.5a1 1 0 0 1-1-1Z"
    clip-rule="evenodd"
  />
</svg>`,githubSvg=Oe$1`<svg fill="none" viewBox="0 0 40 40">
  <g clip-path="url(#a)">
    <g clip-path="url(#b)">
      <circle cx="20" cy="19.89" r="20" fill="#1B1F23" />
      <g clip-path="url(#c)">
        <path
          fill="#fff"
          d="M8 19.89a12 12 0 1 1 15.8 11.38c-.6.12-.8-.26-.8-.57v-3.3c0-1.12-.4-1.85-.82-2.22 2.67-.3 5.48-1.31 5.48-5.92 0-1.31-.47-2.38-1.24-3.22.13-.3.54-1.52-.12-3.18 0 0-1-.32-3.3 1.23a11.54 11.54 0 0 0-6 0c-2.3-1.55-3.3-1.23-3.3-1.23a4.32 4.32 0 0 0-.12 3.18 4.64 4.64 0 0 0-1.24 3.22c0 4.6 2.8 5.63 5.47 5.93-.34.3-.65.83-.76 1.6-.69.31-2.42.84-3.5-1 0 0-.63-1.15-1.83-1.23 0 0-1.18-.02-.09.73 0 0 .8.37 1.34 1.76 0 0 .7 2.14 4.03 1.41v2.24c0 .31-.2.68-.8.57A12 12 0 0 1 8 19.9Z"
        />
      </g>
    </g>
  </g>
  <defs>
    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
  </defs>
</svg>`,googleSvg$1=Oe$1`<svg fill="none" viewBox="0 0 40 40">
  <path
    fill="#4285F4"
    d="M32.74 20.3c0-.93-.08-1.81-.24-2.66H20.26v5.03h7a6 6 0 0 1-2.62 3.91v3.28h4.22c2.46-2.27 3.88-5.6 3.88-9.56Z"
  />
  <path
    fill="#34A853"
    d="M20.26 33a12.4 12.4 0 0 0 8.6-3.14l-4.22-3.28a7.74 7.74 0 0 1-4.38 1.26 7.76 7.76 0 0 1-7.28-5.36H8.65v3.36A12.99 12.99 0 0 0 20.26 33Z"
  />
  <path
    fill="#FBBC05"
    d="M12.98 22.47a7.79 7.79 0 0 1 0-4.94v-3.36H8.65a12.84 12.84 0 0 0 0 11.66l3.37-2.63.96-.73Z"
  />
  <path
    fill="#EA4335"
    d="M20.26 12.18a7.1 7.1 0 0 1 4.98 1.93l3.72-3.72A12.47 12.47 0 0 0 20.26 7c-5.08 0-9.47 2.92-11.6 7.17l4.32 3.36a7.76 7.76 0 0 1 7.28-5.35Z"
  />
</svg>`,helpCircleSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    d="M8.51 5.66a.83.83 0 0 0-.57-.2.83.83 0 0 0-.52.28.8.8 0 0 0-.25.52 1 1 0 0 1-2 0c0-.75.34-1.43.81-1.91a2.75 2.75 0 0 1 4.78 1.92c0 1.24-.8 1.86-1.25 2.2l-.04.03c-.47.36-.5.43-.5.65a1 1 0 1 1-2 0c0-1.25.8-1.86 1.24-2.2l.04-.04c.47-.36.5-.43.5-.65 0-.3-.1-.49-.24-.6ZM9.12 11.87a1.13 1.13 0 1 1-2.25 0 1.13 1.13 0 0 1 2.25 0Z"
  />
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6a6 6 0 1 0 0 12A6 6 0 0 0 8 2Z"
    clip-rule="evenodd"
  />
</svg>`,imageSvg=Oe$1`<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
  <path d="M4.98926 3.73932C4.2989 3.73932 3.73926 4.29896 3.73926 4.98932C3.73926 5.67968 4.2989 6.23932 4.98926 6.23932C5.67962 6.23932 6.23926 5.67968 6.23926 4.98932C6.23926 4.29896 5.67962 3.73932 4.98926 3.73932Z" fill="currentColor"/>
  <path fill-rule="evenodd" clip-rule="evenodd" d="M7.60497 0.500001H6.39504C5.41068 0.499977 4.59185 0.499958 3.93178 0.571471C3.24075 0.64634 2.60613 0.809093 2.04581 1.21619C1.72745 1.44749 1.44749 1.72745 1.21619 2.04581C0.809093 2.60613 0.64634 3.24075 0.571471 3.93178C0.499958 4.59185 0.499977 5.41065 0.500001 6.39501V7.57815C0.499998 8.37476 0.499995 9.05726 0.534869 9.62725C0.570123 10.2034 0.644114 10.7419 0.828442 11.2302C0.925651 11.4877 1.05235 11.7287 1.21619 11.9542C1.44749 12.2726 1.72745 12.5525 2.04581 12.7838C2.60613 13.1909 3.24075 13.3537 3.93178 13.4285C4.59185 13.5001 5.41066 13.5 6.39503 13.5H7.60496C8.58933 13.5 9.40815 13.5001 10.0682 13.4285C10.7593 13.3537 11.3939 13.1909 11.9542 12.7838C12.2726 12.5525 12.5525 12.2726 12.7838 11.9542C13.1909 11.3939 13.3537 10.7593 13.4285 10.0682C13.5 9.40816 13.5 8.58935 13.5 7.60497V6.39505C13.5 5.41068 13.5 4.59185 13.4285 3.93178C13.3537 3.24075 13.1909 2.60613 12.7838 2.04581C12.5525 1.72745 12.2726 1.44749 11.9542 1.21619C11.3939 0.809093 10.7593 0.64634 10.0682 0.571471C9.40816 0.499958 8.58933 0.499977 7.60497 0.500001ZM3.22138 2.83422C3.38394 2.71612 3.62634 2.61627 4.14721 2.55984C4.68679 2.50138 5.39655 2.5 6.45 2.5H7.55C8.60345 2.5 9.31322 2.50138 9.8528 2.55984C10.3737 2.61627 10.6161 2.71612 10.7786 2.83422C10.9272 2.94216 11.0578 3.07281 11.1658 3.22138C11.2839 3.38394 11.3837 3.62634 11.4402 4.14721C11.4986 4.68679 11.5 5.39655 11.5 6.45V6.49703C10.9674 6.11617 10.386 5.84936 9.74213 5.81948C8.40536 5.75745 7.3556 6.73051 6.40509 7.84229C6.33236 7.92737 6.27406 7.98735 6.22971 8.02911L6.1919 8.00514L6.17483 7.99427C6.09523 7.94353 5.98115 7.87083 5.85596 7.80302C5.56887 7.64752 5.18012 7.4921 4.68105 7.4921C4.66697 7.4921 4.6529 7.49239 4.63884 7.49299C3.79163 7.52878 3.09922 8.1106 2.62901 8.55472C2.58751 8.59392 2.54594 8.6339 2.50435 8.6745C2.50011 8.34653 2.5 7.97569 2.5 7.55V6.45C2.5 5.39655 2.50138 4.68679 2.55984 4.14721C2.61627 3.62634 2.71612 3.38394 2.83422 3.22138C2.94216 3.07281 3.07281 2.94216 3.22138 2.83422ZM10.3703 8.14825C10.6798 8.37526 11.043 8.71839 11.4832 9.20889C11.4744 9.44992 11.4608 9.662 11.4402 9.8528C11.3837 10.3737 11.2839 10.6161 11.1658 10.7786C11.0578 10.9272 10.9272 11.0578 10.7786 11.1658C10.6161 11.2839 10.3737 11.3837 9.8528 11.4402C9.31322 11.4986 8.60345 11.5 7.55 11.5H6.45C5.39655 11.5 4.68679 11.4986 4.14721 11.4402C3.62634 11.3837 3.38394 11.2839 3.22138 11.1658C3.15484 11.1174 3.0919 11.0645 3.03298 11.0075C3.10126 10.9356 3.16806 10.8649 3.23317 10.7959L3.29772 10.7276C3.55763 10.4525 3.78639 10.2126 4.00232 10.0087C4.22016 9.80294 4.39412 9.66364 4.53524 9.57742C4.63352 9.51738 4.69022 9.49897 4.71275 9.49345C4.76387 9.49804 4.81803 9.51537 4.90343 9.56162C4.96409 9.59447 5.02355 9.63225 5.11802 9.69238L5.12363 9.69595C5.20522 9.74789 5.32771 9.82587 5.46078 9.89278C5.76529 10.0459 6.21427 10.186 6.74977 10.0158C7.21485 9.86796 7.59367 9.52979 7.92525 9.14195C8.91377 7.98571 9.38267 7.80495 9.64941 7.81733C9.7858 7.82366 10.0101 7.884 10.3703 8.14825Z" fill="currentColor"/>
</svg>`,infoCircleSvg=Oe$1`<svg fill="none" viewBox="0 0 14 15">
  <path
    fill="currentColor"
    d="M6 10.49a1 1 0 1 0 2 0v-2a1 1 0 0 0-2 0v2ZM7 4.49a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"
  />
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M7 14.99a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5-7a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"
    clip-rule="evenodd"
  />
</svg>`,mailSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M4.83 1.34h6.34c.68 0 1.26 0 1.73.04.5.05.97.15 1.42.4.52.3.95.72 1.24 1.24.26.45.35.92.4 1.42.04.47.04 1.05.04 1.73v3.71c0 .69 0 1.26-.04 1.74-.05.5-.14.97-.4 1.41-.3.52-.72.95-1.24 1.25-.45.25-.92.35-1.42.4-.47.03-1.05.03-1.73.03H4.83c-.68 0-1.26 0-1.73-.04-.5-.04-.97-.14-1.42-.4-.52-.29-.95-.72-1.24-1.24a3.39 3.39 0 0 1-.4-1.41A20.9 20.9 0 0 1 0 9.88v-3.7c0-.7 0-1.27.04-1.74.05-.5.14-.97.4-1.42.3-.52.72-.95 1.24-1.24.45-.25.92-.35 1.42-.4.47-.04 1.05-.04 1.73-.04ZM3.28 3.38c-.36.03-.51.08-.6.14-.21.11-.39.29-.5.5a.8.8 0 0 0-.08.19l5.16 3.44c.45.3 1.03.3 1.48 0L13.9 4.2a.79.79 0 0 0-.08-.2c-.11-.2-.29-.38-.5-.5-.09-.05-.24-.1-.6-.13-.37-.04-.86-.04-1.6-.04H4.88c-.73 0-1.22 0-1.6.04ZM14 6.54 9.85 9.31a3.33 3.33 0 0 1-3.7 0L2 6.54v3.3c0 .74 0 1.22.03 1.6.04.36.1.5.15.6.11.2.29.38.5.5.09.05.24.1.6.14.37.03.86.03 1.6.03h6.25c.73 0 1.22 0 1.6-.03.35-.03.5-.09.6-.14.2-.12.38-.3.5-.5.05-.1.1-.24.14-.6.03-.38.03-.86.03-1.6v-3.3Z"
    clip-rule="evenodd"
  />
</svg>`,mobileSvg=Oe$1`<svg fill="none" viewBox="0 0 20 20">
  <path fill="currentColor" d="M10.81 5.81a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" />
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M3 4.75A4.75 4.75 0 0 1 7.75 0h4.5A4.75 4.75 0 0 1 17 4.75v10.5A4.75 4.75 0 0 1 12.25 20h-4.5A4.75 4.75 0 0 1 3 15.25V4.75ZM7.75 2A2.75 2.75 0 0 0 5 4.75v10.5A2.75 2.75 0 0 0 7.75 18h4.5A2.75 2.75 0 0 0 15 15.25V4.75A2.75 2.75 0 0 0 12.25 2h-4.5Z"
    clip-rule="evenodd"
  />
</svg>`,moreSvg=Oe$1`<svg fill="none" viewBox="0 0 41 40">
  <path
    style="fill: var(--wui-color-fg-100);"
    fill-opacity=".05"
    d="M.6 20a20 20 0 1 1 40 0 20 20 0 0 1-40 0Z"
  />
  <path
    fill="#949E9E"
    d="M15.6 20.31a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM23.1 20.31a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM28.1 22.81a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"
  />
</svg>`,networkPlaceholderSvg=Oe$1`<svg fill="none" viewBox="0 0 22 20">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M16.32 13.62a3.14 3.14 0 1 1-.99 1.72l-1.6-.93a3.83 3.83 0 0 1-3.71 1 3.66 3.66 0 0 1-1.74-1l-1.6.94a3.14 3.14 0 1 1-1-1.73l1.6-.94a3.7 3.7 0 0 1 0-2 3.81 3.81 0 0 1 1.8-2.33c.29-.17.6-.3.92-.38V6.1a3.14 3.14 0 1 1 2 0l-.01.02v1.85H12a3.82 3.82 0 0 1 2.33 1.8 3.7 3.7 0 0 1 .39 2.91l1.6.93ZM2.6 16.54a1.14 1.14 0 0 0 1.98-1.14 1.14 1.14 0 0 0-1.98 1.14ZM11 2.01a1.14 1.14 0 1 0 0 2.28 1.14 1.14 0 0 0 0-2.28Zm1.68 10.45c.08-.19.14-.38.16-.58v-.05l.02-.13v-.13a1.92 1.92 0 0 0-.24-.8l-.11-.15a1.89 1.89 0 0 0-.74-.6 1.86 1.86 0 0 0-.77-.17h-.19a1.97 1.97 0 0 0-.89.34 1.98 1.98 0 0 0-.61.74 1.99 1.99 0 0 0-.16.9v.05a1.87 1.87 0 0 0 .24.74l.1.15c.12.16.26.3.42.42l.16.1.13.07.04.02a1.84 1.84 0 0 0 .76.17h.17a2 2 0 0 0 .91-.35 1.78 1.78 0 0 0 .52-.58l.03-.05a.84.84 0 0 0 .05-.11Zm5.15 4.5a1.14 1.14 0 0 0 1.14-1.97 1.13 1.13 0 0 0-1.55.41c-.32.55-.13 1.25.41 1.56Z"
    clip-rule="evenodd"
  />
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M4.63 9.43a1.5 1.5 0 1 0 1.5-2.6 1.5 1.5 0 0 0-1.5 2.6Zm.32-1.55a.5.5 0 0 1 .68-.19.5.5 0 0 1 .18.68.5.5 0 0 1-.68.19.5.5 0 0 1-.18-.68ZM17.94 8.88a1.5 1.5 0 1 1-2.6-1.5 1.5 1.5 0 1 1 2.6 1.5ZM16.9 7.69a.5.5 0 0 0-.68.19.5.5 0 0 0 .18.68.5.5 0 0 0 .68-.19.5.5 0 0 0-.18-.68ZM9.75 17.75a1.5 1.5 0 1 1 2.6 1.5 1.5 1.5 0 1 1-2.6-1.5Zm1.05 1.18a.5.5 0 0 0 .68-.18.5.5 0 0 0-.18-.68.5.5 0 0 0-.68.18.5.5 0 0 0 .18.68Z"
    clip-rule="evenodd"
  />
</svg>`,nftPlaceholderSvg=Oe$1`<svg fill="none" viewBox="0 0 20 20">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M9.13 1h1.71c1.46 0 2.63 0 3.56.1.97.1 1.8.33 2.53.85a5 5 0 0 1 1.1 1.11c.53.73.75 1.56.86 2.53.1.93.1 2.1.1 3.55v1.72c0 1.45 0 2.62-.1 3.55-.1.97-.33 1.8-.86 2.53a5 5 0 0 1-1.1 1.1c-.73.53-1.56.75-2.53.86-.93.1-2.1.1-3.55.1H9.13c-1.45 0-2.62 0-3.56-.1-.96-.1-1.8-.33-2.52-.85a5 5 0 0 1-1.1-1.11 5.05 5.05 0 0 1-.86-2.53c-.1-.93-.1-2.1-.1-3.55V9.14c0-1.45 0-2.62.1-3.55.1-.97.33-1.8.85-2.53a5 5 0 0 1 1.1-1.1 5.05 5.05 0 0 1 2.53-.86C6.51 1 7.67 1 9.13 1ZM5.79 3.09a3.1 3.1 0 0 0-1.57.48 3 3 0 0 0-.66.67c-.24.32-.4.77-.48 1.56-.1.82-.1 1.88-.1 3.4v1.6c0 1.15 0 2.04.05 2.76l.41-.42c.5-.5.93-.92 1.32-1.24.41-.33.86-.6 1.43-.7a3 3 0 0 1 .94 0c.35.06.66.2.95.37a17.11 17.11 0 0 0 .8.45c.1-.08.2-.2.41-.4l.04-.03a27 27 0 0 1 1.95-1.84 4.03 4.03 0 0 1 1.91-.94 4 4 0 0 1 1.25 0c.73.11 1.33.46 1.91.94l.64.55V9.2c0-1.52 0-2.58-.1-3.4a3.1 3.1 0 0 0-.48-1.56 3 3 0 0 0-.66-.67 3.1 3.1 0 0 0-1.56-.48C13.37 3 12.3 3 10.79 3h-1.6c-1.52 0-2.59 0-3.4.09Zm11.18 10-.04-.05a26.24 26.24 0 0 0-1.83-1.74c-.45-.36-.73-.48-.97-.52a2 2 0 0 0-.63 0c-.24.04-.51.16-.97.52-.46.38-1.01.93-1.83 1.74l-.02.02c-.17.18-.34.34-.49.47a2.04 2.04 0 0 1-1.08.5 1.97 1.97 0 0 1-1.25-.27l-.79-.46-.02-.02a.65.65 0 0 0-.24-.1 1 1 0 0 0-.31 0c-.08.02-.21.06-.49.28-.3.24-.65.59-1.2 1.14l-.56.56-.65.66a3 3 0 0 0 .62.6c.33.24.77.4 1.57.49.81.09 1.88.09 3.4.09h1.6c1.52 0 2.58 0 3.4-.09a3.1 3.1 0 0 0 1.56-.48 3 3 0 0 0 .66-.67c.24-.32.4-.77.49-1.56l.07-1.12Zm-8.02-1.03ZM4.99 7a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"
    clip-rule="evenodd"
  />
</svg>`,offSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M8 0a1 1 0 0 1 1 1v5.38a1 1 0 0 1-2 0V1a1 1 0 0 1 1-1ZM5.26 2.6a1 1 0 0 1-.28 1.39 5.46 5.46 0 1 0 6.04 0 1 1 0 1 1 1.1-1.67 7.46 7.46 0 1 1-8.25 0 1 1 0 0 1 1.4.28Z"
    clip-rule="evenodd"
  />
</svg>`,playStoreSvg=Oe$1` <svg
  width="36"
  height="36"
  fill="none"
>
  <path
    d="M0 8a8 8 0 0 1 8-8h20a8 8 0 0 1 8 8v20a8 8 0 0 1-8 8H8a8 8 0 0 1-8-8V8Z"
    fill="#fff"
    fill-opacity=".05"
  />
  <path
    d="m18.262 17.513-8.944 9.49v.01a2.417 2.417 0 0 0 3.56 1.452l.026-.017 10.061-5.803-4.703-5.132Z"
    fill="#EA4335"
  />
  <path
    d="m27.307 15.9-.008-.008-4.342-2.52-4.896 4.36 4.913 4.912 4.325-2.494a2.42 2.42 0 0 0 .008-4.25Z"
    fill="#FBBC04"
  />
  <path
    d="M9.318 8.997c-.05.202-.084.403-.084.622V26.39c0 .218.025.42.084.621l9.246-9.247-9.246-8.768Z"
    fill="#4285F4"
  />
  <path
    d="m18.33 18 4.627-4.628-10.053-5.828a2.427 2.427 0 0 0-3.586 1.444L18.329 18Z"
    fill="#34A853"
  />
  <path
    d="M8 .5h20A7.5 7.5 0 0 1 35.5 8v20a7.5 7.5 0 0 1-7.5 7.5H8A7.5 7.5 0 0 1 .5 28V8A7.5 7.5 0 0 1 8 .5Z"
    stroke="#fff"
    stroke-opacity=".05"
  />
</svg>`,plusSvg=Oe$1`<svg
  width="13"
  height="12"
  viewBox="0 0 13 12"
  fill="none"
>
  <path
    fill="currentColor"
    fill-rule="evenodd"
    clip-rule="evenodd"
    d="M0.794373 5.99982C0.794373 5.52643 1.17812 5.14268 1.6515 5.14268H5.643V1.15109C5.643 0.677701 6.02675 0.293946 6.50012 0.293945C6.9735 0.293946 7.35725 0.677701 7.35725 1.15109V5.14268H11.3488C11.8221 5.14268 12.2059 5.52643 12.2059 5.99982C12.2059 6.47321 11.8221 6.85696 11.3488 6.85696H7.35725V10.8486C7.35725 11.3219 6.9735 11.7057 6.50012 11.7057C6.02675 11.7057 5.643 11.3219 5.643 10.8486V6.85696H1.6515C1.17812 6.85696 0.794373 6.47321 0.794373 5.99982Z"
  /></svg
>`,qrCodeIcon=Oe$1`<svg fill="none" viewBox="0 0 20 20">
  <path
    fill="currentColor"
    d="M3 6a3 3 0 0 1 3-3h1a1 1 0 1 0 0-2H6a5 5 0 0 0-5 5v1a1 1 0 0 0 2 0V6ZM13 1a1 1 0 1 0 0 2h1a3 3 0 0 1 3 3v1a1 1 0 1 0 2 0V6a5 5 0 0 0-5-5h-1ZM3 13a1 1 0 1 0-2 0v1a5 5 0 0 0 5 5h1a1 1 0 1 0 0-2H6a3 3 0 0 1-3-3v-1ZM19 13a1 1 0 1 0-2 0v1a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1.01a5 5 0 0 0 5-5v-1ZM5.3 6.36c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05A1.5 1.5 0 0 0 9.2 8.14c.06-.2.06-.43.06-.89s0-.7-.06-.89A1.5 1.5 0 0 0 8.14 5.3c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06ZM10.8 6.36c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05a1.5 1.5 0 0 0 1.06-1.06c.06-.2.06-.43.06-.89s0-.7-.06-.89a1.5 1.5 0 0 0-1.06-1.06c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06ZM5.26 12.75c0-.46 0-.7.05-.89a1.5 1.5 0 0 1 1.06-1.06c.19-.05.42-.05.89-.05.46 0 .7 0 .88.05.52.14.93.54 1.06 1.06.06.2.06.43.06.89s0 .7-.06.89a1.5 1.5 0 0 1-1.06 1.06c-.19.05-.42.05-.88.05-.47 0-.7 0-.9-.05a1.5 1.5 0 0 1-1.05-1.06c-.05-.2-.05-.43-.05-.89ZM10.8 11.86c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05a1.5 1.5 0 0 0 1.06-1.06c.06-.2.06-.43.06-.89s0-.7-.06-.89a1.5 1.5 0 0 0-1.06-1.06c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06Z"
  />
</svg>`,recycleHorizontalSvg=Oe$1`<svg
  fill="none"
  viewBox="0 0 21 20"
>
  <path
    fill="currentColor"
    d="M8.8071 0.292893C9.19763 0.683417 9.19763 1.31658 8.8071 1.70711L6.91421 3.6H11.8404C14.3368 3.6 16.5533 5.1975 17.3427 7.56588L17.4487 7.88377C17.6233 8.40772 17.3402 8.97404 16.8162 9.14868C16.2923 9.32333 15.726 9.04017 15.5513 8.51623L15.4453 8.19834C14.9281 6.64664 13.476 5.6 11.8404 5.6H6.91421L8.8071 7.49289C9.19763 7.88342 9.19763 8.51658 8.8071 8.90711C8.41658 9.29763 7.78341 9.29763 7.39289 8.90711L3.79289 5.30711C3.40236 4.91658 3.40236 4.28342 3.79289 3.89289L7.39289 0.292893C7.78341 -0.0976311 8.41658 -0.0976311 8.8071 0.292893ZM4.18377 10.8513C4.70771 10.6767 5.27403 10.9598 5.44868 11.4838L5.55464 11.8017C6.07188 13.3534 7.52401 14.4 9.15964 14.4L14.0858 14.4L12.1929 12.5071C11.8024 12.1166 11.8024 11.4834 12.1929 11.0929C12.5834 10.7024 13.2166 10.7024 13.6071 11.0929L17.2071 14.6929C17.5976 15.0834 17.5976 15.7166 17.2071 16.1071L13.6071 19.7071C13.2166 20.0976 12.5834 20.0976 12.1929 19.7071C11.8024 19.3166 11.8024 18.6834 12.1929 18.2929L14.0858 16.4L9.15964 16.4C6.66314 16.4 4.44674 14.8025 3.65728 12.4341L3.55131 12.1162C3.37667 11.5923 3.65983 11.026 4.18377 10.8513Z"
  /></svg
>`,refreshSvg=Oe$1`<svg fill="none" viewBox="0 0 14 16">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M3.94 1.04a1 1 0 0 1 .7 1.23l-.48 1.68a5.85 5.85 0 0 1 8.53 4.32 5.86 5.86 0 0 1-11.4 2.56 1 1 0 0 1 1.9-.57 3.86 3.86 0 1 0 1.83-4.5l1.87.53a1 1 0 0 1-.55 1.92l-4.1-1.15a1 1 0 0 1-.69-1.23l1.16-4.1a1 1 0 0 1 1.23-.7Z"
    clip-rule="evenodd"
  />
</svg>`,searchSvg=Oe$1`<svg fill="none" viewBox="0 0 20 20">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M9.36 4.21a5.14 5.14 0 1 0 0 10.29 5.14 5.14 0 0 0 0-10.29ZM1.64 9.36a7.71 7.71 0 1 1 14 4.47l2.52 2.5a1.29 1.29 0 1 1-1.82 1.83l-2.51-2.51A7.71 7.71 0 0 1 1.65 9.36Z"
    clip-rule="evenodd"
  />
</svg>`,sendSvg=Oe$1`<svg fill="none" viewBox="0 0 21 20">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M14.3808 4.34812C13.72 4.47798 12.8501 4.7587 11.5748 5.17296L9.00869 6.00646C6.90631 6.68935 5.40679 7.17779 4.38121 7.63178C3.87166 7.85734 3.5351 8.05091 3.32022 8.22035C3.11183 8.38466 3.07011 8.48486 3.05969 8.51817C2.98058 8.77103 2.98009 9.04195 3.05831 9.29509C3.06861 9.32844 3.10998 9.42878 3.31777 9.59384C3.53205 9.76404 3.86792 9.95881 4.37667 10.1862C5.29287 10.5957 6.58844 11.0341 8.35529 11.6164L10.8876 8.59854C11.2426 8.17547 11.8733 8.12028 12.2964 8.47528C12.7195 8.83029 12.7746 9.46104 12.4196 9.88412L9.88738 12.9019C10.7676 14.5408 11.4244 15.7406 11.9867 16.5718C12.299 17.0333 12.5491 17.3303 12.7539 17.5117C12.9526 17.6877 13.0586 17.711 13.0932 17.7154C13.3561 17.7484 13.6228 17.7009 13.8581 17.5791C13.8891 17.563 13.9805 17.5046 14.1061 17.2708C14.2357 17.0298 14.3679 16.6647 14.5015 16.1237C14.7705 15.0349 14.9912 13.4733 15.2986 11.2843L15.6738 8.61249C15.8603 7.28456 15.9857 6.37917 15.9989 5.7059C16.012 5.03702 15.9047 4.8056 15.8145 4.69183C15.7044 4.55297 15.5673 4.43792 15.4114 4.35365C15.2837 4.28459 15.0372 4.2191 14.3808 4.34812ZM7.99373 13.603C6.11919 12.9864 4.6304 12.4902 3.5606 12.0121C2.98683 11.7557 2.4778 11.4808 2.07383 11.1599C1.66337 10.8339 1.31312 10.4217 1.14744 9.88551C0.949667 9.24541 0.950886 8.56035 1.15094 7.92096C1.31852 7.38534 1.67024 6.97442 2.08185 6.64985C2.48697 6.33041 2.99697 6.05734 3.57166 5.80295C4.70309 5.3021 6.30179 4.78283 8.32903 4.12437L11.0196 3.25042C12.2166 2.86159 13.2017 2.54158 13.9951 2.38566C14.8065 2.22618 15.6202 2.19289 16.3627 2.59437C16.7568 2.80747 17.1035 3.09839 17.3818 3.4495C17.9062 4.111 18.0147 4.91815 17.9985 5.74496C17.9827 6.55332 17.8386 7.57903 17.6636 8.82534L17.2701 11.6268C16.9737 13.7376 16.7399 15.4022 16.4432 16.6034C16.2924 17.2135 16.1121 17.7632 15.8678 18.2176C15.6197 18.6794 15.2761 19.0971 14.7777 19.3551C14.1827 19.6632 13.5083 19.7833 12.8436 19.6997C12.2867 19.6297 11.82 19.3563 11.4277 19.0087C11.0415 18.6666 10.6824 18.213 10.3302 17.6925C9.67361 16.722 8.92648 15.342 7.99373 13.603Z"
    clip-rule="evenodd"
  />
  <svg
    xmlns="http://www.w3.org/2000/svg"
    width="21"
    height="20"
    viewBox="0 0 21 20"
    fill="none"
  ></svg></svg
>`,swapHorizontalSvg=Oe$1`<svg fill="none" viewBox="0 0 20 20">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M6.76.3a1 1 0 0 1 0 1.4L4.07 4.4h9a1 1 0 1 1 0 2h-9l2.69 2.68a1 1 0 1 1-1.42 1.42L.95 6.09a1 1 0 0 1 0-1.4l4.4-4.4a1 1 0 0 1 1.4 0Zm6.49 9.21a1 1 0 0 1 1.41 0l4.39 4.4a1 1 0 0 1 0 1.4l-4.39 4.4a1 1 0 0 1-1.41-1.42l2.68-2.68h-9a1 1 0 0 1 0-2h9l-2.68-2.68a1 1 0 0 1 0-1.42Z"
    clip-rule="evenodd"
  />
</svg>`,swapHorizontalBoldSvg=Oe$1`<svg width="10" height="10" viewBox="0 0 10 10">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M3.77986 0.566631C4.0589 0.845577 4.0589 1.29784 3.77986 1.57678L3.08261 2.2738H6.34184C6.73647 2.2738 7.05637 2.5936 7.05637 2.98808C7.05637 3.38257 6.73647 3.70237 6.34184 3.70237H3.08261L3.77986 4.39938C4.0589 4.67833 4.0589 5.13059 3.77986 5.40954C3.50082 5.68848 3.04841 5.68848 2.76937 5.40954L0.852346 3.49316C0.573306 3.21421 0.573306 2.76195 0.852346 2.48301L2.76937 0.566631C3.04841 0.287685 3.50082 0.287685 3.77986 0.566631ZM6.22 4.59102C6.49904 4.31208 6.95145 4.31208 7.23049 4.59102L9.14751 6.5074C9.42655 6.78634 9.42655 7.23861 9.14751 7.51755L7.23049 9.43393C6.95145 9.71287 6.49904 9.71287 6.22 9.43393C5.94096 9.15498 5.94096 8.70272 6.22 8.42377L6.91725 7.72676L3.65802 7.72676C3.26339 7.72676 2.94349 7.40696 2.94349 7.01247C2.94349 6.61798 3.26339 6.29819 3.65802 6.29819L6.91725 6.29819L6.22 5.60117C5.94096 5.32223 5.94096 4.86997 6.22 4.59102Z"
    clip-rule="evenodd"
  />
</svg>`,swapHorizontalMediumSvg=Oe$1`<svg
  width="14"
  height="14"
  viewBox="0 0 14 14"
  fill="none"
  xmlns="http://www.w3.org/2000/svg"
>
  <path
    fill-rule="evenodd"
    clip-rule="evenodd"
    d="M13.7306 3.24213C14.0725 3.58384 14.0725 4.13786 13.7306 4.47957L10.7418 7.46737C10.4 7.80908 9.84581 7.80908 9.50399 7.46737C9.16216 7.12567 9.16216 6.57165 9.50399 6.22994L10.9986 4.73585H5.34082C4.85741 4.73585 4.46553 4.3441 4.46553 3.86085C4.46553 3.3776 4.85741 2.98585 5.34082 2.98585L10.9986 2.98585L9.50399 1.49177C9.16216 1.15006 9.16216 0.596037 9.50399 0.254328C9.84581 -0.0873803 10.4 -0.0873803 10.7418 0.254328L13.7306 3.24213ZM9.52515 10.1352C9.52515 10.6185 9.13327 11.0102 8.64986 11.0102L2.9921 11.0102L4.48669 12.5043C4.82852 12.846 4.82852 13.4001 4.48669 13.7418C4.14487 14.0835 3.59066 14.0835 3.24884 13.7418L0.26003 10.754C0.0958806 10.5899 0.0036621 10.3673 0.00366211 10.1352C0.00366212 9.90318 0.0958806 9.68062 0.26003 9.51652L3.24884 6.52872C3.59066 6.18701 4.14487 6.18701 4.48669 6.52872C4.82851 6.87043 4.82851 7.42445 4.48669 7.76616L2.9921 9.26024L8.64986 9.26024C9.13327 9.26024 9.52515 9.65199 9.52515 10.1352Z"
    fill="currentColor"
  />
</svg>

`,swapHorizontalRoundedBoldSvg=Oe$1`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
  <path 
    fill="currentColor"
    fill-rule="evenodd" 
    clip-rule="evenodd" 
    d="M8.3071 0.292893C8.69763 0.683417 8.69763 1.31658 8.3071 1.70711L6.41421 3.6H11.3404C13.8368 3.6 16.0533 5.1975 16.8427 7.56588L16.9487 7.88377C17.1233 8.40772 16.8402 8.97404 16.3162 9.14868C15.7923 9.32333 15.226 9.04017 15.0513 8.51623L14.9453 8.19834C14.4281 6.64664 12.976 5.6 11.3404 5.6H6.41421L8.3071 7.49289C8.69763 7.88342 8.69763 8.51658 8.3071 8.90711C7.91658 9.29763 7.28341 9.29763 6.89289 8.90711L3.29289 5.30711C2.90236 4.91658 2.90236 4.28342 3.29289 3.89289L6.89289 0.292893C7.28341 -0.0976311 7.91658 -0.0976311 8.3071 0.292893ZM3.68377 10.8513C4.20771 10.6767 4.77403 10.9598 4.94868 11.4838L5.05464 11.8017C5.57188 13.3534 7.024 14.4 8.65964 14.4L13.5858 14.4L11.6929 12.5071C11.3024 12.1166 11.3024 11.4834 11.6929 11.0929C12.0834 10.7024 12.7166 10.7024 13.1071 11.0929L16.7071 14.6929C17.0976 15.0834 17.0976 15.7166 16.7071 16.1071L13.1071 19.7071C12.7166 20.0976 12.0834 20.0976 11.6929 19.7071C11.3024 19.3166 11.3024 18.6834 11.6929 18.2929L13.5858 16.4L8.65964 16.4C6.16314 16.4 3.94674 14.8025 3.15728 12.4341L3.05131 12.1162C2.87667 11.5923 3.15983 11.026 3.68377 10.8513Z" 
  />
</svg>`,swapVerticalSvg=Oe$1`<svg fill="none" viewBox="0 0 14 14">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M3.48 2.18a1 1 0 0 1 1.41 0l2.68 2.68a1 1 0 1 1-1.41 1.42l-.98-.98v4.56a1 1 0 0 1-2 0V5.3l-.97.98A1 1 0 0 1 .79 4.86l2.69-2.68Zm6.34 2.93a1 1 0 0 1 1 1v4.56l.97-.98a1 1 0 1 1 1.42 1.42l-2.69 2.68a1 1 0 0 1-1.41 0l-2.68-2.68a1 1 0 0 1 1.41-1.42l.98.98V6.1a1 1 0 0 1 1-1Z"
    clip-rule="evenodd"
  />
</svg>`,telegramSvg=Oe$1`<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
  <g clip-path="url(#a)">
    <path fill="url(#b)" d="M0 0h32v32H0z"/>
    <path fill-rule="evenodd" clip-rule="evenodd" d="M7.034 15.252c4.975-2.167 8.293-3.596 9.953-4.287 4.74-1.971 5.725-2.314 6.366-2.325.142-.002.457.033.662.198.172.14.22.33.243.463.022.132.05.435.028.671-.257 2.7-1.368 9.248-1.933 12.27-.24 1.28-.71 1.708-1.167 1.75-.99.091-1.743-.655-2.703-1.284-1.502-.985-2.351-1.598-3.81-2.558-1.684-1.11-.592-1.721.368-2.718.252-.261 4.619-4.233 4.703-4.594.01-.045.02-.213-.08-.301-.1-.09-.246-.059-.353-.035-.15.034-2.55 1.62-7.198 4.758-.682.468-1.298.696-1.851.684-.61-.013-1.782-.344-2.653-.628-1.069-.347-1.918-.53-1.845-1.12.039-.308.462-.623 1.27-.944Z" fill="#fff"/>
  </g>
  <path d="M.5 16C.5 7.44 7.44.5 16 .5 24.56.5 31.5 7.44 31.5 16c0 8.56-6.94 15.5-15.5 15.5C7.44 31.5.5 24.56.5 16Z" stroke="#141414" stroke-opacity=".05"/>
  <defs>
    <linearGradient id="b" x1="1600" y1="0" x2="1600" y2="3176.27" gradientUnits="userSpaceOnUse">
      <stop stop-color="#2AABEE"/>
      <stop offset="1" stop-color="#229ED9"/>
    </linearGradient>
    <clipPath id="a">
      <path d="M0 16C0 7.163 7.163 0 16 0s16 7.163 16 16-7.163 16-16 16S0 24.837 0 16Z" fill="#fff"/>
    </clipPath>
  </defs>
</svg>`,threeDotsSvg=Oe$1`<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path d="M7 3.71875C6.0335 3.71875 5.25 2.93525 5.25 1.96875C5.25 1.00225 6.0335 0.21875 7 0.21875C7.9665 0.21875 8.75 1.00225 8.75 1.96875C8.75 2.93525 7.9665 3.71875 7 3.71875Z" fill="#949E9E"/>
  <path d="M7 8.96875C6.0335 8.96875 5.25 8.18525 5.25 7.21875C5.25 6.25225 6.0335 5.46875 7 5.46875C7.9665 5.46875 8.75 6.25225 8.75 7.21875C8.75 8.18525 7.9665 8.96875 7 8.96875Z" fill="#949E9E"/>
  <path d="M5.25 12.4688C5.25 13.4352 6.0335 14.2187 7 14.2187C7.9665 14.2187 8.75 13.4352 8.75 12.4688C8.75 11.5023 7.9665 10.7188 7 10.7188C6.0335 10.7188 5.25 11.5023 5.25 12.4688Z" fill="#949E9E"/>
</svg>`,twitchSvg=Oe$1`<svg fill="none" viewBox="0 0 40 40">
  <g clip-path="url(#a)">
    <g clip-path="url(#b)">
      <circle cx="20" cy="19.89" r="20" fill="#5A3E85" />
      <g clip-path="url(#c)">
        <path
          fill="#fff"
          d="M18.22 25.7 20 23.91h3.34l2.1-2.1v-6.68H15.4v8.78h2.82v1.77Zm3.87-8.16h1.25v3.66H22.1v-3.66Zm-3.34 0H20v3.66h-1.25v-3.66ZM20 7.9a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.69 14.56-3.66 3.66h-2.72l-1.77 1.78h-1.88V26.1H13.3v-9.82l.94-2.4H26.7v8.56Z"
        />
      </g>
    </g>
  </g>
  <defs>
    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
  </defs>
</svg>`,twitterIconSvg=Oe$1`<svg fill="none" viewBox="0 0 16 16">
  <path
    fill="currentColor"
    d="m14.36 4.74.01.42c0 4.34-3.3 9.34-9.34 9.34A9.3 9.3 0 0 1 0 13.03a6.6 6.6 0 0 0 4.86-1.36 3.29 3.29 0 0 1-3.07-2.28c.5.1 1 .07 1.48-.06A3.28 3.28 0 0 1 .64 6.11v-.04c.46.26.97.4 1.49.41A3.29 3.29 0 0 1 1.11 2.1a9.32 9.32 0 0 0 6.77 3.43 3.28 3.28 0 0 1 5.6-3 6.59 6.59 0 0 0 2.08-.8 3.3 3.3 0 0 1-1.45 1.82A6.53 6.53 0 0 0 16 3.04c-.44.66-1 1.23-1.64 1.7Z"
  />
</svg>`,verifySvg=Oe$1`<svg fill="none" viewBox="0 0 28 28">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M18.1 4.76c-.42-.73-1.33-1.01-2.09-.66l-1.42.66c-.37.18-.8.18-1.18 0l-1.4-.65a1.63 1.63 0 0 0-2.1.66l-.84 1.45c-.2.34-.53.59-.92.67l-1.7.35c-.83.17-1.39.94-1.3 1.78l.19 1.56c.04.39-.08.78-.33 1.07l-1.12 1.3c-.52.6-.52 1.5 0 2.11L5 16.38c.25.3.37.68.33 1.06l-.18 1.57c-.1.83.46 1.6 1.28 1.78l1.7.35c.4.08.73.32.93.66l.84 1.43a1.63 1.63 0 0 0 2.09.66l1.41-.66c.37-.17.8-.17 1.18 0l1.43.67c.76.35 1.66.07 2.08-.65l.86-1.45c.2-.34.54-.58.92-.66l1.68-.35A1.63 1.63 0 0 0 22.84 19l-.18-1.57a1.4 1.4 0 0 1 .33-1.06l1.12-1.32c.52-.6.52-1.5 0-2.11l-1.12-1.3a1.4 1.4 0 0 1-.33-1.07l.18-1.57c.1-.83-.46-1.6-1.28-1.77l-1.68-.35a1.4 1.4 0 0 1-.92-.66l-.86-1.47Zm-3.27-3.2a4.43 4.43 0 0 1 5.69 1.78l.54.93 1.07.22a4.43 4.43 0 0 1 3.5 4.84l-.11.96.7.83a4.43 4.43 0 0 1 .02 5.76l-.72.85.1.96a4.43 4.43 0 0 1-3.5 4.84l-1.06.22-.54.92a4.43 4.43 0 0 1-5.68 1.77l-.84-.4-.82.39a4.43 4.43 0 0 1-5.7-1.79l-.51-.89-1.09-.22a4.43 4.43 0 0 1-3.5-4.84l.1-.96-.72-.85a4.43 4.43 0 0 1 .01-5.76l.71-.83-.1-.95a4.43 4.43 0 0 1 3.5-4.84l1.08-.23.53-.9a4.43 4.43 0 0 1 5.7-1.8l.81.38.83-.39ZM18.2 9.4c.65.42.84 1.28.42 1.93l-4.4 6.87a1.4 1.4 0 0 1-2.26.14L9.5 15.39a1.4 1.4 0 0 1 2.15-1.8l1.23 1.48 3.38-5.26a1.4 1.4 0 0 1 1.93-.42Z"
    clip-rule="evenodd"
  />
</svg>`,verifyFilledSvg=Oe$1`<svg fill="none" viewBox="0 0 14 14">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="m4.1 12.43-.45-.78-.93-.2a1.65 1.65 0 0 1-1.31-1.8l.1-.86-.61-.71a1.65 1.65 0 0 1 0-2.16l.6-.7-.09-.85c-.1-.86.47-1.64 1.3-1.81l.94-.2.45-.78A1.65 1.65 0 0 1 6.23.9l.77.36.78-.36c.77-.36 1.69-.07 2.12.66l.47.8.91.2c.84.17 1.4.95 1.31 1.8l-.1.86.6.7c.54.62.54 1.54.01 2.16l-.6.71.09.86c.1.85-.47 1.63-1.3 1.8l-.92.2-.47.79a1.65 1.65 0 0 1-2.12.66L7 12.74l-.77.36c-.78.35-1.7.07-2.13-.67Zm5.74-6.9a1 1 0 1 0-1.68-1.07L6.32 7.3l-.55-.66a1 1 0 0 0-1.54 1.28l1.43 1.71a1 1 0 0 0 1.61-.1l2.57-4Z"
    clip-rule="evenodd"
  />
</svg>`,walletPlaceholderSvg=Oe$1`
  <svg fill="none" viewBox="0 0 48 44">
    <path
      style="fill: var(--wui-color-bg-300);"
      d="M4.56 8.64c-1.23 1.68-1.23 4.08-1.23 8.88v8.96c0 4.8 0 7.2 1.23 8.88.39.55.87 1.02 1.41 1.42C7.65 38 10.05 38 14.85 38h14.3c4.8 0 7.2 0 8.88-1.22a6.4 6.4 0 0 0 1.41-1.42c.83-1.14 1.1-2.6 1.19-4.92a6.4 6.4 0 0 0 5.16-4.65c.21-.81.21-1.8.21-3.79 0-1.98 0-2.98-.22-3.79a6.4 6.4 0 0 0-5.15-4.65c-.1-2.32-.36-3.78-1.19-4.92a6.4 6.4 0 0 0-1.41-1.42C36.35 6 33.95 6 29.15 6h-14.3c-4.8 0-7.2 0-8.88 1.22a6.4 6.4 0 0 0-1.41 1.42Z"
    />
    <path
      style="fill: var(--wui-color-fg-200);"
      fill-rule="evenodd"
      d="M2.27 11.33a6.4 6.4 0 0 1 6.4-6.4h26.66a6.4 6.4 0 0 1 6.4 6.4v1.7a6.4 6.4 0 0 1 5.34 6.3v5.34a6.4 6.4 0 0 1-5.34 6.3v1.7a6.4 6.4 0 0 1-6.4 6.4H8.67a6.4 6.4 0 0 1-6.4-6.4V11.33ZM39.6 31.07h-6.93a9.07 9.07 0 1 1 0-18.14h6.93v-1.6a4.27 4.27 0 0 0-4.27-4.26H8.67a4.27 4.27 0 0 0-4.27 4.26v21.34a4.27 4.27 0 0 0 4.27 4.26h26.66a4.27 4.27 0 0 0 4.27-4.26v-1.6Zm-6.93-16a6.93 6.93 0 0 0 0 13.86h8a4.27 4.27 0 0 0 4.26-4.26v-5.34a4.27 4.27 0 0 0-4.26-4.26h-8Z"
      clip-rule="evenodd"
    />
  </svg>
`,walletSvg=Oe$1`<svg fill="none" viewBox="0 0 20 20">
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M0 5.5c0-1.8 1.46-3.25 3.25-3.25H14.5c1.8 0 3.25 1.46 3.25 3.25v.28A3.25 3.25 0 0 1 20 8.88v2.24c0 1.45-.94 2.68-2.25 3.1v.28c0 1.8-1.46 3.25-3.25 3.25H3.25A3.25 3.25 0 0 1 0 14.5v-9Zm15.75 8.88h-2.38a4.38 4.38 0 0 1 0-8.76h2.38V5.5c0-.69-.56-1.25-1.25-1.25H3.25C2.56 4.25 2 4.81 2 5.5v9c0 .69.56 1.25 1.25 1.25H14.5c.69 0 1.25-.56 1.25-1.25v-.13Zm-2.38-6.76a2.37 2.37 0 1 0 0 4.75h3.38c.69 0 1.25-.55 1.25-1.24V8.87c0-.69-.56-1.24-1.25-1.24h-3.38Z"
    clip-rule="evenodd"
  />
</svg>`,walletConnectSvg=Oe$1`<svg fill="none" viewBox="0 0 96 67">
  <path
    fill="currentColor"
    d="M25.32 18.8a32.56 32.56 0 0 1 45.36 0l1.5 1.47c.63.62.63 1.61 0 2.22l-5.15 5.05c-.31.3-.82.3-1.14 0l-2.07-2.03a22.71 22.71 0 0 0-31.64 0l-2.22 2.18c-.31.3-.82.3-1.14 0l-5.15-5.05a1.55 1.55 0 0 1 0-2.22l1.65-1.62Zm56.02 10.44 4.59 4.5c.63.6.63 1.6 0 2.21l-20.7 20.26c-.62.61-1.63.61-2.26 0L48.28 41.83a.4.4 0 0 0-.56 0L33.03 56.21c-.63.61-1.64.61-2.27 0L10.07 35.95a1.55 1.55 0 0 1 0-2.22l4.59-4.5a1.63 1.63 0 0 1 2.27 0L31.6 43.63a.4.4 0 0 0 .57 0l14.69-14.38a1.63 1.63 0 0 1 2.26 0l14.69 14.38a.4.4 0 0 0 .57 0l14.68-14.38a1.63 1.63 0 0 1 2.27 0Z"
  />
  <path
    stroke="#000"
    stroke-opacity=".1"
    d="M25.67 19.15a32.06 32.06 0 0 1 44.66 0l1.5 1.48c.43.42.43 1.09 0 1.5l-5.15 5.05a.31.31 0 0 1-.44 0l-2.07-2.03a23.21 23.21 0 0 0-32.34 0l-2.22 2.18a.31.31 0 0 1-.44 0l-5.15-5.05a1.05 1.05 0 0 1 0-1.5l1.65-1.63ZM81 29.6l4.6 4.5c.42.41.42 1.09 0 1.5l-20.7 20.26c-.43.43-1.14.43-1.57 0L48.63 41.47a.9.9 0 0 0-1.26 0L32.68 55.85c-.43.43-1.14.43-1.57 0L10.42 35.6a1.05 1.05 0 0 1 0-1.5l4.59-4.5a1.13 1.13 0 0 1 1.57 0l14.68 14.38a.9.9 0 0 0 1.27 0l-.35-.35.35.35L47.22 29.6a1.13 1.13 0 0 1 1.56 0l14.7 14.38a.9.9 0 0 0 1.26 0L79.42 29.6a1.13 1.13 0 0 1 1.57 0Z"
  />
</svg>`,walletConnectLightBrownSvg=Oe$1`
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_22274_4692)">
<path d="M0 6.64C0 4.17295 0 2.93942 0.525474 2.01817C0.880399 1.39592 1.39592 0.880399 2.01817 0.525474C2.93942 0 4.17295 0 6.64 0H9.36C11.8271 0 13.0606 0 13.9818 0.525474C14.6041 0.880399 15.1196 1.39592 15.4745 2.01817C16 2.93942 16 4.17295 16 6.64V9.36C16 11.8271 16 13.0606 15.4745 13.9818C15.1196 14.6041 14.6041 15.1196 13.9818 15.4745C13.0606 16 11.8271 16 9.36 16H6.64C4.17295 16 2.93942 16 2.01817 15.4745C1.39592 15.1196 0.880399 14.6041 0.525474 13.9818C0 13.0606 0 11.8271 0 9.36V6.64Z" fill="#C7B994"/>
<path d="M4.49038 5.76609C6.42869 3.86833 9.5713 3.86833 11.5096 5.76609L11.7429 5.99449C11.8398 6.08938 11.8398 6.24323 11.7429 6.33811L10.9449 7.11942C10.8964 7.16686 10.8179 7.16686 10.7694 7.11942L10.4484 6.80512C9.09617 5.48119 6.90381 5.48119 5.5516 6.80512L5.20782 7.14171C5.15936 7.18915 5.08079 7.18915 5.03234 7.14171L4.23434 6.3604C4.13742 6.26552 4.13742 6.11167 4.23434 6.01678L4.49038 5.76609ZM13.1599 7.38192L13.8702 8.07729C13.9671 8.17217 13.9671 8.32602 13.8702 8.4209L10.6677 11.5564C10.5708 11.6513 10.4137 11.6513 10.3168 11.5564L8.04388 9.33105C8.01965 9.30733 7.98037 9.30733 7.95614 9.33105L5.6833 11.5564C5.58638 11.6513 5.42925 11.6513 5.33234 11.5564L2.12982 8.42087C2.0329 8.32598 2.0329 8.17213 2.12982 8.07724L2.84004 7.38188C2.93695 7.28699 3.09408 7.28699 3.191 7.38188L5.46392 9.60726C5.48815 9.63098 5.52743 9.63098 5.55166 9.60726L7.82447 7.38188C7.92138 7.28699 8.07851 7.28699 8.17543 7.38187L10.4484 9.60726C10.4726 9.63098 10.5119 9.63098 10.5361 9.60726L12.809 7.38192C12.9059 7.28703 13.063 7.28703 13.1599 7.38192Z" fill="#202020"/>
</g>
<defs>
<clipPath id="clip0_22274_4692">
<path d="M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8Z" fill="white"/>
</clipPath>
</defs>
</svg>
`,warningCircleSvg=Oe$1`<svg fill="none" viewBox="0 0 20 20">
  <path
    fill="currentColor"
    d="M11 6.67a1 1 0 1 0-2 0v2.66a1 1 0 0 0 2 0V6.67ZM10 14.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"
  />
  <path
    fill="currentColor"
    fill-rule="evenodd"
    d="M10 1a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-7 9a7 7 0 1 1 14 0 7 7 0 0 1-14 0Z"
    clip-rule="evenodd"
  />
</svg>`,lightbulbSvg$1=Oe$1`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.00177 1.78569C3.8179 1.78569 2.85819 2.74508 2.85819 3.92855C2.85819 4.52287 3.09928 5.05956 3.49077 5.4485L3.5005 5.45817C3.64381 5.60054 3.76515 5.72108 3.85631 5.81845C3.93747 5.90512 4.05255 6.03218 4.12889 6.1805C4.16999 6.26034 4.19 6.30843 4.21768 6.39385C4.22145 6.40546 4.22499 6.41703 4.22833 6.42855H5.77521C5.77854 6.41703 5.78208 6.40547 5.78585 6.39385C5.81353 6.30843 5.83354 6.26034 5.87464 6.1805C5.95098 6.03218 6.06606 5.90512 6.14722 5.81845C6.23839 5.72108 6.35973 5.60053 6.50304 5.45816L6.51276 5.4485C6.90425 5.05956 7.14534 4.52287 7.14534 3.92855C7.14534 2.74508 6.18563 1.78569 5.00177 1.78569ZM5.71629 7.85712H4.28724C4.28724 8.21403 4.28876 8.40985 4.30703 8.54571C4.30727 8.54748 4.30751 8.54921 4.30774 8.55091C4.30944 8.55115 4.31118 8.55138 4.31295 8.55162C4.44884 8.56989 4.64474 8.5714 5.00177 8.5714C5.3588 8.5714 5.55469 8.56989 5.69059 8.55162C5.69236 8.55138 5.69409 8.55115 5.69579 8.55091C5.69603 8.54921 5.69627 8.54748 5.6965 8.54571C5.71477 8.40985 5.71629 8.21403 5.71629 7.85712ZM2.85819 7.14283C2.85819 6.9948 2.85796 6.91114 2.8548 6.85032C2.85461 6.84656 2.85441 6.84309 2.85421 6.83988C2.84393 6.8282 2.83047 6.81334 2.81301 6.79469C2.74172 6.71856 2.63908 6.61643 2.48342 6.46178C1.83307 5.81566 1.42914 4.91859 1.42914 3.92855C1.42914 1.9561 3.02866 0.357117 5.00177 0.357117C6.97487 0.357117 8.57439 1.9561 8.57439 3.92855C8.57439 4.91859 8.17047 5.81566 7.52012 6.46178C7.36445 6.61643 7.26182 6.71856 7.19053 6.79469C7.17306 6.81334 7.1596 6.8282 7.14932 6.83988C7.14912 6.84309 7.14892 6.84656 7.14873 6.85032C7.14557 6.91114 7.14534 6.9948 7.14534 7.14283V7.85712C7.14534 7.87009 7.14535 7.88304 7.14535 7.89598C7.14541 8.19889 7.14547 8.49326 7.11281 8.73606C7.076 9.00978 6.98631 9.32212 6.72678 9.58156C6.46726 9.841 6.15481 9.93065 5.881 9.96745C5.63813 10.0001 5.34365 10 5.04064 9.99998C5.0277 9.99998 5.01474 9.99998 5.00177 9.99998C4.98879 9.99998 4.97583 9.99998 4.96289 9.99998C4.65988 10 4.36541 10.0001 4.12253 9.96745C3.84872 9.93065 3.53628 9.841 3.27675 9.58156C3.01722 9.32212 2.92753 9.00978 2.89072 8.73606C2.85807 8.49326 2.85812 8.19889 2.85818 7.89598C2.85819 7.88304 2.85819 7.87008 2.85819 7.85712V7.14283ZM7.1243 6.86977C7.12366 6.87069 7.1233 6.87116 7.12327 6.87119C7.12323 6.87123 7.12356 6.87076 7.1243 6.86977ZM2.88027 6.8712C2.88025 6.87119 2.87988 6.8707 2.87921 6.86975C2.87995 6.87072 2.88028 6.8712 2.88027 6.8712Z" fill="#949E9E"/>
</svg>`,idSvg=Oe$1`<svg
 xmlns="http://www.w3.org/2000/svg"
 width="28"
 height="28"
 viewBox="0 0 28 28"
 fill="none">
  <path
    fill="#949E9E"
    fill-rule="evenodd"
    d="M7.974 2.975h12.052c1.248 0 2.296 0 3.143.092.89.096 1.723.307 2.461.844a4.9 4.9 0 0 1 1.084 1.084c.537.738.748 1.57.844 2.461.092.847.092 1.895.092 3.143v6.802c0 1.248 0 2.296-.092 3.143-.096.89-.307 1.723-.844 2.461a4.9 4.9 0 0 1-1.084 1.084c-.738.537-1.57.748-2.461.844-.847.092-1.895.092-3.143.092H7.974c-1.247 0-2.296 0-3.143-.092-.89-.096-1.723-.307-2.461-.844a4.901 4.901 0 0 1-1.084-1.084c-.537-.738-.748-1.571-.844-2.461C.35 19.697.35 18.649.35 17.4v-6.802c0-1.248 0-2.296.092-3.143.096-.89.307-1.723.844-2.461A4.9 4.9 0 0 1 2.37 3.91c.738-.537 1.571-.748 2.461-.844.847-.092 1.895-.092 3.143-.092ZM5.133 5.85c-.652.071-.936.194-1.117.326a2.1 2.1 0 0 0-.465.465c-.132.181-.255.465-.325 1.117-.074.678-.076 1.573-.076 2.917v6.65c0 1.344.002 2.239.076 2.917.07.652.193.936.325 1.117a2.1 2.1 0 0 0 .465.465c.181.132.465.255 1.117.326.678.073 1.574.075 2.917.075h11.9c1.344 0 2.239-.002 2.917-.075.652-.071.936-.194 1.117-.326.179-.13.335-.286.465-.465.132-.181.255-.465.326-1.117.073-.678.075-1.573.075-2.917v-6.65c0-1.344-.002-2.239-.075-2.917-.071-.652-.194-.936-.326-1.117a2.1 2.1 0 0 0-.465-.465c-.181-.132-.465-.255-1.117-.326-.678-.073-1.573-.075-2.917-.075H8.05c-1.343 0-2.239.002-2.917.075Zm.467 7.275a3.15 3.15 0 1 1 6.3 0 3.15 3.15 0 0 1-6.3 0Zm8.75-1.75a1.4 1.4 0 0 1 1.4-1.4h3.5a1.4 1.4 0 0 1 0 2.8h-3.5a1.4 1.4 0 0 1-1.4-1.4Zm0 5.25a1.4 1.4 0 0 1 1.4-1.4H21a1.4 1.4 0 1 1 0 2.8h-5.25a1.4 1.4 0 0 1-1.4-1.4Z"
    clip-rule="evenodd"/>
</svg>`,xSvg=Oe$1`<svg fill="none" viewBox="0 0 41 40">
  <g clip-path="url(#a)">
    <path fill="#000" d="M.8 0h40v40H.8z" />
    <path
      fill="#fff"
      d="m22.63 18.46 7.14-8.3h-1.69l-6.2 7.2-4.96-7.2H11.2l7.5 10.9-7.5 8.71h1.7l6.55-7.61 5.23 7.61h5.72l-7.77-11.31Zm-9.13-7.03h2.6l11.98 17.13h-2.6L13.5 11.43Z"
    />
  </g>
  <defs>
    <clipPath id="a"><path fill="#fff" d="M.8 20a20 20 0 1 1 40 0 20 20 0 0 1-40 0Z" /></clipPath>
  </defs>
</svg>`,infoSvg=Oe$1`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.125 6.875C9.125 6.57833 9.21298 6.28832 9.3778 6.04165C9.54262 5.79497 9.77689 5.60271 10.051 5.48918C10.3251 5.37565 10.6267 5.34594 10.9176 5.40382C11.2086 5.4617 11.4759 5.60456 11.6857 5.81434C11.8954 6.02412 12.0383 6.29139 12.0962 6.58236C12.1541 6.87334 12.1244 7.17494 12.0108 7.44903C11.8973 7.72311 11.705 7.95738 11.4584 8.1222C11.2117 8.28703 10.9217 8.375 10.625 8.375C10.2272 8.375 9.84565 8.21696 9.56434 7.93566C9.28304 7.65436 9.125 7.27282 9.125 6.875ZM21.125 11C21.125 13.0025 20.5312 14.9601 19.4186 16.6251C18.3061 18.2902 16.7248 19.5879 14.8747 20.3543C13.0246 21.1206 10.9888 21.3211 9.02471 20.9305C7.06066 20.5398 5.25656 19.5755 3.84055 18.1595C2.42454 16.7435 1.46023 14.9393 1.06955 12.9753C0.678878 11.0112 0.879387 8.97543 1.64572 7.12533C2.41206 5.27523 3.70981 3.69392 5.37486 2.58137C7.0399 1.46882 8.99747 0.875 11 0.875C13.6844 0.877978 16.258 1.94567 18.1562 3.84383C20.0543 5.74199 21.122 8.3156 21.125 11ZM18.875 11C18.875 9.44247 18.4131 7.91992 17.5478 6.62488C16.6825 5.32985 15.4526 4.32049 14.0136 3.72445C12.5747 3.12841 10.9913 2.97246 9.46367 3.27632C7.93607 3.58017 6.53288 4.3302 5.43154 5.43153C4.3302 6.53287 3.58018 7.93606 3.27632 9.46366C2.97246 10.9913 3.12841 12.5747 3.72445 14.0136C4.32049 15.4526 5.32985 16.6825 6.62489 17.5478C7.91993 18.4131 9.44248 18.875 11 18.875C13.0879 18.8728 15.0896 18.0424 16.566 16.566C18.0424 15.0896 18.8728 13.0879 18.875 11ZM12.125 14.4387V11.375C12.125 10.8777 11.9275 10.4008 11.5758 10.0492C11.2242 9.69754 10.7473 9.5 10.25 9.5C9.98433 9.4996 9.72708 9.59325 9.52383 9.76435C9.32058 9.93544 9.18444 10.173 9.13952 10.4348C9.09461 10.6967 9.14381 10.966 9.27843 11.195C9.41304 11.4241 9.62438 11.5981 9.875 11.6863V14.75C9.875 15.2473 10.0725 15.7242 10.4242 16.0758C10.7758 16.4275 11.2527 16.625 11.75 16.625C12.0157 16.6254 12.2729 16.5318 12.4762 16.3607C12.6794 16.1896 12.8156 15.952 12.8605 15.6902C12.9054 15.4283 12.8562 15.159 12.7216 14.93C12.587 14.7009 12.3756 14.5269 12.125 14.4387Z" fill="currentColor"/>
</svg>`,exclamationTriangleSvg=Oe$1`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.0162 11.6312L9.55059 2.13937C9.39228 1.86862 9.16584 1.64405 8.8938 1.48798C8.62176 1.33192 8.3136 1.2498 7.99997 1.2498C7.68634 1.2498 7.37817 1.33192 7.10613 1.48798C6.83409 1.64405 6.60765 1.86862 6.44934 2.13937L0.983716 11.6312C0.830104 11.894 0.749146 12.1928 0.749146 12.4972C0.749146 12.8015 0.830104 13.1004 0.983716 13.3631C1.14027 13.6352 1.3664 13.8608 1.63889 14.0166C1.91139 14.1725 2.22044 14.253 2.53434 14.25H13.4656C13.7793 14.2528 14.0881 14.1721 14.3603 14.0163C14.6326 13.8604 14.8585 13.635 15.015 13.3631C15.1688 13.1005 15.2499 12.8017 15.2502 12.4973C15.2504 12.193 15.1696 11.8941 15.0162 11.6312ZM13.7162 12.6125C13.6908 12.6558 13.6541 12.6914 13.6101 12.7157C13.5661 12.7399 13.5164 12.7517 13.4662 12.75H2.53434C2.48415 12.7517 2.43442 12.7399 2.39042 12.7157C2.34641 12.6914 2.30976 12.6558 2.28434 12.6125C2.26278 12.5774 2.25137 12.5371 2.25137 12.4959C2.25137 12.4548 2.26278 12.4144 2.28434 12.3794L7.74997 2.88749C7.77703 2.84583 7.81408 2.8116 7.85774 2.7879C7.9014 2.7642 7.95029 2.75178 7.99997 2.75178C8.04964 2.75178 8.09854 2.7642 8.1422 2.7879C8.18586 2.8116 8.2229 2.84583 8.24997 2.88749L13.715 12.3794C13.7367 12.4143 13.7483 12.4546 13.7486 12.4958C13.7488 12.5369 13.7376 12.5773 13.7162 12.6125ZM7.24997 8.49999V6.49999C7.24997 6.30108 7.32898 6.11031 7.46964 5.96966C7.61029 5.82901 7.80105 5.74999 7.99997 5.74999C8.19888 5.74999 8.38964 5.82901 8.5303 5.96966C8.67095 6.11031 8.74997 6.30108 8.74997 6.49999V8.49999C8.74997 8.6989 8.67095 8.88967 8.5303 9.03032C8.38964 9.17097 8.19888 9.24999 7.99997 9.24999C7.80105 9.24999 7.61029 9.17097 7.46964 9.03032C7.32898 8.88967 7.24997 8.6989 7.24997 8.49999ZM8.99997 11C8.99997 11.1978 8.94132 11.3911 8.83144 11.5556C8.72155 11.72 8.56538 11.8482 8.38265 11.9239C8.19992 11.9996 7.99886 12.0194 7.80488 11.9808C7.6109 11.9422 7.43271 11.847 7.29286 11.7071C7.15301 11.5672 7.05777 11.3891 7.01918 11.1951C6.9806 11.0011 7.0004 10.8 7.07609 10.6173C7.15177 10.4346 7.27995 10.2784 7.4444 10.1685C7.60885 10.0586 7.80219 9.99999 7.99997 9.99999C8.26518 9.99999 8.51954 10.1053 8.70707 10.2929C8.89461 10.4804 8.99997 10.7348 8.99997 11Z" fill="currentColor"/>
</svg>
`;var __decorate$2R=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const svgOptions$1={add:addSvg,allWallets:allWalletsSvg,arrowBottomCircle:arrowBottomCircleSvg,appStore:appStoreSvg,apple:appleSvg,arrowBottom:arrowBottomSvg,arrowLeft:arrowLeftSvg,arrowRight:arrowRightSvg,arrowTop:arrowTopSvg,bank:bankSvg,browser:browserSvg$1,card:cardSvg,checkmark:checkmarkSvg,checkmarkBold:checkmarkBoldSvg,chevronBottom:chevronBottomSvg,chevronLeft:chevronLeftSvg,chevronRight:chevronRightSvg,chevronTop:chevronTopSvg,chromeStore:chromeStoreSvg,clock:clockSvg,close:closeSvg,compass:compassSvg,coinPlaceholder:coinPlaceholderSvg,copy:copySvg,cursor:cursorSvg,cursorTransparent:cursorTransparentSvg,desktop:desktopSvg,disconnect:disconnectSvg,discord:discordSvg,etherscan:etherscanSvg,extension:extensionSvg,externalLink:externalLinkSvg,facebook:facebookSvg,farcaster:farcasterSvg,filters:filtersSvg,github:githubSvg,google:googleSvg$1,helpCircle:helpCircleSvg,image:imageSvg,id:idSvg,infoCircle:infoCircleSvg,lightbulb:lightbulbSvg$1,mail:mailSvg,mobile:mobileSvg,more:moreSvg,networkPlaceholder:networkPlaceholderSvg,nftPlaceholder:nftPlaceholderSvg,off:offSvg,playStore:playStoreSvg,plus:plusSvg,qrCode:qrCodeIcon,recycleHorizontal:recycleHorizontalSvg,refresh:refreshSvg,search:searchSvg,send:sendSvg,swapHorizontal:swapHorizontalSvg,swapHorizontalMedium:swapHorizontalMediumSvg,swapHorizontalBold:swapHorizontalBoldSvg,swapHorizontalRoundedBold:swapHorizontalRoundedBoldSvg,swapVertical:swapVerticalSvg,telegram:telegramSvg,threeDots:threeDotsSvg,twitch:twitchSvg,twitter:xSvg,twitterIcon:twitterIconSvg,verify:verifySvg,verifyFilled:verifyFilledSvg,wallet:walletSvg,walletConnect:walletConnectSvg,walletConnectLightBrown:walletConnectLightBrownSvg,walletPlaceholder:walletPlaceholderSvg,warningCircle:warningCircleSvg,x:xSvg,info:infoSvg,exclamationTriangle:exclamationTriangleSvg};let WuiIcon=class extends h$3{constructor(){super(...arguments),this.size="md",this.name="copy",this.color="fg-300"}render(){return this.style.cssText=`
      --local-color: ${`var(--wui-color-${this.color});`}
      --local-width: ${`var(--wui-icon-size-${this.size});`}
    `,ke`${svgOptions$1[this.name]}`}};WuiIcon.styles=[resetStyles,colorStyles,styles$2f];__decorate$2R([n$4()],WuiIcon.prototype,"size",void 0);__decorate$2R([n$4()],WuiIcon.prototype,"name",void 0);__decorate$2R([n$4()],WuiIcon.prototype,"color",void 0);WuiIcon=__decorate$2R([customElement("wui-icon")],WuiIcon);const styles$2e=i$4`
  :host {
    display: block;
    width: var(--local-width);
    height: var(--local-height);
  }

  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: inherit;
  }
`;var __decorate$2Q=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiImage=class extends h$3{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0}render(){return this.style.cssText=`
      --local-width: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"};
      --local-height: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"};
      `,ke`<img src=${this.src} alt=${this.alt} @error=${this.handleImageError} />`}handleImageError(){this.dispatchEvent(new CustomEvent("onLoadError",{bubbles:!0,composed:!0}))}};WuiImage.styles=[resetStyles,colorStyles,styles$2e];__decorate$2Q([n$4()],WuiImage.prototype,"src",void 0);__decorate$2Q([n$4()],WuiImage.prototype,"alt",void 0);__decorate$2Q([n$4()],WuiImage.prototype,"size",void 0);WuiImage=__decorate$2Q([customElement("wui-image")],WuiImage);const styles$2d=i$4`
  :host {
    display: block;
    width: var(--wui-box-size-lg);
    height: var(--wui-box-size-lg);
  }

  svg {
    width: var(--wui-box-size-lg);
    height: var(--wui-box-size-lg);
    fill: none;
    stroke: transparent;
    stroke-linecap: round;
  }

  use {
    stroke: var(--wui-color-accent-100);
    stroke-width: 2px;
    stroke-dasharray: 54, 118;
    stroke-dashoffset: 172;
    animation: dash 1s linear infinite;
  }

  @keyframes dash {
    to {
      stroke-dashoffset: 0px;
    }
  }
`;var __decorate$2P=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiLoadingHexagon=class extends h$3{render(){return ke`
      <svg viewBox="0 0 54 59">
        <path
          id="wui-loader-path"
          d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"
        />
        <use xlink:href="#wui-loader-path"></use>
      </svg>
    `}};WuiLoadingHexagon.styles=[resetStyles,styles$2d];WuiLoadingHexagon=__decorate$2P([customElement("wui-loading-hexagon")],WuiLoadingHexagon);const styles$2c=i$4`
  :host {
    display: flex;
  }

  :host([data-size='sm']) > svg {
    width: 12px;
    height: 12px;
  }

  :host([data-size='md']) > svg {
    width: 16px;
    height: 16px;
  }

  :host([data-size='lg']) > svg {
    width: 24px;
    height: 24px;
  }

  :host([data-size='xl']) > svg {
    width: 32px;
    height: 32px;
  }

  svg {
    animation: rotate 2s linear infinite;
  }

  circle {
    fill: none;
    stroke: var(--local-color);
    stroke-width: 4px;
    stroke-dasharray: 1, 124;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
  }

  :host([data-size='md']) > svg > circle {
    stroke-width: 6px;
  }

  :host([data-size='sm']) > svg > circle {
    stroke-width: 8px;
  }

  @keyframes rotate {
    100% {
      transform: rotate(360deg);
    }
  }

  @keyframes dash {
    0% {
      stroke-dasharray: 1, 124;
      stroke-dashoffset: 0;
    }

    50% {
      stroke-dasharray: 90, 124;
      stroke-dashoffset: -35;
    }

    100% {
      stroke-dashoffset: -125;
    }
  }
`;var __decorate$2O=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiLoadingSpinner=class extends h$3{constructor(){super(...arguments),this.color="accent-100",this.size="lg"}render(){return this.style.cssText=`--local-color: ${this.color==="inherit"?"inherit":`var(--wui-color-${this.color})`}`,this.dataset.size=this.size,ke`<svg viewBox="25 25 50 50">
      <circle r="20" cy="50" cx="50"></circle>
    </svg>`}};WuiLoadingSpinner.styles=[resetStyles,styles$2c];__decorate$2O([n$4()],WuiLoadingSpinner.prototype,"color",void 0);__decorate$2O([n$4()],WuiLoadingSpinner.prototype,"size",void 0);WuiLoadingSpinner=__decorate$2O([customElement("wui-loading-spinner")],WuiLoadingSpinner);const styles$2b=i$4`
  :host {
    display: block;
    width: var(--wui-box-size-md);
    height: var(--wui-box-size-md);
  }

  svg {
    width: var(--wui-box-size-md);
    height: var(--wui-box-size-md);
  }

  rect {
    fill: none;
    stroke: var(--wui-color-accent-100);
    stroke-width: 4px;
    stroke-linecap: round;
    animation: dash 1s linear infinite;
  }

  @keyframes dash {
    to {
      stroke-dashoffset: 0px;
    }
  }
`;var __decorate$2N=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiLoadingThumbnail=class extends h$3{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const Mn=this.radius>50?50:this.radius,is=36-Mn,os=116+is,as=245+is,us=360+is*1.75;return ke`
      <svg viewBox="0 0 110 110" width="110" height="110">
        <rect
          x="2"
          y="2"
          width="106"
          height="106"
          rx=${Mn}
          stroke-dasharray="${os} ${as}"
          stroke-dashoffset=${us}
        />
      </svg>
    `}};WuiLoadingThumbnail.styles=[resetStyles,styles$2b];__decorate$2N([n$4({type:Number})],WuiLoadingThumbnail.prototype,"radius",void 0);WuiLoadingThumbnail=__decorate$2N([customElement("wui-loading-thumbnail")],WuiLoadingThumbnail);const styles$2a=i$4`
  :host {
    display: block;
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
    background: linear-gradient(
      120deg,
      var(--wui-color-bg-200) 5%,
      var(--wui-color-bg-200) 48%,
      var(--wui-color-bg-300) 55%,
      var(--wui-color-bg-300) 60%,
      var(--wui-color-bg-300) calc(60% + 10px),
      var(--wui-color-bg-200) calc(60% + 12px),
      var(--wui-color-bg-200) 100%
    );
    background-size: 250%;
    animation: shimmer 3s linear infinite reverse;
  }

  :host([variant='light']) {
    background: linear-gradient(
      120deg,
      var(--wui-color-bg-150) 5%,
      var(--wui-color-bg-150) 48%,
      var(--wui-color-bg-200) 55%,
      var(--wui-color-bg-200) 60%,
      var(--wui-color-bg-200) calc(60% + 10px),
      var(--wui-color-bg-150) calc(60% + 12px),
      var(--wui-color-bg-150) 100%
    );
    background-size: 250%;
  }

  @keyframes shimmer {
    from {
      background-position: -250% 0;
    }
    to {
      background-position: 250% 0;
    }
  }
`;var __decorate$2M=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiShimmer=class extends h$3{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m",this.variant="default"}render(){return this.style.cssText=`
      width: ${this.width};
      height: ${this.height};
      border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`};
    `,ke`<slot></slot>`}};WuiShimmer.styles=[styles$2a];__decorate$2M([n$4()],WuiShimmer.prototype,"width",void 0);__decorate$2M([n$4()],WuiShimmer.prototype,"height",void 0);__decorate$2M([n$4()],WuiShimmer.prototype,"borderRadius",void 0);__decorate$2M([n$4()],WuiShimmer.prototype,"variant",void 0);WuiShimmer=__decorate$2M([customElement("wui-shimmer")],WuiShimmer);/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const t$1={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e$2=Fn=>(...Mn)=>({_$litDirective$:Fn,values:Mn});let i$2=class{constructor(Mn){}get _$AU(){return this._$AM._$AU}_$AT(Mn,rs,is){this.t=Mn,this._$AM=rs,this.i=is}_$AS(Mn,rs){return this.update(Mn,rs)}update(Mn,rs){return this.render(...rs)}};/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const Rt$1=e$2(class extends i$2{constructor(Fn){var Mn;if(super(Fn),Fn.type!==t$1.ATTRIBUTE||Fn.name!=="class"||((Mn=Fn.strings)==null?void 0:Mn.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(Fn){return" "+Object.keys(Fn).filter(Mn=>Fn[Mn]).join(" ")+" "}update(Fn,[Mn]){var is,os;if(this.st===void 0){this.st=new Set,Fn.strings!==void 0&&(this.nt=new Set(Fn.strings.join(" ").split(/\s/).filter(as=>as!=="")));for(const as in Mn)Mn[as]&&!((is=this.nt)!=null&&is.has(as))&&this.st.add(as);return this.render(Mn)}const rs=Fn.element.classList;for(const as of this.st)as in Mn||(rs.remove(as),this.st.delete(as));for(const as in Mn){const us=!!Mn[as];us===this.st.has(as)||(os=this.nt)!=null&&os.has(as)||(us?(rs.add(as),this.st.add(as)):(rs.remove(as),this.st.delete(as)))}return R$2}}),styles$29=i$4`
  :host {
    display: inline-flex !important;
  }

  slot {
    width: 100%;
    display: inline-block;
    font-style: normal;
    font-family: var(--wui-font-family);
    font-feature-settings:
      'tnum' on,
      'lnum' on,
      'case' on;
    line-height: 130%;
    font-weight: var(--wui-font-weight-regular);
    overflow: inherit;
    text-overflow: inherit;
    text-align: var(--local-align);
    color: var(--local-color);
  }

  .wui-line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .wui-line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .wui-font-medium-400 {
    font-size: var(--wui-font-size-medium);
    font-weight: var(--wui-font-weight-light);
    letter-spacing: var(--wui-letter-spacing-medium);
  }

  .wui-font-medium-600 {
    font-size: var(--wui-font-size-medium);
    letter-spacing: var(--wui-letter-spacing-medium);
  }

  .wui-font-title-600 {
    font-size: var(--wui-font-size-title);
    letter-spacing: var(--wui-letter-spacing-title);
  }

  .wui-font-title-6-600 {
    font-size: var(--wui-font-size-title-6);
    letter-spacing: var(--wui-letter-spacing-title-6);
  }

  .wui-font-mini-700 {
    font-size: var(--wui-font-size-mini);
    letter-spacing: var(--wui-letter-spacing-mini);
    text-transform: uppercase;
  }

  .wui-font-large-500,
  .wui-font-large-600,
  .wui-font-large-700 {
    font-size: var(--wui-font-size-large);
    letter-spacing: var(--wui-letter-spacing-large);
  }

  .wui-font-2xl-500,
  .wui-font-2xl-600,
  .wui-font-2xl-700 {
    font-size: var(--wui-font-size-2xl);
    letter-spacing: var(--wui-letter-spacing-2xl);
  }

  .wui-font-paragraph-400,
  .wui-font-paragraph-500,
  .wui-font-paragraph-600,
  .wui-font-paragraph-700 {
    font-size: var(--wui-font-size-paragraph);
    letter-spacing: var(--wui-letter-spacing-paragraph);
  }

  .wui-font-small-400,
  .wui-font-small-500,
  .wui-font-small-600 {
    font-size: var(--wui-font-size-small);
    letter-spacing: var(--wui-letter-spacing-small);
  }

  .wui-font-tiny-400,
  .wui-font-tiny-500,
  .wui-font-tiny-600 {
    font-size: var(--wui-font-size-tiny);
    letter-spacing: var(--wui-letter-spacing-tiny);
  }

  .wui-font-micro-700,
  .wui-font-micro-600 {
    font-size: var(--wui-font-size-micro);
    letter-spacing: var(--wui-letter-spacing-micro);
    text-transform: uppercase;
  }

  .wui-font-tiny-400,
  .wui-font-small-400,
  .wui-font-medium-400,
  .wui-font-paragraph-400 {
    font-weight: var(--wui-font-weight-light);
  }

  .wui-font-large-700,
  .wui-font-paragraph-700,
  .wui-font-micro-700,
  .wui-font-mini-700 {
    font-weight: var(--wui-font-weight-bold);
  }

  .wui-font-medium-600,
  .wui-font-medium-title-600,
  .wui-font-title-6-600,
  .wui-font-large-600,
  .wui-font-paragraph-600,
  .wui-font-small-600,
  .wui-font-tiny-600,
  .wui-font-micro-600 {
    font-weight: var(--wui-font-weight-medium);
  }

  :host([disabled]) {
    opacity: 0.4;
  }
`;var __decorate$2L=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiText=class extends h$3{constructor(){super(...arguments),this.variant="paragraph-500",this.color="fg-300",this.align="left",this.lineClamp=void 0}render(){const Mn={[`wui-font-${this.variant}`]:!0,[`wui-color-${this.color}`]:!0,[`wui-line-clamp-${this.lineClamp}`]:!!this.lineClamp};return this.style.cssText=`
      --local-align: ${this.align};
      --local-color: var(--wui-color-${this.color});
    `,ke`<slot class=${Rt$1(Mn)}></slot>`}};WuiText.styles=[resetStyles,styles$29];__decorate$2L([n$4()],WuiText.prototype,"variant",void 0);__decorate$2L([n$4()],WuiText.prototype,"color",void 0);__decorate$2L([n$4()],WuiText.prototype,"align",void 0);__decorate$2L([n$4()],WuiText.prototype,"lineClamp",void 0);WuiText=__decorate$2L([customElement("wui-text")],WuiText);const browserSvg=Oe$1`<svg fill="none" viewBox="0 0 60 60">
  <rect width="60" height="60" fill="#1DC956" rx="30" />
  <circle cx="30" cy="30" r="3" fill="#fff" />
  <path
    fill="#2BEE6C"
    stroke="#fff"
    stroke-width="2"
    d="m45.32 17.9-.88-.42.88.42.02-.05c.1-.2.21-.44.26-.7l-.82-.15.82.16a2 2 0 0 0-.24-1.4c-.13-.23-.32-.42-.47-.57a8.42 8.42 0 0 1-.04-.04l-.04-.04a2.9 2.9 0 0 0-.56-.47l-.51.86.5-.86a2 2 0 0 0-1.4-.24c-.26.05-.5.16-.69.26l-.05.02-15.05 7.25-.1.05c-1.14.55-1.85.89-2.46 1.37a7 7 0 0 0-1.13 1.14c-.5.6-.83 1.32-1.38 2.45l-.05.11-7.25 15.05-.02.05c-.1.2-.21.43-.26.69a2 2 0 0 0 .24 1.4l.85-.5-.85.5c.13.23.32.42.47.57l.04.04.04.04c.15.15.34.34.56.47a2 2 0 0 0 1.41.24l-.2-.98.2.98c.25-.05.5-.17.69-.26l.05-.02-.42-.87.42.87 15.05-7.25.1-.05c1.14-.55 1.85-.89 2.46-1.38a7 7 0 0 0 1.13-1.13 12.87 12.87 0 0 0 1.43-2.56l7.25-15.05Z"
  />
  <path
    fill="#1DC956"
    d="M33.38 32.72 30.7 29.3 15.86 44.14l.2.2a1 1 0 0 0 1.14.2l15.1-7.27a3 3 0 0 0 1.08-4.55Z"
  />
  <path
    fill="#86F999"
    d="m26.62 27.28 2.67 3.43 14.85-14.85-.2-.2a1 1 0 0 0-1.14-.2l-15.1 7.27a3 3 0 0 0-1.08 4.55Z"
  />
  <circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)" />
  <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" />
</svg> `,daoSvg=Oe$1`<svg viewBox="0 0 60 60" fill="none">
  <g clip-path="url(#clip0_7734_50402)">
    <path
      d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z"
      fill="#EB8B47"
    />
    <path
      d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z"
      stroke="#062B2B"
      stroke-opacity="0.1"
    />
    <path
      d="M19 52C24.5228 52 29 47.5228 29 42C29 36.4772 24.5228 32 19 32C13.4772 32 9 36.4772 9 42C9 47.5228 13.4772 52 19 52Z"
      fill="#FF974C"
      stroke="white"
      stroke-width="2"
    />
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M42.8437 8.3264C42.4507 7.70891 41.5493 7.70891 41.1564 8.32641L28.978 27.4638C28.5544 28.1295 29.0326 29.0007 29.8217 29.0007H54.1783C54.9674 29.0007 55.4456 28.1295 55.022 27.4638L42.8437 8.3264Z"
      fill="white"
    />
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M42.3348 11.6456C42.659 11.7608 42.9061 12.1492 43.4005 12.926L50.7332 24.4488C51.2952 25.332 51.5763 25.7737 51.5254 26.1382C51.4915 26.3808 51.3698 26.6026 51.1833 26.7614C50.9031 27 50.3796 27 49.3327 27H34.6673C33.6204 27 33.0969 27 32.8167 26.7614C32.6302 26.6026 32.5085 26.3808 32.4746 26.1382C32.4237 25.7737 32.7048 25.332 33.2669 24.4488L40.5995 12.926C41.0939 12.1492 41.341 11.7608 41.6652 11.6456C41.8818 11.5687 42.1182 11.5687 42.3348 11.6456ZM35.0001 26.999C38.8661 26.999 42.0001 23.865 42.0001 19.999C42.0001 23.865 45.1341 26.999 49.0001 26.999H35.0001Z"
      fill="#FF974C"
    />
    <path
      d="M10.1061 9.35712C9.9973 9.67775 9.99867 10.0388 9.99978 10.3323C9.99989 10.3611 10 10.3893 10 10.4167V25.5833C10 25.6107 9.99989 25.6389 9.99978 25.6677C9.99867 25.9612 9.9973 26.3222 10.1061 26.6429C10.306 27.2317 10.7683 27.694 11.3571 27.8939C11.6777 28.0027 12.0388 28.0013 12.3323 28.0002C12.3611 28.0001 12.3893 28 12.4167 28H19C24.5228 28 29 23.5228 29 18C29 12.4772 24.5228 8 19 8H12.4167C12.3893 8 12.3611 7.99989 12.3323 7.99978C12.0388 7.99867 11.6778 7.9973 11.3571 8.10614C10.7683 8.306 10.306 8.76834 10.1061 9.35712Z"
      fill="#FF974C"
      stroke="white"
      stroke-width="2"
    />
    <circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="white" stroke-width="2" />
    <circle cx="19" cy="42" r="4" fill="#EB8B47" stroke="white" stroke-width="2" />
  </g>
  <defs>
    <clipPath id="clip0_7734_50402">
      <rect width="60" height="60" fill="white" />
    </clipPath>
  </defs>
</svg> `,defiSvg=Oe$1`<svg fill="none" viewBox="0 0 60 60">
  <g clip-path="url(#a)">
    <path
      fill="#1DC956"
      d="M0 25.01c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02.11 15.65.11 24.9.11h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.13 60 15.76 60 25v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-3.45 1.97-8.08 1.97-17.33 1.97H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 49.1 0 44.46 0 35.21v-10.2Z"
    />
    <path
      fill="#2BEE6C"
      d="M16.1 60c-3.82-.18-6.4-.64-8.53-1.86a15 15 0 0 1-5.6-5.6C.55 50.06.16 46.97.04 41.98L4.2 40.6a4 4 0 0 0 2.48-2.39l4.65-12.4a2 2 0 0 1 2.5-1.2l2.53.84a2 2 0 0 0 2.43-1l2.96-5.94a2 2 0 0 1 3.7.32l3.78 12.58a2 2 0 0 0 3.03 1.09l3.34-2.23a2 2 0 0 0 .65-.7l5.3-9.72a2 2 0 0 1 1.42-1.01l4.14-.69a2 2 0 0 1 1.6.44l3.9 3.24a2 2 0 0 0 2.7-.12l4.62-4.63c.08 2.2.08 4.8.08 7.93v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-2.13 1.22-4.7 1.68-8.54 1.86H16.11Z"
    />
    <path
      fill="#fff"
      d="m.07 43.03-.05-2.1 3.85-1.28a3 3 0 0 0 1.86-1.79l4.66-12.4a3 3 0 0 1 3.75-1.8l2.53.84a1 1 0 0 0 1.21-.5l2.97-5.94a3 3 0 0 1 5.56.48l3.77 12.58a1 1 0 0 0 1.51.55l3.34-2.23a1 1 0 0 0 .33-.35l5.3-9.71a3 3 0 0 1 2.14-1.53l4.13-.69a3 3 0 0 1 2.41.66l3.9 3.24a1 1 0 0 0 1.34-.06l5.28-5.28c.05.85.08 1.75.1 2.73L56 22.41a3 3 0 0 1-4.04.19l-3.9-3.25a1 1 0 0 0-.8-.21l-4.13.69a1 1 0 0 0-.72.5l-5.3 9.72a3 3 0 0 1-.97 1.05l-3.34 2.23a3 3 0 0 1-4.53-1.63l-3.78-12.58a1 1 0 0 0-1.85-.16l-2.97 5.94a3 3 0 0 1-3.63 1.5l-2.53-.84a1 1 0 0 0-1.25.6l-4.65 12.4a5 5 0 0 1-3.1 3L.07 43.02Z"
    />
    <path
      fill="#fff"
      fill-rule="evenodd"
      d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
      clip-rule="evenodd"
    />
    <path fill="#fff" d="M45 .28v59.66l-2 .1V.19c.7.02 1.37.05 2 .1Z" />
    <path fill="#2BEE6C" d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" />
    <path
      stroke="#fff"
      stroke-opacity=".1"
      d="M.5 25.01c0-4.63 0-8.08.24-10.8.25-2.7.73-4.64 1.66-6.28a14.5 14.5 0 0 1 5.42-5.41C9.46 1.58 11.39 1.1 14.1.85A133 133 0 0 1 24.9.61h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.67a14.5 14.5 0 0 1 5.42 5.4c.93 1.65 1.41 3.58 1.66 6.3.24 2.71.24 6.16.24 10.79v10.2c0 4.64 0 8.08-.24 10.8-.25 2.7-.73 4.65-1.66 6.28a14.5 14.5 0 0 1-5.42 5.42c-1.63.93-3.57 1.41-6.28 1.66-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.66a14.5 14.5 0 0 1-5.42-5.42C1.47 50.66 1 48.72.74 46.01A133 133 0 0 1 .5 35.2v-10.2Z"
    />
  </g>
  <defs>
    <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath>
  </defs>
</svg>`,defiAltSvg=Oe$1`<svg fill="none" viewBox="0 0 60 60">
  <g clip-path="url(#a)">
    <rect width="60" height="60" fill="#C653C6" rx="30" />
    <path
      fill="#E87DE8"
      d="M57.98.01v19.5a4.09 4.09 0 0 0-2.63 2.29L50.7 34.2a2 2 0 0 1-2.5 1.2l-2.53-.84a2 2 0 0 0-2.42 1l-2.97 5.94a2 2 0 0 1-3.7-.32L32.8 28.6a2 2 0 0 0-3.02-1.09l-3.35 2.23a2 2 0 0 0-.64.7l-5.3 9.72a2 2 0 0 1-1.43 1.01l-4.13.69a2 2 0 0 1-1.61-.44l-3.9-3.24a2 2 0 0 0-2.69.12L2.1 42.93.02 43V.01h57.96Z"
    />
    <path
      fill="#fff"
      d="m61.95 16.94.05 2.1-3.85 1.28a3 3 0 0 0-1.86 1.79l-4.65 12.4a3 3 0 0 1-3.76 1.8l-2.53-.84a1 1 0 0 0-1.2.5l-2.98 5.94a3 3 0 0 1-5.55-.48l-3.78-12.58a1 1 0 0 0-1.5-.55l-3.35 2.23a1 1 0 0 0-.32.35l-5.3 9.72a3 3 0 0 1-2.14 1.52l-4.14.69a3 3 0 0 1-2.41-.66l-3.9-3.24a1 1 0 0 0-1.34.06l-5.28 5.28c-.05-.84-.08-1.75-.1-2.73l3.97-3.96a3 3 0 0 1 4.04-.19l3.89 3.25a1 1 0 0 0 .8.21l4.14-.68a1 1 0 0 0 .71-.51l5.3-9.71a3 3 0 0 1 .97-1.06l3.34-2.23a3 3 0 0 1 4.54 1.63l3.77 12.58a1 1 0 0 0 1.86.16l2.96-5.93a3 3 0 0 1 3.64-1.5l2.52.83a1 1 0 0 0 1.25-.6l4.66-12.4a5 5 0 0 1 3.1-2.99l4.43-1.48Z"
    />
    <path
      fill="#fff"
      fill-rule="evenodd"
      d="M35.5 27a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
      clip-rule="evenodd"
    />
    <path fill="#fff" d="M31 0v60h-2V0h2Z" />
    <path fill="#E87DE8" d="M33.5 27a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" />
  </g>
  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" />
  <defs>
    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
  </defs>
</svg> `,ethSvg=Oe$1`<svg fill="none" viewBox="0 0 60 60">
  <g clip-path="url(#a)">
    <rect width="60" height="60" fill="#987DE8" rx="30" />
    <path
      fill="#fff"
      fill-rule="evenodd"
      d="m15.48 28.37 11.97-19.3a3 3 0 0 1 5.1 0l11.97 19.3a6 6 0 0 1 .9 3.14v.03a6 6 0 0 1-1.16 3.56L33.23 50.2a4 4 0 0 1-6.46 0L15.73 35.1a6 6 0 0 1-1.15-3.54v-.03a6 6 0 0 1 .9-3.16Z"
      clip-rule="evenodd"
    />
    <path
      fill="#643CDD"
      d="M30.84 10.11a1 1 0 0 0-.84-.46V24.5l12.6 5.53a2 2 0 0 0-.28-1.4L30.84 10.11Z"
    />
    <path
      fill="#BDADEB"
      d="M30 9.65a1 1 0 0 0-.85.46L17.66 28.64a2 2 0 0 0-.26 1.39L30 24.5V9.65Z"
    />
    <path
      fill="#643CDD"
      d="M30 50.54a1 1 0 0 0 .8-.4l11.24-15.38c.3-.44-.2-1-.66-.73l-9.89 5.68a3 3 0 0 1-1.5.4v10.43Z"
    />
    <path
      fill="#BDADEB"
      d="m17.97 34.76 11.22 15.37c.2.28.5.41.8.41V40.11a3 3 0 0 1-1.49-.4l-9.88-5.68c-.47-.27-.97.3-.65.73Z"
    />
    <path
      fill="#401AB3"
      d="M42.6 30.03 30 24.5v13.14a3 3 0 0 0 1.5-.4l10.14-5.83a2 2 0 0 0 .95-1.38Z"
    />
    <path
      fill="#7C5AE2"
      d="M30 37.64V24.46l-12.6 5.57a2 2 0 0 0 .97 1.39l10.13 5.82a3 3 0 0 0 1.5.4Z"
    />
  </g>
  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" />
  <defs>
    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
  </defs>
</svg> `,layersSvg=Oe$1`<svg fill="none" viewBox="0 0 60 60">
  <rect width="60" height="60" fill="#1DC956" rx="3" />
  <path
    fill="#1FAD7E"
    stroke="#fff"
    stroke-width="2"
    d="m30.49 29.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z"
  />
  <path
    fill="#2BEE6C"
    stroke="#fff"
    stroke-width="2"
    d="m30.49 19.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z"
  />
  <path
    fill="#86F999"
    stroke="#fff"
    stroke-width="2"
    d="m46.69 21.06-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-6.32-3.51-.18-.1c-2.33-1.3-3.72-2.06-5.22-2.33a9 9 0 0 0-3.08 0c-1.5.27-2.9 1.04-5.22 2.33l-.17.1-6.33 3.51-.05.03c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45Z"
  />
  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
</svg>`,lockSvg=Oe$1`<svg fill="none" viewBox="0 0 60 60">
  <rect width="60" height="60" fill="#C653C6" rx="3" />
  <path
    fill="#fff"
    d="M20.03 15.22C20 15.6 20 16.07 20 17v2.8c0 1.14 0 1.7-.2 2.12-.15.31-.3.5-.58.71-.37.28-1.06.42-2.43.7-.59.12-1.11.29-1.6.51a9 9 0 0 0-4.35 4.36C10 30 10 32.34 10 37c0 4.66 0 7 .84 8.8a9 9 0 0 0 4.36 4.36C17 51 19.34 51 24 51h12c4.66 0 7 0 8.8-.84a9 9 0 0 0 4.36-4.36C50 44 50 41.66 50 37c0-4.66 0-7-.84-8.8a9 9 0 0 0-4.36-4.36c-.48-.22-1-.39-1.6-.5-1.36-.29-2.05-.43-2.42-.7-.27-.22-.43-.4-.58-.72-.2-.42-.2-.98-.2-2.11V17c0-.93 0-1.4-.03-1.78a9 9 0 0 0-8.19-8.19C31.4 7 30.93 7 30 7s-1.4 0-1.78.03a9 9 0 0 0-8.19 8.19Z"
  />
  <path
    fill="#E87DE8"
    d="M22 17c0-.93 0-1.4.04-1.78a7 7 0 0 1 6.18-6.18C28.6 9 29.07 9 30 9s1.4 0 1.78.04a7 7 0 0 1 6.18 6.18c.04.39.04.85.04 1.78v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.4-.08-1.78a4 4 0 0 0-3.14-3.14C31.39 12 30.93 12 30 12s-1.4 0-1.78.08a4 4 0 0 0-3.14 3.14c-.08.39-.08.85-.08 1.78v4.5a1.5 1.5 0 0 1-3 0V17Z"
  />
  <path
    fill="#E87DE8"
    fill-rule="evenodd"
    d="M12 36.62c0-4.32 0-6.48.92-8.09a7 7 0 0 1 2.61-2.61C17.14 25 19.3 25 23.62 25h6.86c.46 0 .7 0 .9.02 2.73.22 4.37 2.43 4.62 4.98.27-2.7 2.11-5 5.02-5A6.98 6.98 0 0 1 48 31.98v5.4c0 4.32 0 6.48-.92 8.09a7 7 0 0 1-2.61 2.61c-1.61.92-3.77.92-8.09.92h-5.86c-.46 0-.7 0-.9-.02-2.73-.22-4.37-2.43-4.62-4.98-.26 2.58-1.94 4.82-4.71 4.99l-.7.01c-.55 0-.82 0-1.05-.02a7 7 0 0 1-6.52-6.52c-.02-.23-.02-.5-.02-1.05v-4.79Zm21.24-.27a4 4 0 1 0-6.48 0 31.28 31.28 0 0 1 1.57 2.23c.17.4.17.81.17 1.24V42.5a1.5 1.5 0 0 0 3 0V39.82c0-.43 0-.85.17-1.24.09-.2.58-.87 1.57-2.23Z"
    clip-rule="evenodd"
  />
  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
</svg>`,loginSvg=Oe$1`<svg fill="none" viewBox="0 0 60 60">
  <g clip-path="url(#a)">
    <path
      fill="#EB8B47"
      d="M0 24.9c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02 0 15.65 0 24.9 0h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.02 60 15.65 60 24.9v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6C48.98 60 44.35 60 35.1 60H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 48.98 0 44.35 0 35.1V24.9Z"
    />
    <path
      stroke="#062B2B"
      stroke-opacity=".1"
      d="M.5 24.9c0-4.64 0-8.08.24-10.8.25-2.7.73-4.65 1.66-6.28A14.5 14.5 0 0 1 7.82 2.4C9.46 1.47 11.39 1 14.1.74A133 133 0 0 1 24.9.5h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.66a14.5 14.5 0 0 1 5.42 5.42c.93 1.63 1.41 3.57 1.66 6.28.24 2.72.24 6.16.24 10.8v10.2c0 4.63 0 8.08-.24 10.8-.25 2.7-.73 4.64-1.66 6.28a14.5 14.5 0 0 1-5.42 5.41c-1.63.94-3.57 1.42-6.28 1.67-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.67a14.5 14.5 0 0 1-5.42-5.4C1.47 50.53 1 48.6.74 45.88A133 133 0 0 1 .5 35.1V24.9Z"
    />
    <path
      fill="#FF974C"
      stroke="#fff"
      stroke-width="2"
      d="M39.2 29.2a13 13 0 1 0-18.4 0l1.3 1.28a12.82 12.82 0 0 1 2.1 2.39 6 6 0 0 1 .6 1.47c.2.76.2 1.56.2 3.17v11.24c0 1.08 0 1.61.13 2.12a4 4 0 0 0 .41.98c.26.45.64.83 1.4 1.6l.3.29c.65.65.98.98 1.36 1.09.26.07.54.07.8 0 .38-.11.7-.44 1.36-1.1l3.48-3.47c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.47-.48c-.65-.65-.98-.98-1.09-1.36a1.5 1.5 0 0 1 0-.8c.1-.38.44-.7 1.1-1.36l.47-.48c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.48-.5c-.65-.64-.98-.97-1.08-1.35a1.5 1.5 0 0 1 0-.79c.1-.38.42-.7 1.06-1.36l5.46-5.55Z"
    />
    <circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2" />
  </g>
  <defs>
    <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath>
  </defs>
</svg> `,networkSvg=Oe$1`<svg fill="none" viewBox="0 0 60 60">
  <g clip-path="url(#a)">
    <rect width="60" height="60" fill="#00ACE6" rx="30" />
    <circle cx="64" cy="39" r="50" fill="#1AC6FF" stroke="#fff" stroke-width="2" />
    <circle cx="78" cy="30" r="50" fill="#4DD2FF" stroke="#fff" stroke-width="2" />
    <circle cx="72" cy="15" r="35" fill="#80DFFF" stroke="#fff" stroke-width="2" />
    <circle cx="34" cy="-17" r="45" stroke="#fff" stroke-width="2" />
    <circle cx="34" cy="-5" r="50" stroke="#fff" stroke-width="2" />
    <circle cx="30" cy="45" r="4" fill="#4DD2FF" stroke="#fff" stroke-width="2" />
    <circle cx="39.5" cy="27.5" r="4" fill="#80DFFF" stroke="#fff" stroke-width="2" />
    <circle cx="16" cy="24" r="4" fill="#19C6FF" stroke="#fff" stroke-width="2" />
  </g>
  <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" />
  <defs>
    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
  </defs>
</svg>`,nftSvg=Oe$1`<svg fill="none" viewBox="0 0 60 60">
  <g clip-path="url(#a)">
    <rect width="60" height="60" fill="#C653C6" rx="3" />
    <path
      fill="#E87DE8"
      stroke="#fff"
      stroke-width="2"
      d="M52.1 47.34c0-4.24-1.44-9.55-5.9-12.4a2.86 2.86 0 0 0-1.6-3.89v-.82c0-1.19-.52-2.26-1.35-3a4.74 4.74 0 0 0-2.4-6.26v-5.5a11.31 11.31 0 1 0-22.63 0v2.15a3.34 3.34 0 0 0-1.18 5.05 4.74 4.74 0 0 0-.68 6.44A5.22 5.22 0 0 0 14 35.92c-3.06 4.13-6.1 8.3-6.1 15.64 0 2.67.37 4.86.74 6.39a20.3 20.3 0 0 0 .73 2.39l.02.04v.01l.92-.39-.92.4.26.6h38.26l.3-.49-.87-.51.86.5.02-.01.03-.07a16.32 16.32 0 0 0 .57-1.05c.36-.72.85-1.74 1.33-2.96a25.51 25.51 0 0 0 1.94-9.07Z"
    />
    <path
      fill="#fff"
      fill-rule="evenodd"
      d="M26.5 29.5c-3-.5-5.5-3-5.5-7v-7c0-.47 0-.7.03-.9a3 3 0 0 1 2.58-2.57c.2-.03.42-.03.89-.03 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.4 0 2.1 0 2.65.23a3 3 0 0 1 1.62 1.62c.23.55.23 1.25.23 2.65v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.5 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z"
      clip-rule="evenodd"
    />
  </g>
  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
  <defs>
    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="3" /></clipPath>
  </defs>
</svg> `,nounSvg=Oe$1`<svg fill="none" viewBox="0 0 60 60">
  <rect width="60" height="60" fill="#794CFF" rx="3" />
  <path
    fill="#987DE8"
    stroke="#fff"
    stroke-width="2"
    d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"
  />
  <path fill="#fff" d="M37.5 25h10v10h-10z" />
  <path fill="#4019B2" d="M42.5 25h5v10h-5z" />
  <path fill="#fff" d="M19.5 25h10v10h-10z" />
  <path fill="#4019B2" d="M24.5 25h5v10h-5z" />
  <path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z" />
  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
</svg>`,profileSvg=Oe$1`<svg
  viewBox="0 0 60 60"
  fill="none"
>
  <g clip-path="url(#1)">
    <rect width="60" height="60" rx="30" fill="#00ACE6" />
    <path
      d="M59 73C59 89.0163 46.0163 102 30 102C13.9837 102 1 89.0163 1 73C1 56.9837 12 44 30 44C48 44 59 56.9837 59 73Z"
      fill="#1AC6FF"
      stroke="white"
      stroke-width="2"
    />
    <path
      d="M18.6904 19.9015C19.6264 15.3286 23.3466 11.8445 27.9708 11.2096C29.3231 11.024 30.6751 11.0238 32.0289 11.2096C36.6532 11.8445 40.3733 15.3286 41.3094 19.9015C41.4868 20.7681 41.6309 21.6509 41.7492 22.5271C41.8811 23.5041 41.8811 24.4944 41.7492 25.4715C41.6309 26.3476 41.4868 27.2304 41.3094 28.097C40.3733 32.6699 36.6532 36.154 32.0289 36.7889C30.6772 36.9744 29.3216 36.9743 27.9708 36.7889C23.3466 36.154 19.6264 32.6699 18.6904 28.097C18.513 27.2304 18.3689 26.3476 18.2506 25.4715C18.1186 24.4944 18.1186 23.5041 18.2506 22.5271C18.3689 21.6509 18.513 20.7681 18.6904 19.9015Z"
      fill="#1AC6FF"
      stroke="white"
      stroke-width="2"
    />
    <circle cx="24.5" cy="23.5" r="1.5" fill="white" />
    <circle cx="35.5" cy="23.5" r="1.5" fill="white" />
    <path
      d="M31 20L28 28H32"
      stroke="white"
      stroke-width="2"
      stroke-linecap="round"
      stroke-linejoin="round"
    />
  </g>
  <rect x="0.5" y="0.5" width="59" height="59" rx="29.5" stroke="white" stroke-opacity="0.1" />
  <defs>
    <clipPath id="1">
      <rect width="60" height="60" rx="30" fill="white" />
    </clipPath>
  </defs>
</svg> `,systemSvg=Oe$1`<svg viewBox="0 0 60 60" fill="none">
  <g clip-path="url(#1)">
    <path
      d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z"
      fill="#794CFF"
    />
    <path
      d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z"
      stroke="#062B2B"
      stroke-opacity="0.1"
    />
    <path
      d="M35.1403 31.5016C35.1193 30.9637 35.388 30.4558 35.8446 30.1707C36.1207 29.9982 36.4761 29.8473 36.7921 29.7685C37.3143 29.6382 37.8664 29.7977 38.2386 30.1864C38.8507 30.8257 39.3004 31.6836 39.8033 32.408C40.2796 33.0942 41.4695 33.2512 41.9687 32.5047C42.4839 31.7341 42.9405 30.8229 43.572 30.1399C43.9375 29.7447 44.4866 29.5756 45.0111 29.6967C45.3283 29.7701 45.6863 29.9147 45.9655 30.0823C46.4269 30.3595 46.7045 30.8626 46.6928 31.4008C46.6731 32.3083 46.3764 33.2571 46.2158 34.1473C46.061 35.0048 46.9045 35.8337 47.7592 35.664C48.6464 35.4878 49.5899 35.1747 50.497 35.1391C51.0348 35.1181 51.5427 35.3868 51.8279 35.8433C52.0004 36.1195 52.1513 36.4749 52.2301 36.7908C52.3604 37.3131 52.2009 37.8651 51.8121 38.2374C51.1729 38.8495 50.3151 39.2991 49.5908 39.8019C48.9046 40.2782 48.7473 41.4683 49.4939 41.9675C50.2644 42.4827 51.1757 42.9393 51.8587 43.5708C52.2539 43.9362 52.423 44.4854 52.3018 45.0099C52.2285 45.3271 52.0839 45.6851 51.9162 45.9642C51.6391 46.4257 51.1359 46.7032 50.5978 46.6916C49.6903 46.6719 48.7417 46.3753 47.8516 46.2146C46.9939 46.0598 46.1648 46.9035 46.3346 47.7583C46.5108 48.6454 46.8239 49.5888 46.8594 50.4958C46.8805 51.0336 46.6117 51.5415 46.1552 51.8267C45.879 51.9992 45.5236 52.15 45.2077 52.2289C44.6854 52.3592 44.1334 52.1997 43.7611 51.8109C43.1491 51.1718 42.6996 50.314 42.1968 49.5897C41.7203 48.9034 40.5301 48.7463 40.0309 49.493C39.5157 50.2634 39.0592 51.1746 38.4278 51.8574C38.0623 52.2527 37.5132 52.4218 36.9887 52.3006C36.6715 52.2273 36.3135 52.0826 36.0343 51.915C35.5729 51.6379 35.2953 51.1347 35.307 50.5966C35.3267 49.6891 35.6233 48.7405 35.7839 47.8505C35.9388 46.9928 35.0951 46.1636 34.2402 46.3334C33.3531 46.5096 32.4098 46.8227 31.5028 46.8582C30.9649 46.8793 30.457 46.6105 30.1719 46.154C29.9994 45.8778 29.8485 45.5224 29.7697 45.2065C29.6394 44.6842 29.7989 44.1322 30.1877 43.7599C30.8269 43.1479 31.6847 42.6982 32.4091 42.1954C33.0954 41.7189 33.2522 40.5289 32.5056 40.0297C31.7351 39.5145 30.824 39.058 30.1411 38.4265C29.7459 38.0611 29.5768 37.5119 29.698 36.9875C29.7713 36.6702 29.9159 36.3122 30.0836 36.0331C30.3607 35.5717 30.8638 35.2941 31.402 35.3058C32.3095 35.3255 33.2583 35.6221 34.1485 35.7828C35.006 35.9376 35.8349 35.094 35.6652 34.2393C35.489 33.3521 35.1759 32.4087 35.1403 31.5016Z"
      fill="#906EF7"
      stroke="white"
      stroke-width="2"
    />
    <path
      d="M20.7706 8.22357C20.9036 7.51411 21.5231 7 22.2449 7H23.7551C24.4769 7 25.0964 7.51411 25.2294 8.22357C25.5051 9.69403 25.4829 11.6321 27.1202 12.2606C27.3092 12.3331 27.4958 12.4105 27.6798 12.4926C29.2818 13.2072 30.6374 11.8199 31.8721 10.9752C32.4678 10.5676 33.2694 10.6421 33.7798 11.1525L34.8477 12.2204C35.3581 12.7308 35.4326 13.5323 35.025 14.128C34.1802 15.3627 32.7931 16.7183 33.5077 18.3202C33.5898 18.5043 33.6672 18.6909 33.7398 18.88C34.3683 20.5171 36.3061 20.4949 37.7764 20.7706C38.4859 20.9036 39 21.5231 39 22.2449V23.7551C39 24.4769 38.4859 25.0964 37.7764 25.2294C36.3061 25.5051 34.3685 25.483 33.7401 27.1201C33.6675 27.3093 33.59 27.4961 33.5079 27.6803C32.7934 29.282 34.1803 30.6374 35.025 31.8719C35.4326 32.4677 35.3581 33.2692 34.8477 33.7796L33.7798 34.8475C33.2694 35.3579 32.4678 35.4324 31.8721 35.0248C30.6376 34.1801 29.2823 32.7934 27.6806 33.508C27.4962 33.5903 27.3093 33.6678 27.12 33.7405C25.483 34.3688 25.5051 36.3062 25.2294 37.7764C25.0964 38.4859 24.4769 39 23.7551 39H22.2449C21.5231 39 20.9036 38.4859 20.7706 37.7764C20.4949 36.3062 20.517 34.3688 18.88 33.7405C18.6908 33.6678 18.5039 33.5903 18.3196 33.5081C16.7179 32.7936 15.3625 34.1804 14.1279 35.0251C13.5322 35.4327 12.7307 35.3582 12.2203 34.8478L11.1524 33.7799C10.642 33.2695 10.5675 32.4679 10.9751 31.8722C11.8198 30.6376 13.2067 29.2822 12.4922 27.6804C12.41 27.4962 12.3325 27.3093 12.2599 27.1201C11.6315 25.483 9.69392 25.5051 8.22357 25.2294C7.51411 25.0964 7 24.4769 7 23.7551V22.2449C7 21.5231 7.51411 20.9036 8.22357 20.7706C9.69394 20.4949 11.6317 20.5171 12.2602 18.88C12.3328 18.6909 12.4103 18.5042 12.4924 18.3201C13.207 16.7181 11.8198 15.3625 10.975 14.1278C10.5674 13.5321 10.6419 12.7305 11.1523 12.2201L12.2202 11.1522C12.7306 10.6418 13.5322 10.5673 14.1279 10.9749C15.3626 11.8197 16.7184 13.2071 18.3204 12.4925C18.5044 12.4105 18.6909 12.3331 18.8799 12.2606C20.5171 11.6321 20.4949 9.69403 20.7706 8.22357Z"
      fill="#906EF7"
      stroke="white"
      stroke-width="2"
    />
    <circle cx="23" cy="23" r="6" fill="#794CFF" stroke="white" stroke-width="2" />
    <circle cx="41" cy="41" r="4" fill="#794CFF" stroke="white" stroke-width="2" />
  </g>
  <defs>
    <clipPath id="1">
      <rect width="60" height="60" fill="white" />
    </clipPath>
  </defs>
</svg> `,coinbaseSvg=Oe$1`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
  <g clip-path="url(#clip0_187_29)">
    <path d="M1.18187e-05 15.8055C1.18187e-05 9.8015 -5.19442e-07 6.91338 1.69991e-08 0C4.5 3.72236e-05 9.62249 0 16.5 0L23.5 4.31399e-05C29.9349 4.31399e-05 35.5 0.000206332 40 3.73468e-05C40 2.77754 40 9.36708 40 15.8055V22.8364C40 29.2647 40 33.7962 40 40C31.5 40 29.8337 40 23.4 40H16.6C10.5092 40 6.50004 40 4.04289e-05 40C3.05176e-05 32.2453 1.18187e-05 29.6382 1.18187e-05 22.8364V15.8055Z" fill="#0052FF"/>
    <path d="M20.0236 26.5C16.4342 26.5 13.5236 23.5931 13.5236 20C13.5236 16.4069 16.4342 13.5 20.0236 13.5C23.2411 13.5 25.9134 15.8472 26.4261 18.9167H32.9731C32.4206 12.2433 26.8342 7 20.02 7C12.8411 7 7.02002 12.8211 7.02002 20C7.02002 27.1789 12.8411 33 20.02 33C26.8342 33 32.4206 27.7567 32.9731 21.0833H26.4225C25.9061 24.1528 23.2411 26.5 20.0236 26.5Z" fill="white"/>
  </g>
  <defs>
    <clipPath id="clip0_187_29">
      <rect width="40" height="40" fill="white"/>
    </clipPath>
  </defs>
</svg>`,moonpaySvg=Oe$1`
  <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
    <g clip-path="url(#a)">
      <path
        d="M0 16.6c0-6.168 0-9.251 1.314-11.555a10 10 0 0 1 3.731-3.731C7.35 0 10.432 0 16.6 0h6.8c6.168 0 9.252 0 11.555 1.314a10 10 0 0 1 3.731 3.731C40 7.35 40 10.432 40 16.6v6.8c0 6.168 0 9.252-1.314 11.555a10 10 0 0 1-3.731 3.731C32.652 40 29.568 40 23.4 40h-6.8c-6.168 0-9.251 0-11.555-1.314a10 10 0 0 1-3.731-3.731C0 32.652 0 29.568 0 23.4v-6.8Z"
        fill="#7D00FF"
      />
      <path
        d="M.5 16.6c0-3.093 0-5.38.162-7.182.161-1.795.48-3.061 1.086-4.125a9.5 9.5 0 0 1 3.545-3.545C6.357 1.141 7.623.823 9.418.662 11.221.5 13.508.5 16.6.5h6.8c3.093 0 5.38 0 7.182.162 1.795.161 3.062.48 4.125 1.086a9.5 9.5 0 0 1 3.545 3.545c.607 1.064.925 2.33 1.086 4.125.161 1.803.162 4.09.162 7.182v6.8c0 3.093 0 5.38-.162 7.182-.161 1.795-.48 3.062-1.086 4.125a9.5 9.5 0 0 1-3.545 3.545c-1.063.607-2.33.925-4.125 1.086-1.803.161-4.09.162-7.182.162h-6.8c-3.093 0-5.38 0-7.182-.162-1.795-.161-3.061-.48-4.125-1.086a9.5 9.5 0 0 1-3.545-3.545c-.607-1.063-.925-2.33-1.086-4.125C.5 28.779.5 26.492.5 23.4v-6.8Z"
        stroke="#fff"
        stroke-opacity=".05"
      />
      <path
        d="M28.306 15.381a3.69 3.69 0 1 0 0-7.381 3.69 3.69 0 0 0 0 7.381ZM16.987 32a8.991 8.991 0 1 1 .016-17.983A8.991 8.991 0 0 1 16.988 32Z"
        fill="#fff"
      />
    </g>
    <defs>
      <clipPath id="a"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
    </defs>
  </svg>
`,stripeSvg=Oe$1`
  <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
    <g clip-path="url(#a)">
      <path
        d="M0 16.6c0-6.168 0-9.251 1.314-11.555a10 10 0 0 1 3.731-3.731C7.35 0 10.432 0 16.6 0h6.8c6.168 0 9.252 0 11.555 1.314a10 10 0 0 1 3.731 3.731C40 7.35 40 10.432 40 16.6v6.8c0 6.168 0 9.252-1.314 11.555a10 10 0 0 1-3.731 3.731C32.652 40 29.568 40 23.4 40h-6.8c-6.168 0-9.251 0-11.555-1.314a10 10 0 0 1-3.731-3.731C0 32.652 0 29.568 0 23.4v-6.8Z"
        fill="#635BFF"
      />
      <path
        d="M.5 16.6c0-3.093 0-5.38.162-7.182.161-1.795.48-3.061 1.086-4.125a9.5 9.5 0 0 1 3.545-3.545C6.357 1.141 7.623.823 9.418.662 11.221.5 13.508.5 16.6.5h6.8c3.093 0 5.38 0 7.182.162 1.795.161 3.062.48 4.125 1.086a9.5 9.5 0 0 1 3.545 3.545c.607 1.064.925 2.33 1.086 4.125.161 1.803.162 4.09.162 7.182v6.8c0 3.093 0 5.38-.162 7.182-.161 1.795-.48 3.062-1.086 4.125a9.5 9.5 0 0 1-3.545 3.545c-1.063.607-2.33.925-4.125 1.086-1.803.161-4.09.162-7.182.162h-6.8c-3.093 0-5.38 0-7.182-.162-1.795-.161-3.061-.48-4.125-1.086a9.5 9.5 0 0 1-3.545-3.545c-.607-1.063-.925-2.33-1.086-4.125C.5 28.779.5 26.492.5 23.4v-6.8Z"
        stroke="#fff"
        stroke-opacity=".05"
      />
      <path
        fill-rule="evenodd"
        clip-rule="evenodd"
        d="M18.299 15.147c0-1.028.844-1.424 2.242-1.424 2.004 0 4.536.607 6.54 1.688V9.213C24.892 8.343 22.73 8 20.541 8c-5.354 0-8.915 2.796-8.915 7.464 0 7.279 10.022 6.118 10.022 9.257 0 1.213-1.055 1.609-2.531 1.609-2.19 0-4.985-.897-7.2-2.11v6.277a18.283 18.283 0 0 0 7.2 1.503c5.485 0 9.257-2.716 9.257-7.437-.027-7.86-10.075-6.462-10.075-9.416Z"
        fill="#fff"
      />
    </g>
    <defs>
      <clipPath id="a"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
    </defs>
  </svg>
`,paypalSvg=Oe$1`
  <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
    <g clip-path="url(#a)">
      <path
        d="M0 16.6c0-6.168 0-9.251 1.314-11.555a10 10 0 0 1 3.731-3.731C7.35 0 10.432 0 16.6 0h6.8c6.168 0 9.252 0 11.555 1.314a10 10 0 0 1 3.731 3.731C40 7.35 40 10.432 40 16.6v6.8c0 6.168 0 9.252-1.314 11.555a10 10 0 0 1-3.731 3.731C32.652 40 29.568 40 23.4 40h-6.8c-6.168 0-9.251 0-11.555-1.314a10 10 0 0 1-3.731-3.731C0 32.652 0 29.568 0 23.4v-6.8Z"
        fill="#fff"
      />
      <path
        d="M.5 16.6c0-3.093 0-5.38.162-7.182.161-1.795.48-3.061 1.086-4.125a9.5 9.5 0 0 1 3.545-3.545C6.357 1.141 7.623.823 9.418.662 11.221.5 13.508.5 16.6.5h6.8c3.093 0 5.38 0 7.182.162 1.795.161 3.062.48 4.125 1.086a9.5 9.5 0 0 1 3.545 3.545c.607 1.064.925 2.33 1.086 4.125.161 1.803.162 4.09.162 7.182v6.8c0 3.093 0 5.38-.162 7.182-.161 1.795-.48 3.062-1.086 4.125a9.5 9.5 0 0 1-3.545 3.545c-1.063.607-2.33.925-4.125 1.086-1.803.161-4.09.162-7.182.162h-6.8c-3.093 0-5.38 0-7.182-.162-1.795-.161-3.061-.48-4.125-1.086a9.5 9.5 0 0 1-3.545-3.545c-.607-1.063-.925-2.33-1.086-4.125C.5 28.779.5 26.492.5 23.4v-6.8Z"
        stroke="#fff"
        stroke-opacity=".05"
      />
      <path
        d="M18.606 12.642a.781.781 0 0 0-.771.66l-1.281 8.125a.78.78 0 0 1 .77-.66h3.755a7.668 7.668 0 0 0 7.57-6.49 6.26 6.26 0 0 0 .075-.843c-.96-.504-2.089-.792-3.325-.792h-6.793Z"
        fill="#001C64"
      />
      <path
        d="M28.724 13.434c-.006.282-.03.564-.075.843a7.668 7.668 0 0 1-7.57 6.491h-3.754a.78.78 0 0 0-.771.66l-1.916 12.15a.634.634 0 0 0 .626.734h4.075a.781.781 0 0 0 .77-.66l1.074-6.807a.781.781 0 0 1 .772-.66h2.4a7.668 7.668 0 0 0 7.57-6.491c.415-2.651-.92-5.064-3.201-6.26Z"
        fill="#0070E0"
      />
      <path
        d="M13.977 7.226a.78.78 0 0 0-.771.658l-3.198 20.277a.634.634 0 0 0 .626.733h4.742l1.178-7.467 1.281-8.125a.782.782 0 0 1 .771-.66H25.4c1.237 0 2.364.289 3.325.792.065-3.4-2.74-6.208-6.599-6.208h-8.148Z"
        fill="#003087"
      />
    </g>
    <defs>
      <clipPath id="a"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
    </defs>
  </svg>
`,onrampCardSvg=Oe$1`<svg width="60" height="60" viewBox="0 0 60 60" fill="none">
<g clip-path="url(#clip0_13859_31161)">
  <path d="M0 24.8995C0 15.6481 0 11.0223 1.97053 7.56763C3.3015 5.2342 5.23468 3.30101 7.56812 1.97004C11.0228 -0.000488281 15.6485 -0.000488281 24.9 -0.000488281H35.1C44.3514 -0.000488281 48.9772 -0.000488281 52.4319 1.97004C54.7653 3.30101 56.6985 5.2342 58.0295 7.56763C60 11.0223 60 15.6481 60 24.8995V35.0995C60 44.351 60 48.9767 58.0295 52.4314C56.6985 54.7648 54.7653 56.698 52.4319 58.029C48.9772 59.9995 44.3514 59.9995 35.1 59.9995H24.9C15.6485 59.9995 11.0228 59.9995 7.56812 58.029C5.23468 56.698 3.3015 54.7648 1.97053 52.4314C0 48.9767 0 44.351 0 35.0995V24.8995Z" fill="#EB8B47"/>
  <path d="M0.5 24.8995C0.5 20.2647 0.50047 16.8216 0.744315 14.1045C0.987552 11.3941 1.46987 9.45455 2.40484 7.81536C3.69145 5.55971 5.56019 3.69096 7.81585 2.40435C9.45504 1.46938 11.3946 0.987064 14.105 0.743826C16.8221 0.499981 20.2652 0.499512 24.9 0.499512H35.1C39.7348 0.499512 43.1779 0.499981 45.895 0.743826C48.6054 0.987064 50.545 1.46938 52.1841 2.40435C54.4398 3.69096 56.3086 5.55971 57.5952 7.81536C58.5301 9.45455 59.0124 11.3941 59.2557 14.1045C59.4995 16.8216 59.5 20.2647 59.5 24.8995V35.0995C59.5 39.7343 59.4995 43.1774 59.2557 45.8945C59.0124 48.6049 58.5301 50.5445 57.5952 52.1837C56.3086 54.4393 54.4398 56.3081 52.1841 57.5947C50.545 58.5296 48.6054 59.012 45.895 59.2552C43.1779 59.499 39.7348 59.4995 35.1 59.4995H24.9C20.2652 59.4995 16.8221 59.499 14.105 59.2552C11.3946 59.012 9.45504 58.5296 7.81585 57.5947C5.56019 56.3081 3.69145 54.4393 2.40484 52.1837C1.46987 50.5445 0.987552 48.6049 0.744315 45.8945C0.50047 43.1774 0.5 39.7343 0.5 35.0995V24.8995Z" stroke="#141414" stroke-opacity="0.1"/>
  <path d="M13 26.0335C13 21.7838 13 19.659 14.0822 18.1694C14.4318 17.6883 14.8548 17.2653 15.3359 16.9157C16.8255 15.8335 18.9503 15.8335 23.2 15.8335H36.8C41.0497 15.8335 43.1745 15.8335 44.6641 16.9157C45.1452 17.2653 45.5682 17.6883 45.9178 18.1694C47 19.659 47 21.7838 47 26.0335V33.9668C47 38.2165 47 40.3414 45.9178 41.831C45.5682 42.312 45.1452 42.7351 44.6641 43.0846C43.1745 44.1668 41.0497 44.1668 36.8 44.1668H23.2C18.9503 44.1668 16.8255 44.1668 15.3359 43.0846C14.8548 42.7351 14.4318 42.312 14.0822 41.831C13 40.3414 13 38.2165 13 33.9668V26.0335Z" fill="#FF974C" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  <path d="M39.5 36.667H36.6666" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
  <path d="M45.2 23.0645H14.8C14.0501 23.0645 13.6751 23.0645 13.4122 23.2554C13.3273 23.3171 13.2527 23.3918 13.191 23.4767C13 23.7395 13 24.1145 13 24.8645V27.2645C13 28.0144 13 28.3894 13.191 28.6522C13.2527 28.7371 13.3273 28.8118 13.4122 28.8735C13.6751 29.0645 14.0501 29.0645 14.8 29.0645H45.2C45.9499 29.0645 46.3249 29.0645 46.5878 28.8735C46.6727 28.8118 46.7473 28.7371 46.809 28.6522C47 28.3894 47 28.0144 47 27.2645V24.8645C47 24.1145 47 23.7395 46.809 23.4767C46.7473 23.3918 46.6727 23.3171 46.5878 23.2554C46.3249 23.0645 45.9499 23.0645 45.2 23.0645Z" fill="white" fill-opacity="0.4" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
  <clipPath id="clip0_13859_31161">
    <rect width="60" height="60" fill="white"/>
  </clipPath>
</defs>
</svg>`,googleSvg=Oe$1`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
  <rect width="64" height="64" rx="30" fill="#1DC956"/>
  <rect x="0.5" y="0.5" width="63" height="63" rx="29.5" stroke="#141414" stroke-opacity="0.1"/>
  <path d="M32.4053 19.8031C35.3901 19.8031 38.0431 20.8349 40.1619 22.8247L45.9656 17.0211C42.4465 13.7416 37.8773 11.7333 32.4053 11.7333C24.4829 11.7333 17.6475 16.2841 14.3127 22.9168L21.056 28.1493C22.6589 23.359 27.136 19.8031 32.4053 19.8031Z" fill="#1DC956" stroke="white" stroke-width="2" stroke-linejoin="round"/>
  <path d="M32.4053 52.2667C37.8773 52.2667 42.465 50.4611 45.8182 47.3658L39.2407 42.2623C37.4351 43.4783 35.1321 44.2153 32.4053 44.2153C27.136 44.2153 22.6589 40.6594 21.056 35.8691L14.3127 41.1016C17.6475 47.7159 24.4829 52.2667 32.4053 52.2667Z" fill="#2BEE6C"/>
  <path d="M21.056 35.8507L19.5636 36.993L14.3127 41.0832M39.2407 42.2623L45.8182 47.3658C42.465 50.4611 37.8773 52.2667 32.4053 52.2667C24.4829 52.2667 17.6475 47.7159 14.3127 41.1016L21.056 35.8691C22.6589 40.6594 27.136 44.2153 32.4053 44.2153C35.1321 44.2153 37.4351 43.4783 39.2407 42.2623Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
  <path d="M51.8613 32.4606C51.8613 31.0235 51.7323 29.6417 51.4928 28.3151H32.4053V36.1638H43.3124C42.8334 38.688 41.3963 40.8252 39.2407 42.2623L45.8181 47.3658C49.6503 43.8283 51.8613 38.6327 51.8613 32.4606Z" fill="#1FAD7E" stroke="white" stroke-width="2" stroke-linejoin="round"/>
  <path d="M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" fill="#86F999"/>
  <path d="M21.056 35.8691L14.3127 41.1016M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
</svg>
`,pencilSvg=Oe$1`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
  <g clip-path="url(#clip0_241_31635)">
    <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58317 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58317 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9268C60.4784 58.4158 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4158 2.1019 55.9268C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#EB8B47"/>
    <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/>
    <path d="M28.1042 49.2329L13.1024 51.2077L15.0772 36.2059L37.1015 14.1815C39.2441 12.039 40.3154 10.9677 41.5718 10.624C42.4205 10.3918 43.3159 10.3918 44.1645 10.624C45.421 10.9677 46.4922 12.039 48.6348 14.1815L50.1286 15.6753C52.2711 17.8179 53.3424 18.8891 53.6861 20.1456C53.9183 20.9942 53.9183 21.8896 53.6861 22.7383C53.3424 23.9947 52.2711 25.066 50.1286 27.2086L28.1042 49.2329Z" fill="#FF974C" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    <path d="M38.5962 20.5376L22.4199 36.7139" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    <path d="M43.7727 25.714L27.5964 41.8903" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    <path d="M22.3703 36.7635C19.3258 39.808 16.0198 36.6395 16.2616 35.0324" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    <path d="M27.5466 41.9399C24.5034 44.9831 28.155 48.7098 29.2738 48.0475" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    <path d="M27.5468 41.9398C23.428 46.0586 18.2516 40.8822 22.3704 36.7634" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    <path d="M15.8191 50.5214C15.4711 49.5823 14.728 48.8392 13.7889 48.4912" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    <path d="M49.2862 29.5805L34.7275 15.0219" stroke="#E4E7E7" stroke-width="2" stroke-linejoin="round"/>
  </g>
  <defs>
    <clipPath id="clip0_241_31635">
      <rect width="64" height="64" fill="white"/>
    </clipPath>
  </defs>
</svg>
`,lightbulbSvg=Oe$1`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
  <g clip-path="url(#clip0_241_31636)">
    <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58318 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58318 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9269C60.4784 58.4159 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4159 2.1019 55.9269C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#794CFF"/>
    <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/>
    <path d="M40 39.4595C44.7824 36.693 48 31.5222 48 25.6C48 16.7634 40.8366 9.59998 32 9.59998C23.1634 9.59998 16 16.7634 16 25.6C16 31.5222 19.2176 36.693 24 39.4595V45.8144H40V39.4595Z" fill="#906EF7"/>
    <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#906EF7"/>
    <path d="M24 45.8144V39.4595C19.2176 36.693 16 31.5222 16 25.6C16 16.7634 23.1634 9.59998 32 9.59998C40.8366 9.59998 48 16.7634 48 25.6C48 31.5222 44.7824 36.693 40 39.4595V45.8144M24 45.8144H40M24 45.8144V49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144" stroke="white" stroke-width="2" stroke-linejoin="round"/>
    <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#643CDD" stroke="white" stroke-width="2" stroke-linejoin="round"/>
    <path d="M29.6735 26.9101V29.1109H34.0753V26.9101C34.0753 25.6945 35.0607 24.7092 36.2762 24.7092C37.4917 24.7092 38.4771 25.6945 38.4771 26.9101C38.4771 28.1256 37.4917 29.1109 36.2762 29.1109H34.0753H29.6735H27.4726C26.2571 29.1109 25.2717 28.1256 25.2717 26.9101C25.2717 25.6945 26.2571 24.7092 27.4726 24.7092C28.6881 24.7092 29.6735 25.6945 29.6735 26.9101Z" fill="#906EF7"/>
    <path d="M29.6735 45.3183V26.9101C29.6735 25.6945 28.6881 24.7092 27.4726 24.7092V24.7092C26.2571 24.7092 25.2717 25.6945 25.2717 26.9101V26.9101C25.2717 28.1256 26.2571 29.1109 27.4726 29.1109H36.2762C37.4917 29.1109 38.4771 28.1256 38.4771 26.9101V26.9101C38.4771 25.6945 37.4917 24.7092 36.2762 24.7092V24.7092C35.0607 24.7092 34.0753 25.6945 34.0753 26.9101V45.3183" stroke="white" stroke-width="2" stroke-linejoin="round"/>
  </g>
  <defs>
    <clipPath id="clip0_241_31636">
      <rect width="64" height="64" fill="white"/>
    </clipPath>
  </defs>
</svg>
`,meldSvg=Oe$1`<svg width="40" height="42" viewBox="0 0 40 42" fill="none">
<path opacity="0.7" d="M19.9526 41.9076L7.3877 34.655V26.1226L19.9526 33.3751V41.9076Z" fill="url(#paint0_linear_2113_32117)"/>
<path opacity="0.7" d="M19.9521 41.9076L32.5171 34.655V26.1226L19.9521 33.3751V41.9076Z" fill="url(#paint1_linear_2113_32117)"/>
<path opacity="0.7" d="M39.9095 7.34521V21.8562L32.5166 26.1225V11.6114L39.9095 7.34521Z" fill="url(#paint2_linear_2113_32117)"/>
<path d="M39.9099 7.34536L27.345 0.0927734L19.9521 4.359L32.5171 11.6116L39.9099 7.34536Z" fill="url(#paint3_linear_2113_32117)"/>
<path d="M0 7.34536L12.5649 0.0927734L19.9519 4.359L7.387 11.6116L0 7.34536Z" fill="#F969D3"/>
<path opacity="0.7" d="M0 7.34521V21.8562L7.387 26.1225V11.6114L0 7.34521Z" fill="url(#paint4_linear_2113_32117)"/>
<defs>
<linearGradient id="paint0_linear_2113_32117" x1="18.6099" y1="41.8335" x2="7.73529" y2="8.31842" gradientUnits="userSpaceOnUse">
<stop stop-color="#E98ADA"/>
<stop offset="1" stop-color="#7E4DBD"/>
</linearGradient>
<linearGradient id="paint1_linear_2113_32117" x1="26.2346" y1="26.1226" x2="26.2346" y2="41.9076" gradientUnits="userSpaceOnUse">
<stop stop-color="#719DED"/>
<stop offset="1" stop-color="#2545BE"/>
</linearGradient>
<linearGradient id="paint2_linear_2113_32117" x1="36.213" y1="7.34521" x2="36.213" y2="26.1225" gradientUnits="userSpaceOnUse">
<stop stop-color="#93EBFF"/>
<stop offset="1" stop-color="#197DDB"/>
</linearGradient>
<linearGradient id="paint3_linear_2113_32117" x1="29.931" y1="0.0927734" x2="38.2156" y2="14.8448" gradientUnits="userSpaceOnUse">
<stop stop-color="#F969D3"/>
<stop offset="1" stop-color="#4F51C0"/>
</linearGradient>
<linearGradient id="paint4_linear_2113_32117" x1="18.1251" y1="44.2539" x2="-7.06792" y2="15.2763" gradientUnits="userSpaceOnUse">
<stop stop-color="#E98ADA"/>
<stop offset="1" stop-color="#7E4DBD"/>
</linearGradient>
</defs>
</svg>`,styles$28=i$4`
  :host {
    display: block;
    width: var(--local-size);
    height: var(--local-size);
  }

  :host svg {
    width: 100%;
    height: 100%;
  }
`,solanaSvg=Oe$1`<svg fill="none" viewBox="0 0 80 80">
  <g clip-path="url(#a)">
    <path fill="url(#b)" d="M40 80a40 40 0 1 0 0-80 40 40 0 0 0 0 80Z" />
    <path
      stroke="#fff"
      stroke-opacity=".1"
      d="M79.5 40a39.5 39.5 0 1 1-79 0 39.5 39.5 0 0 1 79 0Z"
    />
    <path
      fill="#fff"
      d="m62.62 51.54-7.54 7.91a1.75 1.75 0 0 1-1.29.55H18.02a.9.9 0 0 1-.8-.52.84.84 0 0 1 .16-.92l7.55-7.92a1.75 1.75 0 0 1 1.28-.55h35.77a.87.87 0 0 1 .8.52.84.84 0 0 1-.16.93Zm-7.54-15.95a1.75 1.75 0 0 0-1.29-.54H18.02a.89.89 0 0 0-.8.51.84.84 0 0 0 .16.93l7.55 7.92a1.75 1.75 0 0 0 1.28.54h35.77a.89.89 0 0 0 .8-.51.84.84 0 0 0-.16-.93l-7.54-7.92ZM18.02 29.9h35.77a1.79 1.79 0 0 0 1.29-.54l7.54-7.92a.85.85 0 0 0 .16-.93.87.87 0 0 0-.8-.51H26.21a1.79 1.79 0 0 0-1.28.54l-7.55 7.92a.85.85 0 0 0-.16.93.89.89 0 0 0 .8.52Z"
    />
  </g>
  <defs>
    <linearGradient id="b" x1="6.75" x2="80.68" y1="81.91" y2="7.37" gradientUnits="userSpaceOnUse">
      <stop offset=".08" stop-color="#9945FF" />
      <stop offset=".3" stop-color="#8752F3" />
      <stop offset=".5" stop-color="#5497D5" />
      <stop offset=".6" stop-color="#43B4CA" />
      <stop offset=".72" stop-color="#28E0B9" />
      <stop offset=".97" stop-color="#19FB9B" />
    </linearGradient>
    <clipPath id="a"><path fill="#fff" d="M0 0h80v80H0z" /></clipPath>
  </defs>
</svg> `;var __decorate$2K=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const svgOptions={browser:browserSvg,dao:daoSvg,defi:defiSvg,defiAlt:defiAltSvg,eth:ethSvg,layers:layersSvg,lock:lockSvg,login:loginSvg,network:networkSvg,nft:nftSvg,noun:nounSvg,profile:profileSvg,system:systemSvg,coinbase:coinbaseSvg,meld:meldSvg,onrampCard:onrampCardSvg,moonpay:moonpaySvg,stripe:stripeSvg,paypal:paypalSvg,google:googleSvg,pencil:pencilSvg,lightbulb:lightbulbSvg,solana:solanaSvg};let WuiVisual=class extends h$3{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=`
       --local-size: var(--wui-visual-size-${this.size});
   `,ke`${svgOptions[this.name]}`}};WuiVisual.styles=[resetStyles,styles$28];__decorate$2K([n$4()],WuiVisual.prototype,"name",void 0);__decorate$2K([n$4()],WuiVisual.prototype,"size",void 0);WuiVisual=__decorate$2K([customElement("wui-visual")],WuiVisual);/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const to$2=Fn=>Fn??D$2,UiHelperUtil={getSpacingStyles(Fn,Mn){if(Array.isArray(Fn))return Fn[Mn]?`var(--wui-spacing-${Fn[Mn]})`:void 0;if(typeof Fn=="string")return`var(--wui-spacing-${Fn})`},getFormattedDate(Fn){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(Fn)},getHostName(Fn){try{return new URL(Fn).hostname}catch{return""}},getTruncateString({string:Fn,charsStart:Mn,charsEnd:rs,truncate:is}){return Fn.length<=Mn+rs?Fn:is==="end"?`${Fn.substring(0,Mn)}...`:is==="start"?`...${Fn.substring(Fn.length-rs)}`:`${Fn.substring(0,Math.floor(Mn))}...${Fn.substring(Fn.length-Math.floor(rs))}`},generateAvatarColors(Fn){const rs=Fn.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),is=this.hexToRgb(rs),os=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),us=100-3*Number(os==null?void 0:os.replace("px","")),ds=`${us}% ${us}% at 65% 40%`,hs=[];for(let ps=0;ps<5;ps+=1){const io=this.tintColor(is,.15*ps);hs.push(`rgb(${io[0]}, ${io[1]}, ${io[2]})`)}return`
    --local-color-1: ${hs[0]};
    --local-color-2: ${hs[1]};
    --local-color-3: ${hs[2]};
    --local-color-4: ${hs[3]};
    --local-color-5: ${hs[4]};
    --local-radial-circle: ${ds}
   `},hexToRgb(Fn){const Mn=parseInt(Fn,16),rs=Mn>>16&255,is=Mn>>8&255,os=Mn&255;return[rs,is,os]},tintColor(Fn,Mn){const[rs,is,os]=Fn,as=Math.round(rs+(255-rs)*Mn),us=Math.round(is+(255-is)*Mn),ds=Math.round(os+(255-os)*Mn);return[as,us,ds]},isNumber(Fn){return{number:/^[0-9]+$/u}.number.test(Fn)},getColorTheme(Fn){return Fn||(typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark")},splitBalance(Fn){const Mn=Fn.split(".");return Mn.length===2?[Mn[0],Mn[1]]:["0","00"]},roundNumber(Fn,Mn,rs){return Fn.toString().length>=Mn?Number(Fn).toFixed(rs):Fn},formatNumberToLocalString(Fn,Mn=2){return Fn===void 0?"0.00":typeof Fn=="number"?Fn.toLocaleString("en-US",{maximumFractionDigits:Mn,minimumFractionDigits:Mn}):parseFloat(Fn).toLocaleString("en-US",{maximumFractionDigits:Mn,minimumFractionDigits:Mn})}},styles$27=i$4`
  :host {
    display: flex;
    width: inherit;
    height: inherit;
  }
`;var __decorate$2J=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiFlex=class extends h$3{render(){return this.style.cssText=`
      flex-direction: ${this.flexDirection};
      flex-wrap: ${this.flexWrap};
      flex-basis: ${this.flexBasis};
      flex-grow: ${this.flexGrow};
      flex-shrink: ${this.flexShrink};
      align-items: ${this.alignItems};
      justify-content: ${this.justifyContent};
      column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`};
      row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`};
      gap: ${this.gap&&`var(--wui-spacing-${this.gap})`};
      padding-top: ${this.padding&&UiHelperUtil.getSpacingStyles(this.padding,0)};
      padding-right: ${this.padding&&UiHelperUtil.getSpacingStyles(this.padding,1)};
      padding-bottom: ${this.padding&&UiHelperUtil.getSpacingStyles(this.padding,2)};
      padding-left: ${this.padding&&UiHelperUtil.getSpacingStyles(this.padding,3)};
      margin-top: ${this.margin&&UiHelperUtil.getSpacingStyles(this.margin,0)};
      margin-right: ${this.margin&&UiHelperUtil.getSpacingStyles(this.margin,1)};
      margin-bottom: ${this.margin&&UiHelperUtil.getSpacingStyles(this.margin,2)};
      margin-left: ${this.margin&&UiHelperUtil.getSpacingStyles(this.margin,3)};
    `,ke`<slot></slot>`}};WuiFlex.styles=[resetStyles,styles$27];__decorate$2J([n$4()],WuiFlex.prototype,"flexDirection",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"flexWrap",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"flexBasis",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"flexGrow",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"flexShrink",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"alignItems",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"justifyContent",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"columnGap",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"rowGap",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"gap",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"padding",void 0);__decorate$2J([n$4()],WuiFlex.prototype,"margin",void 0);WuiFlex=__decorate$2J([customElement("wui-flex")],WuiFlex);const styles$26=i$4`
  :host {
    display: block;
    width: var(--local-width);
    height: var(--local-height);
    border-radius: var(--wui-border-radius-3xl);
    box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005);
    overflow: hidden;
    position: relative;
  }

  :host([data-variant='generated']) {
    --mixed-local-color-1: var(--local-color-1);
    --mixed-local-color-2: var(--local-color-2);
    --mixed-local-color-3: var(--local-color-3);
    --mixed-local-color-4: var(--local-color-4);
    --mixed-local-color-5: var(--local-color-5);
  }

  @supports (background: color-mix(in srgb, white 50%, black)) {
    :host([data-variant='generated']) {
      --mixed-local-color-1: color-mix(
        in srgb,
        var(--w3m-color-mix) var(--w3m-color-mix-strength),
        var(--local-color-1)
      );
      --mixed-local-color-2: color-mix(
        in srgb,
        var(--w3m-color-mix) var(--w3m-color-mix-strength),
        var(--local-color-2)
      );
      --mixed-local-color-3: color-mix(
        in srgb,
        var(--w3m-color-mix) var(--w3m-color-mix-strength),
        var(--local-color-3)
      );
      --mixed-local-color-4: color-mix(
        in srgb,
        var(--w3m-color-mix) var(--w3m-color-mix-strength),
        var(--local-color-4)
      );
      --mixed-local-color-5: color-mix(
        in srgb,
        var(--w3m-color-mix) var(--w3m-color-mix-strength),
        var(--local-color-5)
      );
    }
  }

  :host([data-variant='generated']) {
    box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005);
    background: radial-gradient(
      var(--local-radial-circle),
      #fff 0.52%,
      var(--mixed-local-color-5) 31.25%,
      var(--mixed-local-color-3) 51.56%,
      var(--mixed-local-color-2) 65.63%,
      var(--mixed-local-color-1) 82.29%,
      var(--mixed-local-color-4) 100%
    );
  }

  :host([data-variant='default']) {
    box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005);
    background: radial-gradient(
      75.29% 75.29% at 64.96% 24.36%,
      #fff 0.52%,
      #f5ccfc 31.25%,
      #dba4f5 51.56%,
      #9a8ee8 65.63%,
      #6493da 82.29%,
      #6ebdea 100%
    );
  }
`;var __decorate$2I=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiAvatar=class extends h$3{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0,this.size="xl"}render(){return this.style.cssText=`
    --local-width: var(--wui-icon-box-size-${this.size});
    --local-height: var(--wui-icon-box-size-${this.size});
    `,ke`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",ke`<wui-image src=${this.imageSrc} alt=${this.alt??"avatar"}></wui-image>`;if(this.address){this.dataset.variant="generated";const Mn=UiHelperUtil.generateAvatarColors(this.address);return this.style.cssText+=`
 ${Mn}`,null}return this.dataset.variant="default",null}};WuiAvatar.styles=[resetStyles,styles$26];__decorate$2I([n$4()],WuiAvatar.prototype,"imageSrc",void 0);__decorate$2I([n$4()],WuiAvatar.prototype,"alt",void 0);__decorate$2I([n$4()],WuiAvatar.prototype,"address",void 0);__decorate$2I([n$4()],WuiAvatar.prototype,"size",void 0);WuiAvatar=__decorate$2I([customElement("wui-avatar")],WuiAvatar);const styles$25=i$4`
  :host {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: var(--wui-color-gray-glass-020);
    border-radius: var(--local-border-radius);
    border: var(--local-border);
    box-sizing: content-box;
    width: var(--local-size);
    height: var(--local-size);
    min-height: var(--local-size);
    min-width: var(--local-size);
  }

  @supports (background: color-mix(in srgb, white 50%, black)) {
    :host {
      background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent);
    }
  }
`;var __decorate$2H=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiIconBox=class extends h$3{constructor(){super(...arguments),this.size="md",this.backgroundColor="accent-100",this.iconColor="accent-100",this.background="transparent",this.border=!1,this.borderColor="wui-color-bg-125",this.icon="copy"}render(){const Mn=this.iconSize||this.size,rs=this.size==="lg",is=this.size==="xl",os=rs?"12%":"16%",as=rs?"xxs":is?"s":"3xl",us=this.background==="gray",ds=this.background==="opaque",hs=this.backgroundColor==="accent-100"&&ds||this.backgroundColor==="success-100"&&ds||this.backgroundColor==="error-100"&&ds||this.backgroundColor==="inverse-100"&&ds;let ps=`var(--wui-color-${this.backgroundColor})`;return hs?ps=`var(--wui-icon-box-bg-${this.backgroundColor})`:us&&(ps=`var(--wui-color-gray-${this.backgroundColor})`),this.style.cssText=`
       --local-bg-value: ${ps};
       --local-bg-mix: ${hs||us?"100%":os};
       --local-border-radius: var(--wui-border-radius-${as});
       --local-size: var(--wui-icon-box-size-${this.size});
       --local-border: ${this.borderColor==="wui-color-bg-125"?"2px":"1px"} solid ${this.border?`var(--${this.borderColor})`:"transparent"}
   `,ke` <wui-icon color=${this.iconColor} size=${Mn} name=${this.icon}></wui-icon> `}};WuiIconBox.styles=[resetStyles,elementStyles,styles$25];__decorate$2H([n$4()],WuiIconBox.prototype,"size",void 0);__decorate$2H([n$4()],WuiIconBox.prototype,"backgroundColor",void 0);__decorate$2H([n$4()],WuiIconBox.prototype,"iconColor",void 0);__decorate$2H([n$4()],WuiIconBox.prototype,"iconSize",void 0);__decorate$2H([n$4()],WuiIconBox.prototype,"background",void 0);__decorate$2H([n$4({type:Boolean})],WuiIconBox.prototype,"border",void 0);__decorate$2H([n$4()],WuiIconBox.prototype,"borderColor",void 0);__decorate$2H([n$4()],WuiIconBox.prototype,"icon",void 0);WuiIconBox=__decorate$2H([customElement("wui-icon-box")],WuiIconBox);const styles$24=i$4`
  :host {
    display: block;
  }

  button {
    border-radius: var(--wui-border-radius-3xl);
    background: var(--wui-color-gray-glass-002);
    display: flex;
    gap: var(--wui-spacing-xs);
    padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) var(--wui-spacing-3xs)
      var(--wui-spacing-xs);
    border: 1px solid var(--wui-color-gray-glass-005);
  }

  button:disabled {
    background: var(--wui-color-gray-glass-015);
  }

  button:disabled > wui-text {
    color: var(--wui-color-gray-glass-015);
  }

  button:disabled > wui-flex > wui-text {
    color: var(--wui-color-gray-glass-015);
  }

  button:disabled > wui-image,
  button:disabled > wui-flex > wui-avatar {
    filter: grayscale(1);
  }

  button:has(wui-image) {
    padding: var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-3xs)
      var(--wui-spacing-xs);
  }

  wui-text {
    color: var(--wui-color-fg-100);
  }

  wui-flex > wui-text {
    color: var(--wui-color-fg-200);
  }

  wui-image,
  wui-icon-box {
    border-radius: var(--wui-border-radius-3xl);
    width: 24px;
    height: 24px;
    box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
  }

  wui-flex {
    border-radius: var(--wui-border-radius-3xl);
    border: 1px solid var(--wui-color-gray-glass-005);
    background: var(--wui-color-gray-glass-005);
    padding: 4px var(--wui-spacing-m) 4px var(--wui-spacing-xxs);
  }

  button.local-no-balance {
    border-radius: 0px;
    border: none;
    background: transparent;
  }

  wui-avatar {
    width: 20px;
    height: 20px;
    box-shadow: 0 0 0 2px var(--wui-color-accent-glass-010);
  }

  @media (max-width: 500px) {
    button {
      gap: 0px;
      padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) !important;
      height: 32px;
    }
    wui-image,
    wui-icon-box,
    button > wui-text {
      visibility: hidden;
      width: 0px;
      height: 0px;
    }
    button {
      border-radius: 0px;
      border: none;
      background: transparent;
      padding: 0px;
    }
  }

  @media (hover: hover) and (pointer: fine) {
    button:hover:enabled > wui-flex > wui-text {
      color: var(--wui-color-fg-175);
    }

    button:active:enabled > wui-flex > wui-text {
      color: var(--wui-color-fg-175);
    }
  }
`;var __decorate$2G=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiAccountButton=class extends h$3{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return ke`
      <button
        ?disabled=${this.disabled}
        class=${to$2(this.balance?void 0:"local-no-balance")}
      >
        ${this.balanceTemplate()}
        <wui-flex gap="xxs" alignItems="center">
          <wui-avatar
            .imageSrc=${this.avatarSrc}
            alt=${this.address}
            address=${this.address}
          ></wui-avatar>
          <wui-text variant="paragraph-600" color="inherit">
            ${this.address?UiHelperUtil.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"}):null}
          </wui-text>
        </wui-flex>
      </button>
    `}balanceTemplate(){if(this.isUnsupportedChain)return ke` <wui-icon-box
          size="sm"
          iconColor="error-100"
          backgroundColor="error-100"
          icon="warningCircle"
        ></wui-icon-box>
        <wui-text variant="paragraph-600" color="inherit"> Switch Network</wui-text>`;if(this.balance){const Mn=this.networkSrc?ke`<wui-image src=${this.networkSrc}></wui-image>`:ke`
            <wui-icon-box
              size="sm"
              iconColor="fg-200"
              backgroundColor="fg-300"
              icon="networkPlaceholder"
            ></wui-icon-box>
          `;return ke`
        ${Mn}
        <wui-text variant="paragraph-600" color="inherit"> ${this.balance}</wui-text>
      `}return null}};WuiAccountButton.styles=[resetStyles,elementStyles,styles$24];__decorate$2G([n$4()],WuiAccountButton.prototype,"networkSrc",void 0);__decorate$2G([n$4()],WuiAccountButton.prototype,"avatarSrc",void 0);__decorate$2G([n$4()],WuiAccountButton.prototype,"balance",void 0);__decorate$2G([n$4({type:Boolean})],WuiAccountButton.prototype,"isUnsupportedChain",void 0);__decorate$2G([n$4({type:Boolean})],WuiAccountButton.prototype,"disabled",void 0);__decorate$2G([n$4()],WuiAccountButton.prototype,"address",void 0);__decorate$2G([n$4()],WuiAccountButton.prototype,"profileName",void 0);__decorate$2G([n$4()],WuiAccountButton.prototype,"charsStart",void 0);__decorate$2G([n$4()],WuiAccountButton.prototype,"charsEnd",void 0);WuiAccountButton=__decorate$2G([customElement("wui-account-button")],WuiAccountButton);const styles$23=i$4`
  :host {
    position: relative;
    background-color: var(--wui-color-gray-glass-002);
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--local-size);
    height: var(--local-size);
    border-radius: inherit;
    border-radius: var(--local-border-radius);
  }

  :host > wui-flex {
    overflow: hidden;
    border-radius: inherit;
    border-radius: var(--local-border-radius);
  }

  :host::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: inherit;
    border: 1px solid var(--wui-color-gray-glass-010);
    pointer-events: none;
  }

  :host([name='Extension'])::after {
    border: 1px solid var(--wui-color-accent-glass-010);
  }

  :host([data-wallet-icon='allWallets']) {
    background-color: var(--wui-all-wallets-bg-100);
  }

  :host([data-wallet-icon='allWallets'])::after {
    border: 1px solid var(--wui-color-accent-glass-010);
  }

  wui-icon[data-parent-size='inherit'] {
    width: 75%;
    height: 75%;
    align-items: center;
  }

  wui-icon[data-parent-size='sm'] {
    width: 18px;
    height: 18px;
  }

  wui-icon[data-parent-size='md'] {
    width: 24px;
    height: 24px;
  }

  wui-icon[data-parent-size='lg'] {
    width: 42px;
    height: 42px;
  }

  wui-icon[data-parent-size='full'] {
    width: 100%;
    height: 100%;
  }

  :host > wui-icon-box {
    position: absolute;
    overflow: hidden;
    right: -1px;
    bottom: -2px;
    z-index: 1;
    border: 2px solid var(--wui-color-bg-150, #1e1f1f);
    padding: 1px;
  }
`;var __decorate$2F=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiWalletImage=class extends h$3{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let Mn="xxs";return this.size==="lg"?Mn="m":this.size==="md"?Mn="xs":Mn="xxs",this.style.cssText=`
       --local-border-radius: var(--wui-border-radius-${Mn});
       --local-size: var(--wui-wallet-image-size-${this.size});
   `,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),ke`
      <wui-flex justifyContent="center" alignItems="center"> ${this.templateVisual()} </wui-flex>
    `}templateVisual(){return this.imageSrc?ke`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:this.walletIcon?ke`<wui-icon
        data-parent-size="md"
        size="md"
        color="inherit"
        name=${this.walletIcon}
      ></wui-icon>`:ke`<wui-icon
      data-parent-size=${this.size}
      size="inherit"
      color="inherit"
      name="walletPlaceholder"
    ></wui-icon>`}};WuiWalletImage.styles=[resetStyles,styles$23];__decorate$2F([n$4()],WuiWalletImage.prototype,"size",void 0);__decorate$2F([n$4()],WuiWalletImage.prototype,"name",void 0);__decorate$2F([n$4()],WuiWalletImage.prototype,"imageSrc",void 0);__decorate$2F([n$4()],WuiWalletImage.prototype,"walletIcon",void 0);__decorate$2F([n$4({type:Boolean})],WuiWalletImage.prototype,"installed",void 0);__decorate$2F([n$4()],WuiWalletImage.prototype,"badgeSize",void 0);WuiWalletImage=__decorate$2F([customElement("wui-wallet-image")],WuiWalletImage);const styles$22=i$4`
  :host {
    position: relative;
    border-radius: var(--wui-border-radius-xxs);
    width: 40px;
    height: 40px;
    overflow: hidden;
    background: var(--wui-color-gray-glass-002);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--wui-spacing-4xs);
    padding: 3.75px !important;
  }

  :host::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: inherit;
    border: 1px solid var(--wui-color-gray-glass-010);
    pointer-events: none;
  }

  :host > wui-wallet-image {
    width: 14px;
    height: 14px;
    border-radius: var(--wui-border-radius-5xs);
  }

  :host > wui-flex {
    padding: 2px;
    position: fixed;
    overflow: hidden;
    left: 34px;
    bottom: 8px;
    background: var(--dark-background-150, #1e1f1f);
    border-radius: 50%;
    z-index: 2;
    display: flex;
  }
`;var __decorate$2E=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const TOTAL_IMAGES=4;let WuiAllWalletsImage=class extends h$3{constructor(){super(...arguments),this.walletImages=[]}render(){const Mn=this.walletImages.length<TOTAL_IMAGES;return ke`${this.walletImages.slice(0,TOTAL_IMAGES).map(({src:rs,walletName:is})=>ke`
            <wui-wallet-image
              size="inherit"
              imageSrc=${rs}
              name=${to$2(is)}
            ></wui-wallet-image>
          `)}
      ${Mn?[...Array(TOTAL_IMAGES-this.walletImages.length)].map(()=>ke` <wui-wallet-image size="inherit" name=""></wui-wallet-image>`):null}
      <wui-flex>
        <wui-icon-box
          size="xxs"
          iconSize="xxs"
          iconcolor="success-100"
          backgroundcolor="success-100"
          icon="checkmark"
          background="opaque"
        ></wui-icon-box>
      </wui-flex>`}};WuiAllWalletsImage.styles=[resetStyles,styles$22];__decorate$2E([n$4({type:Array})],WuiAllWalletsImage.prototype,"walletImages",void 0);WuiAllWalletsImage=__decorate$2E([customElement("wui-all-wallets-image")],WuiAllWalletsImage);const styles$21=i$4`
  :host {
    width: var(--local-width);
    position: relative;
  }

  button {
    border: none;
    border-radius: var(--local-border-radius);
    width: var(--local-width);
    white-space: nowrap;
  }

  /* -- Sizes --------------------------------------------------- */
  button[data-size='md'] {
    padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l);
    height: 36px;
  }

  button[data-size='md'][data-icon-left='true'][data-icon-right='false'] {
    padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s);
  }

  button[data-size='md'][data-icon-right='true'][data-icon-left='false'] {
    padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l);
  }

  button[data-size='lg'] {
    padding: var(--wui-spacing-m) var(--wui-spacing-2l);
    height: 48px;
  }

  /* -- Variants --------------------------------------------------------- */
  button[data-variant='main'] {
    background-color: var(--wui-color-accent-100);
    color: var(--wui-color-inverse-100);
    border: none;
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
  }

  button[data-variant='inverse'] {
    background-color: var(--wui-color-inverse-100);
    color: var(--wui-color-inverse-000);
    border: none;
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
  }

  button[data-variant='accent'] {
    background-color: var(--wui-color-accent-glass-010);
    color: var(--wui-color-accent-100);
    border: none;
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
  }

  button[data-variant='accent-error'] {
    background: var(--wui-color-error-glass-015);
    color: var(--wui-color-error-100);
    border: none;
    box-shadow: inset 0 0 0 1px var(--wui-color-error-glass-010);
  }

  button[data-variant='accent-success'] {
    background: var(--wui-color-success-glass-015);
    color: var(--wui-color-success-100);
    border: none;
    box-shadow: inset 0 0 0 1px var(--wui-color-success-glass-010);
  }

  button[data-variant='neutral'] {
    background: transparent;
    color: var(--wui-color-fg-100);
    border: none;
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
  }

  /* -- Focus states --------------------------------------------------- */
  button[data-variant='main']:focus-visible:enabled {
    background-color: var(--wui-color-accent-090);
    box-shadow:
      inset 0 0 0 1px var(--wui-color-accent-100),
      0 0 0 4px var(--wui-color-accent-glass-020);
  }
  button[data-variant='inverse']:focus-visible:enabled {
    background-color: var(--wui-color-inverse-100);
    box-shadow:
      inset 0 0 0 1px var(--wui-color-gray-glass-010),
      0 0 0 4px var(--wui-color-accent-glass-020);
  }
  button[data-variant='accent']:focus-visible:enabled {
    background-color: var(--wui-color-accent-glass-010);
    box-shadow:
      inset 0 0 0 1px var(--wui-color-accent-100),
      0 0 0 4px var(--wui-color-accent-glass-020);
  }
  button[data-variant='accent-error']:focus-visible:enabled {
    background: var(--wui-color-error-glass-015);
    box-shadow:
      inset 0 0 0 1px var(--wui-color-error-100),
      0 0 0 4px var(--wui-color-error-glass-020);
  }
  button[data-variant='accent-success']:focus-visible:enabled {
    background: var(--wui-color-success-glass-015);
    box-shadow:
      inset 0 0 0 1px var(--wui-color-success-100),
      0 0 0 4px var(--wui-color-success-glass-020);
  }
  button[data-variant='neutral']:focus-visible:enabled {
    background: var(--wui-color-gray-glass-005);
    box-shadow:
      inset 0 0 0 1px var(--wui-color-gray-glass-010),
      0 0 0 4px var(--wui-color-gray-glass-002);
  }

  /* -- Hover & Active states ----------------------------------------------------------- */
  @media (hover: hover) and (pointer: fine) {
    button[data-variant='main']:hover:enabled {
      background-color: var(--wui-color-accent-090);
    }

    button[data-variant='main']:active:enabled {
      background-color: var(--wui-color-accent-080);
    }

    button[data-variant='accent']:hover:enabled {
      background-color: var(--wui-color-accent-glass-015);
    }

    button[data-variant='accent']:active:enabled {
      background-color: var(--wui-color-accent-glass-020);
    }

    button[data-variant='accent-error']:hover:enabled {
      background: var(--wui-color-error-glass-020);
      color: var(--wui-color-error-100);
    }

    button[data-variant='accent-error']:active:enabled {
      background: var(--wui-color-error-glass-030);
      color: var(--wui-color-error-100);
    }

    button[data-variant='accent-success']:hover:enabled {
      background: var(--wui-color-success-glass-020);
      color: var(--wui-color-success-100);
    }

    button[data-variant='accent-success']:active:enabled {
      background: var(--wui-color-success-glass-030);
      color: var(--wui-color-success-100);
    }

    button[data-variant='neutral']:hover:enabled {
      background: var(--wui-color-gray-glass-002);
    }

    button[data-variant='neutral']:active:enabled {
      background: var(--wui-color-gray-glass-005);
    }

    button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] {
      padding-left: var(--wui-spacing-m);
    }

    button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] {
      padding-right: var(--wui-spacing-m);
    }
  }

  /* -- Disabled state --------------------------------------------------- */
  button:disabled {
    background-color: var(--wui-color-gray-glass-002);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
    color: var(--wui-color-gray-glass-020);
    cursor: not-allowed;
  }

  button > wui-text {
    transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: opacity;
    opacity: var(--local-opacity-100);
  }

  ::slotted(*) {
    transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: opacity;
    opacity: var(--local-opacity-100);
  }

  wui-loading-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: var(--local-opacity-000);
  }
`;var __decorate$2D=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const SPINNER_COLOR_BY_VARIANT={main:"inverse-100",inverse:"inverse-000",accent:"accent-100","accent-error":"error-100","accent-success":"success-100",neutral:"fg-100",disabled:"gray-glass-020"},TEXT_VARIANT_BY_SIZE={lg:"paragraph-600",md:"small-600"},SPINNER_SIZE_BY_SIZE={lg:"md",md:"md"};let WuiButton=class extends h$3{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="main",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=`
    --local-width: ${this.fullWidth?"100%":"auto"};
    --local-opacity-100: ${this.loading?0:1};
    --local-opacity-000: ${this.loading?1:0};
    --local-border-radius: var(--wui-border-radius-${this.borderRadius});
    `;const Mn=this.textVariant??TEXT_VARIANT_BY_SIZE[this.size];return ke`
      <button
        data-variant=${this.variant}
        data-icon-left=${this.hasIconLeft}
        data-icon-right=${this.hasIconRight}
        data-size=${this.size}
        ?disabled=${this.disabled}
        ontouchstart
      >
        ${this.loadingTemplate()}
        <slot name="iconLeft" @slotchange=${()=>this.handleSlotLeftChange()}></slot>
        <wui-text variant=${Mn} color="inherit">
          <slot></slot>
        </wui-text>
        <slot name="iconRight" @slotchange=${()=>this.handleSlotRightChange()}></slot>
      </button>
    `}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){if(this.loading){const Mn=SPINNER_SIZE_BY_SIZE[this.size],rs=this.disabled?SPINNER_COLOR_BY_VARIANT.disabled:SPINNER_COLOR_BY_VARIANT[this.variant];return ke`<wui-loading-spinner color=${rs} size=${Mn}></wui-loading-spinner>`}return ke``}};WuiButton.styles=[resetStyles,elementStyles,styles$21];__decorate$2D([n$4()],WuiButton.prototype,"size",void 0);__decorate$2D([n$4({type:Boolean})],WuiButton.prototype,"disabled",void 0);__decorate$2D([n$4({type:Boolean})],WuiButton.prototype,"fullWidth",void 0);__decorate$2D([n$4({type:Boolean})],WuiButton.prototype,"loading",void 0);__decorate$2D([n$4()],WuiButton.prototype,"variant",void 0);__decorate$2D([n$4({type:Boolean})],WuiButton.prototype,"hasIconLeft",void 0);__decorate$2D([n$4({type:Boolean})],WuiButton.prototype,"hasIconRight",void 0);__decorate$2D([n$4()],WuiButton.prototype,"borderRadius",void 0);__decorate$2D([n$4()],WuiButton.prototype,"textVariant",void 0);WuiButton=__decorate$2D([customElement("wui-button")],WuiButton);const networkSvgMd=Oe$1`<svg  viewBox="0 0 48 54" fill="none">
  <path
    d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z"
  />
</svg>`,styles$20=i$4`
  :host {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 76px;
    row-gap: var(--wui-spacing-xs);
    padding: var(--wui-spacing-xs) 10px;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: clamp(0px, var(--wui-border-radius-xs), 20px);
    position: relative;
  }

  wui-shimmer[data-type='network'] {
    border: none;
    -webkit-clip-path: var(--wui-path-network);
    clip-path: var(--wui-path-network);
  }

  svg {
    position: absolute;
    width: 48px;
    height: 54px;
    z-index: 1;
  }

  svg > path {
    stroke: var(--wui-color-gray-glass-010);
    stroke-width: 1px;
  }
`;var __decorate$2C=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiCardSelectLoader=class extends h$3{constructor(){super(...arguments),this.type="wallet"}render(){return ke`
      ${this.shimmerTemplate()}
      <wui-shimmer width="56px" height="20px" borderRadius="xs"></wui-shimmer>
    `}shimmerTemplate(){return this.type==="network"?ke` <wui-shimmer
          data-type=${this.type}
          width="48px"
          height="54px"
          borderRadius="xs"
        ></wui-shimmer>
        ${networkSvgMd}`:ke`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}};WuiCardSelectLoader.styles=[resetStyles,elementStyles,styles$20];__decorate$2C([n$4()],WuiCardSelectLoader.prototype,"type",void 0);WuiCardSelectLoader=__decorate$2C([customElement("wui-card-select-loader")],WuiCardSelectLoader);const networkSvgSm=Oe$1`
  <svg fill="none" viewBox="0 0 36 40">
    <path
      d="M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z"
    />
  </svg>
`,networkSvgLg=Oe$1`<svg width="86" height="96" fill="none">
  <path
    d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
  />
</svg>`,styles$1$=i$4`
  :host {
    position: relative;
    border-radius: inherit;
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--local-width);
    height: var(--local-height);
  }

  :host([data-round='true']) {
    background: var(--wui-color-gray-glass-002);
    border-radius: 100%;
    outline: 1px solid var(--wui-color-gray-glass-005);
  }

  svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    fill: var(--wui-color-gray-glass-002);
  }

  svg > path {
    stroke: var(--local-stroke);
  }

  wui-image {
    width: 100%;
    height: 100%;
    -webkit-clip-path: var(--local-path);
    clip-path: var(--local-path);
    background: var(--wui-color-gray-glass-002);
  }

  wui-icon {
    transform: translateY(-5%);
    width: var(--local-icon-size);
    height: var(--local-icon-size);
  }
`;var __decorate$2B=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiNetworkImage=class extends h$3{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:networkSvgSm,md:networkSvgMd,lg:networkSvgLg},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=`
      --local-width: var(--wui-spacing-3xl);
      --local-height: var(--wui-spacing-3xl);
      --local-icon-size: var(--wui-spacing-l);
    `):this.style.cssText=`

      --local-path: var(--wui-path-network-${this.size});
      --local-width:  var(--wui-width-network-${this.size});
      --local-height:  var(--wui-height-network-${this.size});
      --local-icon-size:  var(--wui-icon-size-network-${this.size});
    `,ke`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?ke`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:ke`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};WuiNetworkImage.styles=[resetStyles,styles$1$];__decorate$2B([n$4()],WuiNetworkImage.prototype,"size",void 0);__decorate$2B([n$4()],WuiNetworkImage.prototype,"name",void 0);__decorate$2B([n$4({type:Object})],WuiNetworkImage.prototype,"networkImagesBySize",void 0);__decorate$2B([n$4()],WuiNetworkImage.prototype,"imageSrc",void 0);__decorate$2B([n$4({type:Boolean})],WuiNetworkImage.prototype,"selected",void 0);__decorate$2B([n$4({type:Boolean})],WuiNetworkImage.prototype,"round",void 0);WuiNetworkImage=__decorate$2B([customElement("wui-network-image")],WuiNetworkImage);const styles$1_=i$4`
  button {
    flex-direction: column;
    width: 76px;
    row-gap: var(--wui-spacing-xs);
    padding: var(--wui-spacing-xs) var(--wui-spacing-0);
    background-color: var(--wui-color-gray-glass-002);
    border-radius: clamp(0px, var(--wui-border-radius-xs), 20px);
  }

  button > wui-text {
    color: var(--wui-color-fg-100);
    max-width: var(--wui-icon-box-size-xl);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: center;
  }

  button:disabled > wui-text {
    color: var(--wui-color-gray-glass-015);
  }

  [data-selected='true'] {
    background-color: var(--wui-color-accent-glass-020);
  }

  @media (hover: hover) and (pointer: fine) {
    [data-selected='true']:hover:enabled {
      background-color: var(--wui-color-accent-glass-015);
    }
  }

  [data-selected='true']:active:enabled {
    background-color: var(--wui-color-accent-glass-010);
  }
`;var __decorate$2A=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiCardSelect=class extends h$3{constructor(){super(...arguments),this.name="Unknown",this.type="wallet",this.imageSrc=void 0,this.disabled=!1,this.selected=!1,this.installed=!1}render(){return ke`
      <button data-selected=${to$2(this.selected)} ?disabled=${this.disabled} ontouchstart>
        ${this.imageTemplate()}
        <wui-text variant="tiny-500" color=${this.selected?"accent-100":"inherit"}>
          ${this.name}
        </wui-text>
      </button>
    `}imageTemplate(){return this.type==="network"?ke`
        <wui-network-image
          .selected=${this.selected}
          imageSrc=${to$2(this.imageSrc)}
          name=${this.name}
        >
        </wui-network-image>
      `:ke`
      <wui-wallet-image
        size="md"
        imageSrc=${to$2(this.imageSrc)}
        name=${this.name}
        .installed=${this.installed}
        badgeSize="sm"
      >
      </wui-wallet-image>
    `}};WuiCardSelect.styles=[resetStyles,elementStyles,styles$1_];__decorate$2A([n$4()],WuiCardSelect.prototype,"name",void 0);__decorate$2A([n$4()],WuiCardSelect.prototype,"type",void 0);__decorate$2A([n$4()],WuiCardSelect.prototype,"imageSrc",void 0);__decorate$2A([n$4({type:Boolean})],WuiCardSelect.prototype,"disabled",void 0);__decorate$2A([n$4({type:Boolean})],WuiCardSelect.prototype,"selected",void 0);__decorate$2A([n$4({type:Boolean})],WuiCardSelect.prototype,"installed",void 0);WuiCardSelect=__decorate$2A([customElement("wui-card-select")],WuiCardSelect);const styles$1Z=i$4`
  a {
    border: 1px solid var(--wui-color-gray-glass-010);
    border-radius: var(--wui-border-radius-3xl);
  }

  wui-image {
    border-radius: var(--wui-border-radius-3xl);
    overflow: hidden;
  }

  a.disabled > wui-icon:not(.image-icon),
  a.disabled > wui-image {
    filter: grayscale(1);
  }

  a[data-variant='fill'] {
    color: var(--wui-color-inverse-100);
    background-color: var(--wui-color-accent-100);
  }

  a[data-variant='shade'],
  a[data-variant='shadeSmall'] {
    background-color: transparent;
    background-color: var(--wui-color-gray-glass-010);
    color: var(--wui-color-fg-200);
  }

  a[data-variant='success'] {
    column-gap: var(--wui-spacing-xxs);
    border: 1px solid var(--wui-color-success-glass-010);
    background-color: var(--wui-color-success-glass-010);
    color: var(--wui-color-success-100);
  }

  a[data-variant='error'] {
    column-gap: var(--wui-spacing-xxs);
    border: 1px solid var(--wui-color-error-glass-010);
    background-color: var(--wui-color-error-glass-010);
    color: var(--wui-color-error-100);
  }

  a[data-variant='transparent'] {
    column-gap: var(--wui-spacing-xxs);
    background-color: transparent;
    color: var(--wui-color-fg-150);
  }

  a[data-variant='transparent'],
  a[data-variant='success'],
  a[data-variant='shadeSmall'],
  a[data-variant='error'] {
    padding: 7px var(--wui-spacing-s) 7px 10px;
  }

  a[data-variant='transparent']:has(wui-text:first-child),
  a[data-variant='success']:has(wui-text:first-child),
  a[data-variant='shadeSmall']:has(wui-text:first-child),
  a[data-variant='error']:has(wui-text:first-child) {
    padding: 7px var(--wui-spacing-s);
  }

  a[data-variant='fill'],
  a[data-variant='shade'] {
    column-gap: var(--wui-spacing-xs);
    padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs)
      var(--wui-spacing-xs);
  }

  a[data-variant='fill']:has(wui-text:first-child),
  a[data-variant='shade']:has(wui-text:first-child) {
    padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m);
  }

  a[data-variant='fill'] > wui-image,
  a[data-variant='shade'] > wui-image {
    width: 24px;
    height: 24px;
  }

  a[data-variant='fill'] > wui-image {
    box-shadow: inset 0 0 0 1px var(--wui-color-accent-090);
  }

  a[data-variant='shade'] > wui-image,
  a[data-variant='shadeSmall'] > wui-image {
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
  }

  a[data-variant='fill'] > wui-icon:not(.image-icon),
  a[data-variant='shade'] > wui-icon:not(.image-icon) {
    width: 14px;
    height: 14px;
  }

  a[data-variant='transparent'] > wui-image,
  a[data-variant='success'] > wui-image,
  a[data-variant='shadeSmall'] > wui-image,
  a[data-variant='error'] > wui-image {
    width: 14px;
    height: 14px;
  }

  a[data-variant='transparent'] > wui-icon:not(.image-icon),
  a[data-variant='success'] > wui-icon:not(.image-icon),
  a[data-variant='shadeSmall'] > wui-icon:not(.image-icon),
  a[data-variant='error'] > wui-icon:not(.image-icon) {
    width: 12px;
    height: 12px;
  }

  a[data-variant='fill']:focus-visible {
    background-color: var(--wui-color-accent-090);
  }

  a[data-variant='shade']:focus-visible,
  a[data-variant='shadeSmall']:focus-visible {
    background-color: var(--wui-color-gray-glass-015);
  }

  a[data-variant='transparent']:focus-visible {
    background-color: var(--wui-color-gray-glass-005);
  }

  a[data-variant='success']:focus-visible {
    background-color: var(--wui-color-success-glass-015);
  }

  a[data-variant='error']:focus-visible {
    background-color: var(--wui-color-error-glass-015);
  }

  a.disabled {
    color: var(--wui-color-gray-glass-015);
    background-color: var(--wui-color-gray-glass-015);
    pointer-events: none;
  }

  @media (hover: hover) and (pointer: fine) {
    a[data-variant='fill']:hover {
      background-color: var(--wui-color-accent-090);
    }

    a[data-variant='shade']:hover,
    a[data-variant='shadeSmall']:hover {
      background-color: var(--wui-color-gray-glass-015);
    }

    a[data-variant='transparent']:hover {
      background-color: var(--wui-color-gray-glass-005);
    }

    a[data-variant='success']:hover {
      background-color: var(--wui-color-success-glass-015);
    }

    a[data-variant='error']:hover {
      background-color: var(--wui-color-error-glass-015);
    }
  }

  a[data-variant='fill']:active {
    background-color: var(--wui-color-accent-080);
  }

  a[data-variant='shade']:active,
  a[data-variant='shadeSmall']:active {
    background-color: var(--wui-color-gray-glass-020);
  }

  a[data-variant='transparent']:active {
    background-color: var(--wui-color-gray-glass-010);
  }

  a[data-variant='success']:active {
    background-color: var(--wui-color-success-glass-020);
  }

  a[data-variant='error']:active {
    background-color: var(--wui-color-error-glass-020);
  }
`;var __decorate$2z=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiChip=class extends h$3{constructor(){super(...arguments),this.variant="fill",this.imageSrc=void 0,this.imageIcon=void 0,this.imageIconSize="md",this.disabled=!1,this.icon="externalLink",this.href="",this.text=void 0}render(){const rs=this.variant==="success"||this.variant==="transparent"||this.variant==="shadeSmall"?"small-600":"paragraph-600";return ke`
      <a
        rel="noreferrer"
        target="_blank"
        href=${this.href}
        class=${this.disabled?"disabled":""}
        data-variant=${this.variant}
      >
        ${this.imageTemplate()}
        <wui-text variant=${rs} color="inherit">
          ${this.title?this.title:UiHelperUtil.getHostName(this.href)}
        </wui-text>
        <wui-icon name=${this.icon} color="inherit" size="inherit"></wui-icon>
      </a>
    `}imageTemplate(){return this.imageSrc?ke`<wui-image src=${this.imageSrc}></wui-image>`:this.imageIcon?ke`<wui-icon
        name=${this.imageIcon}
        color="inherit"
        size=${this.imageIconSize}
        class="image-icon"
      ></wui-icon>`:null}};WuiChip.styles=[resetStyles,elementStyles,styles$1Z];__decorate$2z([n$4()],WuiChip.prototype,"variant",void 0);__decorate$2z([n$4()],WuiChip.prototype,"imageSrc",void 0);__decorate$2z([n$4()],WuiChip.prototype,"imageIcon",void 0);__decorate$2z([n$4()],WuiChip.prototype,"imageIconSize",void 0);__decorate$2z([n$4({type:Boolean})],WuiChip.prototype,"disabled",void 0);__decorate$2z([n$4()],WuiChip.prototype,"icon",void 0);__decorate$2z([n$4()],WuiChip.prototype,"href",void 0);__decorate$2z([n$4()],WuiChip.prototype,"text",void 0);WuiChip=__decorate$2z([customElement("wui-chip")],WuiChip);const styles$1Y=i$4`
  :host {
    position: relative;
    display: block;
  }

  button {
    background: var(--wui-color-accent-100);
    border: 1px solid var(--wui-color-gray-glass-010);
    border-radius: var(--wui-border-radius-m);
    gap: var(--wui-spacing-xs);
  }

  button.loading {
    background: var(--wui-color-gray-glass-010);
    border: 1px solid var(--wui-color-gray-glass-010);
    pointer-events: none;
  }

  button:disabled {
    background-color: var(--wui-color-gray-glass-015);
    border: 1px solid var(--wui-color-gray-glass-010);
  }

  button:disabled > wui-text {
    color: var(--wui-color-gray-glass-015);
  }

  @media (hover: hover) and (pointer: fine) {
    button:hover:enabled {
      background-color: var(--wui-color-accent-090);
    }

    button:active:enabled {
      background-color: var(--wui-color-accent-080);
    }
  }

  button:focus-visible {
    border: 1px solid var(--wui-color-gray-glass-010);
    background-color: var(--wui-color-accent-090);
    -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
    -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
    box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
  }

  button[data-size='sm'] {
    padding: 6.75px 10px 7.25px;
  }

  ::slotted(*) {
    transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: opacity;
    opacity: var(--local-opacity-100);
  }

  button > wui-text {
    transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: opacity;
    opacity: var(--local-opacity-100);
    color: var(--wui-color-inverse-100);
  }

  button[data-size='md'] {
    padding: 9px var(--wui-spacing-l) 9px var(--wui-spacing-l);
  }

  button[data-size='md'] + wui-text {
    padding-left: var(--wui-spacing-3xs);
  }

  @media (max-width: 500px) {
    button[data-size='md'] {
      height: 32px;
      padding: 5px 12px;
    }

    button[data-size='md'] > wui-text > slot {
      font-size: 14px !important;
    }
  }

  wui-loading-spinner {
    width: 14px;
    height: 14px;
  }

  wui-loading-spinner::slotted(svg) {
    width: 10px !important;
    height: 10px !important;
  }

  button[data-size='sm'] > wui-loading-spinner {
    width: 12px;
    height: 12px;
  }
`;var __decorate$2y=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiConnectButton=class extends h$3{constructor(){super(...arguments),this.size="md",this.loading=!1}render(){const Mn=this.size==="md"?"paragraph-600":"small-600";return ke`
      <button data-size=${this.size} ?disabled=${this.loading} ontouchstart>
        ${this.loadingTemplate()}
        <wui-text variant=${Mn} color=${this.loading?"accent-100":"inherit"}>
          <slot></slot>
        </wui-text>
      </button>
    `}loadingTemplate(){return this.loading?ke`<wui-loading-spinner size=${this.size} color="accent-100"></wui-loading-spinner>`:null}};WuiConnectButton.styles=[resetStyles,elementStyles,styles$1Y];__decorate$2y([n$4()],WuiConnectButton.prototype,"size",void 0);__decorate$2y([n$4({type:Boolean})],WuiConnectButton.prototype,"loading",void 0);WuiConnectButton=__decorate$2y([customElement("wui-connect-button")],WuiConnectButton);const styles$1X=i$4`
  wui-flex {
    width: 100%;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
  }
`;var __decorate$2x=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiCtaButton=class extends h$3{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return ke`
      <wui-flex
        justifyContent="space-between"
        alignItems="center"
        .padding=${["1xs","2l","1xs","2l"]}
      >
        <wui-text variant="paragraph-500" color="fg-200">${this.label}</wui-text>
        <wui-chip-button size="sm" variant="shade" text=${this.buttonLabel} icon="chevronRight">
        </wui-chip-button>
      </wui-flex>
    `}};WuiCtaButton.styles=[resetStyles,elementStyles,styles$1X];__decorate$2x([n$4({type:Boolean})],WuiCtaButton.prototype,"disabled",void 0);__decorate$2x([n$4()],WuiCtaButton.prototype,"label",void 0);__decorate$2x([n$4()],WuiCtaButton.prototype,"buttonLabel",void 0);WuiCtaButton=__decorate$2x([customElement("wui-cta-button")],WuiCtaButton);const styles$1W=i$4`
  :host {
    display: block;
    padding: var(--wui-spacing-l) var(--wui-spacing-m);
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
    width: 100%;
  }
`;var __decorate$2w=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiDetailsGroup=class extends h$3{render(){return ke`
      <wui-flex gap="xl" flexDirection="column" justifyContent="space-between" alignItems="center">
        <slot></slot>
      </wui-flex>
    `}};WuiDetailsGroup.styles=[resetStyles,elementStyles,styles$1W];WuiDetailsGroup=__decorate$2w([customElement("wui-details-group")],WuiDetailsGroup);const styles$1V=i$4`
  :host {
    display: flex;
    flex-direction: row;
    gap: var(--wui-spacing-l);
    width: 100%;
    border-radius: var(--wui-border-radius-xs);
  }
`;var __decorate$2v=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiDetailsGroupItem=class extends h$3{constructor(){super(...arguments),this.name=""}render(){return ke`
      <wui-flex justifyContent="space-between" alignItems="center">
        <wui-text variant="paragraph-500" color="fg-200">${this.name}</wui-text>
        <wui-flex gap="xs" alignItems="center">
          <slot></slot>
        </wui-flex>
      </wui-flex>
    `}};WuiDetailsGroupItem.styles=[resetStyles,elementStyles,styles$1V];__decorate$2v([n$4()],WuiDetailsGroupItem.prototype,"name",void 0);WuiDetailsGroupItem=__decorate$2v([customElement("wui-details-group-item")],WuiDetailsGroupItem);const styles$1U=i$4`
  :host {
    z-index: calc(var(--w3m-z-index) + 1);
    width: 200px;
    padding: var(--wui-spacing-3xs);
    align-items: center;
    display: inherit;
    border-radius: var(--wui-border-radius-xs);
    border: 1px solid var(--wui-color-gray-glass-002);
    background: var(--wui-color-fg-base-125);
    /* Dark/Elevation/L */
    box-shadow:
      0px 8px 22px -6px rgba(0, 0, 0, 0.12),
      0px 14px 64px -4px rgba(0, 0, 0, 0.12);
  }
`;var __decorate$2u=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiDropdownMenu=class extends h$3{constructor(){super(...arguments),this.actions=[],this.isOpen=!1}render(){return this.isOpen?ke`
      <wui-flex flexDirection="column" gap="4xs">
        ${this.actions.map(Mn=>ke`
            <wui-list-item
              icon=${Mn.icon}
              iconSize="sm"
              variant="icon"
              @click=${Mn.onClick}
            >
              <wui-text variant="small-400" color="fg-100">${Mn.label}</wui-text>
            </wui-list-item>
          `)}
      </wui-flex>
    `:null}};WuiDropdownMenu.styles=[resetStyles,elementStyles,styles$1U];__decorate$2u([n$4({type:Array})],WuiDropdownMenu.prototype,"actions",void 0);__decorate$2u([n$4({type:Boolean})],WuiDropdownMenu.prototype,"isOpen",void 0);WuiDropdownMenu=__decorate$2u([customElement("wui-dropdown-menu")],WuiDropdownMenu);/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const rt$2=Fn=>Fn.strings===void 0;/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const mt$1=(Fn,Mn)=>{var is;const rs=Fn._$AN;if(rs===void 0)return!1;for(const os of rs)(is=os._$AO)==null||is.call(os,Mn,!1),mt$1(os,Mn);return!0},_t$1=Fn=>{let Mn,rs;do{if((Mn=Fn._$AM)===void 0)break;rs=Mn._$AN,rs.delete(Fn),Fn=Mn}while((rs==null?void 0:rs.size)===0)},wt$1=Fn=>{for(let Mn;Mn=Fn._$AM;Fn=Mn){let rs=Mn._$AN;if(rs===void 0)Mn._$AN=rs=new Set;else if(rs.has(Fn))break;rs.add(Fn),gt$2(Mn)}};function bt$1(Fn){this._$AN!==void 0?(_t$1(this),this._$AM=Fn,wt$1(this)):this._$AM=Fn}function yt$2(Fn,Mn=!1,rs=0){const is=this._$AH,os=this._$AN;if(os!==void 0&&os.size!==0)if(Mn)if(Array.isArray(is))for(let as=rs;as<is.length;as++)mt$1(is[as],!1),_t$1(is[as]);else is!=null&&(mt$1(is,!1),_t$1(is));else mt$1(this,Fn)}const gt$2=Fn=>{Fn.type==t$1.CHILD&&(Fn._$AP??(Fn._$AP=yt$2),Fn._$AQ??(Fn._$AQ=bt$1))};let $t$2=class extends i$2{constructor(){super(...arguments),this._$AN=void 0}_$AT(Mn,rs,is){super._$AT(Mn,rs,is),wt$1(this),this.isConnected=Mn._$AU}_$AO(Mn,rs=!0){var is,os;Mn!==this.isConnected&&(this.isConnected=Mn,Mn?(is=this.reconnected)==null||is.call(this):(os=this.disconnected)==null||os.call(this)),rs&&(mt$1(this,Mn),_t$1(this))}setValue(Mn){if(rt$2(this.t))this.t._$AI(Mn,this);else{const rs=[...this.t._$AH];rs[this.i]=Mn,this.t._$AI(rs,this,0)}}disconnected(){}reconnected(){}};/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const ii$1=()=>new Zt$2;let Zt$2=class{};const qt$2=new WeakMap,Kt$2=e$2(class extends $t$2{render(Fn){return D$2}update(Fn,[Mn]){var is;const rs=Mn!==this.Y;return rs&&this.Y!==void 0&&this.rt(void 0),(rs||this.lt!==this.ct)&&(this.Y=Mn,this.ht=(is=Fn.options)==null?void 0:is.host,this.rt(this.ct=Fn.element)),D$2}rt(Fn){if(this.isConnected||(Fn=void 0),typeof this.Y=="function"){const Mn=this.ht??globalThis;let rs=qt$2.get(Mn);rs===void 0&&(rs=new WeakMap,qt$2.set(Mn,rs)),rs.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),rs.set(this.Y,Fn),Fn!==void 0&&this.Y.call(this.ht,Fn)}else this.Y.value=Fn}get lt(){var Fn,Mn;return typeof this.Y=="function"?(Fn=qt$2.get(this.ht??globalThis))==null?void 0:Fn.get(this.Y):(Mn=this.Y)==null?void 0:Mn.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),styles$1T=i$4`
  :host {
    position: relative;
    width: 100%;
    display: inline-block;
    color: var(--wui-color-fg-275);
  }

  input {
    width: 100%;
    border-radius: var(--wui-border-radius-xs);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
    background: var(--wui-color-gray-glass-002);
    font-size: var(--wui-font-size-paragraph);
    letter-spacing: var(--wui-letter-spacing-paragraph);
    color: var(--wui-color-fg-100);
    transition:
      background-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
      border-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
      box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md);
    will-change: background-color, border-color, box-shadow;
    caret-color: var(--wui-color-accent-100);
  }

  input:disabled {
    cursor: not-allowed;
    border: 1px solid var(--wui-color-gray-glass-010);
  }

  input:disabled::placeholder,
  input:disabled + wui-icon {
    color: var(--wui-color-fg-300);
  }

  input::placeholder {
    color: var(--wui-color-fg-275);
  }

  input:focus:enabled {
    background-color: var(--wui-color-gray-glass-005);
    -webkit-box-shadow:
      inset 0 0 0 1px var(--wui-color-accent-100),
      0px 0px 0px 4px var(--wui-box-shadow-blue);
    -moz-box-shadow:
      inset 0 0 0 1px var(--wui-color-accent-100),
      0px 0px 0px 4px var(--wui-box-shadow-blue);
    box-shadow:
      inset 0 0 0 1px var(--wui-color-accent-100),
      0px 0px 0px 4px var(--wui-box-shadow-blue);
  }

  input:hover:enabled {
    background-color: var(--wui-color-gray-glass-005);
  }

  wui-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
  }

  .wui-size-sm {
    padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s);
  }

  wui-icon + .wui-size-sm {
    padding: 9px var(--wui-spacing-m) 10px 36px;
  }

  wui-icon[data-input='sm'] {
    left: var(--wui-spacing-s);
  }

  .wui-size-md {
    padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m);
  }

  wui-icon + .wui-size-md,
  wui-loading-spinner + .wui-size-md {
    padding: 10.5px var(--wui-spacing-3xl) 10.5px var(--wui-spacing-3xl);
  }

  wui-icon[data-input='md'] {
    left: var(--wui-spacing-l);
  }

  .wui-size-lg {
    padding: var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-l);
    letter-spacing: var(--wui-letter-spacing-medium-title);
    font-size: var(--wui-font-size-medium-title);
    font-weight: var(--wui-font-weight-light);
    line-height: 130%;
    color: var(--wui-color-fg-100);
    height: 64px;
  }

  .wui-padding-right-xs {
    padding-right: var(--wui-spacing-xs);
  }

  .wui-padding-right-s {
    padding-right: var(--wui-spacing-s);
  }

  .wui-padding-right-m {
    padding-right: var(--wui-spacing-m);
  }

  .wui-padding-right-l {
    padding-right: var(--wui-spacing-l);
  }

  .wui-padding-right-xl {
    padding-right: var(--wui-spacing-xl);
  }

  .wui-padding-right-2xl {
    padding-right: var(--wui-spacing-2xl);
  }

  .wui-padding-right-3xl {
    padding-right: var(--wui-spacing-3xl);
  }

  .wui-padding-right-4xl {
    padding-right: var(--wui-spacing-4xl);
  }

  .wui-padding-right-5xl {
    padding-right: var(--wui-spacing-5xl);
  }

  wui-icon + .wui-size-lg,
  wui-loading-spinner + .wui-size-lg {
    padding-left: 50px;
  }

  wui-icon[data-input='lg'] {
    left: var(--wui-spacing-l);
  }

  .wui-size-mdl {
    padding: 17.25px var(--wui-spacing-m) 17.25px var(--wui-spacing-m);
  }
  wui-icon + .wui-size-mdl,
  wui-loading-spinner + .wui-size-mdl {
    padding: 17.25px var(--wui-spacing-3xl) 17.25px 40px;
  }
  wui-icon[data-input='mdl'] {
    left: var(--wui-spacing-m);
  }

  input:placeholder-shown ~ ::slotted(wui-input-element),
  input:placeholder-shown ~ ::slotted(wui-icon) {
    opacity: 0;
    pointer-events: none;
  }

  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  input[type='number'] {
    -moz-appearance: textfield;
  }

  ::slotted(wui-input-element),
  ::slotted(wui-icon) {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  ::slotted(wui-input-element) {
    right: var(--wui-spacing-m);
  }

  ::slotted(wui-icon) {
    right: 0px;
  }
`;var __decorate$2t=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiInputText=class extends h$3{constructor(){super(...arguments),this.inputElementRef=ii$1(),this.size="md",this.disabled=!1,this.placeholder="",this.type="text",this.value=""}render(){const Mn=`wui-padding-right-${this.inputRightPadding}`,is={[`wui-size-${this.size}`]:!0,[Mn]:!!this.inputRightPadding};return ke`${this.templateIcon()}
      <input
        data-testid="wui-input-text"
        ${Kt$2(this.inputElementRef)}
        class=${Rt$1(is)}
        type=${this.type}
        enterkeyhint=${to$2(this.enterKeyHint)}
        ?disabled=${this.disabled}
        placeholder=${this.placeholder}
        @input=${this.dispatchInputChangeEvent.bind(this)}
        .value=${this.value||""}
      />
      <slot></slot>`}templateIcon(){return this.icon?ke`<wui-icon
        data-input=${this.size}
        size=${this.size}
        color="inherit"
        name=${this.icon}
      ></wui-icon>`:null}dispatchInputChangeEvent(){var Mn;this.dispatchEvent(new CustomEvent("inputChange",{detail:(Mn=this.inputElementRef.value)==null?void 0:Mn.value,bubbles:!0,composed:!0}))}};WuiInputText.styles=[resetStyles,elementStyles,styles$1T];__decorate$2t([n$4()],WuiInputText.prototype,"size",void 0);__decorate$2t([n$4()],WuiInputText.prototype,"icon",void 0);__decorate$2t([n$4({type:Boolean})],WuiInputText.prototype,"disabled",void 0);__decorate$2t([n$4()],WuiInputText.prototype,"placeholder",void 0);__decorate$2t([n$4()],WuiInputText.prototype,"type",void 0);__decorate$2t([n$4()],WuiInputText.prototype,"keyHint",void 0);__decorate$2t([n$4()],WuiInputText.prototype,"value",void 0);__decorate$2t([n$4()],WuiInputText.prototype,"inputRightPadding",void 0);WuiInputText=__decorate$2t([customElement("wui-input-text")],WuiInputText);const styles$1S=i$4`
  :host {
    position: relative;
    display: inline-block;
  }

  wui-text {
    margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m);
  }
`;var __decorate$2s=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiEmailInput=class extends h$3{constructor(){super(...arguments),this.disabled=!1}render(){return ke`
      <wui-input-text
        type="email"
        placeholder="Email"
        icon="mail"
        size="mdl"
        .disabled=${this.disabled}
        .value=${this.value}
        data-testid="wui-email-input"
      ></wui-input-text>
      ${this.templateError()}
    `}templateError(){return this.errorMessage?ke`<wui-text variant="tiny-500" color="error-100">${this.errorMessage}</wui-text>`:null}};WuiEmailInput.styles=[resetStyles,styles$1S];__decorate$2s([n$4()],WuiEmailInput.prototype,"errorMessage",void 0);__decorate$2s([n$4({type:Boolean})],WuiEmailInput.prototype,"disabled",void 0);__decorate$2s([n$4()],WuiEmailInput.prototype,"value",void 0);WuiEmailInput=__decorate$2s([customElement("wui-email-input")],WuiEmailInput);const styles$1R=i$4`
  :host {
    position: relative;
    width: 100%;
    display: inline-block;
    color: var(--wui-color-fg-275);
  }

  .error {
    margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m);
  }

  .base-name {
    position: absolute;
    right: 45px;
    top: 15px;
    text-align: right;
  }
`;var __decorate$2r=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiEnsInput=class extends h$3{constructor(){super(...arguments),this.disabled=!1,this.loading=!1}render(){return ke`
      <wui-input-text
        value=${to$2(this.value)}
        ?disabled=${this.disabled}
        .value=${this.value||""}
        data-testid="wui-ens-input"
        inputRightPadding="5xl"
      >
        ${this.baseNameTemplate()} ${this.errorTemplate()}${this.loadingTemplate()}
      </wui-input-text>
    `}baseNameTemplate(){return ke`<wui-text variant="paragraph-400" color="fg-200" class="base-name">
      ${ConstantsUtil$3.WC_NAME_SUFFIX}
    </wui-text>`}loadingTemplate(){return this.loading?ke`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:null}errorTemplate(){return this.errorMessage?ke`<wui-text variant="tiny-500" color="error-100" class="error"
        >${this.errorMessage}</wui-text
      >`:null}};WuiEnsInput.styles=[resetStyles,styles$1R];__decorate$2r([n$4()],WuiEnsInput.prototype,"errorMessage",void 0);__decorate$2r([n$4({type:Boolean})],WuiEnsInput.prototype,"disabled",void 0);__decorate$2r([n$4()],WuiEnsInput.prototype,"value",void 0);__decorate$2r([n$4({type:Boolean})],WuiEnsInput.prototype,"loading",void 0);WuiEnsInput=__decorate$2r([customElement("wui-ens-input")],WuiEnsInput);const styles$1Q=i$4`
  button {
    border-radius: var(--local-border-radius);
    color: var(--wui-color-fg-100);
    padding: var(--local-padding);
  }

  @media (max-width: 700px) {
    button {
      padding: var(--wui-spacing-s);
    }
  }

  button > wui-icon {
    pointer-events: none;
  }

  button:disabled > wui-icon {
    color: var(--wui-color-bg-300) !important;
  }

  button:disabled {
    background-color: transparent;
  }
`;var __decorate$2q=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiIconLink=class extends h$3{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="inherit"}render(){const Mn=this.size==="lg"?"--wui-border-radius-xs":"--wui-border-radius-xxs",rs=this.size==="lg"?"--wui-spacing-1xs":"--wui-spacing-2xs";return this.style.cssText=`
    --local-border-radius: var(${Mn});
    --local-padding: var(${rs});
`,ke`
      <button ?disabled=${this.disabled} ontouchstart>
        <wui-icon color=${this.iconColor} size=${this.size} name=${this.icon}></wui-icon>
      </button>
    `}};WuiIconLink.styles=[resetStyles,elementStyles,colorStyles,styles$1Q];__decorate$2q([n$4()],WuiIconLink.prototype,"size",void 0);__decorate$2q([n$4({type:Boolean})],WuiIconLink.prototype,"disabled",void 0);__decorate$2q([n$4()],WuiIconLink.prototype,"icon",void 0);__decorate$2q([n$4()],WuiIconLink.prototype,"iconColor",void 0);WuiIconLink=__decorate$2q([customElement("wui-icon-link")],WuiIconLink);const styles$1P=i$4`
  button {
    background-color: var(--wui-color-fg-300);
    border-radius: var(--wui-border-radius-4xs);
    width: 16px;
    height: 16px;
  }

  button:disabled {
    background-color: var(--wui-color-bg-300);
  }

  wui-icon {
    color: var(--wui-color-bg-200) !important;
  }

  button:focus-visible {
    background-color: var(--wui-color-fg-250);
    border: 1px solid var(--wui-color-accent-100);
  }

  @media (hover: hover) and (pointer: fine) {
    button:hover:enabled {
      background-color: var(--wui-color-fg-250);
    }

    button:active:enabled {
      background-color: var(--wui-color-fg-225);
    }
  }
`;var __decorate$2p=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiInputElement=class extends h$3{constructor(){super(...arguments),this.icon="copy"}render(){return ke`
      <button>
        <wui-icon color="inherit" size="xxs" name=${this.icon}></wui-icon>
      </button>
    `}};WuiInputElement.styles=[resetStyles,elementStyles,styles$1P];__decorate$2p([n$4()],WuiInputElement.prototype,"icon",void 0);WuiInputElement=__decorate$2p([customElement("wui-input-element")],WuiInputElement);const styles$1O=i$4`
  :host {
    position: relative;
    display: inline-block;
  }

  input {
    width: 50px;
    height: 50px;
    background: var(--wui-color-gray-glass-010);
    border-radius: var(--wui-border-radius-xs);
    border: 1px solid var(--wui-color-gray-glass-005);
    font-family: var(--wui-font-family);
    font-size: var(--wui-font-size-large);
    font-weight: var(--wui-font-weight-regular);
    letter-spacing: var(--wui-letter-spacing-large);
    text-align: center;
    color: var(--wui-color-fg-100);
    caret-color: var(--wui-color-accent-100);
    transition:
      background-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
      border-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
      box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md);
    will-change: background-color, border-color, box-shadow;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    padding: 0px;
  }

  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  input[type='number'] {
    -moz-appearance: textfield;
  }

  input:disabled {
    cursor: not-allowed;
    border: 1px solid var(--wui-color-gray-glass-010);
    background: var(--wui-color-gray-glass-005);
  }

  input:focus:enabled {
    background-color: var(--wui-color-gray-glass-015);
    border: 1px solid var(--wui-color-accent-100);
    -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
    -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
    box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
  }

  @media (hover: hover) and (pointer: fine) {
    input:hover:enabled {
      background-color: var(--wui-color-gray-glass-015);
    }
  }
`;var __decorate$2o=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiInputNumeric=class extends h$3{constructor(){super(...arguments),this.disabled=!1,this.value=""}render(){return ke`<input
      type="number"
      maxlength="1"
      inputmode="numeric"
      autofocus
      ?disabled=${this.disabled}
      value=${this.value}
    /> `}};WuiInputNumeric.styles=[resetStyles,elementStyles,styles$1O];__decorate$2o([n$4({type:Boolean})],WuiInputNumeric.prototype,"disabled",void 0);__decorate$2o([n$4({type:String})],WuiInputNumeric.prototype,"value",void 0);WuiInputNumeric=__decorate$2o([customElement("wui-input-numeric")],WuiInputNumeric);const styles$1N=i$4`
  button {
    padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
    border-radius: var(--wui-border-radius-3xs);
    background-color: transparent;
    color: var(--wui-color-accent-100);
  }

  button:disabled {
    background-color: transparent;
    color: var(--wui-color-gray-glass-015);
  }

  button:hover {
    background-color: var(--wui-color-gray-glass-005);
  }
`;var __decorate$2n=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiLink=class extends h$3{constructor(){super(...arguments),this.disabled=!1,this.color="inherit"}render(){return ke`
      <button ?disabled=${this.disabled} ontouchstart>
        <slot name="iconLeft"></slot>
        <wui-text variant="small-600" color=${this.color}>
          <slot></slot>
        </wui-text>
        <slot name="iconRight"></slot>
      </button>
    `}};WuiLink.styles=[resetStyles,elementStyles,styles$1N];__decorate$2n([n$4({type:Boolean})],WuiLink.prototype,"disabled",void 0);__decorate$2n([n$4()],WuiLink.prototype,"color",void 0);WuiLink=__decorate$2n([customElement("wui-link")],WuiLink);const styles$1M=i$4`
  button {
    column-gap: var(--wui-spacing-s);
    padding: 11px 18px 11px var(--wui-spacing-s);
    width: 100%;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
    color: var(--wui-color-fg-250);
    transition:
      color var(--wui-ease-out-power-1) var(--wui-duration-md),
      background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: color, background-color;
  }

  button[data-iconvariant='square'],
  button[data-iconvariant='square-blue'] {
    padding: 6px 18px 6px 9px;
  }

  button > wui-flex {
    flex: 1;
  }

  button > wui-image {
    width: 32px;
    height: 32px;
    box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
    border-radius: var(--wui-border-radius-3xl);
  }

  button > wui-icon {
    width: 36px;
    height: 36px;
    transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: opacity;
  }

  button > wui-icon-box[data-variant='blue'] {
    box-shadow: 0 0 0 2px var(--wui-color-accent-glass-005);
  }

  button > wui-icon-box[data-variant='overlay'] {
    box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
  }

  button > wui-icon-box[data-variant='square-blue'] {
    border-radius: var(--wui-border-radius-3xs);
    position: relative;
    border: none;
    width: 36px;
    height: 36px;
  }

  button > wui-icon-box[data-variant='square-blue']::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: inherit;
    border: 1px solid var(--wui-color-accent-glass-010);
    pointer-events: none;
  }

  button > wui-icon:last-child {
    width: 14px;
    height: 14px;
  }

  button:disabled {
    color: var(--wui-color-gray-glass-020);
  }

  button[data-loading='true'] > wui-icon {
    opacity: 0;
  }

  wui-loading-spinner {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
  }
`;var __decorate$2m=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiListItem=class extends h$3{constructor(){super(...arguments),this.variant="icon",this.disabled=!1,this.imageSrc=void 0,this.alt=void 0,this.chevron=!1,this.loading=!1}render(){return ke`
      <button
        ?disabled=${this.loading?!0:!!this.disabled}
        data-loading=${this.loading}
        data-iconvariant=${to$2(this.iconVariant)}
        ontouchstart
      >
        ${this.loadingTemplate()} ${this.visualTemplate()}
        <wui-flex gap="3xs">
          <slot></slot>
        </wui-flex>
        ${this.chevronTemplate()}
      </button>
    `}visualTemplate(){if(this.variant==="image"&&this.imageSrc)return ke`<wui-image src=${this.imageSrc} alt=${this.alt??"list item"}></wui-image>`;if(this.iconVariant==="square"&&this.icon&&this.variant==="icon")return ke`<wui-icon name=${this.icon}></wui-icon>`;if(this.variant==="icon"&&this.icon&&this.iconVariant){const Mn=["blue","square-blue"].includes(this.iconVariant)?"accent-100":"fg-200",rs=this.iconVariant==="square-blue"?"mdl":"md",is=this.iconSize?this.iconSize:rs;return ke`
        <wui-icon-box
          data-variant=${this.iconVariant}
          icon=${this.icon}
          iconSize=${is}
          background="transparent"
          iconColor=${Mn}
          backgroundColor=${Mn}
          size=${rs}
        ></wui-icon-box>
      `}return null}loadingTemplate(){return this.loading?ke`<wui-loading-spinner color="fg-300"></wui-loading-spinner>`:ke``}chevronTemplate(){return this.chevron?ke`<wui-icon size="inherit" color="fg-200" name="chevronRight"></wui-icon>`:null}};WuiListItem.styles=[resetStyles,elementStyles,styles$1M];__decorate$2m([n$4()],WuiListItem.prototype,"icon",void 0);__decorate$2m([n$4()],WuiListItem.prototype,"iconSize",void 0);__decorate$2m([n$4()],WuiListItem.prototype,"variant",void 0);__decorate$2m([n$4()],WuiListItem.prototype,"iconVariant",void 0);__decorate$2m([n$4({type:Boolean})],WuiListItem.prototype,"disabled",void 0);__decorate$2m([n$4()],WuiListItem.prototype,"imageSrc",void 0);__decorate$2m([n$4()],WuiListItem.prototype,"alt",void 0);__decorate$2m([n$4({type:Boolean})],WuiListItem.prototype,"chevron",void 0);__decorate$2m([n$4({type:Boolean})],WuiListItem.prototype,"loading",void 0);WuiListItem=__decorate$2m([customElement("wui-list-item")],WuiListItem);var TransactionTypePastTense;(function(Fn){Fn.approve="approved",Fn.bought="bought",Fn.borrow="borrowed",Fn.burn="burnt",Fn.cancel="canceled",Fn.claim="claimed",Fn.deploy="deployed",Fn.deposit="deposited",Fn.execute="executed",Fn.mint="minted",Fn.receive="received",Fn.repay="repaid",Fn.send="sent",Fn.sell="sold",Fn.stake="staked",Fn.trade="swapped",Fn.unstake="unstaked",Fn.withdraw="withdrawn"})(TransactionTypePastTense||(TransactionTypePastTense={}));const styles$1L=i$4`
  :host > wui-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 40px;
    height: 40px;
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
    background-color: var(--wui-color-gray-glass-005);
  }

  :host > wui-flex wui-image {
    display: block;
  }

  :host > wui-flex,
  :host > wui-flex wui-image,
  .swap-images-container,
  .swap-images-container.nft,
  wui-image.nft {
    border-top-left-radius: var(--local-left-border-radius);
    border-top-right-radius: var(--local-right-border-radius);
    border-bottom-left-radius: var(--local-left-border-radius);
    border-bottom-right-radius: var(--local-right-border-radius);
  }

  wui-icon {
    width: 20px;
    height: 20px;
  }

  wui-icon-box {
    position: absolute;
    right: 0;
    bottom: 0;
    transform: translate(20%, 20%);
  }

  .swap-images-container {
    position: relative;
    width: 40px;
    height: 40px;
    overflow: hidden;
  }

  .swap-images-container wui-image:first-child {
    position: absolute;
    width: 40px;
    height: 40px;
    top: 0;
    left: 0%;
    clip-path: inset(0px calc(50% + 2px) 0px 0%);
  }

  .swap-images-container wui-image:last-child {
    clip-path: inset(0px 0px 0px calc(50% + 2px));
  }
`;var __decorate$2l=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiTransactionVisual=class extends h$3{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""}}render(){const[Mn,rs]=this.images,is=(Mn==null?void 0:Mn.type)==="NFT",os=rs!=null&&rs.url?rs.type==="NFT":is,as=is?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)",us=os?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)";return this.style.cssText=`
    --local-left-border-radius: ${as};
    --local-right-border-radius: ${us};
    `,ke`<wui-flex> ${this.templateVisual()} ${this.templateIcon()} </wui-flex>`}templateVisual(){const[Mn,rs]=this.images,is=Mn==null?void 0:Mn.type;return this.images.length===2&&(Mn!=null&&Mn.url||rs!=null&&rs.url)?ke`<div class="swap-images-container">
        ${Mn!=null&&Mn.url?ke`<wui-image src=${Mn.url} alt="Transaction image"></wui-image>`:null}
        ${rs!=null&&rs.url?ke`<wui-image src=${rs.url} alt="Transaction image"></wui-image>`:null}
      </div>`:Mn!=null&&Mn.url?ke`<wui-image src=${Mn.url} alt="Transaction image"></wui-image>`:is==="NFT"?ke`<wui-icon size="inherit" color="fg-200" name="nftPlaceholder"></wui-icon>`:ke`<wui-icon size="inherit" color="fg-200" name="coinPlaceholder"></wui-icon>`}templateIcon(){let Mn="accent-100",rs;return rs=this.getIcon(),this.status&&(Mn=this.getStatusColor()),rs?ke`
      <wui-icon-box
        size="xxs"
        iconColor=${Mn}
        backgroundColor=${Mn}
        background="opaque"
        icon=${rs}
        ?border=${!0}
        borderColor="wui-color-bg-125"
      ></wui-icon-box>
    `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():this.type==="trade"?"swapHorizontalBold":this.type==="approve"?"checkmark":this.type==="cancel"?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success-100";case"failed":return"error-100";case"pending":return"inverse-100";default:return"accent-100"}}};WuiTransactionVisual.styles=[styles$1L];__decorate$2l([n$4()],WuiTransactionVisual.prototype,"type",void 0);__decorate$2l([n$4()],WuiTransactionVisual.prototype,"status",void 0);__decorate$2l([n$4()],WuiTransactionVisual.prototype,"direction",void 0);__decorate$2l([n$4({type:Boolean})],WuiTransactionVisual.prototype,"onlyDirectionIcon",void 0);__decorate$2l([n$4({type:Array})],WuiTransactionVisual.prototype,"images",void 0);__decorate$2l([n$4({type:Object})],WuiTransactionVisual.prototype,"secondImage",void 0);WuiTransactionVisual=__decorate$2l([customElement("wui-transaction-visual")],WuiTransactionVisual);const styles$1K=i$4`
  :host > wui-flex:first-child {
    align-items: center;
    column-gap: var(--wui-spacing-s);
    padding: 6.5px var(--wui-spacing-xs) 6.5px var(--wui-spacing-xs);
    width: 100%;
  }

  :host > wui-flex:first-child wui-text:nth-child(1) {
    text-transform: capitalize;
  }

  wui-transaction-visual {
    width: 40px;
    height: 40px;
  }

  wui-flex {
    flex: 1;
  }

  :host wui-flex wui-flex {
    overflow: hidden;
  }

  :host .description-container wui-text span {
    word-break: break-all;
  }

  :host .description-container wui-text {
    overflow: hidden;
  }

  :host .description-separator-icon {
    margin: 0px 6px;
  }

  :host wui-text > span {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }
`;var __decorate$2k=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiTransactionListItem=class extends h$3{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[],this.price=[],this.amount=[],this.symbol=[]}render(){return ke`
      <wui-flex>
        <wui-transaction-visual
          .status=${this.status}
          direction=${to$2(this.direction)}
          type=${this.type}
          onlyDirectionIcon=${to$2(this.onlyDirectionIcon)}
          .images=${this.images}
        ></wui-transaction-visual>
        <wui-flex flexDirection="column" gap="3xs">
          <wui-text variant="paragraph-600" color="fg-100">
            ${TransactionTypePastTense[this.type]||this.type}
          </wui-text>
          <wui-flex class="description-container">
            ${this.templateDescription()} ${this.templateSecondDescription()}
          </wui-flex>
        </wui-flex>
        <wui-text variant="micro-700" color="fg-300"><span>${this.date}</span></wui-text>
      </wui-flex>
    `}templateDescription(){var rs;const Mn=(rs=this.descriptions)==null?void 0:rs[0];return Mn?ke`
          <wui-text variant="small-500" color="fg-200">
            <span>${Mn}</span>
          </wui-text>
        `:null}templateSecondDescription(){var rs;const Mn=(rs=this.descriptions)==null?void 0:rs[1];return Mn?ke`
          <wui-icon class="description-separator-icon" size="xxs" name="arrowRight"></wui-icon>
          <wui-text variant="small-400" color="fg-200">
            <span>${Mn}</span>
          </wui-text>
        `:null}};WuiTransactionListItem.styles=[resetStyles,styles$1K];__decorate$2k([n$4()],WuiTransactionListItem.prototype,"type",void 0);__decorate$2k([n$4({type:Array})],WuiTransactionListItem.prototype,"descriptions",void 0);__decorate$2k([n$4()],WuiTransactionListItem.prototype,"date",void 0);__decorate$2k([n$4({type:Boolean})],WuiTransactionListItem.prototype,"onlyDirectionIcon",void 0);__decorate$2k([n$4()],WuiTransactionListItem.prototype,"status",void 0);__decorate$2k([n$4()],WuiTransactionListItem.prototype,"direction",void 0);__decorate$2k([n$4({type:Array})],WuiTransactionListItem.prototype,"images",void 0);__decorate$2k([n$4({type:Array})],WuiTransactionListItem.prototype,"price",void 0);__decorate$2k([n$4({type:Array})],WuiTransactionListItem.prototype,"amount",void 0);__decorate$2k([n$4({type:Array})],WuiTransactionListItem.prototype,"symbol",void 0);WuiTransactionListItem=__decorate$2k([customElement("wui-transaction-list-item")],WuiTransactionListItem);const styles$1J=i$4`
  :host > wui-flex:first-child {
    column-gap: var(--wui-spacing-s);
    padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
    width: 100%;
  }

  wui-flex {
    display: flex;
    flex: 1;
  }
`;var __decorate$2j=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiTransactionListItemLoader=class extends h$3{render(){return ke`
      <wui-flex alignItems="center">
        <wui-shimmer width="40px" height="40px"></wui-shimmer>
        <wui-flex flexDirection="column" gap="2xs">
          <wui-shimmer width="72px" height="16px" borderRadius="4xs"></wui-shimmer>
          <wui-shimmer width="148px" height="14px" borderRadius="4xs"></wui-shimmer>
        </wui-flex>
        <wui-shimmer width="24px" height="12px" borderRadius="5xs"></wui-shimmer>
      </wui-flex>
    `}};WuiTransactionListItemLoader.styles=[resetStyles,styles$1J];WuiTransactionListItemLoader=__decorate$2j([customElement("wui-transaction-list-item-loader")],WuiTransactionListItemLoader);const styles$1I=i$4`
  :host {
    display: flex;
    justify-content: center;
    align-items: center;
    height: var(--wui-spacing-m);
    padding: 0 var(--wui-spacing-3xs) !important;
    border-radius: var(--wui-border-radius-5xs);
  }

  :host > wui-text {
    transform: translateY(5%);
  }

  :host([data-variant='main']) {
    background-color: var(--wui-color-accent-glass-015);
    color: var(--wui-color-accent-100);
  }

  :host([data-variant='shade']) {
    background-color: var(--wui-color-gray-glass-010);
    color: var(--wui-color-fg-200);
  }

  :host([data-variant='success']) {
    background-color: var(--wui-icon-box-bg-success-100);
    color: var(--wui-color-success-100);
  }

  :host([data-variant='error']) {
    background-color: var(--wui-icon-box-bg-error-100);
    color: var(--wui-color-error-100);
  }

  :host([data-size='lg']) {
    padding: 11px 5px !important;
  }

  :host([data-size='lg']) > wui-text {
    transform: translateY(2%);
  }
`;var __decorate$2i=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiTag=class extends h$3{constructor(){super(...arguments),this.variant="main",this.size="lg"}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;const Mn=this.size==="md"?"mini-700":"micro-700";return ke`
      <wui-text data-variant=${this.variant} variant=${Mn} color="inherit">
        <slot></slot>
      </wui-text>
    `}};WuiTag.styles=[resetStyles,styles$1I];__decorate$2i([n$4()],WuiTag.prototype,"variant",void 0);__decorate$2i([n$4()],WuiTag.prototype,"size",void 0);WuiTag=__decorate$2i([customElement("wui-tag")],WuiTag);const styles$1H=i$4`
  button {
    column-gap: var(--wui-spacing-s);
    padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
    width: 100%;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
    color: var(--wui-color-fg-100);
  }

  button > wui-text:nth-child(2) {
    display: flex;
    flex: 1;
  }

  button:disabled {
    background-color: var(--wui-color-gray-glass-015);
    color: var(--wui-color-gray-glass-015);
  }

  button:disabled > wui-tag {
    background-color: var(--wui-color-gray-glass-010);
    color: var(--wui-color-fg-300);
  }

  wui-icon {
    color: var(--wui-color-fg-200) !important;
  }
`;var __decorate$2h=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiListWallet=class extends h$3{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.installed=!1,this.disabled=!1,this.showAllWallets=!1}render(){return ke`
      <button ?disabled=${this.disabled} ontouchstart>
        ${this.templateAllWallets()} ${this.templateWalletImage()}
        <wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text>
        ${this.templateStatus()}
      </button>
    `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?ke` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `:this.showAllWallets&&this.walletIcon?ke` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?ke`<wui-wallet-image
        size="sm"
        imageSrc=${this.imageSrc}
        name=${this.name}
        .installed=${this.installed}
      ></wui-wallet-image>`:!this.showAllWallets&&!this.imageSrc?ke`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`:null}templateStatus(){return this.tagLabel&&this.tagVariant?ke`<wui-tag variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`:this.icon?ke`<wui-icon color="inherit" size="sm" name=${this.icon}></wui-icon>`:null}};WuiListWallet.styles=[resetStyles,elementStyles,styles$1H];__decorate$2h([n$4({type:Array})],WuiListWallet.prototype,"walletImages",void 0);__decorate$2h([n$4()],WuiListWallet.prototype,"imageSrc",void 0);__decorate$2h([n$4()],WuiListWallet.prototype,"name",void 0);__decorate$2h([n$4()],WuiListWallet.prototype,"tagLabel",void 0);__decorate$2h([n$4()],WuiListWallet.prototype,"tagVariant",void 0);__decorate$2h([n$4()],WuiListWallet.prototype,"icon",void 0);__decorate$2h([n$4()],WuiListWallet.prototype,"walletIcon",void 0);__decorate$2h([n$4({type:Boolean})],WuiListWallet.prototype,"installed",void 0);__decorate$2h([n$4({type:Boolean})],WuiListWallet.prototype,"disabled",void 0);__decorate$2h([n$4({type:Boolean})],WuiListWallet.prototype,"showAllWallets",void 0);WuiListWallet=__decorate$2h([customElement("wui-list-wallet")],WuiListWallet);const styles$1G=i$4`
  :host {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--wui-border-radius-3xl);
    border: 1px solid var(--wui-color-gray-glass-005);
    overflow: hidden;
  }

  wui-icon {
    width: 100%;
    height: 100%;
  }
`;var __decorate$2g=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiLogo=class extends h$3{constructor(){super(...arguments),this.logo="google"}render(){return ke`<wui-icon color="inherit" size="inherit" name=${this.logo}></wui-icon> `}};WuiLogo.styles=[resetStyles,styles$1G];__decorate$2g([n$4()],WuiLogo.prototype,"logo",void 0);WuiLogo=__decorate$2g([customElement("wui-logo")],WuiLogo);const styles$1F=i$4`
  :host {
    display: block;
    width: 100%;
  }

  button {
    width: 100%;
    height: 56px;
    background: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
  }
`;var __decorate$2f=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiLogoSelect=class extends h$3{constructor(){super(...arguments),this.logo="google",this.disabled=!1}render(){return ke`
      <button ?disabled=${this.disabled} ontouchstart>
        <wui-logo logo=${this.logo}></wui-logo>
      </button>
    `}};WuiLogoSelect.styles=[resetStyles,elementStyles,styles$1F];__decorate$2f([n$4()],WuiLogoSelect.prototype,"logo",void 0);__decorate$2f([n$4({type:Boolean})],WuiLogoSelect.prototype,"disabled",void 0);WuiLogoSelect=__decorate$2f([customElement("wui-logo-select")],WuiLogoSelect);const styles$1E=i$4`
  :host {
    display: block;
  }

  button {
    border-radius: var(--wui-border-radius-3xl);
    display: flex;
    gap: var(--wui-spacing-xs);
    padding: var(--wui-spacing-2xs) var(--wui-spacing-s) var(--wui-spacing-2xs)
      var(--wui-spacing-xs);
    border: 1px solid var(--wui-color-gray-glass-010);
    background-color: var(--wui-color-gray-glass-005);
    color: var(--wui-color-fg-100);
  }

  button:disabled {
    border: 1px solid var(--wui-color-gray-glass-005);
    background-color: var(--wui-color-gray-glass-015);
    color: var(--wui-color-gray-glass-015);
  }

  @media (hover: hover) and (pointer: fine) {
    button:hover:enabled {
      background-color: var(--wui-color-gray-glass-010);
    }

    button:active:enabled {
      background-color: var(--wui-color-gray-glass-015);
    }
  }

  wui-image,
  wui-icon-box {
    border-radius: var(--wui-border-radius-3xl);
    width: 24px;
    height: 24px;
    box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
  }
`;var __decorate$2e=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiNetworkButton=class extends h$3{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return ke`
      <button data-testid="w3m-network-button" ?disabled=${this.disabled}>
        ${this.visualTemplate()}
        <wui-text variant="paragraph-600" color="inherit">
          <slot></slot>
        </wui-text>
      </button>
    `}visualTemplate(){return this.isUnsupportedChain?ke`
        <wui-icon-box
          size="sm"
          iconColor="error-100"
          backgroundColor="error-100"
          icon="warningCircle"
        ></wui-icon-box>
      `:this.imageSrc?ke`<wui-image src=${this.imageSrc}></wui-image>`:ke`
      <wui-icon-box
        size="sm"
        iconColor="inverse-100"
        backgroundColor="fg-100"
        icon="networkPlaceholder"
      ></wui-icon-box>
    `}};WuiNetworkButton.styles=[resetStyles,elementStyles,styles$1E];__decorate$2e([n$4()],WuiNetworkButton.prototype,"imageSrc",void 0);__decorate$2e([n$4({type:Boolean})],WuiNetworkButton.prototype,"isUnsupportedChain",void 0);__decorate$2e([n$4({type:Boolean})],WuiNetworkButton.prototype,"disabled",void 0);WuiNetworkButton=__decorate$2e([customElement("wui-network-button")],WuiNetworkButton);const styles$1D=i$4`
  :host {
    position: relative;
    display: block;
  }
`;var __decorate$2d=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiOtp=class extends h$3{constructor(){super(...arguments),this.length=6,this.otp="",this.values=Array.from({length:this.length}).map(()=>""),this.numerics=[],this.shouldInputBeEnabled=Mn=>this.values.slice(0,Mn).every(is=>is!==""),this.handleKeyDown=(Mn,rs)=>{const is=Mn.target,os=this.getInputElement(is),as=["ArrowLeft","ArrowRight","Shift","Delete"];if(!os)return;as.includes(Mn.key)&&Mn.preventDefault();const us=os.selectionStart;switch(Mn.key){case"ArrowLeft":us&&os.setSelectionRange(us+1,us+1),this.focusInputField("prev",rs);break;case"ArrowRight":this.focusInputField("next",rs);break;case"Shift":this.focusInputField("next",rs);break;case"Delete":os.value===""?this.focusInputField("prev",rs):this.updateInput(os,rs,"");break;case"Backspace":os.value===""?this.focusInputField("prev",rs):this.updateInput(os,rs,"");break}},this.focusInputField=(Mn,rs)=>{if(Mn==="next"){const is=rs+1;if(!this.shouldInputBeEnabled(is))return;const os=this.numerics[is<this.length?is:rs],as=os?this.getInputElement(os):void 0;as&&(as.disabled=!1,as.focus())}if(Mn==="prev"){const is=rs-1,os=this.numerics[is>-1?is:rs],as=os?this.getInputElement(os):void 0;as&&as.focus()}}}firstUpdated(){var rs,is;this.otp&&(this.values=this.otp.split(""));const Mn=(rs=this.shadowRoot)==null?void 0:rs.querySelectorAll("wui-input-numeric");Mn&&(this.numerics=Array.from(Mn)),(is=this.numerics[0])==null||is.focus()}render(){return ke`
      <wui-flex gap="xxs" data-testid="wui-otp-input">
        ${Array.from({length:this.length}).map((Mn,rs)=>ke`
            <wui-input-numeric
              @input=${is=>this.handleInput(is,rs)}
              @click=${is=>this.selectInput(is)}
              @keydown=${is=>this.handleKeyDown(is,rs)}
              .disabled=${!this.shouldInputBeEnabled(rs)}
              .value=${this.values[rs]||""}
            >
            </wui-input-numeric>
          `)}
      </wui-flex>
    `}updateInput(Mn,rs,is){const os=this.numerics[rs],as=Mn||(os?this.getInputElement(os):void 0);as&&(as.value=is,this.values=this.values.map((us,ds)=>ds===rs?is:us))}selectInput(Mn){const rs=Mn.target;if(rs){const is=this.getInputElement(rs);is==null||is.select()}}handleInput(Mn,rs){const is=Mn.target,os=this.getInputElement(is);if(os){const as=os.value;Mn.inputType==="insertFromPaste"?this.handlePaste(os,as,rs):UiHelperUtil.isNumber(as)&&Mn.data?(this.updateInput(os,rs,Mn.data),this.focusInputField("next",rs)):this.updateInput(os,rs,"")}this.dispatchInputChangeEvent()}handlePaste(Mn,rs,is){const os=rs[0];if(os&&UiHelperUtil.isNumber(os)){this.updateInput(Mn,is,os);const us=rs.substring(1);if(is+1<this.length&&us.length){const ds=this.numerics[is+1],hs=ds?this.getInputElement(ds):void 0;hs&&this.handlePaste(hs,us,is+1)}else this.focusInputField("next",is)}else this.updateInput(Mn,is,"")}getInputElement(Mn){var rs;return(rs=Mn.shadowRoot)!=null&&rs.querySelector("input")?Mn.shadowRoot.querySelector("input"):null}dispatchInputChangeEvent(){const Mn=this.values.join("");this.dispatchEvent(new CustomEvent("inputChange",{detail:Mn,bubbles:!0,composed:!0}))}};WuiOtp.styles=[resetStyles,styles$1D];__decorate$2d([n$4({type:Number})],WuiOtp.prototype,"length",void 0);__decorate$2d([n$4({type:String})],WuiOtp.prototype,"otp",void 0);__decorate$2d([r$5()],WuiOtp.prototype,"values",void 0);WuiOtp=__decorate$2d([customElement("wui-otp")],WuiOtp);var browser$1={},canPromise$1=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},qrcode={},utils$g={};let toSJISFunction;const CODEWORDS_COUNT=[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];utils$g.getSymbolSize=function Fn(Mn){if(!Mn)throw new Error('"version" cannot be null or undefined');if(Mn<1||Mn>40)throw new Error('"version" should be in range from 1 to 40');return Mn*4+17};utils$g.getSymbolTotalCodewords=function Fn(Mn){return CODEWORDS_COUNT[Mn]};utils$g.getBCHDigit=function(Fn){let Mn=0;for(;Fn!==0;)Mn++,Fn>>>=1;return Mn};utils$g.setToSJISFunction=function Fn(Mn){if(typeof Mn!="function")throw new Error('"toSJISFunc" is not a valid function.');toSJISFunction=Mn};utils$g.isKanjiModeEnabled=function(){return typeof toSJISFunction<"u"};utils$g.toSJIS=function Fn(Mn){return toSJISFunction(Mn)};var errorCorrectionLevel={};(function(Fn){Fn.L={bit:1},Fn.M={bit:0},Fn.Q={bit:3},Fn.H={bit:2};function Mn(rs){if(typeof rs!="string")throw new Error("Param is not a string");switch(rs.toLowerCase()){case"l":case"low":return Fn.L;case"m":case"medium":return Fn.M;case"q":case"quartile":return Fn.Q;case"h":case"high":return Fn.H;default:throw new Error("Unknown EC Level: "+rs)}}Fn.isValid=function(is){return is&&typeof is.bit<"u"&&is.bit>=0&&is.bit<4},Fn.from=function(is,os){if(Fn.isValid(is))return is;try{return Mn(is)}catch{return os}}})(errorCorrectionLevel);function BitBuffer$1(){this.buffer=[],this.length=0}BitBuffer$1.prototype={get:function(Fn){const Mn=Math.floor(Fn/8);return(this.buffer[Mn]>>>7-Fn%8&1)===1},put:function(Fn,Mn){for(let rs=0;rs<Mn;rs++)this.putBit((Fn>>>Mn-rs-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(Fn){const Mn=Math.floor(this.length/8);this.buffer.length<=Mn&&this.buffer.push(0),Fn&&(this.buffer[Mn]|=128>>>this.length%8),this.length++}};var bitBuffer=BitBuffer$1;function BitMatrix$1(Fn){if(!Fn||Fn<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=Fn,this.data=new Uint8Array(Fn*Fn),this.reservedBit=new Uint8Array(Fn*Fn)}BitMatrix$1.prototype.set=function(Fn,Mn,rs,is){const os=Fn*this.size+Mn;this.data[os]=rs,is&&(this.reservedBit[os]=!0)};BitMatrix$1.prototype.get=function(Fn,Mn){return this.data[Fn*this.size+Mn]};BitMatrix$1.prototype.xor=function(Fn,Mn,rs){this.data[Fn*this.size+Mn]^=rs};BitMatrix$1.prototype.isReserved=function(Fn,Mn){return this.reservedBit[Fn*this.size+Mn]};var bitMatrix=BitMatrix$1,alignmentPattern={};(function(Fn){const Mn=utils$g.getSymbolSize;Fn.getRowColCoords=function(is){if(is===1)return[];const os=Math.floor(is/7)+2,as=Mn(is),us=as===145?26:Math.ceil((as-13)/(2*os-2))*2,ds=[as-7];for(let hs=1;hs<os-1;hs++)ds[hs]=ds[hs-1]-us;return ds.push(6),ds.reverse()},Fn.getPositions=function(is){const os=[],as=Fn.getRowColCoords(is),us=as.length;for(let ds=0;ds<us;ds++)for(let hs=0;hs<us;hs++)ds===0&&hs===0||ds===0&&hs===us-1||ds===us-1&&hs===0||os.push([as[ds],as[hs]]);return os}})(alignmentPattern);var finderPattern={};const getSymbolSize=utils$g.getSymbolSize,FINDER_PATTERN_SIZE=7;finderPattern.getPositions=function Fn(Mn){const rs=getSymbolSize(Mn);return[[0,0],[rs-FINDER_PATTERN_SIZE,0],[0,rs-FINDER_PATTERN_SIZE]]};var maskPattern={};(function(Fn){Fn.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const Mn={N1:3,N2:3,N3:40,N4:10};Fn.isValid=function(os){return os!=null&&os!==""&&!isNaN(os)&&os>=0&&os<=7},Fn.from=function(os){return Fn.isValid(os)?parseInt(os,10):void 0},Fn.getPenaltyN1=function(os){const as=os.size;let us=0,ds=0,hs=0,ps=null,io=null;for(let fo=0;fo<as;fo++){ds=hs=0,ps=io=null;for(let mo=0;mo<as;mo++){let Ao=os.get(fo,mo);Ao===ps?ds++:(ds>=5&&(us+=Mn.N1+(ds-5)),ps=Ao,ds=1),Ao=os.get(mo,fo),Ao===io?hs++:(hs>=5&&(us+=Mn.N1+(hs-5)),io=Ao,hs=1)}ds>=5&&(us+=Mn.N1+(ds-5)),hs>=5&&(us+=Mn.N1+(hs-5))}return us},Fn.getPenaltyN2=function(os){const as=os.size;let us=0;for(let ds=0;ds<as-1;ds++)for(let hs=0;hs<as-1;hs++){const ps=os.get(ds,hs)+os.get(ds,hs+1)+os.get(ds+1,hs)+os.get(ds+1,hs+1);(ps===4||ps===0)&&us++}return us*Mn.N2},Fn.getPenaltyN3=function(os){const as=os.size;let us=0,ds=0,hs=0;for(let ps=0;ps<as;ps++){ds=hs=0;for(let io=0;io<as;io++)ds=ds<<1&2047|os.get(ps,io),io>=10&&(ds===1488||ds===93)&&us++,hs=hs<<1&2047|os.get(io,ps),io>=10&&(hs===1488||hs===93)&&us++}return us*Mn.N3},Fn.getPenaltyN4=function(os){let as=0;const us=os.data.length;for(let hs=0;hs<us;hs++)as+=os.data[hs];return Math.abs(Math.ceil(as*100/us/5)-10)*Mn.N4};function rs(is,os,as){switch(is){case Fn.Patterns.PATTERN000:return(os+as)%2===0;case Fn.Patterns.PATTERN001:return os%2===0;case Fn.Patterns.PATTERN010:return as%3===0;case Fn.Patterns.PATTERN011:return(os+as)%3===0;case Fn.Patterns.PATTERN100:return(Math.floor(os/2)+Math.floor(as/3))%2===0;case Fn.Patterns.PATTERN101:return os*as%2+os*as%3===0;case Fn.Patterns.PATTERN110:return(os*as%2+os*as%3)%2===0;case Fn.Patterns.PATTERN111:return(os*as%3+(os+as)%2)%2===0;default:throw new Error("bad maskPattern:"+is)}}Fn.applyMask=function(os,as){const us=as.size;for(let ds=0;ds<us;ds++)for(let hs=0;hs<us;hs++)as.isReserved(hs,ds)||as.xor(hs,ds,rs(os,hs,ds))},Fn.getBestMask=function(os,as){const us=Object.keys(Fn.Patterns).length;let ds=0,hs=1/0;for(let ps=0;ps<us;ps++){as(ps),Fn.applyMask(ps,os);const io=Fn.getPenaltyN1(os)+Fn.getPenaltyN2(os)+Fn.getPenaltyN3(os)+Fn.getPenaltyN4(os);Fn.applyMask(ps,os),io<hs&&(hs=io,ds=ps)}return ds}})(maskPattern);var errorCorrectionCode={};const ECLevel$1=errorCorrectionLevel,EC_BLOCKS_TABLE=[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],EC_CODEWORDS_TABLE=[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];errorCorrectionCode.getBlocksCount=function Fn(Mn,rs){switch(rs){case ECLevel$1.L:return EC_BLOCKS_TABLE[(Mn-1)*4+0];case ECLevel$1.M:return EC_BLOCKS_TABLE[(Mn-1)*4+1];case ECLevel$1.Q:return EC_BLOCKS_TABLE[(Mn-1)*4+2];case ECLevel$1.H:return EC_BLOCKS_TABLE[(Mn-1)*4+3];default:return}};errorCorrectionCode.getTotalCodewordsCount=function Fn(Mn,rs){switch(rs){case ECLevel$1.L:return EC_CODEWORDS_TABLE[(Mn-1)*4+0];case ECLevel$1.M:return EC_CODEWORDS_TABLE[(Mn-1)*4+1];case ECLevel$1.Q:return EC_CODEWORDS_TABLE[(Mn-1)*4+2];case ECLevel$1.H:return EC_CODEWORDS_TABLE[(Mn-1)*4+3];default:return}};var polynomial={},galoisField={};const EXP_TABLE=new Uint8Array(512),LOG_TABLE=new Uint8Array(256);(function Fn(){let Mn=1;for(let rs=0;rs<255;rs++)EXP_TABLE[rs]=Mn,LOG_TABLE[Mn]=rs,Mn<<=1,Mn&256&&(Mn^=285);for(let rs=255;rs<512;rs++)EXP_TABLE[rs]=EXP_TABLE[rs-255]})();galoisField.log=function Fn(Mn){if(Mn<1)throw new Error("log("+Mn+")");return LOG_TABLE[Mn]};galoisField.exp=function Fn(Mn){return EXP_TABLE[Mn]};galoisField.mul=function Fn(Mn,rs){return Mn===0||rs===0?0:EXP_TABLE[LOG_TABLE[Mn]+LOG_TABLE[rs]]};(function(Fn){const Mn=galoisField;Fn.mul=function(is,os){const as=new Uint8Array(is.length+os.length-1);for(let us=0;us<is.length;us++)for(let ds=0;ds<os.length;ds++)as[us+ds]^=Mn.mul(is[us],os[ds]);return as},Fn.mod=function(is,os){let as=new Uint8Array(is);for(;as.length-os.length>=0;){const us=as[0];for(let hs=0;hs<os.length;hs++)as[hs]^=Mn.mul(os[hs],us);let ds=0;for(;ds<as.length&&as[ds]===0;)ds++;as=as.slice(ds)}return as},Fn.generateECPolynomial=function(is){let os=new Uint8Array([1]);for(let as=0;as<is;as++)os=Fn.mul(os,new Uint8Array([1,Mn.exp(as)]));return os}})(polynomial);const Polynomial=polynomial;function ReedSolomonEncoder$1(Fn){this.genPoly=void 0,this.degree=Fn,this.degree&&this.initialize(this.degree)}ReedSolomonEncoder$1.prototype.initialize=function Fn(Mn){this.degree=Mn,this.genPoly=Polynomial.generateECPolynomial(this.degree)};ReedSolomonEncoder$1.prototype.encode=function Fn(Mn){if(!this.genPoly)throw new Error("Encoder not initialized");const rs=new Uint8Array(Mn.length+this.degree);rs.set(Mn);const is=Polynomial.mod(rs,this.genPoly),os=this.degree-is.length;if(os>0){const as=new Uint8Array(this.degree);return as.set(is,os),as}return is};var reedSolomonEncoder=ReedSolomonEncoder$1,version$3={},mode={},versionCheck={};versionCheck.isValid=function Fn(Mn){return!isNaN(Mn)&&Mn>=1&&Mn<=40};var regex={};const numeric="[0-9]+",alphanumeric="[A-Z $%*+\\-./:]+";let kanji="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";kanji=kanji.replace(/u/g,"\\u");const byte="(?:(?![A-Z0-9 $%*+\\-./:]|"+kanji+`)(?:.|[\r
]))+`;regex.KANJI=new RegExp(kanji,"g");regex.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");regex.BYTE=new RegExp(byte,"g");regex.NUMERIC=new RegExp(numeric,"g");regex.ALPHANUMERIC=new RegExp(alphanumeric,"g");const TEST_KANJI=new RegExp("^"+kanji+"$"),TEST_NUMERIC=new RegExp("^"+numeric+"$"),TEST_ALPHANUMERIC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");regex.testKanji=function Fn(Mn){return TEST_KANJI.test(Mn)};regex.testNumeric=function Fn(Mn){return TEST_NUMERIC.test(Mn)};regex.testAlphanumeric=function Fn(Mn){return TEST_ALPHANUMERIC.test(Mn)};(function(Fn){const Mn=versionCheck,rs=regex;Fn.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},Fn.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},Fn.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},Fn.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},Fn.MIXED={bit:-1},Fn.getCharCountIndicator=function(as,us){if(!as.ccBits)throw new Error("Invalid mode: "+as);if(!Mn.isValid(us))throw new Error("Invalid version: "+us);return us>=1&&us<10?as.ccBits[0]:us<27?as.ccBits[1]:as.ccBits[2]},Fn.getBestModeForData=function(as){return rs.testNumeric(as)?Fn.NUMERIC:rs.testAlphanumeric(as)?Fn.ALPHANUMERIC:rs.testKanji(as)?Fn.KANJI:Fn.BYTE},Fn.toString=function(as){if(as&&as.id)return as.id;throw new Error("Invalid mode")},Fn.isValid=function(as){return as&&as.bit&&as.ccBits};function is(os){if(typeof os!="string")throw new Error("Param is not a string");switch(os.toLowerCase()){case"numeric":return Fn.NUMERIC;case"alphanumeric":return Fn.ALPHANUMERIC;case"kanji":return Fn.KANJI;case"byte":return Fn.BYTE;default:throw new Error("Unknown mode: "+os)}}Fn.from=function(as,us){if(Fn.isValid(as))return as;try{return is(as)}catch{return us}}})(mode);(function(Fn){const Mn=utils$g,rs=errorCorrectionCode,is=errorCorrectionLevel,os=mode,as=versionCheck,us=7973,ds=Mn.getBCHDigit(us);function hs(mo,Ao,$o){for(let Lo=1;Lo<=40;Lo++)if(Ao<=Fn.getCapacity(Lo,$o,mo))return Lo}function ps(mo,Ao){return os.getCharCountIndicator(mo,Ao)+4}function io(mo,Ao){let $o=0;return mo.forEach(function(Lo){const Go=ps(Lo.mode,Ao);$o+=Go+Lo.getBitsLength()}),$o}function fo(mo,Ao){for(let $o=1;$o<=40;$o++)if(io(mo,$o)<=Fn.getCapacity($o,Ao,os.MIXED))return $o}Fn.from=function(Ao,$o){return as.isValid(Ao)?parseInt(Ao,10):$o},Fn.getCapacity=function(Ao,$o,Lo){if(!as.isValid(Ao))throw new Error("Invalid QR Code version");typeof Lo>"u"&&(Lo=os.BYTE);const Go=Mn.getSymbolTotalCodewords(Ao),Yo=rs.getTotalCodewordsCount(Ao,$o),Wo=(Go-Yo)*8;if(Lo===os.MIXED)return Wo;const Jo=Wo-ps(Lo,Ao);switch(Lo){case os.NUMERIC:return Math.floor(Jo/10*3);case os.ALPHANUMERIC:return Math.floor(Jo/11*2);case os.KANJI:return Math.floor(Jo/13);case os.BYTE:default:return Math.floor(Jo/8)}},Fn.getBestVersionForData=function(Ao,$o){let Lo;const Go=is.from($o,is.M);if(Array.isArray(Ao)){if(Ao.length>1)return fo(Ao,Go);if(Ao.length===0)return 1;Lo=Ao[0]}else Lo=Ao;return hs(Lo.mode,Lo.getLength(),Go)},Fn.getEncodedBits=function(Ao){if(!as.isValid(Ao)||Ao<7)throw new Error("Invalid QR Code version");let $o=Ao<<12;for(;Mn.getBCHDigit($o)-ds>=0;)$o^=us<<Mn.getBCHDigit($o)-ds;return Ao<<12|$o}})(version$3);var formatInfo={};const Utils$3=utils$g,G15=1335,G15_MASK=21522,G15_BCH=Utils$3.getBCHDigit(G15);formatInfo.getEncodedBits=function Fn(Mn,rs){const is=Mn.bit<<3|rs;let os=is<<10;for(;Utils$3.getBCHDigit(os)-G15_BCH>=0;)os^=G15<<Utils$3.getBCHDigit(os)-G15_BCH;return(is<<10|os)^G15_MASK};var segments={};const Mode$4=mode;function NumericData(Fn){this.mode=Mode$4.NUMERIC,this.data=Fn.toString()}NumericData.getBitsLength=function Fn(Mn){return 10*Math.floor(Mn/3)+(Mn%3?Mn%3*3+1:0)};NumericData.prototype.getLength=function Fn(){return this.data.length};NumericData.prototype.getBitsLength=function Fn(){return NumericData.getBitsLength(this.data.length)};NumericData.prototype.write=function Fn(Mn){let rs,is,os;for(rs=0;rs+3<=this.data.length;rs+=3)is=this.data.substr(rs,3),os=parseInt(is,10),Mn.put(os,10);const as=this.data.length-rs;as>0&&(is=this.data.substr(rs),os=parseInt(is,10),Mn.put(os,as*3+1))};var numericData=NumericData;const Mode$3=mode,ALPHA_NUM_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"," ","$","%","*","+","-",".","/",":"];function AlphanumericData(Fn){this.mode=Mode$3.ALPHANUMERIC,this.data=Fn}AlphanumericData.getBitsLength=function Fn(Mn){return 11*Math.floor(Mn/2)+6*(Mn%2)};AlphanumericData.prototype.getLength=function Fn(){return this.data.length};AlphanumericData.prototype.getBitsLength=function Fn(){return AlphanumericData.getBitsLength(this.data.length)};AlphanumericData.prototype.write=function Fn(Mn){let rs;for(rs=0;rs+2<=this.data.length;rs+=2){let is=ALPHA_NUM_CHARS.indexOf(this.data[rs])*45;is+=ALPHA_NUM_CHARS.indexOf(this.data[rs+1]),Mn.put(is,11)}this.data.length%2&&Mn.put(ALPHA_NUM_CHARS.indexOf(this.data[rs]),6)};var alphanumericData=AlphanumericData,encodeUtf8$1=function Fn(Mn){for(var rs=[],is=Mn.length,os=0;os<is;os++){var as=Mn.charCodeAt(os);if(as>=55296&&as<=56319&&is>os+1){var us=Mn.charCodeAt(os+1);us>=56320&&us<=57343&&(as=(as-55296)*1024+us-56320+65536,os+=1)}if(as<128){rs.push(as);continue}if(as<2048){rs.push(as>>6|192),rs.push(as&63|128);continue}if(as<55296||as>=57344&&as<65536){rs.push(as>>12|224),rs.push(as>>6&63|128),rs.push(as&63|128);continue}if(as>=65536&&as<=1114111){rs.push(as>>18|240),rs.push(as>>12&63|128),rs.push(as>>6&63|128),rs.push(as&63|128);continue}rs.push(239,191,189)}return new Uint8Array(rs).buffer};const encodeUtf8=encodeUtf8$1,Mode$2=mode;function ByteData(Fn){this.mode=Mode$2.BYTE,typeof Fn=="string"&&(Fn=encodeUtf8(Fn)),this.data=new Uint8Array(Fn)}ByteData.getBitsLength=function Fn(Mn){return Mn*8};ByteData.prototype.getLength=function Fn(){return this.data.length};ByteData.prototype.getBitsLength=function Fn(){return ByteData.getBitsLength(this.data.length)};ByteData.prototype.write=function(Fn){for(let Mn=0,rs=this.data.length;Mn<rs;Mn++)Fn.put(this.data[Mn],8)};var byteData=ByteData;const Mode$1=mode,Utils$2=utils$g;function KanjiData(Fn){this.mode=Mode$1.KANJI,this.data=Fn}KanjiData.getBitsLength=function Fn(Mn){return Mn*13};KanjiData.prototype.getLength=function Fn(){return this.data.length};KanjiData.prototype.getBitsLength=function Fn(){return KanjiData.getBitsLength(this.data.length)};KanjiData.prototype.write=function(Fn){let Mn;for(Mn=0;Mn<this.data.length;Mn++){let rs=Utils$2.toSJIS(this.data[Mn]);if(rs>=33088&&rs<=40956)rs-=33088;else if(rs>=57408&&rs<=60351)rs-=49472;else throw new Error("Invalid SJIS character: "+this.data[Mn]+`
Make sure your charset is UTF-8`);rs=(rs>>>8&255)*192+(rs&255),Fn.put(rs,13)}};var kanjiData=KanjiData,dijkstra={exports:{}};(function(Fn){var Mn={single_source_shortest_paths:function(rs,is,os){var as={},us={};us[is]=0;var ds=Mn.PriorityQueue.make();ds.push(is,0);for(var hs,ps,io,fo,mo,Ao,$o,Lo,Go;!ds.empty();){hs=ds.pop(),ps=hs.value,fo=hs.cost,mo=rs[ps]||{};for(io in mo)mo.hasOwnProperty(io)&&(Ao=mo[io],$o=fo+Ao,Lo=us[io],Go=typeof us[io]>"u",(Go||Lo>$o)&&(us[io]=$o,ds.push(io,$o),as[io]=ps))}if(typeof os<"u"&&typeof us[os]>"u"){var Yo=["Could not find a path from ",is," to ",os,"."].join("");throw new Error(Yo)}return as},extract_shortest_path_from_predecessor_list:function(rs,is){for(var os=[],as=is;as;)os.push(as),rs[as],as=rs[as];return os.reverse(),os},find_path:function(rs,is,os){var as=Mn.single_source_shortest_paths(rs,is,os);return Mn.extract_shortest_path_from_predecessor_list(as,os)},PriorityQueue:{make:function(rs){var is=Mn.PriorityQueue,os={},as;rs=rs||{};for(as in is)is.hasOwnProperty(as)&&(os[as]=is[as]);return os.queue=[],os.sorter=rs.sorter||is.default_sorter,os},default_sorter:function(rs,is){return rs.cost-is.cost},push:function(rs,is){var os={value:rs,cost:is};this.queue.push(os),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};Fn.exports=Mn})(dijkstra);var dijkstraExports=dijkstra.exports;(function(Fn){const Mn=mode,rs=numericData,is=alphanumericData,os=byteData,as=kanjiData,us=regex,ds=utils$g,hs=dijkstraExports;function ps(Yo){return unescape(encodeURIComponent(Yo)).length}function io(Yo,Wo,Jo){const xl=[];let _l;for(;(_l=Yo.exec(Jo))!==null;)xl.push({data:_l[0],index:_l.index,mode:Wo,length:_l[0].length});return xl}function fo(Yo){const Wo=io(us.NUMERIC,Mn.NUMERIC,Yo),Jo=io(us.ALPHANUMERIC,Mn.ALPHANUMERIC,Yo);let xl,_l;return ds.isKanjiModeEnabled()?(xl=io(us.BYTE,Mn.BYTE,Yo),_l=io(us.KANJI,Mn.KANJI,Yo)):(xl=io(us.BYTE_KANJI,Mn.BYTE,Yo),_l=[]),Wo.concat(Jo,xl,_l).sort(function(Sl,$l){return Sl.index-$l.index}).map(function(Sl){return{data:Sl.data,mode:Sl.mode,length:Sl.length}})}function mo(Yo,Wo){switch(Wo){case Mn.NUMERIC:return rs.getBitsLength(Yo);case Mn.ALPHANUMERIC:return is.getBitsLength(Yo);case Mn.KANJI:return as.getBitsLength(Yo);case Mn.BYTE:return os.getBitsLength(Yo)}}function Ao(Yo){return Yo.reduce(function(Wo,Jo){const xl=Wo.length-1>=0?Wo[Wo.length-1]:null;return xl&&xl.mode===Jo.mode?(Wo[Wo.length-1].data+=Jo.data,Wo):(Wo.push(Jo),Wo)},[])}function $o(Yo){const Wo=[];for(let Jo=0;Jo<Yo.length;Jo++){const xl=Yo[Jo];switch(xl.mode){case Mn.NUMERIC:Wo.push([xl,{data:xl.data,mode:Mn.ALPHANUMERIC,length:xl.length},{data:xl.data,mode:Mn.BYTE,length:xl.length}]);break;case Mn.ALPHANUMERIC:Wo.push([xl,{data:xl.data,mode:Mn.BYTE,length:xl.length}]);break;case Mn.KANJI:Wo.push([xl,{data:xl.data,mode:Mn.BYTE,length:ps(xl.data)}]);break;case Mn.BYTE:Wo.push([{data:xl.data,mode:Mn.BYTE,length:ps(xl.data)}])}}return Wo}function Lo(Yo,Wo){const Jo={},xl={start:{}};let _l=["start"];for(let Tl=0;Tl<Yo.length;Tl++){const Sl=Yo[Tl],$l=[];for(let Pl=0;Pl<Sl.length;Pl++){const Dl=Sl[Pl],Ol=""+Tl+Pl;$l.push(Ol),Jo[Ol]={node:Dl,lastCount:0},xl[Ol]={};for(let Rl=0;Rl<_l.length;Rl++){const Vo=_l[Rl];Jo[Vo]&&Jo[Vo].node.mode===Dl.mode?(xl[Vo][Ol]=mo(Jo[Vo].lastCount+Dl.length,Dl.mode)-mo(Jo[Vo].lastCount,Dl.mode),Jo[Vo].lastCount+=Dl.length):(Jo[Vo]&&(Jo[Vo].lastCount=Dl.length),xl[Vo][Ol]=mo(Dl.length,Dl.mode)+4+Mn.getCharCountIndicator(Dl.mode,Wo))}}_l=$l}for(let Tl=0;Tl<_l.length;Tl++)xl[_l[Tl]].end=0;return{map:xl,table:Jo}}function Go(Yo,Wo){let Jo;const xl=Mn.getBestModeForData(Yo);if(Jo=Mn.from(Wo,xl),Jo!==Mn.BYTE&&Jo.bit<xl.bit)throw new Error('"'+Yo+'" cannot be encoded with mode '+Mn.toString(Jo)+`.
 Suggested mode is: `+Mn.toString(xl));switch(Jo===Mn.KANJI&&!ds.isKanjiModeEnabled()&&(Jo=Mn.BYTE),Jo){case Mn.NUMERIC:return new rs(Yo);case Mn.ALPHANUMERIC:return new is(Yo);case Mn.KANJI:return new as(Yo);case Mn.BYTE:return new os(Yo)}}Fn.fromArray=function(Wo){return Wo.reduce(function(Jo,xl){return typeof xl=="string"?Jo.push(Go(xl,null)):xl.data&&Jo.push(Go(xl.data,xl.mode)),Jo},[])},Fn.fromString=function(Wo,Jo){const xl=fo(Wo,ds.isKanjiModeEnabled()),_l=$o(xl),Tl=Lo(_l,Jo),Sl=hs.find_path(Tl.map,"start","end"),$l=[];for(let Pl=1;Pl<Sl.length-1;Pl++)$l.push(Tl.table[Sl[Pl]].node);return Fn.fromArray(Ao($l))},Fn.rawSplit=function(Wo){return Fn.fromArray(fo(Wo,ds.isKanjiModeEnabled()))}})(segments);const Utils$1=utils$g,ECLevel=errorCorrectionLevel,BitBuffer=bitBuffer,BitMatrix=bitMatrix,AlignmentPattern=alignmentPattern,FinderPattern=finderPattern,MaskPattern=maskPattern,ECCode=errorCorrectionCode,ReedSolomonEncoder=reedSolomonEncoder,Version=version$3,FormatInfo=formatInfo,Mode=mode,Segments=segments;function setupFinderPattern(Fn,Mn){const rs=Fn.size,is=FinderPattern.getPositions(Mn);for(let os=0;os<is.length;os++){const as=is[os][0],us=is[os][1];for(let ds=-1;ds<=7;ds++)if(!(as+ds<=-1||rs<=as+ds))for(let hs=-1;hs<=7;hs++)us+hs<=-1||rs<=us+hs||(ds>=0&&ds<=6&&(hs===0||hs===6)||hs>=0&&hs<=6&&(ds===0||ds===6)||ds>=2&&ds<=4&&hs>=2&&hs<=4?Fn.set(as+ds,us+hs,!0,!0):Fn.set(as+ds,us+hs,!1,!0))}}function setupTimingPattern(Fn){const Mn=Fn.size;for(let rs=8;rs<Mn-8;rs++){const is=rs%2===0;Fn.set(rs,6,is,!0),Fn.set(6,rs,is,!0)}}function setupAlignmentPattern(Fn,Mn){const rs=AlignmentPattern.getPositions(Mn);for(let is=0;is<rs.length;is++){const os=rs[is][0],as=rs[is][1];for(let us=-2;us<=2;us++)for(let ds=-2;ds<=2;ds++)us===-2||us===2||ds===-2||ds===2||us===0&&ds===0?Fn.set(os+us,as+ds,!0,!0):Fn.set(os+us,as+ds,!1,!0)}}function setupVersionInfo(Fn,Mn){const rs=Fn.size,is=Version.getEncodedBits(Mn);let os,as,us;for(let ds=0;ds<18;ds++)os=Math.floor(ds/3),as=ds%3+rs-8-3,us=(is>>ds&1)===1,Fn.set(os,as,us,!0),Fn.set(as,os,us,!0)}function setupFormatInfo(Fn,Mn,rs){const is=Fn.size,os=FormatInfo.getEncodedBits(Mn,rs);let as,us;for(as=0;as<15;as++)us=(os>>as&1)===1,as<6?Fn.set(as,8,us,!0):as<8?Fn.set(as+1,8,us,!0):Fn.set(is-15+as,8,us,!0),as<8?Fn.set(8,is-as-1,us,!0):as<9?Fn.set(8,15-as-1+1,us,!0):Fn.set(8,15-as-1,us,!0);Fn.set(is-8,8,1,!0)}function setupData(Fn,Mn){const rs=Fn.size;let is=-1,os=rs-1,as=7,us=0;for(let ds=rs-1;ds>0;ds-=2)for(ds===6&&ds--;;){for(let hs=0;hs<2;hs++)if(!Fn.isReserved(os,ds-hs)){let ps=!1;us<Mn.length&&(ps=(Mn[us]>>>as&1)===1),Fn.set(os,ds-hs,ps),as--,as===-1&&(us++,as=7)}if(os+=is,os<0||rs<=os){os-=is,is=-is;break}}}function createData(Fn,Mn,rs){const is=new BitBuffer;rs.forEach(function(hs){is.put(hs.mode.bit,4),is.put(hs.getLength(),Mode.getCharCountIndicator(hs.mode,Fn)),hs.write(is)});const os=Utils$1.getSymbolTotalCodewords(Fn),as=ECCode.getTotalCodewordsCount(Fn,Mn),us=(os-as)*8;for(is.getLengthInBits()+4<=us&&is.put(0,4);is.getLengthInBits()%8!==0;)is.putBit(0);const ds=(us-is.getLengthInBits())/8;for(let hs=0;hs<ds;hs++)is.put(hs%2?17:236,8);return createCodewords(is,Fn,Mn)}function createCodewords(Fn,Mn,rs){const is=Utils$1.getSymbolTotalCodewords(Mn),os=ECCode.getTotalCodewordsCount(Mn,rs),as=is-os,us=ECCode.getBlocksCount(Mn,rs),ds=is%us,hs=us-ds,ps=Math.floor(is/us),io=Math.floor(as/us),fo=io+1,mo=ps-io,Ao=new ReedSolomonEncoder(mo);let $o=0;const Lo=new Array(us),Go=new Array(us);let Yo=0;const Wo=new Uint8Array(Fn.buffer);for(let Sl=0;Sl<us;Sl++){const $l=Sl<hs?io:fo;Lo[Sl]=Wo.slice($o,$o+$l),Go[Sl]=Ao.encode(Lo[Sl]),$o+=$l,Yo=Math.max(Yo,$l)}const Jo=new Uint8Array(is);let xl=0,_l,Tl;for(_l=0;_l<Yo;_l++)for(Tl=0;Tl<us;Tl++)_l<Lo[Tl].length&&(Jo[xl++]=Lo[Tl][_l]);for(_l=0;_l<mo;_l++)for(Tl=0;Tl<us;Tl++)Jo[xl++]=Go[Tl][_l];return Jo}function createSymbol(Fn,Mn,rs,is){let os;if(Array.isArray(Fn))os=Segments.fromArray(Fn);else if(typeof Fn=="string"){let ps=Mn;if(!ps){const io=Segments.rawSplit(Fn);ps=Version.getBestVersionForData(io,rs)}os=Segments.fromString(Fn,ps||40)}else throw new Error("Invalid data");const as=Version.getBestVersionForData(os,rs);if(!as)throw new Error("The amount of data is too big to be stored in a QR Code");if(!Mn)Mn=as;else if(Mn<as)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+as+`.
`);const us=createData(Mn,rs,os),ds=Utils$1.getSymbolSize(Mn),hs=new BitMatrix(ds);return setupFinderPattern(hs,Mn),setupTimingPattern(hs),setupAlignmentPattern(hs,Mn),setupFormatInfo(hs,rs,0),Mn>=7&&setupVersionInfo(hs,Mn),setupData(hs,us),isNaN(is)&&(is=MaskPattern.getBestMask(hs,setupFormatInfo.bind(null,hs,rs))),MaskPattern.applyMask(is,hs),setupFormatInfo(hs,rs,is),{modules:hs,version:Mn,errorCorrectionLevel:rs,maskPattern:is,segments:os}}qrcode.create=function Fn(Mn,rs){if(typeof Mn>"u"||Mn==="")throw new Error("No input text");let is=ECLevel.M,os,as;return typeof rs<"u"&&(is=ECLevel.from(rs.errorCorrectionLevel,ECLevel.M),os=Version.from(rs.version),as=MaskPattern.from(rs.maskPattern),rs.toSJISFunc&&Utils$1.setToSJISFunction(rs.toSJISFunc)),createSymbol(Mn,os,is,as)};var canvas={},utils$f={};(function(Fn){function Mn(rs){if(typeof rs=="number"&&(rs=rs.toString()),typeof rs!="string")throw new Error("Color should be defined as hex string");let is=rs.slice().replace("#","").split("");if(is.length<3||is.length===5||is.length>8)throw new Error("Invalid hex color: "+rs);(is.length===3||is.length===4)&&(is=Array.prototype.concat.apply([],is.map(function(as){return[as,as]}))),is.length===6&&is.push("F","F");const os=parseInt(is.join(""),16);return{r:os>>24&255,g:os>>16&255,b:os>>8&255,a:os&255,hex:"#"+is.slice(0,6).join("")}}Fn.getOptions=function(is){is||(is={}),is.color||(is.color={});const os=typeof is.margin>"u"||is.margin===null||is.margin<0?4:is.margin,as=is.width&&is.width>=21?is.width:void 0,us=is.scale||4;return{width:as,scale:as?4:us,margin:os,color:{dark:Mn(is.color.dark||"#000000ff"),light:Mn(is.color.light||"#ffffffff")},type:is.type,rendererOpts:is.rendererOpts||{}}},Fn.getScale=function(is,os){return os.width&&os.width>=is+os.margin*2?os.width/(is+os.margin*2):os.scale},Fn.getImageWidth=function(is,os){const as=Fn.getScale(is,os);return Math.floor((is+os.margin*2)*as)},Fn.qrToImageData=function(is,os,as){const us=os.modules.size,ds=os.modules.data,hs=Fn.getScale(us,as),ps=Math.floor((us+as.margin*2)*hs),io=as.margin*hs,fo=[as.color.light,as.color.dark];for(let mo=0;mo<ps;mo++)for(let Ao=0;Ao<ps;Ao++){let $o=(mo*ps+Ao)*4,Lo=as.color.light;if(mo>=io&&Ao>=io&&mo<ps-io&&Ao<ps-io){const Go=Math.floor((mo-io)/hs),Yo=Math.floor((Ao-io)/hs);Lo=fo[ds[Go*us+Yo]?1:0]}is[$o++]=Lo.r,is[$o++]=Lo.g,is[$o++]=Lo.b,is[$o]=Lo.a}}})(utils$f);(function(Fn){const Mn=utils$f;function rs(os,as,us){os.clearRect(0,0,as.width,as.height),as.style||(as.style={}),as.height=us,as.width=us,as.style.height=us+"px",as.style.width=us+"px"}function is(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}Fn.render=function(as,us,ds){let hs=ds,ps=us;typeof hs>"u"&&(!us||!us.getContext)&&(hs=us,us=void 0),us||(ps=is()),hs=Mn.getOptions(hs);const io=Mn.getImageWidth(as.modules.size,hs),fo=ps.getContext("2d"),mo=fo.createImageData(io,io);return Mn.qrToImageData(mo.data,as,hs),rs(fo,ps,io),fo.putImageData(mo,0,0),ps},Fn.renderToDataURL=function(as,us,ds){let hs=ds;typeof hs>"u"&&(!us||!us.getContext)&&(hs=us,us=void 0),hs||(hs={});const ps=Fn.render(as,us,hs),io=hs.type||"image/png",fo=hs.rendererOpts||{};return ps.toDataURL(io,fo.quality)}})(canvas);var svgTag={};const Utils=utils$f;function getColorAttrib(Fn,Mn){const rs=Fn.a/255,is=Mn+'="'+Fn.hex+'"';return rs<1?is+" "+Mn+'-opacity="'+rs.toFixed(2).slice(1)+'"':is}function svgCmd(Fn,Mn,rs){let is=Fn+Mn;return typeof rs<"u"&&(is+=" "+rs),is}function qrToPath(Fn,Mn,rs){let is="",os=0,as=!1,us=0;for(let ds=0;ds<Fn.length;ds++){const hs=Math.floor(ds%Mn),ps=Math.floor(ds/Mn);!hs&&!as&&(as=!0),Fn[ds]?(us++,ds>0&&hs>0&&Fn[ds-1]||(is+=as?svgCmd("M",hs+rs,.5+ps+rs):svgCmd("m",os,0),os=0,as=!1),hs+1<Mn&&Fn[ds+1]||(is+=svgCmd("h",us),us=0)):os++}return is}svgTag.render=function Fn(Mn,rs,is){const os=Utils.getOptions(rs),as=Mn.modules.size,us=Mn.modules.data,ds=as+os.margin*2,hs=os.color.light.a?"<path "+getColorAttrib(os.color.light,"fill")+' d="M0 0h'+ds+"v"+ds+'H0z"/>':"",ps="<path "+getColorAttrib(os.color.dark,"stroke")+' d="'+qrToPath(us,as,os.margin)+'"/>',io='viewBox="0 0 '+ds+" "+ds+'"',mo='<svg xmlns="http://www.w3.org/2000/svg" '+(os.width?'width="'+os.width+'" height="'+os.width+'" ':"")+io+' shape-rendering="crispEdges">'+hs+ps+`</svg>
`;return typeof is=="function"&&is(null,mo),mo};const canPromise=canPromise$1,QRCode=qrcode,CanvasRenderer=canvas,SvgRenderer=svgTag;function renderCanvas(Fn,Mn,rs,is,os){const as=[].slice.call(arguments,1),us=as.length,ds=typeof as[us-1]=="function";if(!ds&&!canPromise())throw new Error("Callback required as last argument");if(ds){if(us<2)throw new Error("Too few arguments provided");us===2?(os=rs,rs=Mn,Mn=is=void 0):us===3&&(Mn.getContext&&typeof os>"u"?(os=is,is=void 0):(os=is,is=rs,rs=Mn,Mn=void 0))}else{if(us<1)throw new Error("Too few arguments provided");return us===1?(rs=Mn,Mn=is=void 0):us===2&&!Mn.getContext&&(is=rs,rs=Mn,Mn=void 0),new Promise(function(hs,ps){try{const io=QRCode.create(rs,is);hs(Fn(io,Mn,is))}catch(io){ps(io)}})}try{const hs=QRCode.create(rs,is);os(null,Fn(hs,Mn,is))}catch(hs){os(hs)}}browser$1.create=QRCode.create;browser$1.toCanvas=renderCanvas.bind(null,CanvasRenderer.render);browser$1.toDataURL=renderCanvas.bind(null,CanvasRenderer.renderToDataURL);browser$1.toString=renderCanvas.bind(null,function(Fn,Mn,rs){return SvgRenderer.render(Fn,rs)});const CONNECTING_ERROR_MARGIN=.1,CIRCLE_SIZE_MODIFIER=2.5,QRCODE_MATRIX_MARGIN=7;function isAdjecentDots(Fn,Mn,rs){return Fn===Mn?!1:(Fn-Mn<0?Mn-Fn:Fn-Mn)<=rs+CONNECTING_ERROR_MARGIN}function getMatrix(Fn,Mn){const rs=Array.prototype.slice.call(browser$1.create(Fn,{errorCorrectionLevel:Mn}).modules.data,0),is=Math.sqrt(rs.length);return rs.reduce((os,as,us)=>(us%is===0?os.push([as]):os[os.length-1].push(as))&&os,[])}const QrCodeUtil={generate(Fn,Mn,rs){const is="#141414",os="transparent",us=[],ds=getMatrix(Fn,"Q"),hs=Mn/ds.length,ps=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];ps.forEach(({x:Lo,y:Go})=>{const Yo=(ds.length-QRCODE_MATRIX_MARGIN)*hs*Lo,Wo=(ds.length-QRCODE_MATRIX_MARGIN)*hs*Go,Jo=.45;for(let xl=0;xl<ps.length;xl+=1){const _l=hs*(QRCODE_MATRIX_MARGIN-xl*2);us.push(Oe$1`
            <rect
              fill=${xl===2?is:os}
              width=${xl===0?_l-5:_l}
              rx= ${xl===0?(_l-5)*Jo:_l*Jo}
              ry= ${xl===0?(_l-5)*Jo:_l*Jo}
              stroke=${is}
              stroke-width=${xl===0?5:0}
              height=${xl===0?_l-5:_l}
              x= ${xl===0?Wo+hs*xl+5/2:Wo+hs*xl}
              y= ${xl===0?Yo+hs*xl+5/2:Yo+hs*xl}
            />
          `)}});const io=Math.floor((rs+25)/hs),fo=ds.length/2-io/2,mo=ds.length/2+io/2-1,Ao=[];ds.forEach((Lo,Go)=>{Lo.forEach((Yo,Wo)=>{if(ds[Go][Wo]&&!(Go<QRCODE_MATRIX_MARGIN&&Wo<QRCODE_MATRIX_MARGIN||Go>ds.length-(QRCODE_MATRIX_MARGIN+1)&&Wo<QRCODE_MATRIX_MARGIN||Go<QRCODE_MATRIX_MARGIN&&Wo>ds.length-(QRCODE_MATRIX_MARGIN+1))&&!(Go>fo&&Go<mo&&Wo>fo&&Wo<mo)){const Jo=Go*hs+hs/2,xl=Wo*hs+hs/2;Ao.push([Jo,xl])}})});const $o={};return Ao.forEach(([Lo,Go])=>{var Yo;$o[Lo]?(Yo=$o[Lo])==null||Yo.push(Go):$o[Lo]=[Go]}),Object.entries($o).map(([Lo,Go])=>{const Yo=Go.filter(Wo=>Go.every(Jo=>!isAdjecentDots(Wo,Jo,hs)));return[Number(Lo),Yo]}).forEach(([Lo,Go])=>{Go.forEach(Yo=>{us.push(Oe$1`<circle cx=${Lo} cy=${Yo} fill=${is} r=${hs/CIRCLE_SIZE_MODIFIER} />`)})}),Object.entries($o).filter(([Lo,Go])=>Go.length>1).map(([Lo,Go])=>{const Yo=Go.filter(Wo=>Go.some(Jo=>isAdjecentDots(Wo,Jo,hs)));return[Number(Lo),Yo]}).map(([Lo,Go])=>{Go.sort((Wo,Jo)=>Wo<Jo?-1:1);const Yo=[];for(const Wo of Go){const Jo=Yo.find(xl=>xl.some(_l=>isAdjecentDots(Wo,_l,hs)));Jo?Jo.push(Wo):Yo.push([Wo])}return[Lo,Yo.map(Wo=>[Wo[0],Wo[Wo.length-1]])]}).forEach(([Lo,Go])=>{Go.forEach(([Yo,Wo])=>{us.push(Oe$1`
              <line
                x1=${Lo}
                x2=${Lo}
                y1=${Yo}
                y2=${Wo}
                stroke=${is}
                stroke-width=${hs/(CIRCLE_SIZE_MODIFIER/2)}
                stroke-linecap="round"
              />
            `)})}),us}},styles$1C=i$4`
  :host {
    position: relative;
    user-select: none;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    width: var(--local-size);
  }

  :host([data-theme='dark']) {
    border-radius: clamp(0px, var(--wui-border-radius-l), 40px);
    background-color: var(--wui-color-inverse-100);
    padding: var(--wui-spacing-l);
  }

  :host([data-theme='light']) {
    box-shadow: 0 0 0 1px var(--wui-color-bg-125);
    background-color: var(--wui-color-bg-125);
  }

  :host([data-clear='true']) > wui-icon {
    display: none;
  }

  svg:first-child,
  wui-image,
  wui-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateY(-50%) translateX(-50%);
  }

  wui-image {
    width: 25%;
    height: 25%;
    border-radius: var(--wui-border-radius-xs);
  }

  wui-icon {
    width: 100%;
    height: 100%;
    color: #3396ff !important;
    transform: translateY(-50%) translateX(-50%) scale(0.25);
  }
`;var __decorate$2c=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiQrCode=class extends h$3{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=`--local-size: ${this.size}px`,ke`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){const Mn=this.theme==="light"?this.size:this.size-32;return Oe$1`
      <svg height=${Mn} width=${Mn}>
        ${QrCodeUtil.generate(this.uri,Mn,this.arenaClear?0:Mn/4)}
      </svg>
    `}templateVisual(){return this.imageSrc?ke`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?ke`<wui-icon
        class="farcaster"
        size="inherit"
        color="inherit"
        name="farcaster"
      ></wui-icon>`:ke`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};WuiQrCode.styles=[resetStyles,styles$1C];__decorate$2c([n$4()],WuiQrCode.prototype,"uri",void 0);__decorate$2c([n$4({type:Number})],WuiQrCode.prototype,"size",void 0);__decorate$2c([n$4()],WuiQrCode.prototype,"theme",void 0);__decorate$2c([n$4()],WuiQrCode.prototype,"imageSrc",void 0);__decorate$2c([n$4()],WuiQrCode.prototype,"alt",void 0);__decorate$2c([n$4({type:Boolean})],WuiQrCode.prototype,"arenaClear",void 0);__decorate$2c([n$4({type:Boolean})],WuiQrCode.prototype,"farcaster",void 0);WuiQrCode=__decorate$2c([customElement("wui-qr-code")],WuiQrCode);const styles$1B=i$4`
  :host {
    position: relative;
    display: inline-block;
    width: 100%;
  }
`;var __decorate$2b=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiSearchBar=class extends h$3{constructor(){super(...arguments),this.inputComponentRef=ii$1()}render(){return ke`
      <wui-input-text
        ${Kt$2(this.inputComponentRef)}
        placeholder="Search wallet"
        icon="search"
        type="search"
        enterKeyHint="search"
        size="sm"
      >
        <wui-input-element @click=${this.clearValue} icon="close"></wui-input-element>
      </wui-input-text>
    `}clearValue(){const Mn=this.inputComponentRef.value,rs=Mn==null?void 0:Mn.inputElementRef.value;rs&&(rs.value="",rs.focus(),rs.dispatchEvent(new Event("input")))}};WuiSearchBar.styles=[resetStyles,styles$1B];WuiSearchBar=__decorate$2b([customElement("wui-search-bar")],WuiSearchBar);const styles$1A=i$4`
  :host {
    display: flex;
    column-gap: var(--wui-spacing-xs);
    align-items: center;
    padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs);
    border-radius: var(--wui-border-radius-3xl);
    border: 1px solid var(--wui-color-gray-glass-005);
    box-sizing: border-box;
    max-height: 40px;
    background-color: var(--wui-color-bg-175);
    box-shadow:
      0px 14px 64px -4px rgba(0, 0, 0, 0.15),
      0px 8px 22px -6px rgba(0, 0, 0, 0.15);
  }

  :host wui-loading-spinner {
    margin-left: var(--wui-spacing-3xs);
  }
`;var __decorate$2a=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiSnackbar=class extends h$3{constructor(){super(...arguments),this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="checkmark",this.message="",this.loading=!1}render(){return ke`
      ${this.loading?ke`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:ke`<wui-icon-box
            size="sm"
            iconSize="xs"
            iconColor=${this.iconColor}
            backgroundColor=${this.backgroundColor}
            icon=${this.icon}
            background="opaque"
          ></wui-icon-box>`}
      <wui-text variant="paragraph-500" color="fg-100" data-testid="wui-snackbar-message"
        >${this.message}</wui-text
      >
    `}};WuiSnackbar.styles=[resetStyles,styles$1A];__decorate$2a([n$4()],WuiSnackbar.prototype,"backgroundColor",void 0);__decorate$2a([n$4()],WuiSnackbar.prototype,"iconColor",void 0);__decorate$2a([n$4()],WuiSnackbar.prototype,"icon",void 0);__decorate$2a([n$4()],WuiSnackbar.prototype,"message",void 0);__decorate$2a([n$4()],WuiSnackbar.prototype,"loading",void 0);WuiSnackbar=__decorate$2a([customElement("wui-snackbar")],WuiSnackbar);const styles$1z=i$4`
  :host {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--wui-spacing-s);
    border-radius: var(--wui-border-radius-s);
    border: 1px solid var(--wui-color-dark-glass-100);
    box-sizing: border-box;
    background-color: var(--wui-color-bg-325);
    box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
  }

  wui-flex {
    width: 100%;
  }

  wui-text {
    word-break: break-word;
    flex: 1;
  }

  .close {
    cursor: pointer;
  }

  .icon-box {
    height: 40px;
    width: 40px;
    border-radius: var(--wui-border-radius-3xs);
    background-color: var(--local-icon-bg-value);
  }
`;var __decorate$29=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiAlertBar=class extends h$3{constructor(){super(...arguments),this.message="",this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="info"}render(){return this.style.cssText=`
      --local-icon-bg-value: var(--wui-color-${this.backgroundColor});
   `,ke`
      <wui-flex flexDirection="row" justifyContent="space-between" alignItems="center">
        <wui-flex columnGap="xs" flexDirection="row" alignItems="center">
          <wui-flex
            flexDirection="row"
            alignItems="center"
            justifyContent="center"
            class="icon-box"
          >
            <wui-icon color=${this.iconColor} size="md" name=${this.icon}></wui-icon>
          </wui-flex>
          <wui-text variant="small-500" color="bg-350" data-testid="wui-alertbar-text"
            >${this.message}</wui-text
          >
        </wui-flex>
        <wui-icon
          class="close"
          color="bg-350"
          size="sm"
          name="close"
          @click=${this.onClose}
        ></wui-icon>
      </wui-flex>
    `}onClose(){AlertController.close()}};WuiAlertBar.styles=[resetStyles,styles$1z];__decorate$29([n$4()],WuiAlertBar.prototype,"message",void 0);__decorate$29([n$4()],WuiAlertBar.prototype,"backgroundColor",void 0);__decorate$29([n$4()],WuiAlertBar.prototype,"iconColor",void 0);__decorate$29([n$4()],WuiAlertBar.prototype,"icon",void 0);WuiAlertBar=__decorate$29([customElement("wui-alertbar")],WuiAlertBar);const styles$1y=i$4`
  :host {
    display: inline-flex;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-3xl);
    padding: var(--wui-spacing-3xs);
    position: relative;
    height: 36px;
    min-height: 36px;
    overflow: hidden;
  }

  :host::before {
    content: '';
    position: absolute;
    pointer-events: none;
    top: 4px;
    left: 4px;
    display: block;
    width: var(--local-tab-width);
    height: 28px;
    border-radius: var(--wui-border-radius-3xl);
    background-color: var(--wui-color-gray-glass-002);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
    transform: translateX(calc(var(--local-tab) * var(--local-tab-width)));
    transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: background-color, opacity;
  }

  :host([data-type='flex'])::before {
    left: 3px;
    transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px)));
  }

  :host([data-type='flex']) {
    display: flex;
    padding: 0px 0px 0px 12px;
    gap: 4px;
  }

  :host([data-type='flex']) > button > wui-text {
    position: absolute;
    left: 18px;
    opacity: 0;
  }

  button[data-active='true'] > wui-icon,
  button[data-active='true'] > wui-text {
    color: var(--wui-color-fg-100);
  }

  button[data-active='false'] > wui-icon,
  button[data-active='false'] > wui-text {
    color: var(--wui-color-fg-200);
  }

  button[data-active='true']:disabled,
  button[data-active='false']:disabled {
    background-color: transparent;
    opacity: 0.5;
    cursor: not-allowed;
  }

  button[data-active='true']:disabled > wui-text {
    color: var(--wui-color-fg-200);
  }

  button[data-active='false']:disabled > wui-text {
    color: var(--wui-color-fg-300);
  }

  button > wui-icon,
  button > wui-text {
    pointer-events: none;
    transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md);
    will-change: color;
  }

  button {
    width: var(--local-tab-width);
    transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: background-color;
  }

  :host([data-type='flex']) > button {
    width: 34px;
    position: relative;
    display: flex;
    justify-content: flex-start;
  }

  button:hover:enabled,
  button:active:enabled {
    background-color: transparent !important;
  }

  button:hover:enabled > wui-icon,
  button:active:enabled > wui-icon {
    transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg);
    color: var(--wui-color-fg-125);
  }

  button:hover:enabled > wui-text,
  button:active:enabled > wui-text {
    transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg);
    color: var(--wui-color-fg-125);
  }

  button {
    border-radius: var(--wui-border-radius-3xl);
  }
`;var __decorate$28=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiTabs=class extends h$3{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=`
      --local-tab: ${this.activeTab};
      --local-tab-width: ${this.localTabWidth};
    `,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((Mn,rs)=>{var os;const is=rs===this.activeTab;return ke`
        <button
          ?disabled=${this.disabled}
          @click=${()=>this.onTabClick(rs)}
          data-active=${is}
          data-testid="tab-${(os=Mn.label)==null?void 0:os.toLowerCase()}"
        >
          ${this.iconTemplate(Mn)}
          <wui-text variant="small-600" color="inherit"> ${Mn.label} </wui-text>
        </button>
      `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(Mn){return Mn.icon?ke`<wui-icon size="xs" color="inherit" name=${Mn.icon}></wui-icon>`:null}onTabClick(Mn){this.buttons&&this.animateTabs(Mn,!1),this.activeTab=Mn,this.onTabChange(Mn)}animateTabs(Mn,rs){const is=this.buttons[this.activeTab],os=this.buttons[Mn],as=is==null?void 0:is.querySelector("wui-text"),us=os==null?void 0:os.querySelector("wui-text"),ds=os==null?void 0:os.getBoundingClientRect(),hs=us==null?void 0:us.getBoundingClientRect();is&&as&&!rs&&Mn!==this.activeTab&&(as.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),is.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),os&&ds&&hs&&us&&(Mn!==this.activeTab||rs)&&(this.localTabWidth=`${Math.round(ds.width+hs.width)+6}px`,os.animate([{width:`${ds.width+hs.width}px`}],{duration:rs?0:500,fill:"forwards",easing:"ease"}),us.animate([{opacity:1}],{duration:rs?0:125,delay:rs?0:200,fill:"forwards",easing:"ease"}))}};WuiTabs.styles=[resetStyles,elementStyles,styles$1y];__decorate$28([n$4({type:Array})],WuiTabs.prototype,"tabs",void 0);__decorate$28([n$4()],WuiTabs.prototype,"onTabChange",void 0);__decorate$28([n$4({type:Array})],WuiTabs.prototype,"buttons",void 0);__decorate$28([n$4({type:Boolean})],WuiTabs.prototype,"disabled",void 0);__decorate$28([n$4()],WuiTabs.prototype,"localTabWidth",void 0);__decorate$28([r$5()],WuiTabs.prototype,"activeTab",void 0);__decorate$28([r$5()],WuiTabs.prototype,"isDense",void 0);WuiTabs=__decorate$28([customElement("wui-tabs")],WuiTabs);const styles$1x=i$4`
  :host {
    display: block;
  }

  :host > button {
    gap: var(--wui-spacing-xxs);
    padding: var(--wui-spacing-xs);
    padding-right: var(--wui-spacing-1xs);
    height: 40px;
    border-radius: var(--wui-border-radius-l);
    background: var(--wui-color-gray-glass-002);
    border-width: 0px;
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
  }

  :host > button wui-image {
    width: 24px;
    height: 24px;
    border-radius: var(--wui-border-radius-s);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
  }
`;var __decorate$27=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiTokenButton=class extends h$3{constructor(){super(...arguments),this.text=""}render(){return ke`
      <button ontouchstart>
        ${this.tokenTemplate()}
        <wui-text variant="paragraph-600" color="fg-100">${this.text}</wui-text>
      </button>
    `}tokenTemplate(){return this.imageSrc?ke`<wui-image src=${this.imageSrc}></wui-image>`:ke`
      <wui-icon-box
        size="sm"
        iconColor="fg-200"
        backgroundColor="fg-300"
        icon="networkPlaceholder"
      ></wui-icon-box>
    `}};WuiTokenButton.styles=[resetStyles,elementStyles,styles$1x];__decorate$27([n$4()],WuiTokenButton.prototype,"imageSrc",void 0);__decorate$27([n$4()],WuiTokenButton.prototype,"text",void 0);WuiTokenButton=__decorate$27([customElement("wui-token-button")],WuiTokenButton);const styles$1w=i$4`
  :host {
    display: block;
    padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s);
    border-radius: var(--wui-border-radius-xxs);

    color: var(--wui-color-bg-100);
    position: relative;
  }

  :host([data-variant='shade']) {
    background-color: var(--wui-color-bg-150);
    border: 1px solid var(--wui-color-gray-glass-005);
  }

  :host([data-variant='shade']) > wui-text {
    color: var(--wui-color-fg-150);
  }

  :host([data-variant='fill']) {
    background-color: var(--wui-color-fg-100);
    border: none;
  }

  wui-icon {
    position: absolute;
    width: 12px !important;
    height: 4px !important;
  }

  wui-icon[data-placement='top'] {
    bottom: 0px;
    left: 50%;
    transform: translate(-50%, 95%);
  }

  wui-icon[data-placement='bottom'] {
    top: 0;
    left: 50%;
    transform: translate(-50%, -95%) rotate(180deg);
  }

  wui-icon[data-placement='right'] {
    top: 50%;
    left: 0;
    transform: translate(-65%, -50%) rotate(90deg);
  }

  wui-icon[data-placement='left'] {
    top: 50%;
    right: 0%;
    transform: translate(65%, -50%) rotate(270deg);
  }
`;var __decorate$26=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiTooltip=class extends h$3{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.message=""}render(){return this.dataset.variant=this.variant,ke`<wui-icon
        data-placement=${this.placement}
        color="fg-100"
        size="inherit"
        name=${this.variant==="fill"?"cursor":"cursorTransparent"}
      ></wui-icon>
      <wui-text color="inherit" variant="small-500">${this.message}</wui-text>`}};WuiTooltip.styles=[resetStyles,elementStyles,styles$1w];__decorate$26([n$4()],WuiTooltip.prototype,"placement",void 0);__decorate$26([n$4()],WuiTooltip.prototype,"variant",void 0);__decorate$26([n$4()],WuiTooltip.prototype,"message",void 0);WuiTooltip=__decorate$26([customElement("wui-tooltip")],WuiTooltip);const styles$1v=i$4`
  :host {
    height: 60px;
    min-height: 60px;
  }

  :host > wui-flex {
    cursor: pointer;
    height: 100%;
    display: flex;
    column-gap: var(--wui-spacing-s);
    padding: var(--wui-spacing-xs);
    padding-right: var(--wui-spacing-l);
    width: 100%;
    background-color: transparent;
    border-radius: var(--wui-border-radius-xs);
    color: var(--wui-color-fg-250);
    transition:
      background-color var(--wui-ease-out-power-1) var(--wui-duration-lg),
      opacity var(--wui-ease-out-power-1) var(--wui-duration-lg);
    will-change: background-color, opacity;
  }

  @media (hover: hover) and (pointer: fine) {
    :host > wui-flex:hover {
      background-color: var(--wui-color-gray-glass-002);
    }

    :host > wui-flex:active {
      background-color: var(--wui-color-gray-glass-005);
    }
  }

  :host([disabled]) > wui-flex {
    opacity: 0.6;
  }

  :host([disabled]) > wui-flex:hover {
    background-color: transparent;
  }

  :host > wui-flex > wui-flex {
    flex: 1;
  }

  :host > wui-flex > wui-image,
  :host > wui-flex > .token-item-image-placeholder {
    width: 40px;
    max-width: 40px;
    height: 40px;
    border-radius: var(--wui-border-radius-3xl);
    position: relative;
  }

  :host > wui-flex > .token-item-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  :host > wui-flex > wui-image::after,
  :host > wui-flex > .token-item-image-placeholder::after {
    position: absolute;
    content: '';
    inset: 0;
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
    border-radius: var(--wui-border-radius-l);
  }

  button > wui-icon-box[data-variant='square-blue'] {
    border-radius: var(--wui-border-radius-3xs);
    position: relative;
    border: none;
    width: 36px;
    height: 36px;
  }
`;var __decorate$25=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiTokenListItem=class extends h$3{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.imageSrc=void 0,this.name=void 0,this.symbol=void 0,this.price=void 0,this.amount=void 0,this.visible=!1,this.imageError=!1,this.observer=new IntersectionObserver(Mn=>{Mn.forEach(rs=>{rs.isIntersecting?this.visible=!0:this.visible=!1})},{threshold:.1})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var rs;if(!this.visible)return null;const Mn=this.amount&&this.price?(rs=NumberUtil.multiply(this.price,this.amount))==null?void 0:rs.toFixed(3):null;return ke`
      <wui-flex alignItems="center">
        ${this.visualTemplate()}
        <wui-flex flexDirection="column" gap="3xs">
          <wui-flex justifyContent="space-between">
            <wui-text variant="paragraph-500" color="fg-100" lineClamp="1">${this.name}</wui-text>
            ${Mn?ke`
                  <wui-text variant="paragraph-500" color="fg-100">
                    $${UiHelperUtil.formatNumberToLocalString(Mn,3)}
                  </wui-text>
                `:null}
          </wui-flex>
          <wui-flex justifyContent="space-between">
            <wui-text variant="small-400" color="fg-200" lineClamp="1">${this.symbol}</wui-text>
            ${this.amount?ke`<wui-text variant="small-400" color="fg-200">
                  ${UiHelperUtil.formatNumberToLocalString(this.amount,4)}
                </wui-text>`:null}
          </wui-flex>
        </wui-flex>
      </wui-flex>
    `}visualTemplate(){return this.imageError?ke`<wui-flex class="token-item-image-placeholder">
        <wui-icon name="image" color="inherit"></wui-icon>
      </wui-flex>`:this.imageSrc?ke`<wui-image
        width="40"
        height="40"
        src=${this.imageSrc}
        @onLoadError=${this.imageLoadError}
      ></wui-image>`:null}imageLoadError(){this.imageError=!0}};WuiTokenListItem.styles=[resetStyles,elementStyles,styles$1v];__decorate$25([n$4()],WuiTokenListItem.prototype,"imageSrc",void 0);__decorate$25([n$4()],WuiTokenListItem.prototype,"name",void 0);__decorate$25([n$4()],WuiTokenListItem.prototype,"symbol",void 0);__decorate$25([n$4()],WuiTokenListItem.prototype,"price",void 0);__decorate$25([n$4()],WuiTokenListItem.prototype,"amount",void 0);__decorate$25([r$5()],WuiTokenListItem.prototype,"visible",void 0);__decorate$25([r$5()],WuiTokenListItem.prototype,"imageError",void 0);WuiTokenListItem=__decorate$25([customElement("wui-token-list-item")],WuiTokenListItem);const styles$1u=i$4`
  :host {
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--wui-icon-box-size-xl);
    height: var(--wui-icon-box-size-xl);
    box-shadow: 0 0 0 8px var(--wui-thumbnail-border);
    border-radius: var(--local-border-radius);
    overflow: hidden;
  }

  wui-icon {
    width: 32px;
    height: 32px;
  }
`;var __decorate$24=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiVisualThumbnail=class extends h$3{render(){return this.style.cssText=`--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"}; background-color: var(--wui-color-modal-bg);`,ke`${this.templateVisual()}`}templateVisual(){return this.imageSrc?ke`<wui-image src=${this.imageSrc} alt=${this.alt??""}></wui-image>`:ke`<wui-icon
      data-parent-size="md"
      size="inherit"
      color="inherit"
      name="walletPlaceholder"
    ></wui-icon>`}};WuiVisualThumbnail.styles=[resetStyles,styles$1u];__decorate$24([n$4()],WuiVisualThumbnail.prototype,"imageSrc",void 0);__decorate$24([n$4()],WuiVisualThumbnail.prototype,"alt",void 0);__decorate$24([n$4({type:Boolean})],WuiVisualThumbnail.prototype,"borderRadiusFull",void 0);WuiVisualThumbnail=__decorate$24([customElement("wui-visual-thumbnail")],WuiVisualThumbnail);const styles$1t=i$4`
  :host {
    display: block;
  }

  button {
    width: 100%;
    display: block;
    padding-top: var(--wui-spacing-l);
    padding-bottom: var(--wui-spacing-l);
    padding-left: var(--wui-spacing-s);
    padding-right: var(--wui-spacing-2l);
    border-radius: var(--wui-border-radius-s);
    background-color: var(--wui-color-accent-glass-010);
  }

  button:hover {
    background-color: var(--wui-color-accent-glass-015) !important;
  }

  button:active {
    background-color: var(--wui-color-accent-glass-020) !important;
  }
`;var __decorate$23=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiNoticeCard=class extends h$3{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return ke`
      <button>
        <wui-flex gap="m" alignItems="center" justifyContent="space-between">
          <wui-icon-box
            size="lg"
            iconcolor="accent-100"
            backgroundcolor="accent-100"
            icon=${this.icon}
            background="transparent"
          ></wui-icon-box>

          <wui-flex flexDirection="column" gap="3xs">
            <wui-text variant="paragraph-500" color="fg-100">${this.label}</wui-text>
            <wui-text variant="small-400" color="fg-200">${this.description}</wui-text>
          </wui-flex>

          <wui-icon size="md" color="fg-200" name="chevronRight"></wui-icon>
        </wui-flex>
      </button>
    `}};WuiNoticeCard.styles=[resetStyles,elementStyles,styles$1t];__decorate$23([n$4()],WuiNoticeCard.prototype,"label",void 0);__decorate$23([n$4()],WuiNoticeCard.prototype,"description",void 0);__decorate$23([n$4()],WuiNoticeCard.prototype,"icon",void 0);WuiNoticeCard=__decorate$23([customElement("wui-notice-card")],WuiNoticeCard);const styles$1s=i$4`
  button {
    height: auto;
    position: relative;
    flex-direction: column;
    gap: var(--wui-spacing-s);
    padding: 17px 18px 17px var(--wui-spacing-m);
    width: 100%;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
    color: var(--wui-color-fg-250);
  }

  .overflowedContent {
    width: 100%;
    overflow: hidden;
  }

  .overflowedContent[data-active='false']:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, var(--wui-color-bg-150), transparent);
    border-bottom-left-radius: var(--wui-border-radius-xs);
    border-bottom-right-radius: var(--wui-border-radius-xs);
  }

  .heightContent {
    max-height: 100px;
  }

  pre {
    text-align: left;
    white-space: pre-wrap;
    height: auto;
    overflow-x: auto;
    overflow-wrap: anywhere;
  }
`;var __decorate$22=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const MAX_HEIGHT=100;let WuiListAccordion=class extends h$3{constructor(){super(...arguments),this.textTitle="",this.overflowedContent="",this.toggled=!1,this.enableAccordion=!1,this.scrollElement=void 0,this.scrollHeightElement=0}updated(Mn){super.updated(Mn),(Mn.has("textTitle")||Mn.has("overflowedContent"))&&setTimeout(()=>{this.checkHeight()},1)}checkHeight(){this.updateComplete.then(()=>{var is,os;const Mn=(is=this.shadowRoot)==null?void 0:is.querySelector(".heightContent"),rs=(os=this.shadowRoot)==null?void 0:os.querySelector(".textContent");if(Mn&&rs){this.scrollElement=Mn;const as=rs==null?void 0:rs.scrollHeight;as&&as>MAX_HEIGHT&&(this.enableAccordion=!0,this.scrollHeightElement=as,this.requestUpdate())}})}render(){return ke`
      <button ontouchstart @click=${()=>this.onClick()}>
        <wui-flex justifyContent="space-between" alignItems="center">
          <wui-text variant="paragraph-500" color="fg-100">${this.textTitle}</wui-text>
          ${this.chevronTemplate()}
        </wui-flex>
        <div
          data-active=${this.enableAccordion?!!this.toggled:!0}
          class="overflowedContent"
        >
          <div class="heightContent">
            <wui-text class="textContent" variant="paragraph-400" color="fg-200">
              <pre>${this.overflowedContent}</pre>
            </wui-text>
          </div>
        </div>
      </button>
    `}onClick(){var rs;const Mn=(rs=this.shadowRoot)==null?void 0:rs.querySelector("wui-icon");this.enableAccordion&&(this.toggled=!this.toggled,this.requestUpdate(),this.scrollElement&&this.scrollElement.animate([{maxHeight:this.toggled?`${MAX_HEIGHT}px`:`${this.scrollHeightElement}px`},{maxHeight:this.toggled?`${this.scrollHeightElement}px`:`${MAX_HEIGHT}px`}],{duration:300,fill:"forwards",easing:"ease"}),Mn&&Mn.animate([{transform:this.toggled?"rotate(0deg)":"rotate(180deg)"},{transform:this.toggled?"rotate(180deg)":"rotate(0deg)"}],{duration:300,fill:"forwards",easing:"ease"}))}chevronTemplate(){return this.enableAccordion?ke` <wui-icon color="fg-100" size="sm" name="chevronBottom"></wui-icon>`:null}};WuiListAccordion.styles=[resetStyles,elementStyles,styles$1s];__decorate$22([n$4()],WuiListAccordion.prototype,"textTitle",void 0);__decorate$22([n$4()],WuiListAccordion.prototype,"overflowedContent",void 0);WuiListAccordion=__decorate$22([customElement("wui-list-accordion")],WuiListAccordion);const styles$1r=i$4`
  :host {
    display: flex;
    column-gap: var(--wui-spacing-s);
    padding: 17px 18px 17px var(--wui-spacing-m);
    width: 100%;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
    color: var(--wui-color-fg-250);
  }

  wui-image {
    width: var(--wui-icon-size-lg);
    height: var(--wui-icon-size-lg);
    border-radius: var(--wui-border-radius-3xl);
  }

  wui-icon {
    width: var(--wui-icon-size-lg);
    height: var(--wui-icon-size-lg);
  }
`;var __decorate$21=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiListContent=class extends h$3{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return ke`
      <wui-flex justifyContent="space-between" alignItems="center">
        <wui-text variant="paragraph-500" color=${this.textValue?"fg-200":"fg-100"}>
          ${this.textTitle}
        </wui-text>
        ${this.templateContent()}
      </wui-flex>
    `}templateContent(){return this.imageSrc?ke`<wui-image src=${this.imageSrc} alt=${this.textTitle}></wui-image>`:this.textValue?ke` <wui-text variant="paragraph-400" color="fg-100"> ${this.textValue} </wui-text>`:ke`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};WuiListContent.styles=[resetStyles,elementStyles,styles$1r];__decorate$21([n$4()],WuiListContent.prototype,"imageSrc",void 0);__decorate$21([n$4()],WuiListContent.prototype,"textTitle",void 0);__decorate$21([n$4()],WuiListContent.prototype,"textValue",void 0);WuiListContent=__decorate$21([customElement("wui-list-content")],WuiListContent);const styles$1q=i$4`
  button {
    column-gap: var(--wui-spacing-s);
    padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
    width: 100%;
    transition: all var(--wui-ease-out-power-1) var(--wui-duration-md);
    border-radius: var(--wui-border-radius-xs);
    color: var(--wui-color-fg-100);
  }

  button > wui-text:nth-child(2) {
    display: flex;
    flex: 1;
  }

  button[data-transparent='true'] {
    pointer-events: none;
    background-color: transparent;
  }

  button:hover {
    background-color: var(--wui-color-gray-glass-002);
  }

  button:active {
    background-color: var(--wui-color-gray-glass-005);
  }

  wui-image {
    width: var(--wui-spacing-3xl);
    height: var(--wui-spacing-3xl);
    border-radius: 100%;
  }

  button:disabled {
    background-color: var(--wui-color-gray-glass-002);
    opacity: 0.5;
    cursor: not-allowed;
  }

  button:disabled > wui-tag {
    background-color: var(--wui-color-gray-glass-010);
    color: var(--wui-color-fg-300);
  }
`;var __decorate$20=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiListNetwork=class extends h$3{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.selected=!1,this.transparent=!1}render(){return ke`
      <button data-transparent=${this.transparent} ?disabled=${this.disabled} ontouchstart>
        <wui-flex gap="s" alignItems="center">
          ${this.templateNetworkImage()}
          <wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text></wui-flex
        >
        ${this.checkmarkTemplate()}
      </button>
    `}checkmarkTemplate(){return this.selected?ke`<wui-icon size="sm" color="accent-100" name="checkmarkBold"></wui-icon>`:null}templateNetworkImage(){return this.imageSrc?ke`<wui-image size="sm" src=${this.imageSrc} name=${this.name}></wui-image>`:this.imageSrc?null:ke`<wui-network-image
        ?round=${!0}
        size="md"
        name=${this.name}
      ></wui-network-image>`}};WuiListNetwork.styles=[resetStyles,elementStyles,styles$1q];__decorate$20([n$4()],WuiListNetwork.prototype,"imageSrc",void 0);__decorate$20([n$4()],WuiListNetwork.prototype,"name",void 0);__decorate$20([n$4({type:Boolean})],WuiListNetwork.prototype,"disabled",void 0);__decorate$20([n$4({type:Boolean})],WuiListNetwork.prototype,"selected",void 0);__decorate$20([n$4({type:Boolean})],WuiListNetwork.prototype,"transparent",void 0);WuiListNetwork=__decorate$20([customElement("wui-list-network")],WuiListNetwork);const styles$1p=i$4`
  :host {
    display: flex;
    flex-direction: column;
    gap: var(--wui-spacing-l);
    padding: 17px 18px 17px var(--wui-spacing-m);
    width: 100%;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
    color: var(--wui-color-fg-250);
  }

  wui-image {
    width: var(--wui-icon-size-lg);
    height: var(--wui-icon-size-lg);
    border-radius: var(--wui-border-radius-3xl);
  }

  wui-icon {
    width: var(--wui-icon-size-lg);
    height: var(--wui-icon-size-lg);
  }
`;var __decorate$1$=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiListWalletTransaction=class extends h$3{constructor(){super(...arguments),this.amount="",this.networkCurreny="",this.networkImageUrl="",this.receiverAddress="",this.addressExplorerUrl=""}render(){return ke`
      <wui-flex justifyContent="space-between" alignItems="center">
        <wui-text variant="paragraph-500" color="fg-200">Sending</wui-text>
        <wui-flex gap="xs" alignItems="center">
          <wui-text variant="paragraph-400" color="fg-100">
            ${this.amount} ${this.networkCurreny}
          </wui-text>
          ${this.templateNetworkVisual()}
        </wui-flex>
      </wui-flex>
      <wui-flex justifyContent="space-between" alignItems="center">
        <wui-text variant="paragraph-500" color="fg-200">To</wui-text>
        <wui-chip
          icon="externalLink"
          variant="shadeSmall"
          href=${this.addressExplorerUrl}
          title=${this.receiverAddress}
        ></wui-chip>
      </wui-flex>
    `}templateNetworkVisual(){return this.networkImageUrl?ke`<wui-image src=${this.networkImageUrl} alt="Network Image"></wui-image>`:ke`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};WuiListWalletTransaction.styles=[resetStyles,elementStyles,styles$1p];__decorate$1$([n$4()],WuiListWalletTransaction.prototype,"amount",void 0);__decorate$1$([n$4()],WuiListWalletTransaction.prototype,"networkCurreny",void 0);__decorate$1$([n$4()],WuiListWalletTransaction.prototype,"networkImageUrl",void 0);__decorate$1$([n$4()],WuiListWalletTransaction.prototype,"receiverAddress",void 0);__decorate$1$([n$4()],WuiListWalletTransaction.prototype,"addressExplorerUrl",void 0);WuiListWalletTransaction=__decorate$1$([customElement("wui-list-wallet-transaction")],WuiListWalletTransaction);const styles$1o=i$4`
  button {
    display: flex;
    gap: var(--wui-spacing-3xs);
    align-items: center;
    padding: 6.25px var(--wui-spacing-xs) 7.25px var(--wui-spacing-s);
    background-color: var(--wui-color-gray-glass-090);
    border-radius: var(--wui-border-radius-3xl);
    border: 1px solid var(--wui-color-gray-glass-060);
    transition: background-color var(--wui-duration-md) var(--wui-ease-inout-power-1);
    will-change: background-color;
  }

  @media (hover: hover) and (pointer: fine) {
    button:hover:enabled {
      background-color: var(--wui-color-gray-glass-080);
    }

    button:active:enabled {
      background-color: var(--wui-color-gray-glass-060);
    }
  }
`;var __decorate$1_=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiPromo=class extends h$3{constructor(){super(...arguments),this.text=""}render(){return ke`<button ontouchstart>
      <wui-text variant="small-600" color="bg-100">${this.text}</wui-text>
      <wui-icon color="bg-100" size="xs" name="arrowRight"></wui-icon>
    </button>`}};WuiPromo.styles=[resetStyles,elementStyles,styles$1o];__decorate$1_([n$4()],WuiPromo.prototype,"text",void 0);WuiPromo=__decorate$1_([customElement("wui-promo")],WuiPromo);const styles$1n=i$4`
  span {
    font-weight: 500;
    font-size: 40px;
    color: var(--wui-color-fg-100);
    line-height: 130%; /* 52px */
    letter-spacing: -1.6px;
    text-align: center;
  }

  .pennies {
    color: var(--wui-color-fg-200);
  }
`;var __decorate$1Z=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiBalance=class extends h$3{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return ke`<span>$${this.dollars}<span class="pennies">.${this.pennies}</span></span>`}};WuiBalance.styles=[resetStyles,styles$1n];__decorate$1Z([n$4()],WuiBalance.prototype,"dollars",void 0);__decorate$1Z([n$4()],WuiBalance.prototype,"pennies",void 0);WuiBalance=__decorate$1Z([customElement("wui-balance")],WuiBalance);const styles$1m=i$4`
  button {
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-3xl);
    border: 1px solid var(--wui-color-gray-glass-002);
    padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs);
    position: relative;
  }

  wui-avatar {
    width: 32px;
    height: 32px;
    box-shadow: 0 0 0 0;
    outline: 3px solid var(--wui-color-gray-glass-005);
  }

  wui-icon-box,
  wui-image {
    width: 16px;
    height: 16px;
    border-radius: var(--wui-border-radius-3xl);
    position: absolute;
    left: 26px;
    top: 24px;
  }

  wui-image {
    outline: 2px solid var(--wui-color-bg-125);
  }

  wui-icon-box {
    outline: 2px solid var(--wui-color-bg-200);
    background-color: var(--wui-color-bg-250);
  }
`;var __decorate$1Y=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiProfileButton=class extends h$3{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="chevronBottom"}render(){return ke`<button ontouchstart data-testid="wui-profile-button">
      <wui-flex gap="xs" alignItems="center">
        <wui-avatar
          .imageSrc=${this.avatarSrc}
          alt=${this.address}
          address=${this.address}
        ></wui-avatar>
        ${this.networkImageTemplate()}
        <wui-flex gap="xs" alignItems="center">
          <wui-text variant="large-600" color="fg-100">
            ${UiHelperUtil.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
          </wui-text>
          <wui-icon size="sm" color="fg-200" name=${this.icon}></wui-icon>
        </wui-flex>
      </wui-flex>
    </button>`}networkImageTemplate(){return this.networkSrc?ke`<wui-image src=${this.networkSrc}></wui-image>`:ke`
      <wui-icon-box
        size="xxs"
        iconColor="fg-200"
        backgroundColor="bg-100"
        icon="networkPlaceholder"
      ></wui-icon-box>
    `}};WuiProfileButton.styles=[resetStyles,elementStyles,styles$1m];__decorate$1Y([n$4()],WuiProfileButton.prototype,"networkSrc",void 0);__decorate$1Y([n$4()],WuiProfileButton.prototype,"avatarSrc",void 0);__decorate$1Y([n$4()],WuiProfileButton.prototype,"profileName",void 0);__decorate$1Y([n$4()],WuiProfileButton.prototype,"address",void 0);__decorate$1Y([n$4()],WuiProfileButton.prototype,"icon",void 0);WuiProfileButton=__decorate$1Y([customElement("wui-profile-button")],WuiProfileButton);const styles$1l=i$4`
  button {
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-3xl);
    border: 1px solid var(--wui-color-gray-glass-002);
    padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs);
    position: relative;
  }

  wui-avatar {
    width: 32px;
    height: 32px;
    box-shadow: 0 0 0 0;
    outline: 3px solid var(--wui-color-gray-glass-005);
  }

  wui-icon-box,
  wui-image {
    width: 16px;
    height: 16px;
    border-radius: var(--wui-border-radius-3xl);
    position: absolute;
    left: 26px;
    top: 24px;
  }

  wui-image {
    outline: 2px solid var(--wui-color-bg-125);
  }

  wui-icon-box {
    outline: 2px solid var(--wui-color-bg-200);
    background-color: var(--wui-color-bg-250);
  }
`;var __decorate$1X=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiProfileButtonV2=class extends h$3{constructor(){super(...arguments),this.avatarSrc=void 0,this.profileName="",this.address="",this.icon="mail",this.connectedConnector=StorageUtil.getConnectedConnector(),this.shouldShowIcon=this.connectedConnector==="AUTH"}render(){return ke`<button ontouchstart data-testid="wui-profile-button" @click=${this.handleClick}>
      <wui-flex gap="xs" alignItems="center">
        <wui-avatar
          .imageSrc=${this.avatarSrc}
          alt=${this.address}
          address=${this.address}
        ></wui-avatar>
        ${this.shouldShowIcon?this.getIconTemplate(this.icon):""}
        <wui-flex gap="xs" alignItems="center">
          <wui-text variant="large-600" color="fg-100">
            ${UiHelperUtil.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
          </wui-text>
          <wui-icon size="sm" color="fg-200" name="copy" id="copy-address"></wui-icon>
        </wui-flex>
      </wui-flex>
    </button>`}handleClick(Mn){var rs,is;if(Mn.target instanceof HTMLElement&&Mn.target.id==="copy-address"){(rs=this.onCopyClick)==null||rs.call(this,Mn);return}(is=this.onProfileClick)==null||is.call(this,Mn)}getIconTemplate(Mn){return ke`
      <wui-icon-box
        size="xxs"
        iconColor="fg-200"
        backgroundColor="bg-100"
        icon="${Mn||"networkPlaceholder"}"
      ></wui-icon-box>
    `}};WuiProfileButtonV2.styles=[resetStyles,elementStyles,styles$1l];__decorate$1X([n$4()],WuiProfileButtonV2.prototype,"avatarSrc",void 0);__decorate$1X([n$4()],WuiProfileButtonV2.prototype,"profileName",void 0);__decorate$1X([n$4()],WuiProfileButtonV2.prototype,"address",void 0);__decorate$1X([n$4()],WuiProfileButtonV2.prototype,"icon",void 0);__decorate$1X([n$4()],WuiProfileButtonV2.prototype,"onProfileClick",void 0);__decorate$1X([n$4()],WuiProfileButtonV2.prototype,"onCopyClick",void 0);WuiProfileButtonV2=__decorate$1X([customElement("wui-profile-button-v2")],WuiProfileButtonV2);const styles$1k=i$4`
  button {
    border: none;
    border-radius: var(--wui-border-radius-3xl);
  }

  button[data-variant='main'] {
    background-color: var(--wui-color-accent-100);
    color: var(--wui-color-inverse-100);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
  }

  button[data-variant='accent'] {
    background-color: var(--wui-color-accent-glass-010);
    color: var(--wui-color-accent-100);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
  }

  button[data-variant='gray'] {
    background-color: transparent;
    color: var(--wui-color-fg-200);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
  }

  button[data-variant='shade'] {
    background-color: transparent;
    color: var(--wui-color-accent-100);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
  }

  button[data-size='sm'] {
    height: 32px;
    padding: 0 var(--wui-spacing-s);
  }

  button[data-size='md'] {
    height: 40px;
    padding: 0 var(--wui-spacing-l);
  }

  button[data-size='sm'] > wui-image {
    width: 16px;
    height: 16px;
  }

  button[data-size='md'] > wui-image {
    width: 24px;
    height: 24px;
  }

  button[data-size='sm'] > wui-icon {
    width: 12px;
    height: 12px;
  }

  button[data-size='md'] > wui-icon {
    width: 14px;
    height: 14px;
  }

  wui-image {
    border-radius: var(--wui-border-radius-3xl);
    overflow: hidden;
  }

  button.disabled > wui-icon,
  button.disabled > wui-image {
    filter: grayscale(1);
  }

  button[data-variant='main'] > wui-image {
    box-shadow: inset 0 0 0 1px var(--wui-color-accent-090);
  }

  button[data-variant='shade'] > wui-image,
  button[data-variant='gray'] > wui-image {
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
  }

  @media (hover: hover) and (pointer: fine) {
    button[data-variant='main']:focus-visible {
      background-color: var(--wui-color-accent-090);
    }

    button[data-variant='main']:hover:enabled {
      background-color: var(--wui-color-accent-090);
    }

    button[data-variant='main']:active:enabled {
      background-color: var(--wui-color-accent-080);
    }

    button[data-variant='accent']:hover:enabled {
      background-color: var(--wui-color-accent-glass-015);
    }

    button[data-variant='accent']:active:enabled {
      background-color: var(--wui-color-accent-glass-020);
    }

    button[data-variant='shade']:focus-visible,
    button[data-variant='gray']:focus-visible,
    button[data-variant='shade']:hover,
    button[data-variant='gray']:hover {
      background-color: var(--wui-color-gray-glass-002);
    }

    button[data-variant='gray']:active,
    button[data-variant='shade']:active {
      background-color: var(--wui-color-gray-glass-005);
    }
  }

  button.disabled {
    color: var(--wui-color-gray-glass-020);
    background-color: var(--wui-color-gray-glass-002);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
    pointer-events: none;
  }
`;var __decorate$1W=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiChipButton=class extends h$3{constructor(){super(...arguments),this.variant="accent",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.size="md",this.text=""}render(){const Mn=this.size==="sm"?"small-600":"paragraph-600";return ke`
      <button
        class=${this.disabled?"disabled":""}
        data-variant=${this.variant}
        data-size=${this.size}
      >
        ${this.imageSrc?ke`<wui-image src=${this.imageSrc}></wui-image>`:null}
        <wui-text variant=${Mn} color="inherit"> ${this.text} </wui-text>
        <wui-icon name=${this.icon} color="inherit" size="inherit"></wui-icon>
      </button>
    `}};WuiChipButton.styles=[resetStyles,elementStyles,styles$1k];__decorate$1W([n$4()],WuiChipButton.prototype,"variant",void 0);__decorate$1W([n$4()],WuiChipButton.prototype,"imageSrc",void 0);__decorate$1W([n$4({type:Boolean})],WuiChipButton.prototype,"disabled",void 0);__decorate$1W([n$4()],WuiChipButton.prototype,"icon",void 0);__decorate$1W([n$4()],WuiChipButton.prototype,"size",void 0);__decorate$1W([n$4()],WuiChipButton.prototype,"text",void 0);WuiChipButton=__decorate$1W([customElement("wui-chip-button")],WuiChipButton);const styles$1j=i$4`
  button {
    display: flex;
    gap: var(--wui-spacing-xl);
    width: 100%;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xxs);
    padding: var(--wui-spacing-m) var(--wui-spacing-s);
  }

  wui-text {
    width: 100%;
  }

  wui-flex {
    width: auto;
  }

  .network-icon {
    width: var(--wui-spacing-2l);
    height: var(--wui-spacing-2l);
    border-radius: calc(var(--wui-spacing-2l) / 2);
    overflow: hidden;
    box-shadow:
      0 0 0 3px var(--wui-color-gray-glass-002),
      0 0 0 3px var(--wui-color-modal-bg);
  }
`;var __decorate$1V=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiCompatibleNetwork=class extends h$3{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return ke`
      <button ontouchstart>
        <wui-text variant="small-400" color="fg-200">${this.text}</wui-text>
        <wui-flex gap="3xs" alignItems="center">
          ${this.networksTemplate()}
          <wui-icon name="chevronRight" size="sm" color="fg-200"></wui-icon>
        </wui-flex>
      </button>
    `}networksTemplate(){const Mn=this.networkImages.slice(0,5);return ke` <wui-flex class="networks">
      ${Mn==null?void 0:Mn.map(rs=>ke` <wui-flex class="network-icon"> <wui-image src=${rs}></wui-image> </wui-flex>`)}
    </wui-flex>`}};WuiCompatibleNetwork.styles=[resetStyles,elementStyles,styles$1j];__decorate$1V([n$4({type:Array})],WuiCompatibleNetwork.prototype,"networkImages",void 0);__decorate$1V([n$4()],WuiCompatibleNetwork.prototype,"text",void 0);WuiCompatibleNetwork=__decorate$1V([customElement("wui-compatible-network")],WuiCompatibleNetwork);const styles$1i=i$4`
  wui-flex {
    width: 100%;
    background-color: var(--wui-color-gray-glass-005);
    border-radius: var(--wui-border-radius-s);
    padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs)
      var(--wui-spacing-1xs);
  }
`;var __decorate$1U=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiBanner=class extends h$3{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return ke`
      <wui-flex gap="1xs" alignItems="center">
        <wui-icon-box
          size="sm"
          iconcolor="fg-200"
          backgroundcolor="fg-200"
          icon=${this.icon}
          background="transparent"
        ></wui-icon-box>
        <wui-text variant="small-400" color="fg-200">${this.text}</wui-text>
      </wui-flex>
    `}};WuiBanner.styles=[resetStyles,elementStyles,styles$1i];__decorate$1U([n$4()],WuiBanner.prototype,"icon",void 0);__decorate$1U([n$4()],WuiBanner.prototype,"text",void 0);WuiBanner=__decorate$1U([customElement("wui-banner")],WuiBanner);const styles$1h=i$4`
  wui-flex {
    width: 100%;
    background-color: var(--wui-color-gray-glass-005);
    border-radius: var(--wui-border-radius-m);
    padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs)
      var(--wui-spacing-1xs);
  }
`;var __decorate$1T=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiBannerImg=class extends h$3{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size=""}render(){return ke`
      <wui-flex gap="1xs" alignItems="center">
        <wui-avatar size=${this.size} imageSrc=${this.imageSrc}></wui-avatar>
        <wui-text variant="small-400" color="fg-200">${this.text}</wui-text>
      </wui-flex>
    `}};WuiBannerImg.styles=[resetStyles,elementStyles,styles$1h];__decorate$1T([n$4()],WuiBannerImg.prototype,"imageSrc",void 0);__decorate$1T([n$4()],WuiBannerImg.prototype,"text",void 0);__decorate$1T([n$4()],WuiBannerImg.prototype,"size",void 0);WuiBannerImg=__decorate$1T([customElement("wui-banner-img")],WuiBannerImg);const styles$1g=i$4`
  button {
    padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs);
    display: flex;
    justify-content: space-between;
    width: 100%;
    border-radius: var(--wui-border-radius-xs);
    background-color: var(--wui-color-gray-glass-002);
  }

  button[data-clickable='false'] {
    pointer-events: none;
    background-color: transparent;
  }

  wui-image,
  wui-icon {
    width: var(--wui-spacing-3xl);
    height: var(--wui-spacing-3xl);
  }

  wui-image {
    border-radius: var(--wui-border-radius-3xl);
  }
`;var __decorate$1S=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiListToken=class extends h$3{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return ke`
      <button data-clickable=${String(this.clickable)} ontouchstart>
        <wui-flex gap="s" alignItems="center">
          ${this.visualTemplate()}
          <wui-flex flexDirection="column" justifyContent="spaceBetween">
            <wui-text variant="paragraph-500" color="fg-100">${this.tokenName}</wui-text>
            <wui-text variant="small-400" color="fg-200">
              ${UiHelperUtil.formatNumberToLocalString(this.tokenAmount,4)} ${this.tokenCurrency}
            </wui-text>
          </wui-flex>
        </wui-flex>
        <wui-text variant="paragraph-500" color="fg-100">$${this.tokenValue.toFixed(2)}</wui-text>
      </button>
    `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?ke`<wui-image alt=${this.tokenName} src=${this.tokenImageUrl}></wui-image>`:ke`<wui-icon name="coinPlaceholder" color="fg-100"></wui-icon>`}};WuiListToken.styles=[resetStyles,elementStyles,styles$1g];__decorate$1S([n$4()],WuiListToken.prototype,"tokenName",void 0);__decorate$1S([n$4()],WuiListToken.prototype,"tokenImageUrl",void 0);__decorate$1S([n$4({type:Number})],WuiListToken.prototype,"tokenValue",void 0);__decorate$1S([n$4()],WuiListToken.prototype,"tokenAmount",void 0);__decorate$1S([n$4()],WuiListToken.prototype,"tokenCurrency",void 0);__decorate$1S([n$4({type:Boolean})],WuiListToken.prototype,"clickable",void 0);WuiListToken=__decorate$1S([customElement("wui-list-token")],WuiListToken);const styles$1f=i$4`
  button {
    width: 100%;
    display: flex;
    gap: var(--wui-spacing-s);
    align-items: center;
    justify-content: flex-start;
    padding: var(--wui-spacing-s) var(--wui-spacing-m) var(--wui-spacing-s) var(--wui-spacing-s);
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
  }

  wui-icon-box {
    width: var(--wui-spacing-2xl);
    height: var(--wui-spacing-2xl);
  }

  wui-flex {
    width: auto;
  }
`;var __decorate$1R=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiListDescription=class extends h$3{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroundColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return ke`
      <button ontouchstart ?disabled=${this.disabled}>
        <wui-icon-box
          iconColor=${this.iconColor}
          backgroundColor=${this.iconBackgroundColor}
          size="inherit"
          icon=${this.icon}
          iconSize="md"
        ></wui-icon-box>
        <wui-flex flexDirection="column" justifyContent="spaceBetween">
          ${this.titleTemplate()}
          <wui-text variant="small-400" color="fg-200"> ${this.description}</wui-text></wui-flex
        >
      </button>
    `}titleTemplate(){return this.tag?ke` <wui-flex alignItems="center" gap="xxs"
        ><wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text
        ><wui-tag tagType="main" size="md">${this.tag}</wui-tag>
      </wui-flex>`:ke`<wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text>`}};WuiListDescription.styles=[resetStyles,elementStyles,styles$1f];__decorate$1R([n$4()],WuiListDescription.prototype,"icon",void 0);__decorate$1R([n$4()],WuiListDescription.prototype,"text",void 0);__decorate$1R([n$4()],WuiListDescription.prototype,"description",void 0);__decorate$1R([n$4()],WuiListDescription.prototype,"tag",void 0);__decorate$1R([n$4()],WuiListDescription.prototype,"iconBackgroundColor",void 0);__decorate$1R([n$4()],WuiListDescription.prototype,"iconColor",void 0);__decorate$1R([n$4({type:Boolean})],WuiListDescription.prototype,"disabled",void 0);WuiListDescription=__decorate$1R([customElement("wui-list-description")],WuiListDescription);const styles$1e=i$4`
  :host {
    position: relative;
    display: inline-block;
  }

  input {
    background: transparent;
    width: 100%;
    height: auto;
    font-family: var(--wui-font-family);
    color: var(--wui-color-fg-100);

    font-feature-settings: 'case' on;
    font-size: 32px;
    font-weight: var(--wui-font-weight-light);
    caret-color: var(--wui-color-accent-100);
    line-height: 130%;
    letter-spacing: -1.28px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    padding: 0px;
  }

  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  input::placeholder {
    color: var(--wui-color-fg-275);
  }
`,specialCharactersRegex=/[.*+?^${}()|[\]\\]/gu,numbersRegex=/[0-9,.]/u;var __decorate$1Q=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiInputAmount=class extends h$3{constructor(){super(...arguments),this.inputElementRef=ii$1(),this.disabled=!1,this.value="",this.placeholder="0"}render(){var Mn;return(Mn=this.inputElementRef)!=null&&Mn.value&&this.value&&(this.inputElementRef.value.value=this.value),ke`<input
      ${Kt$2(this.inputElementRef)}
      type="text"
      inputmode="decimal"
      pattern="[0-9,.]*"
      placeholder=${this.placeholder}
      ?disabled=${this.disabled}
      autofocus
      value=${this.value??""}
      @input=${this.dispatchInputChangeEvent.bind(this)}
    /> `}dispatchInputChangeEvent(Mn){var is,os;const rs=Mn.data;if(rs&&((is=this.inputElementRef)!=null&&is.value))if(rs===","){const as=this.inputElementRef.value.value.replace(",",".");this.inputElementRef.value.value=as,this.value=`${this.value}${as}`}else numbersRegex.test(rs)||(this.inputElementRef.value.value=this.value.replace(new RegExp(rs.replace(specialCharactersRegex,"\\$&"),"gu"),""));this.dispatchEvent(new CustomEvent("inputChange",{detail:(os=this.inputElementRef.value)==null?void 0:os.value,bubbles:!0,composed:!0}))}};WuiInputAmount.styles=[resetStyles,elementStyles,styles$1e];__decorate$1Q([n$4({type:Boolean})],WuiInputAmount.prototype,"disabled",void 0);__decorate$1Q([n$4({type:String})],WuiInputAmount.prototype,"value",void 0);__decorate$1Q([n$4({type:String})],WuiInputAmount.prototype,"placeholder",void 0);WuiInputAmount=__decorate$1Q([customElement("wui-input-amount")],WuiInputAmount);const styles$1d=i$4`
  :host {
    display: flex;
    gap: var(--wui-spacing-xs);
    border-radius: var(--wui-border-radius-3xl);
    border: 1px solid var(--wui-color-gray-glass-002);
    background: var(--wui-color-gray-glass-002);
    padding: var(--wui-spacing-2xs) var(--wui-spacing-xs) var(--wui-spacing-2xs)
      var(--wui-spacing-s);
    align-items: center;
  }

  wui-avatar,
  wui-icon,
  wui-image {
    width: 32px;
    height: 32px;
    border: 1px solid var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-3xl);
    box-shadow: 0 0 0 2px var(--wui-color-gray-glass-002);
  }
`;var __decorate$1P=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiPreviewItem=class extends h$3{constructor(){super(...arguments),this.text="",this.address="",this.isAddress=!1}render(){return ke`<wui-text variant="large-500" color="fg-100">${this.text}</wui-text>
      ${this.imageTemplate()}`}imageTemplate(){return this.isAddress?ke`<wui-avatar address=${this.address} .imageSrc=${this.imageSrc}></wui-avatar>`:this.imageSrc?ke`<wui-image src=${this.imageSrc}></wui-image>`:ke`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`}};WuiPreviewItem.styles=[resetStyles,elementStyles,styles$1d];__decorate$1P([n$4()],WuiPreviewItem.prototype,"text",void 0);__decorate$1P([n$4()],WuiPreviewItem.prototype,"address",void 0);__decorate$1P([n$4()],WuiPreviewItem.prototype,"imageSrc",void 0);__decorate$1P([n$4({type:Boolean})],WuiPreviewItem.prototype,"isAddress",void 0);WuiPreviewItem=__decorate$1P([customElement("wui-preview-item")],WuiPreviewItem);const styles$1c=i$4`
  button {
    padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs);
    display: flex;
    justify-content: space-between;
    width: 100%;
    border-radius: var(--wui-border-radius-xs);
    background-color: var(--wui-color-gray-glass-002);
  }

  button[data-clickable='false'] {
    pointer-events: none;
    background-color: transparent;
  }

  wui-image {
    width: var(--wui-spacing-3xl);
    height: var(--wui-spacing-3xl);
    border-radius: var(--wui-border-radius-3xl);
  }

  wui-avatar {
    width: var(--wui-spacing-3xl);
    height: var(--wui-spacing-3xl);
    box-shadow: 0 0 0 0;
  }
  .address {
    color: var(--wui-color-fg-base-100);
  }
  .address-description {
    text-transform: capitalize;
    color: var(--wui-color-fg-base-200);
  }

  wui-icon-box {
    position: relative;
    right: 15px;
    top: 15px;
    border: 2px solid var(--wui-color-bg-150);
    background-color: var(--wui-color-bg-125);
  }
`;var __decorate$1O=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiListAccount=class extends h$3{constructor(){super(...arguments),this.accountAddress="",this.accountType="",this.connectedConnector=StorageUtil.getConnectedConnector(),this.labels=AccountController.state.addressLabels,this.caipNetwork=ChainController.state.activeCaipNetwork,this.socialProvider=StorageUtil.getConnectedSocialProvider(),this.balance=0,this.fetchingBalance=!0,this.shouldShowIcon=!1,this.selected=!1}connectedCallback(){var Mn;super.connectedCallback(),BlockchainApiController.getBalance(this.accountAddress,(Mn=this.caipNetwork)==null?void 0:Mn.caipNetworkId).then(rs=>{let is=this.balance;rs.balances.length>0&&(is=rs.balances.reduce((os,as)=>os+((as==null?void 0:as.value)||0),0)),this.balance=is,this.fetchingBalance=!1,this.requestUpdate()})}render(){const Mn=this.getLabel();return this.shouldShowIcon=this.connectedConnector==="AUTH",ke`
      <wui-flex
        flexDirection="row"
        justifyContent="space-between"
        .padding=${["0","0","s","1xs"]}
      >
        <wui-flex gap="md" alignItems="center">
          <wui-avatar address=${this.accountAddress}></wui-avatar>
          ${this.shouldShowIcon?ke`<wui-icon-box
                size="sm"
                iconcolor="fg-200"
                backgroundcolor="fg-300"
                icon=${this.accountType===W3mFrameRpcConstants.ACCOUNT_TYPES.EOA?this.socialProvider??"mail":"lightbulb"}
                background="fg-300"
              ></wui-icon-box>`:ke`<wui-flex .padding="${["0","0","0","s"]}"></wui-flex>`}
          <wui-flex flexDirection="column">
            <wui-text class="address" variant="paragraph-500" color="fg-100"
              >${UiHelperUtil.getTruncateString({string:this.accountAddress,charsStart:4,charsEnd:6,truncate:"middle"})}</wui-text
            >
            <wui-text class="address-description" variant="small-400">${Mn}</wui-text></wui-flex
          >
        </wui-flex>
        <wui-flex gap="s" alignItems="center">
          ${this.fetchingBalance?ke`<wui-loading-spinner size="sm" color="accent-100"></wui-loading-spinner>`:ke` <wui-text variant="small-400">$${this.balance.toFixed(2)}</wui-text>`}
          <slot name="action"></slot>
        </wui-flex>
      </wui-flex>
    `}getLabel(){var rs;let Mn=(rs=this.labels)==null?void 0:rs.get(this.accountAddress);return!Mn&&this.connectedConnector==="AUTH"?Mn=`${this.accountType==="eoa"?this.socialProvider??"Email":"Smart"} Account`:!Mn&&this.connectedConnector==="INJECTED"||this.connectedConnector==="ANNOUNCED"?Mn="Injected Account":Mn||(Mn="EOA"),Mn}};WuiListAccount.styles=[resetStyles,elementStyles,styles$1c];__decorate$1O([n$4()],WuiListAccount.prototype,"accountAddress",void 0);__decorate$1O([n$4()],WuiListAccount.prototype,"accountType",void 0);__decorate$1O([n$4({type:Boolean})],WuiListAccount.prototype,"selected",void 0);__decorate$1O([n$4({type:Function})],WuiListAccount.prototype,"onSelect",void 0);WuiListAccount=__decorate$1O([customElement("wui-list-account")],WuiListAccount);const styles$1b=i$4`
  :host {
    position: relative;
  }

  button {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    width: 100%;
    background-color: var(--wui-color-accent-glass-010);
    border-radius: var(--wui-border-radius-xs);
    border: 1px solid var(--wui-color-accent-glass-010);
    transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: background-color;
  }

  wui-tooltip {
    padding: 7px var(--wui-spacing-s) 8px var(--wui-spacing-s);
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translate(-50%, -100%);
    opacity: 0;
    display: none;
  }

  @media (hover: hover) and (pointer: fine) {
    button:hover:enabled {
      background-color: var(--wui-color-accent-glass-015);
    }

    button:active:enabled {
      background-color: var(--wui-color-accent-glass-020);
    }
  }
`;var __decorate$1N=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiIconButton=class extends h$3{constructor(){super(...arguments),this.text="",this.icon="card"}render(){return ke`<button>
      <wui-icon color="accent-100" name=${this.icon} size="lg"></wui-icon>
    </button>`}};WuiIconButton.styles=[resetStyles,elementStyles,styles$1b];__decorate$1N([n$4()],WuiIconButton.prototype,"text",void 0);__decorate$1N([n$4()],WuiIconButton.prototype,"icon",void 0);WuiIconButton=__decorate$1N([customElement("wui-icon-button")],WuiIconButton);const styles$1a=i$4`
  button {
    column-gap: var(--wui-spacing-s);
    padding: 16.5px var(--wui-spacing-l) 16.5px var(--wui-spacing-xs);
    width: 100%;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
    color: var(--wui-color-fg-100);
    justify-content: center;
    align-items: center;
  }

  button:disabled {
    background-color: var(--wui-color-gray-glass-015);
    color: var(--wui-color-gray-glass-015);
  }
`;var __decorate$1M=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiListButton=class extends h$3{constructor(){super(...arguments),this.text="",this.disabled=!1}render(){return ke`
      <button ?disabled=${this.disabled} ontouchstart>
        <wui-text align="center" variant="paragraph-500" color="inherit">${this.text}</wui-text>
      </button>
    `}};WuiListButton.styles=[resetStyles,elementStyles,styles$1a];__decorate$1M([n$4()],WuiListButton.prototype,"text",void 0);__decorate$1M([n$4({type:Boolean})],WuiListButton.prototype,"disabled",void 0);WuiListButton=__decorate$1M([customElement("wui-list-button")],WuiListButton);const styles$19=i$4`
  button {
    column-gap: var(--wui-spacing-s);
    padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
    width: 100%;
    justify-content: flex-start;
    background-color: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
    color: var(--wui-color-fg-100);
  }

  wui-text {
    text-transform: capitalize;
  }

  wui-text[data-align='left'] {
    display: flex;
    flex: 1;
  }

  wui-text[data-align='center'] {
    display: flex;
    flex: 1;
    justify-content: center;
  }

  .invisible {
    opacity: 0;
    pointer-events: none;
  }

  button:disabled {
    background-color: var(--wui-color-gray-glass-015);
    color: var(--wui-color-gray-glass-015);
  }
`;var __decorate$1L=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiListSocial=class extends h$3{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.align="left",this.disabled=!1}render(){return ke`
      <button ?disabled=${this.disabled} ontouchstart>
        <wui-logo logo=${this.logo}></wui-logo>
        <wui-text
          data-align=${this.align}
          variant="paragraph-500"
          color="inherit"
          align=${this.align}
          >${this.name}</wui-text
        >
        ${this.templatePlacement()}
      </button>
    `}templatePlacement(){return this.align==="center"?ke` <wui-logo class="invisible" logo=${this.logo}></wui-logo>`:null}};WuiListSocial.styles=[resetStyles,elementStyles,styles$19];__decorate$1L([n$4()],WuiListSocial.prototype,"logo",void 0);__decorate$1L([n$4()],WuiListSocial.prototype,"name",void 0);__decorate$1L([n$4()],WuiListSocial.prototype,"align",void 0);__decorate$1L([n$4({type:Boolean})],WuiListSocial.prototype,"disabled",void 0);WuiListSocial=__decorate$1L([customElement("wui-list-social")],WuiListSocial);const styles$18=i$4`
  button {
    display: block;
    display: flex;
    align-items: center;
    padding: var(--wui-spacing-xxs);
    gap: var(--wui-spacing-xxs);
    transition: all var(--wui-ease-out-power-1) var(--wui-duration-md);
    border-radius: var(--wui-border-radius-xxs);
  }

  wui-image {
    border-radius: 100%;
    width: var(--wui-spacing-xl);
    height: var(--wui-spacing-xl);
  }

  wui-icon-box {
    width: var(--wui-spacing-xl);
    height: var(--wui-spacing-xl);
  }

  button:hover {
    background-color: var(--wui-color-gray-glass-002);
  }

  button:active {
    background-color: var(--wui-color-gray-glass-005);
  }
`;var __decorate$1K=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiSelect=class extends h$3{constructor(){super(...arguments),this.imageSrc=""}render(){return ke`<button>
      ${this.imageTemplate()}
      <wui-icon size="xs" color="fg-200" name="chevronBottom"></wui-icon>
    </button>`}imageTemplate(){return this.imageSrc?ke`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`:ke`<wui-icon-box
      size="xxs"
      iconColor="fg-200"
      backgroundColor="fg-100"
      background="opaque"
      icon="networkPlaceholder"
    ></wui-icon-box>`}};WuiSelect.styles=[resetStyles,elementStyles,colorStyles,styles$18];__decorate$1K([n$4()],WuiSelect.prototype,"imageSrc",void 0);WuiSelect=__decorate$1K([customElement("wui-select")],WuiSelect);const styles$17=i$4`
  :host {
    display: grid;
    width: inherit;
    height: inherit;
  }
`;var __decorate$1J=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiGrid=class extends h$3{render(){return this.style.cssText=`
      grid-template-rows: ${this.gridTemplateRows};
      grid-template-columns: ${this.gridTemplateColumns};
      justify-items: ${this.justifyItems};
      align-items: ${this.alignItems};
      justify-content: ${this.justifyContent};
      align-content: ${this.alignContent};
      column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`};
      row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`};
      gap: ${this.gap&&`var(--wui-spacing-${this.gap})`};
      padding-top: ${this.padding&&UiHelperUtil.getSpacingStyles(this.padding,0)};
      padding-right: ${this.padding&&UiHelperUtil.getSpacingStyles(this.padding,1)};
      padding-bottom: ${this.padding&&UiHelperUtil.getSpacingStyles(this.padding,2)};
      padding-left: ${this.padding&&UiHelperUtil.getSpacingStyles(this.padding,3)};
      margin-top: ${this.margin&&UiHelperUtil.getSpacingStyles(this.margin,0)};
      margin-right: ${this.margin&&UiHelperUtil.getSpacingStyles(this.margin,1)};
      margin-bottom: ${this.margin&&UiHelperUtil.getSpacingStyles(this.margin,2)};
      margin-left: ${this.margin&&UiHelperUtil.getSpacingStyles(this.margin,3)};
    `,ke`<slot></slot>`}};WuiGrid.styles=[resetStyles,styles$17];__decorate$1J([n$4()],WuiGrid.prototype,"gridTemplateRows",void 0);__decorate$1J([n$4()],WuiGrid.prototype,"gridTemplateColumns",void 0);__decorate$1J([n$4()],WuiGrid.prototype,"justifyItems",void 0);__decorate$1J([n$4()],WuiGrid.prototype,"alignItems",void 0);__decorate$1J([n$4()],WuiGrid.prototype,"justifyContent",void 0);__decorate$1J([n$4()],WuiGrid.prototype,"alignContent",void 0);__decorate$1J([n$4()],WuiGrid.prototype,"columnGap",void 0);__decorate$1J([n$4()],WuiGrid.prototype,"rowGap",void 0);__decorate$1J([n$4()],WuiGrid.prototype,"gap",void 0);__decorate$1J([n$4()],WuiGrid.prototype,"padding",void 0);__decorate$1J([n$4()],WuiGrid.prototype,"margin",void 0);WuiGrid=__decorate$1J([customElement("wui-grid")],WuiGrid);const styles$16=i$4`
  :host {
    position: relative;
    display: flex;
    width: 100%;
    height: 1px;
    background-color: var(--wui-color-gray-glass-005);
    justify-content: center;
    align-items: center;
  }

  :host > wui-text {
    position: absolute;
    padding: 0px 10px;
    background-color: var(--wui-color-modal-bg);
  }
`;var __decorate$1I=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiSeparator=class extends h$3{constructor(){super(...arguments),this.text=""}render(){return ke`${this.template()}`}template(){return this.text?ke`<wui-text variant="small-500" color="fg-200">${this.text}</wui-text>`:null}};WuiSeparator.styles=[resetStyles,styles$16];__decorate$1I([n$4()],WuiSeparator.prototype,"text",void 0);WuiSeparator=__decorate$1I([customElement("wui-separator")],WuiSeparator);const MathUtil={interpolate(Fn,Mn,rs){if(Fn.length!==2||Mn.length!==2)throw new Error("inputRange and outputRange must be an array of length 2");const is=Fn[0]||0,os=Fn[1]||0,as=Mn[0]||0,us=Mn[1]||0;return rs<is?as:rs>os?us:(us-as)/(os-is)*(rs-is)+as}},FLOAT_FIXED_VALUE=3,plusTypes=["receive","deposit","borrow","claim"],minusTypes=["withdraw","repay","burn"],TransactionUtil={getMonthName(Fn){const Mn=new Date;return Mn.setMonth(Fn),Mn.toLocaleString("en-US",{month:"long"})},getTransactionGroupTitle(Fn,Mn){const rs=DateUtil.getYear(),is=this.getMonthName(Mn);return Fn===rs?is:`${is} ${Fn}`},getTransactionImages(Fn){const[Mn,rs]=Fn,is=!!Mn&&(Fn==null?void 0:Fn.every(us=>!!us.nft_info)),os=(Fn==null?void 0:Fn.length)>1;return(Fn==null?void 0:Fn.length)===2&&!is?[this.getTransactionImage(Mn),this.getTransactionImage(rs)]:os?Fn.map(us=>this.getTransactionImage(us)):[this.getTransactionImage(Mn)]},getTransactionImage(Fn){return{type:TransactionUtil.getTransactionTransferTokenType(Fn),url:TransactionUtil.getTransactionImageURL(Fn)}},getTransactionImageURL(Fn){var os,as,us,ds,hs;let Mn;const rs=!!(Fn!=null&&Fn.nft_info),is=!!(Fn!=null&&Fn.fungible_info);return Fn&&rs?Mn=(us=(as=(os=Fn==null?void 0:Fn.nft_info)==null?void 0:os.content)==null?void 0:as.preview)==null?void 0:us.url:Fn&&is&&(Mn=(hs=(ds=Fn==null?void 0:Fn.fungible_info)==null?void 0:ds.icon)==null?void 0:hs.url),Mn},getTransactionTransferTokenType(Fn){if(Fn!=null&&Fn.fungible_info)return"FUNGIBLE";if(Fn!=null&&Fn.nft_info)return"NFT"},getTransactionDescriptions(Fn){var fo,mo,Ao;const Mn=(fo=Fn==null?void 0:Fn.metadata)==null?void 0:fo.operationType,rs=Fn==null?void 0:Fn.transfers,is=((mo=Fn==null?void 0:Fn.transfers)==null?void 0:mo.length)>0,os=((Ao=Fn==null?void 0:Fn.transfers)==null?void 0:Ao.length)>1,as=is&&(rs==null?void 0:rs.every($o=>!!($o!=null&&$o.fungible_info))),[us,ds]=rs;let hs=this.getTransferDescription(us),ps=this.getTransferDescription(ds);if(!is)return(Mn==="send"||Mn==="receive")&&as?(hs=UiHelperUtil.getTruncateString({string:Fn==null?void 0:Fn.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),ps=UiHelperUtil.getTruncateString({string:Fn==null?void 0:Fn.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[hs,ps]):[Fn.metadata.status];if(os)return rs.map($o=>this.getTransferDescription($o));let io="";return plusTypes.includes(Mn)?io="+":minusTypes.includes(Mn)&&(io="-"),hs=io.concat(hs),[hs]},getTransferDescription(Fn){var rs;let Mn="";return Fn&&(Fn!=null&&Fn.nft_info?Mn=((rs=Fn==null?void 0:Fn.nft_info)==null?void 0:rs.name)||"-":Fn!=null&&Fn.fungible_info&&(Mn=this.getFungibleTransferDescription(Fn)||"-")),Mn},getFungibleTransferDescription(Fn){var is;return Fn?[this.getQuantityFixedValue(Fn==null?void 0:Fn.quantity.numeric),(is=Fn==null?void 0:Fn.fungible_info)==null?void 0:is.symbol].join(" ").trim():null},getQuantityFixedValue(Fn){return Fn?parseFloat(Fn).toFixed(FLOAT_FIXED_VALUE):null}},ConstantsUtil$1={WALLET_CONNECT_CONNECTOR_ID:"walletConnect",INJECTED_CONNECTOR_ID:"injected",WALLET_STANDARD_CONNECTOR_ID:"announced",COINBASE_CONNECTOR_ID:"coinbaseWallet",COINBASE_SDK_CONNECTOR_ID:"coinbaseWalletSDK",SAFE_CONNECTOR_ID:"safe",LEDGER_CONNECTOR_ID:"ledger",EIP6963_CONNECTOR_ID:"eip6963",AUTH_CONNECTOR_ID:"w3mAuth",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"}},PresetsUtil={ConnectorExplorerIds:{[ConstantsUtil$1.COINBASE_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[ConstantsUtil$1.COINBASE_SDK_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[ConstantsUtil$1.SAFE_CONNECTOR_ID]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[ConstantsUtil$1.LEDGER_CONNECTOR_ID]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700"},ConnectorImageIds:{[ConstantsUtil$1.COINBASE_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[ConstantsUtil$1.COINBASE_SDK_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[ConstantsUtil$1.SAFE_CONNECTOR_ID]:"461db637-8616-43ce-035a-d89b8a1d5800",[ConstantsUtil$1.LEDGER_CONNECTOR_ID]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[ConstantsUtil$1.INJECTED_CONNECTOR_ID]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[ConstantsUtil$1.INJECTED_CONNECTOR_ID]:"Browser Wallet",[ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID]:"WalletConnect",[ConstantsUtil$1.COINBASE_CONNECTOR_ID]:"Coinbase",[ConstantsUtil$1.COINBASE_SDK_CONNECTOR_ID]:"Coinbase",[ConstantsUtil$1.LEDGER_CONNECTOR_ID]:"Ledger",[ConstantsUtil$1.SAFE_CONNECTOR_ID]:"Safe"},ConnectorTypesMap:{[ConstantsUtil$1.INJECTED_CONNECTOR_ID]:"INJECTED",[ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID]:"WALLET_CONNECT",[ConstantsUtil$1.EIP6963_CONNECTOR_ID]:"ANNOUNCED",[ConstantsUtil$1.AUTH_CONNECTOR_ID]:"AUTH"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]},HelpersUtil={getCaipTokens(Fn){if(!Fn)return;const Mn={};return Object.entries(Fn).forEach(([rs,is])=>{Mn[`${ConstantsUtil$1.EIP155}:${rs}`]=is}),Mn}},ErrorUtil={UniversalProviderErrors:{UNAUTHORIZED_DOMAIN_NOT_ALLOWED:"Unauthorized: origin not allowed"},ALERT_ERRORS:{INVALID_APP_CONFIGURATION:{shortMessage:"Invalid App Configuration",longMessage:()=>`Origin ${isSafe()?window.origin:"unknown"} not found on Allowlist - update configuration`},INVALID_APP_CONFIGURATION_SOCIALS:{shortMessage:"Invalid App Configuration",longMessage:()=>`Origin ${isSafe()?window.origin:"unknown"} not found on Allowlist - update configuration to enable social login`},PROJECT_ID_NOT_CONFIGURED:{shortMessage:"Project ID Not Configured",longMessage:"Project ID Not Configured - update configuration"}}};function isSafe(){return typeof window<"u"}const LoggerUtil={createLogger(Fn,Mn="error"){const rs=k$2({level:Mn}),{logger:is}=A$1({opts:rs});return is.error=(...os)=>{for(const as of os)if(as instanceof Error){Fn(as,...os);break}Fn(new Error,...os)},is}},RPC_URL_HOST="rpc.walletconnect.org";function getBlockchainApiRpcUrl(Fn,Mn){const rs=new URL("https://rpc.walletconnect.org/v1/");return rs.searchParams.set("chainId",Fn),rs.searchParams.set("projectId",Mn),rs.toString()}const WC_HTTP_RPC_SUPPORTED_CHAINS=["near:mainnet","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","eip155:1101","eip155:56","eip155:42161","eip155:7777777","eip155:59144","eip155:324","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","eip155:5000","solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz","eip155:80084","eip155:5003","eip155:100","eip155:8453","eip155:42220","eip155:1313161555","eip155:17000","eip155:1","eip155:300","eip155:1313161554","eip155:1329","eip155:84532","eip155:421614","eip155:11155111","eip155:8217","eip155:43114","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","eip155:999999999","eip155:11155420","eip155:80002","eip155:97","eip155:43113","eip155:137","eip155:10","eip155:1301"],CaipNetworksUtil={extendRpcUrlWithProjectId(Fn,Mn){let rs=!1;try{rs=new URL(Fn).host===RPC_URL_HOST}catch{rs=!1}if(rs){const is=new URL(Fn);return is.searchParams.has("projectId")||is.searchParams.set("projectId",Mn),is.toString()}return Fn},isCaipNetwork(Fn){return"chainNamespace"in Fn&&"caipNetworkId"in Fn},getChainNamespace(Fn){return this.isCaipNetwork(Fn)?Fn.chainNamespace:ConstantsUtil$3.CHAIN.EVM},getCaipNetworkId(Fn){return this.isCaipNetwork(Fn)?Fn.caipNetworkId:`${ConstantsUtil$3.CHAIN.EVM}:${Fn.id}`},getRpcUrl(Fn,Mn,rs){var os,as,us;const is=(us=(as=(os=Fn.rpcUrls)==null?void 0:os.default)==null?void 0:as.http)==null?void 0:us[0];return WC_HTTP_RPC_SUPPORTED_CHAINS.includes(Mn)?getBlockchainApiRpcUrl(Mn,rs):is||""},extendCaipNetwork(Fn,{customNetworkImageUrls:Mn,projectId:rs}){const is=this.getCaipNetworkId(Fn),os=this.getChainNamespace(Fn),as=this.getRpcUrl(Fn,is,rs);return{...Fn,chainNamespace:os,caipNetworkId:is,assets:{imageId:PresetsUtil.NetworkImageIds[Fn.id],imageUrl:Mn==null?void 0:Mn[Fn.id]},rpcUrls:{...Fn.rpcUrls,default:{http:[as]}}}},extendCaipNetworks(Fn,{customNetworkImageUrls:Mn,projectId:rs}){return Fn.map(is=>CaipNetworksUtil.extendCaipNetwork(is,{customNetworkImageUrls:Mn,projectId:rs}))},getViemTransport(Fn){var rs;const Mn=(rs=Fn.rpcUrls.default.http)==null?void 0:rs[0];return WC_HTTP_RPC_SUPPORTED_CHAINS.includes(Fn.caipNetworkId)?fallback$1([http(Mn,{fetchOptions:{headers:{"Content-Type":"text/plain"}}}),http(Mn)]):http(Mn)}};var SocialProviderEnum;(function(Fn){Fn.Google="google",Fn.Github="github",Fn.Apple="apple",Fn.Facebook="facebook",Fn.X="x",Fn.Discord="discord",Fn.Farcaster="farcaster"})(SocialProviderEnum||(SocialProviderEnum={}));var events={exports:{}},R$1=typeof Reflect=="object"?Reflect:null,ReflectApply=R$1&&typeof R$1.apply=="function"?R$1.apply:function Fn(Mn,rs,is){return Function.prototype.apply.call(Mn,rs,is)},ReflectOwnKeys;R$1&&typeof R$1.ownKeys=="function"?ReflectOwnKeys=R$1.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function(Mn){return Object.getOwnPropertyNames(Mn).concat(Object.getOwnPropertySymbols(Mn))}:ReflectOwnKeys=function(Mn){return Object.getOwnPropertyNames(Mn)};function ProcessEmitWarning(Fn){console&&console.warn&&console.warn(Fn)}var NumberIsNaN=Number.isNaN||function Fn(Mn){return Mn!==Mn};function EventEmitter$1(){EventEmitter$1.init.call(this)}events.exports=EventEmitter$1;events.exports.once=once;EventEmitter$1.EventEmitter=EventEmitter$1;EventEmitter$1.prototype._events=void 0;EventEmitter$1.prototype._eventsCount=0;EventEmitter$1.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(Fn){if(typeof Fn!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof Fn)}Object.defineProperty(EventEmitter$1,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(Fn){if(typeof Fn!="number"||Fn<0||NumberIsNaN(Fn))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+Fn+".");defaultMaxListeners=Fn}});EventEmitter$1.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};EventEmitter$1.prototype.setMaxListeners=function Fn(Mn){if(typeof Mn!="number"||Mn<0||NumberIsNaN(Mn))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+Mn+".");return this._maxListeners=Mn,this};function _getMaxListeners(Fn){return Fn._maxListeners===void 0?EventEmitter$1.defaultMaxListeners:Fn._maxListeners}EventEmitter$1.prototype.getMaxListeners=function Fn(){return _getMaxListeners(this)};EventEmitter$1.prototype.emit=function Fn(Mn){for(var rs=[],is=1;is<arguments.length;is++)rs.push(arguments[is]);var os=Mn==="error",as=this._events;if(as!==void 0)os=os&&as.error===void 0;else if(!os)return!1;if(os){var us;if(rs.length>0&&(us=rs[0]),us instanceof Error)throw us;var ds=new Error("Unhandled error."+(us?" ("+us.message+")":""));throw ds.context=us,ds}var hs=as[Mn];if(hs===void 0)return!1;if(typeof hs=="function")ReflectApply(hs,this,rs);else for(var ps=hs.length,io=arrayClone(hs,ps),is=0;is<ps;++is)ReflectApply(io[is],this,rs);return!0};function _addListener(Fn,Mn,rs,is){var os,as,us;if(checkListener(rs),as=Fn._events,as===void 0?(as=Fn._events=Object.create(null),Fn._eventsCount=0):(as.newListener!==void 0&&(Fn.emit("newListener",Mn,rs.listener?rs.listener:rs),as=Fn._events),us=as[Mn]),us===void 0)us=as[Mn]=rs,++Fn._eventsCount;else if(typeof us=="function"?us=as[Mn]=is?[rs,us]:[us,rs]:is?us.unshift(rs):us.push(rs),os=_getMaxListeners(Fn),os>0&&us.length>os&&!us.warned){us.warned=!0;var ds=new Error("Possible EventEmitter memory leak detected. "+us.length+" "+String(Mn)+" listeners added. Use emitter.setMaxListeners() to increase limit");ds.name="MaxListenersExceededWarning",ds.emitter=Fn,ds.type=Mn,ds.count=us.length,ProcessEmitWarning(ds)}return Fn}EventEmitter$1.prototype.addListener=function Fn(Mn,rs){return _addListener(this,Mn,rs,!1)};EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener;EventEmitter$1.prototype.prependListener=function Fn(Mn,rs){return _addListener(this,Mn,rs,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(Fn,Mn,rs){var is={fired:!1,wrapFn:void 0,target:Fn,type:Mn,listener:rs},os=onceWrapper.bind(is);return os.listener=rs,is.wrapFn=os,os}EventEmitter$1.prototype.once=function Fn(Mn,rs){return checkListener(rs),this.on(Mn,_onceWrap(this,Mn,rs)),this};EventEmitter$1.prototype.prependOnceListener=function Fn(Mn,rs){return checkListener(rs),this.prependListener(Mn,_onceWrap(this,Mn,rs)),this};EventEmitter$1.prototype.removeListener=function Fn(Mn,rs){var is,os,as,us,ds;if(checkListener(rs),os=this._events,os===void 0)return this;if(is=os[Mn],is===void 0)return this;if(is===rs||is.listener===rs)--this._eventsCount===0?this._events=Object.create(null):(delete os[Mn],os.removeListener&&this.emit("removeListener",Mn,is.listener||rs));else if(typeof is!="function"){for(as=-1,us=is.length-1;us>=0;us--)if(is[us]===rs||is[us].listener===rs){ds=is[us].listener,as=us;break}if(as<0)return this;as===0?is.shift():spliceOne(is,as),is.length===1&&(os[Mn]=is[0]),os.removeListener!==void 0&&this.emit("removeListener",Mn,ds||rs)}return this};EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener;EventEmitter$1.prototype.removeAllListeners=function Fn(Mn){var rs,is,os;if(is=this._events,is===void 0)return this;if(is.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):is[Mn]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete is[Mn]),this;if(arguments.length===0){var as=Object.keys(is),us;for(os=0;os<as.length;++os)us=as[os],us!=="removeListener"&&this.removeAllListeners(us);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(rs=is[Mn],typeof rs=="function")this.removeListener(Mn,rs);else if(rs!==void 0)for(os=rs.length-1;os>=0;os--)this.removeListener(Mn,rs[os]);return this};function _listeners(Fn,Mn,rs){var is=Fn._events;if(is===void 0)return[];var os=is[Mn];return os===void 0?[]:typeof os=="function"?rs?[os.listener||os]:[os]:rs?unwrapListeners(os):arrayClone(os,os.length)}EventEmitter$1.prototype.listeners=function Fn(Mn){return _listeners(this,Mn,!0)};EventEmitter$1.prototype.rawListeners=function Fn(Mn){return _listeners(this,Mn,!1)};EventEmitter$1.listenerCount=function(Fn,Mn){return typeof Fn.listenerCount=="function"?Fn.listenerCount(Mn):listenerCount.call(Fn,Mn)};EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount(Fn){var Mn=this._events;if(Mn!==void 0){var rs=Mn[Fn];if(typeof rs=="function")return 1;if(rs!==void 0)return rs.length}return 0}EventEmitter$1.prototype.eventNames=function Fn(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(Fn,Mn){for(var rs=new Array(Mn),is=0;is<Mn;++is)rs[is]=Fn[is];return rs}function spliceOne(Fn,Mn){for(;Mn+1<Fn.length;Mn++)Fn[Mn]=Fn[Mn+1];Fn.pop()}function unwrapListeners(Fn){for(var Mn=new Array(Fn.length),rs=0;rs<Mn.length;++rs)Mn[rs]=Fn[rs].listener||Fn[rs];return Mn}function once(Fn,Mn){return new Promise(function(rs,is){function os(us){Fn.removeListener(Mn,as),is(us)}function as(){typeof Fn.removeListener=="function"&&Fn.removeListener("error",os),rs([].slice.call(arguments))}eventTargetAgnosticAddListener(Fn,Mn,as,{once:!0}),Mn!=="error"&&addErrorHandlerIfEventEmitter(Fn,os,{once:!0})})}function addErrorHandlerIfEventEmitter(Fn,Mn,rs){typeof Fn.on=="function"&&eventTargetAgnosticAddListener(Fn,"error",Mn,rs)}function eventTargetAgnosticAddListener(Fn,Mn,rs,is){if(typeof Fn.on=="function")is.once?Fn.once(Mn,rs):Fn.on(Mn,rs);else if(typeof Fn.addEventListener=="function")Fn.addEventListener(Mn,function os(as){is.once&&Fn.removeEventListener(Mn,os),rs(as)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof Fn)}var eventsExports=events.exports;const Jg=getDefaultExportFromCjs(eventsExports);var cjs$4={};/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var extendStatics=function(Fn,Mn){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(rs,is){rs.__proto__=is}||function(rs,is){for(var os in is)is.hasOwnProperty(os)&&(rs[os]=is[os])},extendStatics(Fn,Mn)};function __extends(Fn,Mn){extendStatics(Fn,Mn);function rs(){this.constructor=Fn}Fn.prototype=Mn===null?Object.create(Mn):(rs.prototype=Mn.prototype,new rs)}var __assign=function(){return __assign=Object.assign||function(Mn){for(var rs,is=1,os=arguments.length;is<os;is++){rs=arguments[is];for(var as in rs)Object.prototype.hasOwnProperty.call(rs,as)&&(Mn[as]=rs[as])}return Mn},__assign.apply(this,arguments)};function __rest(Fn,Mn){var rs={};for(var is in Fn)Object.prototype.hasOwnProperty.call(Fn,is)&&Mn.indexOf(is)<0&&(rs[is]=Fn[is]);if(Fn!=null&&typeof Object.getOwnPropertySymbols=="function")for(var os=0,is=Object.getOwnPropertySymbols(Fn);os<is.length;os++)Mn.indexOf(is[os])<0&&Object.prototype.propertyIsEnumerable.call(Fn,is[os])&&(rs[is[os]]=Fn[is[os]]);return rs}function __decorate$1H(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as}function __param(Fn,Mn){return function(rs,is){Mn(rs,is,Fn)}}function __metadata(Fn,Mn){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(Fn,Mn)}function __awaiter(Fn,Mn,rs,is){function os(as){return as instanceof rs?as:new rs(function(us){us(as)})}return new(rs||(rs=Promise))(function(as,us){function ds(io){try{ps(is.next(io))}catch(fo){us(fo)}}function hs(io){try{ps(is.throw(io))}catch(fo){us(fo)}}function ps(io){io.done?as(io.value):os(io.value).then(ds,hs)}ps((is=is.apply(Fn,Mn||[])).next())})}function __generator(Fn,Mn){var rs={label:0,sent:function(){if(as[0]&1)throw as[1];return as[1]},trys:[],ops:[]},is,os,as,us;return us={next:ds(0),throw:ds(1),return:ds(2)},typeof Symbol=="function"&&(us[Symbol.iterator]=function(){return this}),us;function ds(ps){return function(io){return hs([ps,io])}}function hs(ps){if(is)throw new TypeError("Generator is already executing.");for(;rs;)try{if(is=1,os&&(as=ps[0]&2?os.return:ps[0]?os.throw||((as=os.return)&&as.call(os),0):os.next)&&!(as=as.call(os,ps[1])).done)return as;switch(os=0,as&&(ps=[ps[0]&2,as.value]),ps[0]){case 0:case 1:as=ps;break;case 4:return rs.label++,{value:ps[1],done:!1};case 5:rs.label++,os=ps[1],ps=[0];continue;case 7:ps=rs.ops.pop(),rs.trys.pop();continue;default:if(as=rs.trys,!(as=as.length>0&&as[as.length-1])&&(ps[0]===6||ps[0]===2)){rs=0;continue}if(ps[0]===3&&(!as||ps[1]>as[0]&&ps[1]<as[3])){rs.label=ps[1];break}if(ps[0]===6&&rs.label<as[1]){rs.label=as[1],as=ps;break}if(as&&rs.label<as[2]){rs.label=as[2],rs.ops.push(ps);break}as[2]&&rs.ops.pop(),rs.trys.pop();continue}ps=Mn.call(Fn,rs)}catch(io){ps=[6,io],os=0}finally{is=as=0}if(ps[0]&5)throw ps[1];return{value:ps[0]?ps[1]:void 0,done:!0}}}function __createBinding(Fn,Mn,rs,is){is===void 0&&(is=rs),Fn[is]=Mn[rs]}function __exportStar(Fn,Mn){for(var rs in Fn)rs!=="default"&&!Mn.hasOwnProperty(rs)&&(Mn[rs]=Fn[rs])}function __values(Fn){var Mn=typeof Symbol=="function"&&Symbol.iterator,rs=Mn&&Fn[Mn],is=0;if(rs)return rs.call(Fn);if(Fn&&typeof Fn.length=="number")return{next:function(){return Fn&&is>=Fn.length&&(Fn=void 0),{value:Fn&&Fn[is++],done:!Fn}}};throw new TypeError(Mn?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(Fn,Mn){var rs=typeof Symbol=="function"&&Fn[Symbol.iterator];if(!rs)return Fn;var is=rs.call(Fn),os,as=[],us;try{for(;(Mn===void 0||Mn-- >0)&&!(os=is.next()).done;)as.push(os.value)}catch(ds){us={error:ds}}finally{try{os&&!os.done&&(rs=is.return)&&rs.call(is)}finally{if(us)throw us.error}}return as}function __spread(){for(var Fn=[],Mn=0;Mn<arguments.length;Mn++)Fn=Fn.concat(__read(arguments[Mn]));return Fn}function __spreadArrays(){for(var Fn=0,Mn=0,rs=arguments.length;Mn<rs;Mn++)Fn+=arguments[Mn].length;for(var is=Array(Fn),os=0,Mn=0;Mn<rs;Mn++)for(var as=arguments[Mn],us=0,ds=as.length;us<ds;us++,os++)is[os]=as[us];return is}function __await(Fn){return this instanceof __await?(this.v=Fn,this):new __await(Fn)}function __asyncGenerator(Fn,Mn,rs){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var is=rs.apply(Fn,Mn||[]),os,as=[];return os={},us("next"),us("throw"),us("return"),os[Symbol.asyncIterator]=function(){return this},os;function us(mo){is[mo]&&(os[mo]=function(Ao){return new Promise(function($o,Lo){as.push([mo,Ao,$o,Lo])>1||ds(mo,Ao)})})}function ds(mo,Ao){try{hs(is[mo](Ao))}catch($o){fo(as[0][3],$o)}}function hs(mo){mo.value instanceof __await?Promise.resolve(mo.value.v).then(ps,io):fo(as[0][2],mo)}function ps(mo){ds("next",mo)}function io(mo){ds("throw",mo)}function fo(mo,Ao){mo(Ao),as.shift(),as.length&&ds(as[0][0],as[0][1])}}function __asyncDelegator(Fn){var Mn,rs;return Mn={},is("next"),is("throw",function(os){throw os}),is("return"),Mn[Symbol.iterator]=function(){return this},Mn;function is(os,as){Mn[os]=Fn[os]?function(us){return(rs=!rs)?{value:__await(Fn[os](us)),done:os==="return"}:as?as(us):us}:as}}function __asyncValues(Fn){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Mn=Fn[Symbol.asyncIterator],rs;return Mn?Mn.call(Fn):(Fn=typeof __values=="function"?__values(Fn):Fn[Symbol.iterator](),rs={},is("next"),is("throw"),is("return"),rs[Symbol.asyncIterator]=function(){return this},rs);function is(as){rs[as]=Fn[as]&&function(us){return new Promise(function(ds,hs){us=Fn[as](us),os(ds,hs,us.done,us.value)})}}function os(as,us,ds,hs){Promise.resolve(hs).then(function(ps){as({value:ps,done:ds})},us)}}function __makeTemplateObject(Fn,Mn){return Object.defineProperty?Object.defineProperty(Fn,"raw",{value:Mn}):Fn.raw=Mn,Fn}function __importStar(Fn){if(Fn&&Fn.__esModule)return Fn;var Mn={};if(Fn!=null)for(var rs in Fn)Object.hasOwnProperty.call(Fn,rs)&&(Mn[rs]=Fn[rs]);return Mn.default=Fn,Mn}function __importDefault(Fn){return Fn&&Fn.__esModule?Fn:{default:Fn}}function __classPrivateFieldGet(Fn,Mn){if(!Mn.has(Fn))throw new TypeError("attempted to get private field on non-instance");return Mn.get(Fn)}function __classPrivateFieldSet(Fn,Mn,rs){if(!Mn.has(Fn))throw new TypeError("attempted to set private field on non-instance");return Mn.set(Fn,rs),rs}const tslib_es6=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return __assign},__asyncDelegator,__asyncGenerator,__asyncValues,__await,__awaiter,__classPrivateFieldGet,__classPrivateFieldSet,__createBinding,__decorate:__decorate$1H,__exportStar,__extends,__generator,__importDefault,__importStar,__makeTemplateObject,__metadata,__param,__read,__rest,__spread,__spreadArrays,__values},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(tslib_es6);var utils$e={},delay={},hasRequiredDelay;function requireDelay(){if(hasRequiredDelay)return delay;hasRequiredDelay=1,Object.defineProperty(delay,"__esModule",{value:!0}),delay.delay=void 0;function Fn(Mn){return new Promise(rs=>{setTimeout(()=>{rs(!0)},Mn)})}return delay.delay=Fn,delay}var convert={},constants={},misc={},hasRequiredMisc;function requireMisc(){return hasRequiredMisc||(hasRequiredMisc=1,Object.defineProperty(misc,"__esModule",{value:!0}),misc.ONE_THOUSAND=misc.ONE_HUNDRED=void 0,misc.ONE_HUNDRED=100,misc.ONE_THOUSAND=1e3),misc}var time={},hasRequiredTime;function requireTime(){return hasRequiredTime||(hasRequiredTime=1,function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.ONE_YEAR=Fn.FOUR_WEEKS=Fn.THREE_WEEKS=Fn.TWO_WEEKS=Fn.ONE_WEEK=Fn.THIRTY_DAYS=Fn.SEVEN_DAYS=Fn.FIVE_DAYS=Fn.THREE_DAYS=Fn.ONE_DAY=Fn.TWENTY_FOUR_HOURS=Fn.TWELVE_HOURS=Fn.SIX_HOURS=Fn.THREE_HOURS=Fn.ONE_HOUR=Fn.SIXTY_MINUTES=Fn.THIRTY_MINUTES=Fn.TEN_MINUTES=Fn.FIVE_MINUTES=Fn.ONE_MINUTE=Fn.SIXTY_SECONDS=Fn.THIRTY_SECONDS=Fn.TEN_SECONDS=Fn.FIVE_SECONDS=Fn.ONE_SECOND=void 0,Fn.ONE_SECOND=1,Fn.FIVE_SECONDS=5,Fn.TEN_SECONDS=10,Fn.THIRTY_SECONDS=30,Fn.SIXTY_SECONDS=60,Fn.ONE_MINUTE=Fn.SIXTY_SECONDS,Fn.FIVE_MINUTES=Fn.ONE_MINUTE*5,Fn.TEN_MINUTES=Fn.ONE_MINUTE*10,Fn.THIRTY_MINUTES=Fn.ONE_MINUTE*30,Fn.SIXTY_MINUTES=Fn.ONE_MINUTE*60,Fn.ONE_HOUR=Fn.SIXTY_MINUTES,Fn.THREE_HOURS=Fn.ONE_HOUR*3,Fn.SIX_HOURS=Fn.ONE_HOUR*6,Fn.TWELVE_HOURS=Fn.ONE_HOUR*12,Fn.TWENTY_FOUR_HOURS=Fn.ONE_HOUR*24,Fn.ONE_DAY=Fn.TWENTY_FOUR_HOURS,Fn.THREE_DAYS=Fn.ONE_DAY*3,Fn.FIVE_DAYS=Fn.ONE_DAY*5,Fn.SEVEN_DAYS=Fn.ONE_DAY*7,Fn.THIRTY_DAYS=Fn.ONE_DAY*30,Fn.ONE_WEEK=Fn.SEVEN_DAYS,Fn.TWO_WEEKS=Fn.ONE_WEEK*2,Fn.THREE_WEEKS=Fn.ONE_WEEK*3,Fn.FOUR_WEEKS=Fn.ONE_WEEK*4,Fn.ONE_YEAR=Fn.ONE_DAY*365}(time)),time}var hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});const Mn=require$$0$1;Mn.__exportStar(requireMisc(),Fn),Mn.__exportStar(requireTime(),Fn)}(constants)),constants}var hasRequiredConvert;function requireConvert(){if(hasRequiredConvert)return convert;hasRequiredConvert=1,Object.defineProperty(convert,"__esModule",{value:!0}),convert.fromMiliseconds=convert.toMiliseconds=void 0;const Fn=requireConstants();function Mn(is){return is*Fn.ONE_THOUSAND}convert.toMiliseconds=Mn;function rs(is){return Math.floor(is/Fn.ONE_THOUSAND)}return convert.fromMiliseconds=rs,convert}var hasRequiredUtils;function requireUtils(){return hasRequiredUtils||(hasRequiredUtils=1,function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});const Mn=require$$0$1;Mn.__exportStar(requireDelay(),Fn),Mn.__exportStar(requireConvert(),Fn)}(utils$e)),utils$e}var watch$2={},hasRequiredWatch$1;function requireWatch$1(){if(hasRequiredWatch$1)return watch$2;hasRequiredWatch$1=1,Object.defineProperty(watch$2,"__esModule",{value:!0}),watch$2.Watch=void 0;class Fn{constructor(){this.timestamps=new Map}start(rs){if(this.timestamps.has(rs))throw new Error(`Watch already started for label: ${rs}`);this.timestamps.set(rs,{started:Date.now()})}stop(rs){const is=this.get(rs);if(typeof is.elapsed<"u")throw new Error(`Watch already stopped for label: ${rs}`);const os=Date.now()-is.started;this.timestamps.set(rs,{started:is.started,elapsed:os})}get(rs){const is=this.timestamps.get(rs);if(typeof is>"u")throw new Error(`No timestamp found for label: ${rs}`);return is}elapsed(rs){const is=this.get(rs);return is.elapsed||Date.now()-is.started}}return watch$2.Watch=Fn,watch$2.default=Fn,watch$2}var types={},watch$1={},hasRequiredWatch;function requireWatch(){if(hasRequiredWatch)return watch$1;hasRequiredWatch=1,Object.defineProperty(watch$1,"__esModule",{value:!0}),watch$1.IWatch=void 0;class Fn{}return watch$1.IWatch=Fn,watch$1}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0}),require$$0$1.__exportStar(requireWatch(),Fn)}(types)),types}(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});const Mn=require$$0$1;Mn.__exportStar(requireUtils(),Fn),Mn.__exportStar(requireWatch$1(),Fn),Mn.__exportStar(requireTypes(),Fn),Mn.__exportStar(requireConstants(),Fn)})(cjs$4);class IEvents{}let n$3=class extends IEvents{constructor(Mn){super()}};const s$1=cjs$4.FIVE_SECONDS,r$4={pulse:"heartbeat_pulse"};let i$1=class n_ extends n$3{constructor(Mn){super(Mn),this.events=new eventsExports.EventEmitter,this.interval=s$1,this.interval=(Mn==null?void 0:Mn.interval)||s$1}static async init(Mn){const rs=new n_(Mn);return await rs.init(),rs}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(Mn,rs){this.events.on(Mn,rs)}once(Mn,rs){this.events.once(Mn,rs)}off(Mn,rs){this.events.off(Mn,rs)}removeListener(Mn,rs){this.events.removeListener(Mn,rs)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),cjs$4.toMiliseconds(this.interval))}pulse(){this.events.emit(r$4.pulse)}};const suspectProtoRx=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,suspectConstructorRx=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,JsonSigRx=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function jsonParseTransform(Fn,Mn){if(Fn==="__proto__"||Fn==="constructor"&&Mn&&typeof Mn=="object"&&"prototype"in Mn){warnKeyDropped(Fn);return}return Mn}function warnKeyDropped(Fn){console.warn(`[destr] Dropping "${Fn}" key to prevent prototype pollution.`)}function destr(Fn,Mn={}){if(typeof Fn!="string")return Fn;const rs=Fn.trim();if(Fn[0]==='"'&&Fn.endsWith('"')&&!Fn.includes("\\"))return rs.slice(1,-1);if(rs.length<=9){const is=rs.toLowerCase();if(is==="true")return!0;if(is==="false")return!1;if(is==="undefined")return;if(is==="null")return null;if(is==="nan")return Number.NaN;if(is==="infinity")return Number.POSITIVE_INFINITY;if(is==="-infinity")return Number.NEGATIVE_INFINITY}if(!JsonSigRx.test(Fn)){if(Mn.strict)throw new SyntaxError("[destr] Invalid JSON");return Fn}try{if(suspectProtoRx.test(Fn)||suspectConstructorRx.test(Fn)){if(Mn.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(Fn,jsonParseTransform)}return JSON.parse(Fn)}catch(is){if(Mn.strict)throw is;return Fn}}function wrapToPromise(Fn){return!Fn||typeof Fn.then!="function"?Promise.resolve(Fn):Fn}function asyncCall(Fn,...Mn){try{return wrapToPromise(Fn(...Mn))}catch(rs){return Promise.reject(rs)}}function isPrimitive(Fn){const Mn=typeof Fn;return Fn===null||Mn!=="object"&&Mn!=="function"}function isPureObject(Fn){const Mn=Object.getPrototypeOf(Fn);return!Mn||Mn.isPrototypeOf(Object)}function stringify(Fn){if(isPrimitive(Fn))return String(Fn);if(isPureObject(Fn)||Array.isArray(Fn))return JSON.stringify(Fn);if(typeof Fn.toJSON=="function")return stringify(Fn.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function checkBufferSupport(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const BASE64_PREFIX="base64:";function serializeRaw(Fn){if(typeof Fn=="string")return Fn;checkBufferSupport();const Mn=Buffer.from(Fn).toString("base64");return BASE64_PREFIX+Mn}function deserializeRaw(Fn){return typeof Fn!="string"||!Fn.startsWith(BASE64_PREFIX)?Fn:(checkBufferSupport(),Buffer.from(Fn.slice(BASE64_PREFIX.length),"base64"))}function normalizeKey(Fn){return Fn?Fn.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function joinKeys(...Fn){return normalizeKey(Fn.join(":"))}function normalizeBaseKey(Fn){return Fn=normalizeKey(Fn),Fn?Fn+":":""}function defineDriver(Fn){return Fn}const DRIVER_NAME="memory",memory=()=>{const Fn=new Map;return{name:DRIVER_NAME,options:{},hasItem(Mn){return Fn.has(Mn)},getItem(Mn){return Fn.get(Mn)??null},getItemRaw(Mn){return Fn.get(Mn)??null},setItem(Mn,rs){Fn.set(Mn,rs)},setItemRaw(Mn,rs){Fn.set(Mn,rs)},removeItem(Mn){Fn.delete(Mn)},getKeys(){return Array.from(Fn.keys())},clear(){Fn.clear()},dispose(){Fn.clear()}}};function createStorage(Fn={}){const Mn={mounts:{"":Fn.driver||memory()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},rs=ps=>{for(const io of Mn.mountpoints)if(ps.startsWith(io))return{base:io,relativeKey:ps.slice(io.length),driver:Mn.mounts[io]};return{base:"",relativeKey:ps,driver:Mn.mounts[""]}},is=(ps,io)=>Mn.mountpoints.filter(fo=>fo.startsWith(ps)||io&&ps.startsWith(fo)).map(fo=>({relativeBase:ps.length>fo.length?ps.slice(fo.length):void 0,mountpoint:fo,driver:Mn.mounts[fo]})),os=(ps,io)=>{if(Mn.watching){io=normalizeKey(io);for(const fo of Mn.watchListeners)fo(ps,io)}},as=async()=>{if(!Mn.watching){Mn.watching=!0;for(const ps in Mn.mounts)Mn.unwatch[ps]=await watch(Mn.mounts[ps],os,ps)}},us=async()=>{if(Mn.watching){for(const ps in Mn.unwatch)await Mn.unwatch[ps]();Mn.unwatch={},Mn.watching=!1}},ds=(ps,io,fo)=>{const mo=new Map,Ao=$o=>{let Lo=mo.get($o.base);return Lo||(Lo={driver:$o.driver,base:$o.base,items:[]},mo.set($o.base,Lo)),Lo};for(const $o of ps){const Lo=typeof $o=="string",Go=normalizeKey(Lo?$o:$o.key),Yo=Lo?void 0:$o.value,Wo=Lo||!$o.options?io:{...io,...$o.options},Jo=rs(Go);Ao(Jo).items.push({key:Go,value:Yo,relativeKey:Jo.relativeKey,options:Wo})}return Promise.all([...mo.values()].map($o=>fo($o))).then($o=>$o.flat())},hs={hasItem(ps,io={}){ps=normalizeKey(ps);const{relativeKey:fo,driver:mo}=rs(ps);return asyncCall(mo.hasItem,fo,io)},getItem(ps,io={}){ps=normalizeKey(ps);const{relativeKey:fo,driver:mo}=rs(ps);return asyncCall(mo.getItem,fo,io).then(Ao=>destr(Ao))},getItems(ps,io){return ds(ps,io,fo=>fo.driver.getItems?asyncCall(fo.driver.getItems,fo.items.map(mo=>({key:mo.relativeKey,options:mo.options})),io).then(mo=>mo.map(Ao=>({key:joinKeys(fo.base,Ao.key),value:destr(Ao.value)}))):Promise.all(fo.items.map(mo=>asyncCall(fo.driver.getItem,mo.relativeKey,mo.options).then(Ao=>({key:mo.key,value:destr(Ao)})))))},getItemRaw(ps,io={}){ps=normalizeKey(ps);const{relativeKey:fo,driver:mo}=rs(ps);return mo.getItemRaw?asyncCall(mo.getItemRaw,fo,io):asyncCall(mo.getItem,fo,io).then(Ao=>deserializeRaw(Ao))},async setItem(ps,io,fo={}){if(io===void 0)return hs.removeItem(ps);ps=normalizeKey(ps);const{relativeKey:mo,driver:Ao}=rs(ps);Ao.setItem&&(await asyncCall(Ao.setItem,mo,stringify(io),fo),Ao.watch||os("update",ps))},async setItems(ps,io){await ds(ps,io,async fo=>{if(fo.driver.setItems)return asyncCall(fo.driver.setItems,fo.items.map(mo=>({key:mo.relativeKey,value:stringify(mo.value),options:mo.options})),io);fo.driver.setItem&&await Promise.all(fo.items.map(mo=>asyncCall(fo.driver.setItem,mo.relativeKey,stringify(mo.value),mo.options)))})},async setItemRaw(ps,io,fo={}){if(io===void 0)return hs.removeItem(ps,fo);ps=normalizeKey(ps);const{relativeKey:mo,driver:Ao}=rs(ps);if(Ao.setItemRaw)await asyncCall(Ao.setItemRaw,mo,io,fo);else if(Ao.setItem)await asyncCall(Ao.setItem,mo,serializeRaw(io),fo);else return;Ao.watch||os("update",ps)},async removeItem(ps,io={}){typeof io=="boolean"&&(io={removeMeta:io}),ps=normalizeKey(ps);const{relativeKey:fo,driver:mo}=rs(ps);mo.removeItem&&(await asyncCall(mo.removeItem,fo,io),(io.removeMeta||io.removeMata)&&await asyncCall(mo.removeItem,fo+"$",io),mo.watch||os("remove",ps))},async getMeta(ps,io={}){typeof io=="boolean"&&(io={nativeOnly:io}),ps=normalizeKey(ps);const{relativeKey:fo,driver:mo}=rs(ps),Ao=Object.create(null);if(mo.getMeta&&Object.assign(Ao,await asyncCall(mo.getMeta,fo,io)),!io.nativeOnly){const $o=await asyncCall(mo.getItem,fo+"$",io).then(Lo=>destr(Lo));$o&&typeof $o=="object"&&(typeof $o.atime=="string"&&($o.atime=new Date($o.atime)),typeof $o.mtime=="string"&&($o.mtime=new Date($o.mtime)),Object.assign(Ao,$o))}return Ao},setMeta(ps,io,fo={}){return this.setItem(ps+"$",io,fo)},removeMeta(ps,io={}){return this.removeItem(ps+"$",io)},async getKeys(ps,io={}){ps=normalizeBaseKey(ps);const fo=is(ps,!0);let mo=[];const Ao=[];for(const $o of fo){const Go=(await asyncCall($o.driver.getKeys,$o.relativeBase,io)).map(Yo=>$o.mountpoint+normalizeKey(Yo)).filter(Yo=>!mo.some(Wo=>Yo.startsWith(Wo)));Ao.push(...Go),mo=[$o.mountpoint,...mo.filter(Yo=>!Yo.startsWith($o.mountpoint))]}return ps?Ao.filter($o=>$o.startsWith(ps)&&!$o.endsWith("$")):Ao.filter($o=>!$o.endsWith("$"))},async clear(ps,io={}){ps=normalizeBaseKey(ps),await Promise.all(is(ps,!1).map(async fo=>{if(fo.driver.clear)return asyncCall(fo.driver.clear,fo.relativeBase,io);if(fo.driver.removeItem){const mo=await fo.driver.getKeys(fo.relativeBase||"",io);return Promise.all(mo.map(Ao=>fo.driver.removeItem(Ao,io)))}}))},async dispose(){await Promise.all(Object.values(Mn.mounts).map(ps=>dispose(ps)))},async watch(ps){return await as(),Mn.watchListeners.push(ps),async()=>{Mn.watchListeners=Mn.watchListeners.filter(io=>io!==ps),Mn.watchListeners.length===0&&await us()}},async unwatch(){Mn.watchListeners=[],await us()},mount(ps,io){if(ps=normalizeBaseKey(ps),ps&&Mn.mounts[ps])throw new Error(`already mounted at ${ps}`);return ps&&(Mn.mountpoints.push(ps),Mn.mountpoints.sort((fo,mo)=>mo.length-fo.length)),Mn.mounts[ps]=io,Mn.watching&&Promise.resolve(watch(io,os,ps)).then(fo=>{Mn.unwatch[ps]=fo}).catch(console.error),hs},async unmount(ps,io=!0){ps=normalizeBaseKey(ps),!(!ps||!Mn.mounts[ps])&&(Mn.watching&&ps in Mn.unwatch&&(Mn.unwatch[ps](),delete Mn.unwatch[ps]),io&&await dispose(Mn.mounts[ps]),Mn.mountpoints=Mn.mountpoints.filter(fo=>fo!==ps),delete Mn.mounts[ps])},getMount(ps=""){ps=normalizeKey(ps)+":";const io=rs(ps);return{driver:io.driver,base:io.base}},getMounts(ps="",io={}){return ps=normalizeKey(ps),is(ps,io.parents).map(mo=>({driver:mo.driver,base:mo.mountpoint}))}};return hs}function watch(Fn,Mn,rs){return Fn.watch?Fn.watch((is,os)=>Mn(is,rs+os)):()=>{}}async function dispose(Fn){typeof Fn.dispose=="function"&&await asyncCall(Fn.dispose)}function promisifyRequest(Fn){return new Promise((Mn,rs)=>{Fn.oncomplete=Fn.onsuccess=()=>Mn(Fn.result),Fn.onabort=Fn.onerror=()=>rs(Fn.error)})}function createStore(Fn,Mn){const rs=indexedDB.open(Fn);rs.onupgradeneeded=()=>rs.result.createObjectStore(Mn);const is=promisifyRequest(rs);return(os,as)=>is.then(us=>as(us.transaction(Mn,os).objectStore(Mn)))}let defaultGetStoreFunc;function defaultGetStore(){return defaultGetStoreFunc||(defaultGetStoreFunc=createStore("keyval-store","keyval")),defaultGetStoreFunc}function get$1(Fn,Mn=defaultGetStore()){return Mn("readonly",rs=>promisifyRequest(rs.get(Fn)))}function set$1(Fn,Mn,rs=defaultGetStore()){return rs("readwrite",is=>(is.put(Mn,Fn),promisifyRequest(is.transaction)))}function del(Fn,Mn=defaultGetStore()){return Mn("readwrite",rs=>(rs.delete(Fn),promisifyRequest(rs.transaction)))}function clear$1(Fn=defaultGetStore()){return Fn("readwrite",Mn=>(Mn.clear(),promisifyRequest(Mn.transaction)))}function eachCursor(Fn,Mn){return Fn.openCursor().onsuccess=function(){this.result&&(Mn(this.result),this.result.continue())},promisifyRequest(Fn.transaction)}function keys(Fn=defaultGetStore()){return Fn("readonly",Mn=>{if(Mn.getAllKeys)return promisifyRequest(Mn.getAllKeys());const rs=[];return eachCursor(Mn,is=>rs.push(is.key)).then(()=>rs)})}const x$2="idb-keyval";var z$3=(Fn={})=>{const Mn=Fn.base&&Fn.base.length>0?`${Fn.base}:`:"",rs=os=>Mn+os;let is;return Fn.dbName&&Fn.storeName&&(is=createStore(Fn.dbName,Fn.storeName)),{name:x$2,options:Fn,async hasItem(os){return!(typeof await get$1(rs(os),is)>"u")},async getItem(os){return await get$1(rs(os),is)??null},setItem(os,as){return set$1(rs(os),as,is)},removeItem(os){return del(rs(os),is)},getKeys(){return keys(is)},clear(){return clear$1(is)}}};const D$1="WALLET_CONNECT_V2_INDEXED_DB",E$1="keyvaluestorage";let _$1=class{constructor(){this.indexedDb=createStorage({driver:z$3({dbName:D$1,storeName:E$1})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(Mn=>[Mn.key,Mn.value])}async getItem(Mn){const rs=await this.indexedDb.getItem(Mn);if(rs!==null)return rs}async setItem(Mn,rs){await this.indexedDb.setItem(Mn,safeJsonStringify(rs))}async removeItem(Mn){await this.indexedDb.removeItem(Mn)}};var l$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global$2<"u"?global$2:typeof self<"u"?self:{},c$1={exports:{}};(function(){let Fn;function Mn(){}Fn=Mn,Fn.prototype.getItem=function(rs){return this.hasOwnProperty(rs)?String(this[rs]):null},Fn.prototype.setItem=function(rs,is){this[rs]=String(is)},Fn.prototype.removeItem=function(rs){delete this[rs]},Fn.prototype.clear=function(){const rs=this;Object.keys(rs).forEach(function(is){rs[is]=void 0,delete rs[is]})},Fn.prototype.key=function(rs){return rs=rs||0,Object.keys(this)[rs]},Fn.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof l$1<"u"&&l$1.localStorage?c$1.exports=l$1.localStorage:typeof window<"u"&&window.localStorage?c$1.exports=window.localStorage:c$1.exports=new Mn})();function k(Fn){var Mn;return[Fn[0],safeJsonParse((Mn=Fn[1])!=null?Mn:"")]}let K$1=class{constructor(){this.localStorage=c$1.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(k)}async getItem(Mn){const rs=this.localStorage.getItem(Mn);if(rs!==null)return safeJsonParse(rs)}async setItem(Mn,rs){this.localStorage.setItem(Mn,safeJsonStringify(rs))}async removeItem(Mn){this.localStorage.removeItem(Mn)}};const N="wc_storage_version",y$2=1,O$2=async(Fn,Mn,rs)=>{const is=N,os=await Mn.getItem(is);if(os&&os>=y$2){rs(Mn);return}const as=await Fn.getKeys();if(!as.length){rs(Mn);return}const us=[];for(;as.length;){const ds=as.shift();if(!ds)continue;const hs=ds.toLowerCase();if(hs.includes("wc@")||hs.includes("walletconnect")||hs.includes("wc_")||hs.includes("wallet_connect")){const ps=await Fn.getItem(ds);await Mn.setItem(ds,ps),us.push(ds)}}await Mn.setItem(is,y$2),rs(Mn),j$3(Fn,us)},j$3=async(Fn,Mn)=>{Mn.length&&Mn.forEach(async rs=>{await Fn.removeItem(rs)})};let h$2=class{constructor(){this.initialized=!1,this.setInitialized=rs=>{this.storage=rs,this.initialized=!0};const Mn=new K$1;this.storage=Mn;try{const rs=new _$1;O$2(Mn,rs,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(Mn){return await this.initialize(),this.storage.getItem(Mn)}async setItem(Mn,rs){return await this.initialize(),this.storage.setItem(Mn,rs)}async removeItem(Mn){return await this.initialize(),this.storage.removeItem(Mn)}async initialize(){this.initialized||await new Promise(Mn=>{const rs=setInterval(()=>{this.initialized&&(clearInterval(rs),Mn())},20)})}},n$2=class extends IEvents{constructor(Mn){super(),this.opts=Mn,this.protocol="wc",this.version=2}},h$1=class extends IEvents{constructor(Mn,rs){super(),this.core=Mn,this.logger=rs,this.records=new Map}},a$1=class{constructor(Mn,rs){this.logger=Mn,this.core=rs}},g$1=class extends IEvents{constructor(Mn,rs){super(),this.relayer=Mn,this.logger=rs}};class u extends IEvents{constructor(Mn){super()}}let p$1=class{constructor(Mn,rs,is,os){this.core=Mn,this.logger=rs,this.name=is}},d$1=class extends IEvents{constructor(Mn,rs){super(),this.relayer=Mn,this.logger=rs}},x$1=class extends IEvents{constructor(Mn,rs){super(),this.core=Mn,this.logger=rs}},y$1=class{constructor(Mn,rs,is){this.core=Mn,this.logger=rs,this.store=is}},v$2=class{constructor(Mn,rs){this.projectId=Mn,this.logger=rs}},C$1=class{constructor(Mn,rs,is){this.core=Mn,this.logger=rs,this.telemetryEnabled=is}},S$1=class{constructor(Mn){this.opts=Mn,this.protocol="wc",this.version=2}},M$1=class{constructor(Mn){this.client=Mn}};var ed25519={},random={},system={},browser={};Object.defineProperty(browser,"__esModule",{value:!0});browser.BrowserRandomSource=void 0;const QUOTA=65536;class BrowserRandomSource{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const Mn=typeof self<"u"?self.crypto||self.msCrypto:null;Mn&&Mn.getRandomValues!==void 0&&(this._crypto=Mn,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(Mn){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const rs=new Uint8Array(Mn);for(let is=0;is<rs.length;is+=QUOTA)this._crypto.getRandomValues(rs.subarray(is,is+Math.min(rs.length-is,QUOTA)));return rs}}browser.BrowserRandomSource=BrowserRandomSource;function commonjsRequire(Fn){throw new Error('Could not dynamically require "'+Fn+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var node$1={},wipe$1={};Object.defineProperty(wipe$1,"__esModule",{value:!0});function wipe(Fn){for(var Mn=0;Mn<Fn.length;Mn++)Fn[Mn]=0;return Fn}wipe$1.wipe=wipe;Object.defineProperty(node$1,"__esModule",{value:!0});node$1.NodeRandomSource=void 0;const wipe_1$3=wipe$1;class NodeRandomSource{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof commonjsRequire<"u"){const Mn=require$$3;Mn&&Mn.randomBytes&&(this._crypto=Mn,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(Mn){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let rs=this._crypto.randomBytes(Mn);if(rs.length!==Mn)throw new Error("NodeRandomSource: got fewer bytes than requested");const is=new Uint8Array(Mn);for(let os=0;os<is.length;os++)is[os]=rs[os];return(0,wipe_1$3.wipe)(rs),is}}node$1.NodeRandomSource=NodeRandomSource;Object.defineProperty(system,"__esModule",{value:!0});system.SystemRandomSource=void 0;const browser_1=browser,node_1=node$1;class SystemRandomSource{constructor(){if(this.isAvailable=!1,this.name="",this._source=new browser_1.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new node_1.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(Mn){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(Mn)}}system.SystemRandomSource=SystemRandomSource;var binary={},int={};(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});function Mn(ds,hs){var ps=ds>>>16&65535,io=ds&65535,fo=hs>>>16&65535,mo=hs&65535;return io*mo+(ps*mo+io*fo<<16>>>0)|0}Fn.mul=Math.imul||Mn;function rs(ds,hs){return ds+hs|0}Fn.add=rs;function is(ds,hs){return ds-hs|0}Fn.sub=is;function os(ds,hs){return ds<<hs|ds>>>32-hs}Fn.rotl=os;function as(ds,hs){return ds<<32-hs|ds>>>hs}Fn.rotr=as;function us(ds){return typeof ds=="number"&&isFinite(ds)&&Math.floor(ds)===ds}Fn.isInteger=Number.isInteger||us,Fn.MAX_SAFE_INTEGER=9007199254740991,Fn.isSafeInteger=function(ds){return Fn.isInteger(ds)&&ds>=-Fn.MAX_SAFE_INTEGER&&ds<=Fn.MAX_SAFE_INTEGER}})(int);Object.defineProperty(binary,"__esModule",{value:!0});var int_1=int;function readInt16BE(Fn,Mn){return Mn===void 0&&(Mn=0),(Fn[Mn+0]<<8|Fn[Mn+1])<<16>>16}binary.readInt16BE=readInt16BE;function readUint16BE(Fn,Mn){return Mn===void 0&&(Mn=0),(Fn[Mn+0]<<8|Fn[Mn+1])>>>0}binary.readUint16BE=readUint16BE;function readInt16LE(Fn,Mn){return Mn===void 0&&(Mn=0),(Fn[Mn+1]<<8|Fn[Mn])<<16>>16}binary.readInt16LE=readInt16LE;function readUint16LE(Fn,Mn){return Mn===void 0&&(Mn=0),(Fn[Mn+1]<<8|Fn[Mn])>>>0}binary.readUint16LE=readUint16LE;function writeUint16BE(Fn,Mn,rs){return Mn===void 0&&(Mn=new Uint8Array(2)),rs===void 0&&(rs=0),Mn[rs+0]=Fn>>>8,Mn[rs+1]=Fn>>>0,Mn}binary.writeUint16BE=writeUint16BE;binary.writeInt16BE=writeUint16BE;function writeUint16LE(Fn,Mn,rs){return Mn===void 0&&(Mn=new Uint8Array(2)),rs===void 0&&(rs=0),Mn[rs+0]=Fn>>>0,Mn[rs+1]=Fn>>>8,Mn}binary.writeUint16LE=writeUint16LE;binary.writeInt16LE=writeUint16LE;function readInt32BE(Fn,Mn){return Mn===void 0&&(Mn=0),Fn[Mn]<<24|Fn[Mn+1]<<16|Fn[Mn+2]<<8|Fn[Mn+3]}binary.readInt32BE=readInt32BE;function readUint32BE(Fn,Mn){return Mn===void 0&&(Mn=0),(Fn[Mn]<<24|Fn[Mn+1]<<16|Fn[Mn+2]<<8|Fn[Mn+3])>>>0}binary.readUint32BE=readUint32BE;function readInt32LE(Fn,Mn){return Mn===void 0&&(Mn=0),Fn[Mn+3]<<24|Fn[Mn+2]<<16|Fn[Mn+1]<<8|Fn[Mn]}binary.readInt32LE=readInt32LE;function readUint32LE(Fn,Mn){return Mn===void 0&&(Mn=0),(Fn[Mn+3]<<24|Fn[Mn+2]<<16|Fn[Mn+1]<<8|Fn[Mn])>>>0}binary.readUint32LE=readUint32LE;function writeUint32BE(Fn,Mn,rs){return Mn===void 0&&(Mn=new Uint8Array(4)),rs===void 0&&(rs=0),Mn[rs+0]=Fn>>>24,Mn[rs+1]=Fn>>>16,Mn[rs+2]=Fn>>>8,Mn[rs+3]=Fn>>>0,Mn}binary.writeUint32BE=writeUint32BE;binary.writeInt32BE=writeUint32BE;function writeUint32LE(Fn,Mn,rs){return Mn===void 0&&(Mn=new Uint8Array(4)),rs===void 0&&(rs=0),Mn[rs+0]=Fn>>>0,Mn[rs+1]=Fn>>>8,Mn[rs+2]=Fn>>>16,Mn[rs+3]=Fn>>>24,Mn}binary.writeUint32LE=writeUint32LE;binary.writeInt32LE=writeUint32LE;function readInt64BE(Fn,Mn){Mn===void 0&&(Mn=0);var rs=readInt32BE(Fn,Mn),is=readInt32BE(Fn,Mn+4);return rs*4294967296+is-(is>>31)*4294967296}binary.readInt64BE=readInt64BE;function readUint64BE(Fn,Mn){Mn===void 0&&(Mn=0);var rs=readUint32BE(Fn,Mn),is=readUint32BE(Fn,Mn+4);return rs*4294967296+is}binary.readUint64BE=readUint64BE;function readInt64LE(Fn,Mn){Mn===void 0&&(Mn=0);var rs=readInt32LE(Fn,Mn),is=readInt32LE(Fn,Mn+4);return is*4294967296+rs-(rs>>31)*4294967296}binary.readInt64LE=readInt64LE;function readUint64LE(Fn,Mn){Mn===void 0&&(Mn=0);var rs=readUint32LE(Fn,Mn),is=readUint32LE(Fn,Mn+4);return is*4294967296+rs}binary.readUint64LE=readUint64LE;function writeUint64BE(Fn,Mn,rs){return Mn===void 0&&(Mn=new Uint8Array(8)),rs===void 0&&(rs=0),writeUint32BE(Fn/4294967296>>>0,Mn,rs),writeUint32BE(Fn>>>0,Mn,rs+4),Mn}binary.writeUint64BE=writeUint64BE;binary.writeInt64BE=writeUint64BE;function writeUint64LE(Fn,Mn,rs){return Mn===void 0&&(Mn=new Uint8Array(8)),rs===void 0&&(rs=0),writeUint32LE(Fn>>>0,Mn,rs),writeUint32LE(Fn/4294967296>>>0,Mn,rs+4),Mn}binary.writeUint64LE=writeUint64LE;binary.writeInt64LE=writeUint64LE;function readUintBE(Fn,Mn,rs){if(rs===void 0&&(rs=0),Fn%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(Fn/8>Mn.length-rs)throw new Error("readUintBE: array is too short for the given bitLength");for(var is=0,os=1,as=Fn/8+rs-1;as>=rs;as--)is+=Mn[as]*os,os*=256;return is}binary.readUintBE=readUintBE;function readUintLE(Fn,Mn,rs){if(rs===void 0&&(rs=0),Fn%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(Fn/8>Mn.length-rs)throw new Error("readUintLE: array is too short for the given bitLength");for(var is=0,os=1,as=rs;as<rs+Fn/8;as++)is+=Mn[as]*os,os*=256;return is}binary.readUintLE=readUintLE;function writeUintBE(Fn,Mn,rs,is){if(rs===void 0&&(rs=new Uint8Array(Fn/8)),is===void 0&&(is=0),Fn%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(Mn))throw new Error("writeUintBE value must be an integer");for(var os=1,as=Fn/8+is-1;as>=is;as--)rs[as]=Mn/os&255,os*=256;return rs}binary.writeUintBE=writeUintBE;function writeUintLE(Fn,Mn,rs,is){if(rs===void 0&&(rs=new Uint8Array(Fn/8)),is===void 0&&(is=0),Fn%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!int_1.isSafeInteger(Mn))throw new Error("writeUintLE value must be an integer");for(var os=1,as=is;as<is+Fn/8;as++)rs[as]=Mn/os&255,os*=256;return rs}binary.writeUintLE=writeUintLE;function readFloat32BE(Fn,Mn){Mn===void 0&&(Mn=0);var rs=new DataView(Fn.buffer,Fn.byteOffset,Fn.byteLength);return rs.getFloat32(Mn)}binary.readFloat32BE=readFloat32BE;function readFloat32LE(Fn,Mn){Mn===void 0&&(Mn=0);var rs=new DataView(Fn.buffer,Fn.byteOffset,Fn.byteLength);return rs.getFloat32(Mn,!0)}binary.readFloat32LE=readFloat32LE;function readFloat64BE(Fn,Mn){Mn===void 0&&(Mn=0);var rs=new DataView(Fn.buffer,Fn.byteOffset,Fn.byteLength);return rs.getFloat64(Mn)}binary.readFloat64BE=readFloat64BE;function readFloat64LE(Fn,Mn){Mn===void 0&&(Mn=0);var rs=new DataView(Fn.buffer,Fn.byteOffset,Fn.byteLength);return rs.getFloat64(Mn,!0)}binary.readFloat64LE=readFloat64LE;function writeFloat32BE(Fn,Mn,rs){Mn===void 0&&(Mn=new Uint8Array(4)),rs===void 0&&(rs=0);var is=new DataView(Mn.buffer,Mn.byteOffset,Mn.byteLength);return is.setFloat32(rs,Fn),Mn}binary.writeFloat32BE=writeFloat32BE;function writeFloat32LE(Fn,Mn,rs){Mn===void 0&&(Mn=new Uint8Array(4)),rs===void 0&&(rs=0);var is=new DataView(Mn.buffer,Mn.byteOffset,Mn.byteLength);return is.setFloat32(rs,Fn,!0),Mn}binary.writeFloat32LE=writeFloat32LE;function writeFloat64BE(Fn,Mn,rs){Mn===void 0&&(Mn=new Uint8Array(8)),rs===void 0&&(rs=0);var is=new DataView(Mn.buffer,Mn.byteOffset,Mn.byteLength);return is.setFloat64(rs,Fn),Mn}binary.writeFloat64BE=writeFloat64BE;function writeFloat64LE(Fn,Mn,rs){Mn===void 0&&(Mn=new Uint8Array(8)),rs===void 0&&(rs=0);var is=new DataView(Mn.buffer,Mn.byteOffset,Mn.byteLength);return is.setFloat64(rs,Fn,!0),Mn}binary.writeFloat64LE=writeFloat64LE;(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.randomStringForEntropy=Fn.randomString=Fn.randomUint32=Fn.randomBytes=Fn.defaultRandomSource=void 0;const Mn=system,rs=binary,is=wipe$1;Fn.defaultRandomSource=new Mn.SystemRandomSource;function os(ps,io=Fn.defaultRandomSource){return io.randomBytes(ps)}Fn.randomBytes=os;function as(ps=Fn.defaultRandomSource){const io=os(4,ps),fo=(0,rs.readUint32LE)(io);return(0,is.wipe)(io),fo}Fn.randomUint32=as;const us="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function ds(ps,io=us,fo=Fn.defaultRandomSource){if(io.length<2)throw new Error("randomString charset is too short");if(io.length>256)throw new Error("randomString charset is too long");let mo="";const Ao=io.length,$o=256-256%Ao;for(;ps>0;){const Lo=os(Math.ceil(ps*256/$o),fo);for(let Go=0;Go<Lo.length&&ps>0;Go++){const Yo=Lo[Go];Yo<$o&&(mo+=io.charAt(Yo%Ao),ps--)}(0,is.wipe)(Lo)}return mo}Fn.randomString=ds;function hs(ps,io=us,fo=Fn.defaultRandomSource){const mo=Math.ceil(ps/(Math.log(io.length)/Math.LN2));return ds(mo,io,fo)}Fn.randomStringForEntropy=hs})(random);var sha512={};(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});var Mn=binary,rs=wipe$1;Fn.DIGEST_LENGTH=64,Fn.BLOCK_SIZE=128;var is=function(){function ds(){this.digestLength=Fn.DIGEST_LENGTH,this.blockSize=Fn.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return ds.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},ds.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},ds.prototype.clean=function(){rs.wipe(this._buffer),rs.wipe(this._tempHi),rs.wipe(this._tempLo),this.reset()},ds.prototype.update=function(hs,ps){if(ps===void 0&&(ps=hs.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var io=0;if(this._bytesHashed+=ps,this._bufferLength>0){for(;this._bufferLength<Fn.BLOCK_SIZE&&ps>0;)this._buffer[this._bufferLength++]=hs[io++],ps--;this._bufferLength===this.blockSize&&(as(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(ps>=this.blockSize&&(io=as(this._tempHi,this._tempLo,this._stateHi,this._stateLo,hs,io,ps),ps%=this.blockSize);ps>0;)this._buffer[this._bufferLength++]=hs[io++],ps--;return this},ds.prototype.finish=function(hs){if(!this._finished){var ps=this._bytesHashed,io=this._bufferLength,fo=ps/536870912|0,mo=ps<<3,Ao=ps%128<112?128:256;this._buffer[io]=128;for(var $o=io+1;$o<Ao-8;$o++)this._buffer[$o]=0;Mn.writeUint32BE(fo,this._buffer,Ao-8),Mn.writeUint32BE(mo,this._buffer,Ao-4),as(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,Ao),this._finished=!0}for(var $o=0;$o<this.digestLength/8;$o++)Mn.writeUint32BE(this._stateHi[$o],hs,$o*8),Mn.writeUint32BE(this._stateLo[$o],hs,$o*8+4);return this},ds.prototype.digest=function(){var hs=new Uint8Array(this.digestLength);return this.finish(hs),hs},ds.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},ds.prototype.restoreState=function(hs){return this._stateHi.set(hs.stateHi),this._stateLo.set(hs.stateLo),this._bufferLength=hs.bufferLength,hs.buffer&&this._buffer.set(hs.buffer),this._bytesHashed=hs.bytesHashed,this._finished=!1,this},ds.prototype.cleanSavedState=function(hs){rs.wipe(hs.stateHi),rs.wipe(hs.stateLo),hs.buffer&&rs.wipe(hs.buffer),hs.bufferLength=0,hs.bytesHashed=0},ds}();Fn.SHA512=is;var os=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function as(ds,hs,ps,io,fo,mo,Ao){for(var $o=ps[0],Lo=ps[1],Go=ps[2],Yo=ps[3],Wo=ps[4],Jo=ps[5],xl=ps[6],_l=ps[7],Tl=io[0],Sl=io[1],$l=io[2],Pl=io[3],Dl=io[4],Ol=io[5],Rl=io[6],Vo=io[7],jo,Ho,Qo,El,Xo,Al,wl,yl;Ao>=128;){for(var Il=0;Il<16;Il++){var Bl=8*Il+mo;ds[Il]=Mn.readUint32BE(fo,Bl),hs[Il]=Mn.readUint32BE(fo,Bl+4)}for(var Il=0;Il<80;Il++){var Gl=$o,Nl=Lo,zl=Go,Vl=Yo,Hl=Wo,Yl=Jo,Ll=xl,Zl=_l,Xl=Tl,wu=Sl,yu=$l,rp=Pl,dp=Dl,up=Ol,wp=Rl,vp=Vo;if(jo=_l,Ho=Vo,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=(Wo>>>14|Dl<<18)^(Wo>>>18|Dl<<14)^(Dl>>>9|Wo<<23),Ho=(Dl>>>14|Wo<<18)^(Dl>>>18|Wo<<14)^(Wo>>>9|Dl<<23),Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,jo=Wo&Jo^~Wo&xl,Ho=Dl&Ol^~Dl&Rl,Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,jo=os[Il*2],Ho=os[Il*2+1],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,jo=ds[Il%16],Ho=hs[Il%16],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,Qo=wl&65535|yl<<16,El=Xo&65535|Al<<16,jo=Qo,Ho=El,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=($o>>>28|Tl<<4)^(Tl>>>2|$o<<30)^(Tl>>>7|$o<<25),Ho=(Tl>>>28|$o<<4)^($o>>>2|Tl<<30)^($o>>>7|Tl<<25),Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,jo=$o&Lo^$o&Go^Lo&Go,Ho=Tl&Sl^Tl&$l^Sl&$l,Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,Zl=wl&65535|yl<<16,vp=Xo&65535|Al<<16,jo=Vl,Ho=rp,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=Qo,Ho=El,Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,Vl=wl&65535|yl<<16,rp=Xo&65535|Al<<16,Lo=Gl,Go=Nl,Yo=zl,Wo=Vl,Jo=Hl,xl=Yl,_l=Ll,$o=Zl,Sl=Xl,$l=wu,Pl=yu,Dl=rp,Ol=dp,Rl=up,Vo=wp,Tl=vp,Il%16===15)for(var Bl=0;Bl<16;Bl++)jo=ds[Bl],Ho=hs[Bl],Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=ds[(Bl+9)%16],Ho=hs[(Bl+9)%16],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Qo=ds[(Bl+1)%16],El=hs[(Bl+1)%16],jo=(Qo>>>1|El<<31)^(Qo>>>8|El<<24)^Qo>>>7,Ho=(El>>>1|Qo<<31)^(El>>>8|Qo<<24)^(El>>>7|Qo<<25),Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Qo=ds[(Bl+14)%16],El=hs[(Bl+14)%16],jo=(Qo>>>19|El<<13)^(El>>>29|Qo<<3)^Qo>>>6,Ho=(El>>>19|Qo<<13)^(Qo>>>29|El<<3)^(El>>>6|Qo<<26),Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,ds[Bl]=wl&65535|yl<<16,hs[Bl]=Xo&65535|Al<<16}jo=$o,Ho=Tl,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=ps[0],Ho=io[0],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,ps[0]=$o=wl&65535|yl<<16,io[0]=Tl=Xo&65535|Al<<16,jo=Lo,Ho=Sl,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=ps[1],Ho=io[1],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,ps[1]=Lo=wl&65535|yl<<16,io[1]=Sl=Xo&65535|Al<<16,jo=Go,Ho=$l,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=ps[2],Ho=io[2],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,ps[2]=Go=wl&65535|yl<<16,io[2]=$l=Xo&65535|Al<<16,jo=Yo,Ho=Pl,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=ps[3],Ho=io[3],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,ps[3]=Yo=wl&65535|yl<<16,io[3]=Pl=Xo&65535|Al<<16,jo=Wo,Ho=Dl,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=ps[4],Ho=io[4],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,ps[4]=Wo=wl&65535|yl<<16,io[4]=Dl=Xo&65535|Al<<16,jo=Jo,Ho=Ol,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=ps[5],Ho=io[5],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,ps[5]=Jo=wl&65535|yl<<16,io[5]=Ol=Xo&65535|Al<<16,jo=xl,Ho=Rl,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=ps[6],Ho=io[6],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,ps[6]=xl=wl&65535|yl<<16,io[6]=Rl=Xo&65535|Al<<16,jo=_l,Ho=Vo,Xo=Ho&65535,Al=Ho>>>16,wl=jo&65535,yl=jo>>>16,jo=ps[7],Ho=io[7],Xo+=Ho&65535,Al+=Ho>>>16,wl+=jo&65535,yl+=jo>>>16,Al+=Xo>>>16,wl+=Al>>>16,yl+=wl>>>16,ps[7]=_l=wl&65535|yl<<16,io[7]=Vo=Xo&65535|Al<<16,mo+=128,Ao-=128}return mo}function us(ds){var hs=new is;hs.update(ds);var ps=hs.digest();return hs.clean(),ps}Fn.hash=us})(sha512);(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.convertSecretKeyToX25519=Fn.convertPublicKeyToX25519=Fn.verify=Fn.sign=Fn.extractPublicKeyFromSecretKey=Fn.generateKeyPair=Fn.generateKeyPairFromSeed=Fn.SEED_LENGTH=Fn.SECRET_KEY_LENGTH=Fn.PUBLIC_KEY_LENGTH=Fn.SIGNATURE_LENGTH=void 0;const Mn=random,rs=sha512,is=wipe$1;Fn.SIGNATURE_LENGTH=64,Fn.PUBLIC_KEY_LENGTH=32,Fn.SECRET_KEY_LENGTH=64,Fn.SEED_LENGTH=32;function os(Vl){const Hl=new Float64Array(16);if(Vl)for(let Yl=0;Yl<Vl.length;Yl++)Hl[Yl]=Vl[Yl];return Hl}const as=new Uint8Array(32);as[0]=9;const us=os(),ds=os([1]),hs=os([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),ps=os([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),io=os([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),fo=os([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),mo=os([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Ao(Vl,Hl){for(let Yl=0;Yl<16;Yl++)Vl[Yl]=Hl[Yl]|0}function $o(Vl){let Hl=1;for(let Yl=0;Yl<16;Yl++){let Ll=Vl[Yl]+Hl+65535;Hl=Math.floor(Ll/65536),Vl[Yl]=Ll-Hl*65536}Vl[0]+=Hl-1+37*(Hl-1)}function Lo(Vl,Hl,Yl){const Ll=~(Yl-1);for(let Zl=0;Zl<16;Zl++){const Xl=Ll&(Vl[Zl]^Hl[Zl]);Vl[Zl]^=Xl,Hl[Zl]^=Xl}}function Go(Vl,Hl){const Yl=os(),Ll=os();for(let Zl=0;Zl<16;Zl++)Ll[Zl]=Hl[Zl];$o(Ll),$o(Ll),$o(Ll);for(let Zl=0;Zl<2;Zl++){Yl[0]=Ll[0]-65517;for(let wu=1;wu<15;wu++)Yl[wu]=Ll[wu]-65535-(Yl[wu-1]>>16&1),Yl[wu-1]&=65535;Yl[15]=Ll[15]-32767-(Yl[14]>>16&1);const Xl=Yl[15]>>16&1;Yl[14]&=65535,Lo(Ll,Yl,1-Xl)}for(let Zl=0;Zl<16;Zl++)Vl[2*Zl]=Ll[Zl]&255,Vl[2*Zl+1]=Ll[Zl]>>8}function Yo(Vl,Hl){let Yl=0;for(let Ll=0;Ll<32;Ll++)Yl|=Vl[Ll]^Hl[Ll];return(1&Yl-1>>>8)-1}function Wo(Vl,Hl){const Yl=new Uint8Array(32),Ll=new Uint8Array(32);return Go(Yl,Vl),Go(Ll,Hl),Yo(Yl,Ll)}function Jo(Vl){const Hl=new Uint8Array(32);return Go(Hl,Vl),Hl[0]&1}function xl(Vl,Hl){for(let Yl=0;Yl<16;Yl++)Vl[Yl]=Hl[2*Yl]+(Hl[2*Yl+1]<<8);Vl[15]&=32767}function _l(Vl,Hl,Yl){for(let Ll=0;Ll<16;Ll++)Vl[Ll]=Hl[Ll]+Yl[Ll]}function Tl(Vl,Hl,Yl){for(let Ll=0;Ll<16;Ll++)Vl[Ll]=Hl[Ll]-Yl[Ll]}function Sl(Vl,Hl,Yl){let Ll,Zl,Xl=0,wu=0,yu=0,rp=0,dp=0,up=0,wp=0,vp=0,pp=0,cp=0,gp=0,mp=0,fp=0,hp=0,xp=0,Kl=0,Fl=0,Ul=0,Jl=0,fu=0,_d=0,tp=0,yp=0,_p=0,Sp=0,Ap=0,Op=0,Zp=0,Qp=0,Xp=0,h0=0,Wp=Yl[0],Np=Yl[1],Rp=Yl[2],Pp=Yl[3],Hp=Yl[4],kp=Yl[5],Gp=Yl[6],Yp=Yl[7],Mp=Yl[8],Ip=Yl[9],Dp=Yl[10],Lp=Yl[11],zp=Yl[12],Bp=Yl[13],qp=Yl[14],Vp=Yl[15];Ll=Hl[0],Xl+=Ll*Wp,wu+=Ll*Np,yu+=Ll*Rp,rp+=Ll*Pp,dp+=Ll*Hp,up+=Ll*kp,wp+=Ll*Gp,vp+=Ll*Yp,pp+=Ll*Mp,cp+=Ll*Ip,gp+=Ll*Dp,mp+=Ll*Lp,fp+=Ll*zp,hp+=Ll*Bp,xp+=Ll*qp,Kl+=Ll*Vp,Ll=Hl[1],wu+=Ll*Wp,yu+=Ll*Np,rp+=Ll*Rp,dp+=Ll*Pp,up+=Ll*Hp,wp+=Ll*kp,vp+=Ll*Gp,pp+=Ll*Yp,cp+=Ll*Mp,gp+=Ll*Ip,mp+=Ll*Dp,fp+=Ll*Lp,hp+=Ll*zp,xp+=Ll*Bp,Kl+=Ll*qp,Fl+=Ll*Vp,Ll=Hl[2],yu+=Ll*Wp,rp+=Ll*Np,dp+=Ll*Rp,up+=Ll*Pp,wp+=Ll*Hp,vp+=Ll*kp,pp+=Ll*Gp,cp+=Ll*Yp,gp+=Ll*Mp,mp+=Ll*Ip,fp+=Ll*Dp,hp+=Ll*Lp,xp+=Ll*zp,Kl+=Ll*Bp,Fl+=Ll*qp,Ul+=Ll*Vp,Ll=Hl[3],rp+=Ll*Wp,dp+=Ll*Np,up+=Ll*Rp,wp+=Ll*Pp,vp+=Ll*Hp,pp+=Ll*kp,cp+=Ll*Gp,gp+=Ll*Yp,mp+=Ll*Mp,fp+=Ll*Ip,hp+=Ll*Dp,xp+=Ll*Lp,Kl+=Ll*zp,Fl+=Ll*Bp,Ul+=Ll*qp,Jl+=Ll*Vp,Ll=Hl[4],dp+=Ll*Wp,up+=Ll*Np,wp+=Ll*Rp,vp+=Ll*Pp,pp+=Ll*Hp,cp+=Ll*kp,gp+=Ll*Gp,mp+=Ll*Yp,fp+=Ll*Mp,hp+=Ll*Ip,xp+=Ll*Dp,Kl+=Ll*Lp,Fl+=Ll*zp,Ul+=Ll*Bp,Jl+=Ll*qp,fu+=Ll*Vp,Ll=Hl[5],up+=Ll*Wp,wp+=Ll*Np,vp+=Ll*Rp,pp+=Ll*Pp,cp+=Ll*Hp,gp+=Ll*kp,mp+=Ll*Gp,fp+=Ll*Yp,hp+=Ll*Mp,xp+=Ll*Ip,Kl+=Ll*Dp,Fl+=Ll*Lp,Ul+=Ll*zp,Jl+=Ll*Bp,fu+=Ll*qp,_d+=Ll*Vp,Ll=Hl[6],wp+=Ll*Wp,vp+=Ll*Np,pp+=Ll*Rp,cp+=Ll*Pp,gp+=Ll*Hp,mp+=Ll*kp,fp+=Ll*Gp,hp+=Ll*Yp,xp+=Ll*Mp,Kl+=Ll*Ip,Fl+=Ll*Dp,Ul+=Ll*Lp,Jl+=Ll*zp,fu+=Ll*Bp,_d+=Ll*qp,tp+=Ll*Vp,Ll=Hl[7],vp+=Ll*Wp,pp+=Ll*Np,cp+=Ll*Rp,gp+=Ll*Pp,mp+=Ll*Hp,fp+=Ll*kp,hp+=Ll*Gp,xp+=Ll*Yp,Kl+=Ll*Mp,Fl+=Ll*Ip,Ul+=Ll*Dp,Jl+=Ll*Lp,fu+=Ll*zp,_d+=Ll*Bp,tp+=Ll*qp,yp+=Ll*Vp,Ll=Hl[8],pp+=Ll*Wp,cp+=Ll*Np,gp+=Ll*Rp,mp+=Ll*Pp,fp+=Ll*Hp,hp+=Ll*kp,xp+=Ll*Gp,Kl+=Ll*Yp,Fl+=Ll*Mp,Ul+=Ll*Ip,Jl+=Ll*Dp,fu+=Ll*Lp,_d+=Ll*zp,tp+=Ll*Bp,yp+=Ll*qp,_p+=Ll*Vp,Ll=Hl[9],cp+=Ll*Wp,gp+=Ll*Np,mp+=Ll*Rp,fp+=Ll*Pp,hp+=Ll*Hp,xp+=Ll*kp,Kl+=Ll*Gp,Fl+=Ll*Yp,Ul+=Ll*Mp,Jl+=Ll*Ip,fu+=Ll*Dp,_d+=Ll*Lp,tp+=Ll*zp,yp+=Ll*Bp,_p+=Ll*qp,Sp+=Ll*Vp,Ll=Hl[10],gp+=Ll*Wp,mp+=Ll*Np,fp+=Ll*Rp,hp+=Ll*Pp,xp+=Ll*Hp,Kl+=Ll*kp,Fl+=Ll*Gp,Ul+=Ll*Yp,Jl+=Ll*Mp,fu+=Ll*Ip,_d+=Ll*Dp,tp+=Ll*Lp,yp+=Ll*zp,_p+=Ll*Bp,Sp+=Ll*qp,Ap+=Ll*Vp,Ll=Hl[11],mp+=Ll*Wp,fp+=Ll*Np,hp+=Ll*Rp,xp+=Ll*Pp,Kl+=Ll*Hp,Fl+=Ll*kp,Ul+=Ll*Gp,Jl+=Ll*Yp,fu+=Ll*Mp,_d+=Ll*Ip,tp+=Ll*Dp,yp+=Ll*Lp,_p+=Ll*zp,Sp+=Ll*Bp,Ap+=Ll*qp,Op+=Ll*Vp,Ll=Hl[12],fp+=Ll*Wp,hp+=Ll*Np,xp+=Ll*Rp,Kl+=Ll*Pp,Fl+=Ll*Hp,Ul+=Ll*kp,Jl+=Ll*Gp,fu+=Ll*Yp,_d+=Ll*Mp,tp+=Ll*Ip,yp+=Ll*Dp,_p+=Ll*Lp,Sp+=Ll*zp,Ap+=Ll*Bp,Op+=Ll*qp,Zp+=Ll*Vp,Ll=Hl[13],hp+=Ll*Wp,xp+=Ll*Np,Kl+=Ll*Rp,Fl+=Ll*Pp,Ul+=Ll*Hp,Jl+=Ll*kp,fu+=Ll*Gp,_d+=Ll*Yp,tp+=Ll*Mp,yp+=Ll*Ip,_p+=Ll*Dp,Sp+=Ll*Lp,Ap+=Ll*zp,Op+=Ll*Bp,Zp+=Ll*qp,Qp+=Ll*Vp,Ll=Hl[14],xp+=Ll*Wp,Kl+=Ll*Np,Fl+=Ll*Rp,Ul+=Ll*Pp,Jl+=Ll*Hp,fu+=Ll*kp,_d+=Ll*Gp,tp+=Ll*Yp,yp+=Ll*Mp,_p+=Ll*Ip,Sp+=Ll*Dp,Ap+=Ll*Lp,Op+=Ll*zp,Zp+=Ll*Bp,Qp+=Ll*qp,Xp+=Ll*Vp,Ll=Hl[15],Kl+=Ll*Wp,Fl+=Ll*Np,Ul+=Ll*Rp,Jl+=Ll*Pp,fu+=Ll*Hp,_d+=Ll*kp,tp+=Ll*Gp,yp+=Ll*Yp,_p+=Ll*Mp,Sp+=Ll*Ip,Ap+=Ll*Dp,Op+=Ll*Lp,Zp+=Ll*zp,Qp+=Ll*Bp,Xp+=Ll*qp,h0+=Ll*Vp,Xl+=38*Fl,wu+=38*Ul,yu+=38*Jl,rp+=38*fu,dp+=38*_d,up+=38*tp,wp+=38*yp,vp+=38*_p,pp+=38*Sp,cp+=38*Ap,gp+=38*Op,mp+=38*Zp,fp+=38*Qp,hp+=38*Xp,xp+=38*h0,Zl=1,Ll=Xl+Zl+65535,Zl=Math.floor(Ll/65536),Xl=Ll-Zl*65536,Ll=wu+Zl+65535,Zl=Math.floor(Ll/65536),wu=Ll-Zl*65536,Ll=yu+Zl+65535,Zl=Math.floor(Ll/65536),yu=Ll-Zl*65536,Ll=rp+Zl+65535,Zl=Math.floor(Ll/65536),rp=Ll-Zl*65536,Ll=dp+Zl+65535,Zl=Math.floor(Ll/65536),dp=Ll-Zl*65536,Ll=up+Zl+65535,Zl=Math.floor(Ll/65536),up=Ll-Zl*65536,Ll=wp+Zl+65535,Zl=Math.floor(Ll/65536),wp=Ll-Zl*65536,Ll=vp+Zl+65535,Zl=Math.floor(Ll/65536),vp=Ll-Zl*65536,Ll=pp+Zl+65535,Zl=Math.floor(Ll/65536),pp=Ll-Zl*65536,Ll=cp+Zl+65535,Zl=Math.floor(Ll/65536),cp=Ll-Zl*65536,Ll=gp+Zl+65535,Zl=Math.floor(Ll/65536),gp=Ll-Zl*65536,Ll=mp+Zl+65535,Zl=Math.floor(Ll/65536),mp=Ll-Zl*65536,Ll=fp+Zl+65535,Zl=Math.floor(Ll/65536),fp=Ll-Zl*65536,Ll=hp+Zl+65535,Zl=Math.floor(Ll/65536),hp=Ll-Zl*65536,Ll=xp+Zl+65535,Zl=Math.floor(Ll/65536),xp=Ll-Zl*65536,Ll=Kl+Zl+65535,Zl=Math.floor(Ll/65536),Kl=Ll-Zl*65536,Xl+=Zl-1+37*(Zl-1),Zl=1,Ll=Xl+Zl+65535,Zl=Math.floor(Ll/65536),Xl=Ll-Zl*65536,Ll=wu+Zl+65535,Zl=Math.floor(Ll/65536),wu=Ll-Zl*65536,Ll=yu+Zl+65535,Zl=Math.floor(Ll/65536),yu=Ll-Zl*65536,Ll=rp+Zl+65535,Zl=Math.floor(Ll/65536),rp=Ll-Zl*65536,Ll=dp+Zl+65535,Zl=Math.floor(Ll/65536),dp=Ll-Zl*65536,Ll=up+Zl+65535,Zl=Math.floor(Ll/65536),up=Ll-Zl*65536,Ll=wp+Zl+65535,Zl=Math.floor(Ll/65536),wp=Ll-Zl*65536,Ll=vp+Zl+65535,Zl=Math.floor(Ll/65536),vp=Ll-Zl*65536,Ll=pp+Zl+65535,Zl=Math.floor(Ll/65536),pp=Ll-Zl*65536,Ll=cp+Zl+65535,Zl=Math.floor(Ll/65536),cp=Ll-Zl*65536,Ll=gp+Zl+65535,Zl=Math.floor(Ll/65536),gp=Ll-Zl*65536,Ll=mp+Zl+65535,Zl=Math.floor(Ll/65536),mp=Ll-Zl*65536,Ll=fp+Zl+65535,Zl=Math.floor(Ll/65536),fp=Ll-Zl*65536,Ll=hp+Zl+65535,Zl=Math.floor(Ll/65536),hp=Ll-Zl*65536,Ll=xp+Zl+65535,Zl=Math.floor(Ll/65536),xp=Ll-Zl*65536,Ll=Kl+Zl+65535,Zl=Math.floor(Ll/65536),Kl=Ll-Zl*65536,Xl+=Zl-1+37*(Zl-1),Vl[0]=Xl,Vl[1]=wu,Vl[2]=yu,Vl[3]=rp,Vl[4]=dp,Vl[5]=up,Vl[6]=wp,Vl[7]=vp,Vl[8]=pp,Vl[9]=cp,Vl[10]=gp,Vl[11]=mp,Vl[12]=fp,Vl[13]=hp,Vl[14]=xp,Vl[15]=Kl}function $l(Vl,Hl){Sl(Vl,Hl,Hl)}function Pl(Vl,Hl){const Yl=os();let Ll;for(Ll=0;Ll<16;Ll++)Yl[Ll]=Hl[Ll];for(Ll=253;Ll>=0;Ll--)$l(Yl,Yl),Ll!==2&&Ll!==4&&Sl(Yl,Yl,Hl);for(Ll=0;Ll<16;Ll++)Vl[Ll]=Yl[Ll]}function Dl(Vl,Hl){const Yl=os();let Ll;for(Ll=0;Ll<16;Ll++)Yl[Ll]=Hl[Ll];for(Ll=250;Ll>=0;Ll--)$l(Yl,Yl),Ll!==1&&Sl(Yl,Yl,Hl);for(Ll=0;Ll<16;Ll++)Vl[Ll]=Yl[Ll]}function Ol(Vl,Hl){const Yl=os(),Ll=os(),Zl=os(),Xl=os(),wu=os(),yu=os(),rp=os(),dp=os(),up=os();Tl(Yl,Vl[1],Vl[0]),Tl(up,Hl[1],Hl[0]),Sl(Yl,Yl,up),_l(Ll,Vl[0],Vl[1]),_l(up,Hl[0],Hl[1]),Sl(Ll,Ll,up),Sl(Zl,Vl[3],Hl[3]),Sl(Zl,Zl,ps),Sl(Xl,Vl[2],Hl[2]),_l(Xl,Xl,Xl),Tl(wu,Ll,Yl),Tl(yu,Xl,Zl),_l(rp,Xl,Zl),_l(dp,Ll,Yl),Sl(Vl[0],wu,yu),Sl(Vl[1],dp,rp),Sl(Vl[2],rp,yu),Sl(Vl[3],wu,dp)}function Rl(Vl,Hl,Yl){for(let Ll=0;Ll<4;Ll++)Lo(Vl[Ll],Hl[Ll],Yl)}function Vo(Vl,Hl){const Yl=os(),Ll=os(),Zl=os();Pl(Zl,Hl[2]),Sl(Yl,Hl[0],Zl),Sl(Ll,Hl[1],Zl),Go(Vl,Ll),Vl[31]^=Jo(Yl)<<7}function jo(Vl,Hl,Yl){Ao(Vl[0],us),Ao(Vl[1],ds),Ao(Vl[2],ds),Ao(Vl[3],us);for(let Ll=255;Ll>=0;--Ll){const Zl=Yl[Ll/8|0]>>(Ll&7)&1;Rl(Vl,Hl,Zl),Ol(Hl,Vl),Ol(Vl,Vl),Rl(Vl,Hl,Zl)}}function Ho(Vl,Hl){const Yl=[os(),os(),os(),os()];Ao(Yl[0],io),Ao(Yl[1],fo),Ao(Yl[2],ds),Sl(Yl[3],io,fo),jo(Vl,Yl,Hl)}function Qo(Vl){if(Vl.length!==Fn.SEED_LENGTH)throw new Error(`ed25519: seed must be ${Fn.SEED_LENGTH} bytes`);const Hl=(0,rs.hash)(Vl);Hl[0]&=248,Hl[31]&=127,Hl[31]|=64;const Yl=new Uint8Array(32),Ll=[os(),os(),os(),os()];Ho(Ll,Hl),Vo(Yl,Ll);const Zl=new Uint8Array(64);return Zl.set(Vl),Zl.set(Yl,32),{publicKey:Yl,secretKey:Zl}}Fn.generateKeyPairFromSeed=Qo;function El(Vl){const Hl=(0,Mn.randomBytes)(32,Vl),Yl=Qo(Hl);return(0,is.wipe)(Hl),Yl}Fn.generateKeyPair=El;function Xo(Vl){if(Vl.length!==Fn.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${Fn.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(Vl.subarray(32))}Fn.extractPublicKeyFromSecretKey=Xo;const Al=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function wl(Vl,Hl){let Yl,Ll,Zl,Xl;for(Ll=63;Ll>=32;--Ll){for(Yl=0,Zl=Ll-32,Xl=Ll-12;Zl<Xl;++Zl)Hl[Zl]+=Yl-16*Hl[Ll]*Al[Zl-(Ll-32)],Yl=Math.floor((Hl[Zl]+128)/256),Hl[Zl]-=Yl*256;Hl[Zl]+=Yl,Hl[Ll]=0}for(Yl=0,Zl=0;Zl<32;Zl++)Hl[Zl]+=Yl-(Hl[31]>>4)*Al[Zl],Yl=Hl[Zl]>>8,Hl[Zl]&=255;for(Zl=0;Zl<32;Zl++)Hl[Zl]-=Yl*Al[Zl];for(Ll=0;Ll<32;Ll++)Hl[Ll+1]+=Hl[Ll]>>8,Vl[Ll]=Hl[Ll]&255}function yl(Vl){const Hl=new Float64Array(64);for(let Yl=0;Yl<64;Yl++)Hl[Yl]=Vl[Yl];for(let Yl=0;Yl<64;Yl++)Vl[Yl]=0;wl(Vl,Hl)}function Il(Vl,Hl){const Yl=new Float64Array(64),Ll=[os(),os(),os(),os()],Zl=(0,rs.hash)(Vl.subarray(0,32));Zl[0]&=248,Zl[31]&=127,Zl[31]|=64;const Xl=new Uint8Array(64);Xl.set(Zl.subarray(32),32);const wu=new rs.SHA512;wu.update(Xl.subarray(32)),wu.update(Hl);const yu=wu.digest();wu.clean(),yl(yu),Ho(Ll,yu),Vo(Xl,Ll),wu.reset(),wu.update(Xl.subarray(0,32)),wu.update(Vl.subarray(32)),wu.update(Hl);const rp=wu.digest();yl(rp);for(let dp=0;dp<32;dp++)Yl[dp]=yu[dp];for(let dp=0;dp<32;dp++)for(let up=0;up<32;up++)Yl[dp+up]+=rp[dp]*Zl[up];return wl(Xl.subarray(32),Yl),Xl}Fn.sign=Il;function Bl(Vl,Hl){const Yl=os(),Ll=os(),Zl=os(),Xl=os(),wu=os(),yu=os(),rp=os();return Ao(Vl[2],ds),xl(Vl[1],Hl),$l(Zl,Vl[1]),Sl(Xl,Zl,hs),Tl(Zl,Zl,Vl[2]),_l(Xl,Vl[2],Xl),$l(wu,Xl),$l(yu,wu),Sl(rp,yu,wu),Sl(Yl,rp,Zl),Sl(Yl,Yl,Xl),Dl(Yl,Yl),Sl(Yl,Yl,Zl),Sl(Yl,Yl,Xl),Sl(Yl,Yl,Xl),Sl(Vl[0],Yl,Xl),$l(Ll,Vl[0]),Sl(Ll,Ll,Xl),Wo(Ll,Zl)&&Sl(Vl[0],Vl[0],mo),$l(Ll,Vl[0]),Sl(Ll,Ll,Xl),Wo(Ll,Zl)?-1:(Jo(Vl[0])===Hl[31]>>7&&Tl(Vl[0],us,Vl[0]),Sl(Vl[3],Vl[0],Vl[1]),0)}function Gl(Vl,Hl,Yl){const Ll=new Uint8Array(32),Zl=[os(),os(),os(),os()],Xl=[os(),os(),os(),os()];if(Yl.length!==Fn.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${Fn.SIGNATURE_LENGTH} bytes`);if(Bl(Xl,Vl))return!1;const wu=new rs.SHA512;wu.update(Yl.subarray(0,32)),wu.update(Vl),wu.update(Hl);const yu=wu.digest();return yl(yu),jo(Zl,Xl,yu),Ho(Xl,Yl.subarray(32)),Ol(Zl,Xl),Vo(Ll,Zl),!Yo(Yl,Ll)}Fn.verify=Gl;function Nl(Vl){let Hl=[os(),os(),os(),os()];if(Bl(Hl,Vl))throw new Error("Ed25519: invalid public key");let Yl=os(),Ll=os(),Zl=Hl[1];_l(Yl,ds,Zl),Tl(Ll,ds,Zl),Pl(Ll,Ll),Sl(Yl,Yl,Ll);let Xl=new Uint8Array(32);return Go(Xl,Yl),Xl}Fn.convertPublicKeyToX25519=Nl;function zl(Vl){const Hl=(0,rs.hash)(Vl.subarray(0,32));Hl[0]&=248,Hl[31]&=127,Hl[31]|=64;const Yl=new Uint8Array(Hl.subarray(0,32));return(0,is.wipe)(Hl),Yl}Fn.convertSecretKeyToX25519=zl})(ed25519);const JWT_IRIDIUM_ALG="EdDSA",JWT_IRIDIUM_TYP="JWT",JWT_DELIMITER=".",JWT_ENCODING="base64url",JSON_ENCODING="utf8",DATA_ENCODING="utf8",DID_DELIMITER=":",DID_PREFIX="did",DID_METHOD="key",MULTICODEC_ED25519_ENCODING="base58btc",MULTICODEC_ED25519_BASE="z",MULTICODEC_ED25519_HEADER="K36",KEY_PAIR_SEED_LENGTH=32;function asUint8Array(Fn){return globalThis.Buffer!=null?new Uint8Array(Fn.buffer,Fn.byteOffset,Fn.byteLength):Fn}function allocUnsafe$1(Fn=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?asUint8Array(globalThis.Buffer.allocUnsafe(Fn)):new Uint8Array(Fn)}function concat$1(Fn,Mn){Mn||(Mn=Fn.reduce((os,as)=>os+as.length,0));const rs=allocUnsafe$1(Mn);let is=0;for(const os of Fn)rs.set(os,is),is+=os.length;return asUint8Array(rs)}function base$1(Fn,Mn){if(Fn.length>=255)throw new TypeError("Alphabet too long");for(var rs=new Uint8Array(256),is=0;is<rs.length;is++)rs[is]=255;for(var os=0;os<Fn.length;os++){var as=Fn.charAt(os),us=as.charCodeAt(0);if(rs[us]!==255)throw new TypeError(as+" is ambiguous");rs[us]=os}var ds=Fn.length,hs=Fn.charAt(0),ps=Math.log(ds)/Math.log(256),io=Math.log(256)/Math.log(ds);function fo($o){if($o instanceof Uint8Array||(ArrayBuffer.isView($o)?$o=new Uint8Array($o.buffer,$o.byteOffset,$o.byteLength):Array.isArray($o)&&($o=Uint8Array.from($o))),!($o instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if($o.length===0)return"";for(var Lo=0,Go=0,Yo=0,Wo=$o.length;Yo!==Wo&&$o[Yo]===0;)Yo++,Lo++;for(var Jo=(Wo-Yo)*io+1>>>0,xl=new Uint8Array(Jo);Yo!==Wo;){for(var _l=$o[Yo],Tl=0,Sl=Jo-1;(_l!==0||Tl<Go)&&Sl!==-1;Sl--,Tl++)_l+=256*xl[Sl]>>>0,xl[Sl]=_l%ds>>>0,_l=_l/ds>>>0;if(_l!==0)throw new Error("Non-zero carry");Go=Tl,Yo++}for(var $l=Jo-Go;$l!==Jo&&xl[$l]===0;)$l++;for(var Pl=hs.repeat(Lo);$l<Jo;++$l)Pl+=Fn.charAt(xl[$l]);return Pl}function mo($o){if(typeof $o!="string")throw new TypeError("Expected String");if($o.length===0)return new Uint8Array;var Lo=0;if($o[Lo]!==" "){for(var Go=0,Yo=0;$o[Lo]===hs;)Go++,Lo++;for(var Wo=($o.length-Lo)*ps+1>>>0,Jo=new Uint8Array(Wo);$o[Lo];){var xl=rs[$o.charCodeAt(Lo)];if(xl===255)return;for(var _l=0,Tl=Wo-1;(xl!==0||_l<Yo)&&Tl!==-1;Tl--,_l++)xl+=ds*Jo[Tl]>>>0,Jo[Tl]=xl%256>>>0,xl=xl/256>>>0;if(xl!==0)throw new Error("Non-zero carry");Yo=_l,Lo++}if($o[Lo]!==" "){for(var Sl=Wo-Yo;Sl!==Wo&&Jo[Sl]===0;)Sl++;for(var $l=new Uint8Array(Go+(Wo-Sl)),Pl=Go;Sl!==Wo;)$l[Pl++]=Jo[Sl++];return $l}}}function Ao($o){var Lo=mo($o);if(Lo)return Lo;throw new Error(`Non-${Mn} character`)}return{encode:fo,decodeUnsafe:mo,decode:Ao}}var src$1=base$1,_brrp__multiformats_scope_baseX=src$1;const coerce=Fn=>{if(Fn instanceof Uint8Array&&Fn.constructor.name==="Uint8Array")return Fn;if(Fn instanceof ArrayBuffer)return new Uint8Array(Fn);if(ArrayBuffer.isView(Fn))return new Uint8Array(Fn.buffer,Fn.byteOffset,Fn.byteLength);throw new Error("Unknown type, must be binary type")},fromString$2=Fn=>new TextEncoder().encode(Fn),toString$2=Fn=>new TextDecoder().decode(Fn);class Encoder{constructor(Mn,rs,is){this.name=Mn,this.prefix=rs,this.baseEncode=is}encode(Mn){if(Mn instanceof Uint8Array)return`${this.prefix}${this.baseEncode(Mn)}`;throw Error("Unknown type, must be binary type")}}class Decoder{constructor(Mn,rs,is){if(this.name=Mn,this.prefix=rs,rs.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=rs.codePointAt(0),this.baseDecode=is}decode(Mn){if(typeof Mn=="string"){if(Mn.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(Mn)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(Mn.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(Mn){return or$2(this,Mn)}}class ComposedDecoder{constructor(Mn){this.decoders=Mn}or(Mn){return or$2(this,Mn)}decode(Mn){const rs=Mn[0],is=this.decoders[rs];if(is)return is.decode(Mn);throw RangeError(`Unable to decode multibase string ${JSON.stringify(Mn)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const or$2=(Fn,Mn)=>new ComposedDecoder({...Fn.decoders||{[Fn.prefix]:Fn},...Mn.decoders||{[Mn.prefix]:Mn}});class Codec{constructor(Mn,rs,is,os){this.name=Mn,this.prefix=rs,this.baseEncode=is,this.baseDecode=os,this.encoder=new Encoder(Mn,rs,is),this.decoder=new Decoder(Mn,rs,os)}encode(Mn){return this.encoder.encode(Mn)}decode(Mn){return this.decoder.decode(Mn)}}const from$1=({name:Fn,prefix:Mn,encode:rs,decode:is})=>new Codec(Fn,Mn,rs,is),baseX=({prefix:Fn,name:Mn,alphabet:rs})=>{const{encode:is,decode:os}=_brrp__multiformats_scope_baseX(rs,Mn);return from$1({prefix:Fn,name:Mn,encode:is,decode:as=>coerce(os(as))})},decode$2=(Fn,Mn,rs,is)=>{const os={};for(let io=0;io<Mn.length;++io)os[Mn[io]]=io;let as=Fn.length;for(;Fn[as-1]==="=";)--as;const us=new Uint8Array(as*rs/8|0);let ds=0,hs=0,ps=0;for(let io=0;io<as;++io){const fo=os[Fn[io]];if(fo===void 0)throw new SyntaxError(`Non-${is} character`);hs=hs<<rs|fo,ds+=rs,ds>=8&&(ds-=8,us[ps++]=255&hs>>ds)}if(ds>=rs||255&hs<<8-ds)throw new SyntaxError("Unexpected end of data");return us},encode$1=(Fn,Mn,rs)=>{const is=Mn[Mn.length-1]==="=",os=(1<<rs)-1;let as="",us=0,ds=0;for(let hs=0;hs<Fn.length;++hs)for(ds=ds<<8|Fn[hs],us+=8;us>rs;)us-=rs,as+=Mn[os&ds>>us];if(us&&(as+=Mn[os&ds<<rs-us]),is)for(;as.length*rs&7;)as+="=";return as},rfc4648=({name:Fn,prefix:Mn,bitsPerChar:rs,alphabet:is})=>from$1({prefix:Mn,name:Fn,encode(os){return encode$1(os,is,rs)},decode(os){return decode$2(os,is,rs,Fn)}}),identity=from$1({prefix:"\0",name:"identity",encode:Fn=>toString$2(Fn),decode:Fn=>fromString$2(Fn)}),identityBase=Object.freeze(Object.defineProperty({__proto__:null,identity},Symbol.toStringTag,{value:"Module"})),base2=rfc4648({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$1=Object.freeze(Object.defineProperty({__proto__:null,base2},Symbol.toStringTag,{value:"Module"})),base8=rfc4648({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$1=Object.freeze(Object.defineProperty({__proto__:null,base8},Symbol.toStringTag,{value:"Module"})),base10=baseX({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$1=Object.freeze(Object.defineProperty({__proto__:null,base10},Symbol.toStringTag,{value:"Module"})),base16=rfc4648({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper=rfc4648({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$1=Object.freeze(Object.defineProperty({__proto__:null,base16,base16upper},Symbol.toStringTag,{value:"Module"})),base32=rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper=rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad=rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper=rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex=rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper=rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad=rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper=rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z=rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$1=Object.freeze(Object.defineProperty({__proto__:null,base32,base32hex,base32hexpad,base32hexpadupper,base32hexupper,base32pad,base32padupper,base32upper,base32z},Symbol.toStringTag,{value:"Module"})),base36=baseX({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper=baseX({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$1=Object.freeze(Object.defineProperty({__proto__:null,base36,base36upper},Symbol.toStringTag,{value:"Module"})),base58btc=baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr=baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58=Object.freeze(Object.defineProperty({__proto__:null,base58btc,base58flickr},Symbol.toStringTag,{value:"Module"})),base64=rfc4648({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad=rfc4648({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url=rfc4648({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad=rfc4648({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$1=Object.freeze(Object.defineProperty({__proto__:null,base64,base64pad,base64url,base64urlpad},Symbol.toStringTag,{value:"Module"})),alphabet=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars=alphabet.reduce((Fn,Mn,rs)=>(Fn[rs]=Mn,Fn),[]),alphabetCharsToBytes=alphabet.reduce((Fn,Mn,rs)=>(Fn[Mn.codePointAt(0)]=rs,Fn),[]);function encode(Fn){return Fn.reduce((Mn,rs)=>(Mn+=alphabetBytesToChars[rs],Mn),"")}function decode$1(Fn){const Mn=[];for(const rs of Fn){const is=alphabetCharsToBytes[rs.codePointAt(0)];if(is===void 0)throw new Error(`Non-base256emoji character: ${rs}`);Mn.push(is)}return new Uint8Array(Mn)}const base256emoji=from$1({prefix:"🚀",name:"base256emoji",encode,decode:decode$1}),base256emoji$1=Object.freeze(Object.defineProperty({__proto__:null,base256emoji},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases={...identityBase,...base2$1,...base8$1,...base10$1,...base16$1,...base32$1,...base36$1,...base58,...base64$1,...base256emoji$1};function createCodec$1(Fn,Mn,rs,is){return{name:Fn,prefix:Mn,encoder:{name:Fn,prefix:Mn,encode:rs},decoder:{decode:is}}}const string$2=createCodec$1("utf8","u",Fn=>"u"+new TextDecoder("utf8").decode(Fn),Fn=>new TextEncoder().encode(Fn.substring(1))),ascii$1=createCodec$1("ascii","a",Fn=>{let Mn="a";for(let rs=0;rs<Fn.length;rs++)Mn+=String.fromCharCode(Fn[rs]);return Mn},Fn=>{Fn=Fn.substring(1);const Mn=allocUnsafe$1(Fn.length);for(let rs=0;rs<Fn.length;rs++)Mn[rs]=Fn.charCodeAt(rs);return Mn}),BASES$1={utf8:string$2,"utf-8":string$2,hex:bases.base16,latin1:ascii$1,ascii:ascii$1,binary:ascii$1,...bases};function toString$1(Fn,Mn="utf8"){const rs=BASES$1[Mn];if(!rs)throw new Error(`Unsupported encoding "${Mn}"`);return(Mn==="utf8"||Mn==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(Fn.buffer,Fn.byteOffset,Fn.byteLength).toString("utf8"):rs.encoder.encode(Fn).substring(1)}function fromString$1(Fn,Mn="utf8"){const rs=BASES$1[Mn];if(!rs)throw new Error(`Unsupported encoding "${Mn}"`);return(Mn==="utf8"||Mn==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?asUint8Array(globalThis.Buffer.from(Fn,"utf-8")):rs.decoder.decode(`${rs.prefix}${Fn}`)}function decodeJSON(Fn){return safeJsonParse(toString$1(fromString$1(Fn,JWT_ENCODING),JSON_ENCODING))}function encodeJSON(Fn){return toString$1(fromString$1(safeJsonStringify(Fn),JSON_ENCODING),JWT_ENCODING)}function encodeIss(Fn){const Mn=fromString$1(MULTICODEC_ED25519_HEADER,MULTICODEC_ED25519_ENCODING),rs=MULTICODEC_ED25519_BASE+toString$1(concat$1([Mn,Fn]),MULTICODEC_ED25519_ENCODING);return[DID_PREFIX,DID_METHOD,rs].join(DID_DELIMITER)}function encodeSig(Fn){return toString$1(Fn,JWT_ENCODING)}function decodeSig(Fn){return fromString$1(Fn,JWT_ENCODING)}function encodeData(Fn){return fromString$1([encodeJSON(Fn.header),encodeJSON(Fn.payload)].join(JWT_DELIMITER),DATA_ENCODING)}function encodeJWT(Fn){return[encodeJSON(Fn.header),encodeJSON(Fn.payload),encodeSig(Fn.signature)].join(JWT_DELIMITER)}function decodeJWT(Fn){const Mn=Fn.split(JWT_DELIMITER),rs=decodeJSON(Mn[0]),is=decodeJSON(Mn[1]),os=decodeSig(Mn[2]),as=fromString$1(Mn.slice(0,2).join(JWT_DELIMITER),DATA_ENCODING);return{header:rs,payload:is,signature:os,data:as}}function generateKeyPair(Fn=random.randomBytes(KEY_PAIR_SEED_LENGTH)){return ed25519.generateKeyPairFromSeed(Fn)}async function signJWT(Fn,Mn,rs,is,os=cjs$4.fromMiliseconds(Date.now())){const as={alg:JWT_IRIDIUM_ALG,typ:JWT_IRIDIUM_TYP},us=encodeIss(is.publicKey),ds=os+rs,hs={iss:us,sub:Fn,aud:Mn,iat:os,exp:ds},ps=encodeData({header:as,payload:hs}),io=ed25519.sign(is.secretKey,ps);return encodeJWT({header:as,payload:hs,signature:io})}var __spreadArray=function(Fn,Mn,rs){if(rs||arguments.length===2)for(var is=0,os=Mn.length,as;is<os;is++)(as||!(is in Mn))&&(as||(as=Array.prototype.slice.call(Mn,0,is)),as[is]=Mn[is]);return Fn.concat(as||Array.prototype.slice.call(Mn))},BrowserInfo=function(){function Fn(Mn,rs,is){this.name=Mn,this.version=rs,this.os=is,this.type="browser"}return Fn}(),NodeInfo=function(){function Fn(Mn){this.version=Mn,this.type="node",this.name="node",this.os=browser$1$1.platform}return Fn}(),SearchBotDeviceInfo=function(){function Fn(Mn,rs,is,os){this.name=Mn,this.version=rs,this.os=is,this.bot=os,this.type="bot-device"}return Fn}(),BotInfo=function(){function Fn(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return Fn}(),ReactNativeInfo=function(){function Fn(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return Fn}(),SEARCHBOX_UA_REGEX=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,SEARCHBOT_OS_REGEX=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,REQUIRED_VERSION_PARTS=3,userAgentRules=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",SEARCHBOX_UA_REGEX]],operatingSystemRules=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function detect(Fn){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ReactNativeInfo:typeof navigator<"u"?parseUserAgent(navigator.userAgent):getNodeVersion()}function matchUserAgent(Fn){return Fn!==""&&userAgentRules.reduce(function(Mn,rs){var is=rs[0],os=rs[1];if(Mn)return Mn;var as=os.exec(Fn);return!!as&&[is,as]},!1)}function parseUserAgent(Fn){var Mn=matchUserAgent(Fn);if(!Mn)return null;var rs=Mn[0],is=Mn[1];if(rs==="searchbot")return new BotInfo;var os=is[1]&&is[1].split(".").join("_").split("_").slice(0,3);os?os.length<REQUIRED_VERSION_PARTS&&(os=__spreadArray(__spreadArray([],os,!0),createVersionParts(REQUIRED_VERSION_PARTS-os.length),!0)):os=[];var as=os.join("."),us=detectOS(Fn),ds=SEARCHBOT_OS_REGEX.exec(Fn);return ds&&ds[1]?new SearchBotDeviceInfo(rs,as,us,ds[1]):new BrowserInfo(rs,as,us)}function detectOS(Fn){for(var Mn=0,rs=operatingSystemRules.length;Mn<rs;Mn++){var is=operatingSystemRules[Mn],os=is[0],as=is[1],us=as.exec(Fn);if(us)return os}return null}function getNodeVersion(){var Fn=typeof browser$1$1<"u"&&browser$1$1.version;return Fn?new NodeInfo(browser$1$1.version.slice(1)):null}function createVersionParts(Fn){for(var Mn=[],rs=0;rs<Fn;rs++)Mn.push("0");return Mn}var cjs$3={};Object.defineProperty(cjs$3,"__esModule",{value:!0});cjs$3.getLocalStorage=cjs$3.getLocalStorageOrThrow=cjs$3.getCrypto=cjs$3.getCryptoOrThrow=getLocation_1=cjs$3.getLocation=cjs$3.getLocationOrThrow=getNavigator_1=cjs$3.getNavigator=cjs$3.getNavigatorOrThrow=getDocument_1=cjs$3.getDocument=cjs$3.getDocumentOrThrow=cjs$3.getFromWindowOrThrow=cjs$3.getFromWindow=void 0;function getFromWindow(Fn){let Mn;return typeof window<"u"&&typeof window[Fn]<"u"&&(Mn=window[Fn]),Mn}cjs$3.getFromWindow=getFromWindow;function getFromWindowOrThrow(Fn){const Mn=getFromWindow(Fn);if(!Mn)throw new Error(`${Fn} is not defined in Window`);return Mn}cjs$3.getFromWindowOrThrow=getFromWindowOrThrow;function getDocumentOrThrow(){return getFromWindowOrThrow("document")}cjs$3.getDocumentOrThrow=getDocumentOrThrow;function getDocument(){return getFromWindow("document")}var getDocument_1=cjs$3.getDocument=getDocument;function getNavigatorOrThrow(){return getFromWindowOrThrow("navigator")}cjs$3.getNavigatorOrThrow=getNavigatorOrThrow;function getNavigator(){return getFromWindow("navigator")}var getNavigator_1=cjs$3.getNavigator=getNavigator;function getLocationOrThrow(){return getFromWindowOrThrow("location")}cjs$3.getLocationOrThrow=getLocationOrThrow;function getLocation(){return getFromWindow("location")}var getLocation_1=cjs$3.getLocation=getLocation;function getCryptoOrThrow(){return getFromWindowOrThrow("crypto")}cjs$3.getCryptoOrThrow=getCryptoOrThrow;function getCrypto(){return getFromWindow("crypto")}cjs$3.getCrypto=getCrypto;function getLocalStorageOrThrow(){return getFromWindowOrThrow("localStorage")}cjs$3.getLocalStorageOrThrow=getLocalStorageOrThrow;function getLocalStorage(){return getFromWindow("localStorage")}cjs$3.getLocalStorage=getLocalStorage;var cjs$2={};Object.defineProperty(cjs$2,"__esModule",{value:!0});var getWindowMetadata_1=cjs$2.getWindowMetadata=void 0;const window_getters_1=cjs$3;function getWindowMetadata(){let Fn,Mn;try{Fn=window_getters_1.getDocumentOrThrow(),Mn=window_getters_1.getLocationOrThrow()}catch{return null}function rs(){const fo=Fn.getElementsByTagName("link"),mo=[];for(let Ao=0;Ao<fo.length;Ao++){const $o=fo[Ao],Lo=$o.getAttribute("rel");if(Lo&&Lo.toLowerCase().indexOf("icon")>-1){const Go=$o.getAttribute("href");if(Go)if(Go.toLowerCase().indexOf("https:")===-1&&Go.toLowerCase().indexOf("http:")===-1&&Go.indexOf("//")!==0){let Yo=Mn.protocol+"//"+Mn.host;if(Go.indexOf("/")===0)Yo+=Go;else{const Wo=Mn.pathname.split("/");Wo.pop();const Jo=Wo.join("/");Yo+=Jo+"/"+Go}mo.push(Yo)}else if(Go.indexOf("//")===0){const Yo=Mn.protocol+Go;mo.push(Yo)}else mo.push(Go)}}return mo}function is(...fo){const mo=Fn.getElementsByTagName("meta");for(let Ao=0;Ao<mo.length;Ao++){const $o=mo[Ao],Lo=["itemprop","property","name"].map(Go=>$o.getAttribute(Go)).filter(Go=>Go?fo.includes(Go):!1);if(Lo.length&&Lo){const Go=$o.getAttribute("content");if(Go)return Go}}return""}function os(){let fo=is("name","og:site_name","og:title","twitter:title");return fo||(fo=Fn.title),fo}function as(){return is("description","og:description","twitter:description","keywords")}const us=os(),ds=as(),hs=Mn.origin,ps=rs();return{description:ds,url:hs,icons:ps,name:us}}getWindowMetadata_1=cjs$2.getWindowMetadata=getWindowMetadata;var queryString$1={},strictUriEncode=Fn=>encodeURIComponent(Fn).replace(/[!'()*]/g,Mn=>`%${Mn.charCodeAt(0).toString(16).toUpperCase()}`),token="%[a-f0-9]{2}",singleMatcher=new RegExp("("+token+")|([^%]+?)","gi"),multiMatcher=new RegExp("("+token+")+","gi");function decodeComponents(Fn,Mn){try{return[decodeURIComponent(Fn.join(""))]}catch{}if(Fn.length===1)return Fn;Mn=Mn||1;var rs=Fn.slice(0,Mn),is=Fn.slice(Mn);return Array.prototype.concat.call([],decodeComponents(rs),decodeComponents(is))}function decode(Fn){try{return decodeURIComponent(Fn)}catch{for(var Mn=Fn.match(singleMatcher)||[],rs=1;rs<Mn.length;rs++)Fn=decodeComponents(Mn,rs).join(""),Mn=Fn.match(singleMatcher)||[];return Fn}}function customDecodeURIComponent(Fn){for(var Mn={"%FE%FF":"��","%FF%FE":"��"},rs=multiMatcher.exec(Fn);rs;){try{Mn[rs[0]]=decodeURIComponent(rs[0])}catch{var is=decode(rs[0]);is!==rs[0]&&(Mn[rs[0]]=is)}rs=multiMatcher.exec(Fn)}Mn["%C2"]="�";for(var os=Object.keys(Mn),as=0;as<os.length;as++){var us=os[as];Fn=Fn.replace(new RegExp(us,"g"),Mn[us])}return Fn}var decodeUriComponent=function(Fn){if(typeof Fn!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof Fn+"`");try{return Fn=Fn.replace(/\+/g," "),decodeURIComponent(Fn)}catch{return customDecodeURIComponent(Fn)}},splitOnFirst=(Fn,Mn)=>{if(!(typeof Fn=="string"&&typeof Mn=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(Mn==="")return[Fn];const rs=Fn.indexOf(Mn);return rs===-1?[Fn]:[Fn.slice(0,rs),Fn.slice(rs+Mn.length)]},filterObj=function(Fn,Mn){for(var rs={},is=Object.keys(Fn),os=Array.isArray(Mn),as=0;as<is.length;as++){var us=is[as],ds=Fn[us];(os?Mn.indexOf(us)!==-1:Mn(us,ds,Fn))&&(rs[us]=ds)}return rs};(function(Fn){const Mn=strictUriEncode,rs=decodeUriComponent,is=splitOnFirst,os=filterObj,as=Wo=>Wo==null,us=Symbol("encodeFragmentIdentifier");function ds(Wo){switch(Wo.arrayFormat){case"index":return Jo=>(xl,_l)=>{const Tl=xl.length;return _l===void 0||Wo.skipNull&&_l===null||Wo.skipEmptyString&&_l===""?xl:_l===null?[...xl,[io(Jo,Wo),"[",Tl,"]"].join("")]:[...xl,[io(Jo,Wo),"[",io(Tl,Wo),"]=",io(_l,Wo)].join("")]};case"bracket":return Jo=>(xl,_l)=>_l===void 0||Wo.skipNull&&_l===null||Wo.skipEmptyString&&_l===""?xl:_l===null?[...xl,[io(Jo,Wo),"[]"].join("")]:[...xl,[io(Jo,Wo),"[]=",io(_l,Wo)].join("")];case"colon-list-separator":return Jo=>(xl,_l)=>_l===void 0||Wo.skipNull&&_l===null||Wo.skipEmptyString&&_l===""?xl:_l===null?[...xl,[io(Jo,Wo),":list="].join("")]:[...xl,[io(Jo,Wo),":list=",io(_l,Wo)].join("")];case"comma":case"separator":case"bracket-separator":{const Jo=Wo.arrayFormat==="bracket-separator"?"[]=":"=";return xl=>(_l,Tl)=>Tl===void 0||Wo.skipNull&&Tl===null||Wo.skipEmptyString&&Tl===""?_l:(Tl=Tl===null?"":Tl,_l.length===0?[[io(xl,Wo),Jo,io(Tl,Wo)].join("")]:[[_l,io(Tl,Wo)].join(Wo.arrayFormatSeparator)])}default:return Jo=>(xl,_l)=>_l===void 0||Wo.skipNull&&_l===null||Wo.skipEmptyString&&_l===""?xl:_l===null?[...xl,io(Jo,Wo)]:[...xl,[io(Jo,Wo),"=",io(_l,Wo)].join("")]}}function hs(Wo){let Jo;switch(Wo.arrayFormat){case"index":return(xl,_l,Tl)=>{if(Jo=/\[(\d*)\]$/.exec(xl),xl=xl.replace(/\[\d*\]$/,""),!Jo){Tl[xl]=_l;return}Tl[xl]===void 0&&(Tl[xl]={}),Tl[xl][Jo[1]]=_l};case"bracket":return(xl,_l,Tl)=>{if(Jo=/(\[\])$/.exec(xl),xl=xl.replace(/\[\]$/,""),!Jo){Tl[xl]=_l;return}if(Tl[xl]===void 0){Tl[xl]=[_l];return}Tl[xl]=[].concat(Tl[xl],_l)};case"colon-list-separator":return(xl,_l,Tl)=>{if(Jo=/(:list)$/.exec(xl),xl=xl.replace(/:list$/,""),!Jo){Tl[xl]=_l;return}if(Tl[xl]===void 0){Tl[xl]=[_l];return}Tl[xl]=[].concat(Tl[xl],_l)};case"comma":case"separator":return(xl,_l,Tl)=>{const Sl=typeof _l=="string"&&_l.includes(Wo.arrayFormatSeparator),$l=typeof _l=="string"&&!Sl&&fo(_l,Wo).includes(Wo.arrayFormatSeparator);_l=$l?fo(_l,Wo):_l;const Pl=Sl||$l?_l.split(Wo.arrayFormatSeparator).map(Dl=>fo(Dl,Wo)):_l===null?_l:fo(_l,Wo);Tl[xl]=Pl};case"bracket-separator":return(xl,_l,Tl)=>{const Sl=/(\[\])$/.test(xl);if(xl=xl.replace(/\[\]$/,""),!Sl){Tl[xl]=_l&&fo(_l,Wo);return}const $l=_l===null?[]:_l.split(Wo.arrayFormatSeparator).map(Pl=>fo(Pl,Wo));if(Tl[xl]===void 0){Tl[xl]=$l;return}Tl[xl]=[].concat(Tl[xl],$l)};default:return(xl,_l,Tl)=>{if(Tl[xl]===void 0){Tl[xl]=_l;return}Tl[xl]=[].concat(Tl[xl],_l)}}}function ps(Wo){if(typeof Wo!="string"||Wo.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function io(Wo,Jo){return Jo.encode?Jo.strict?Mn(Wo):encodeURIComponent(Wo):Wo}function fo(Wo,Jo){return Jo.decode?rs(Wo):Wo}function mo(Wo){return Array.isArray(Wo)?Wo.sort():typeof Wo=="object"?mo(Object.keys(Wo)).sort((Jo,xl)=>Number(Jo)-Number(xl)).map(Jo=>Wo[Jo]):Wo}function Ao(Wo){const Jo=Wo.indexOf("#");return Jo!==-1&&(Wo=Wo.slice(0,Jo)),Wo}function $o(Wo){let Jo="";const xl=Wo.indexOf("#");return xl!==-1&&(Jo=Wo.slice(xl)),Jo}function Lo(Wo){Wo=Ao(Wo);const Jo=Wo.indexOf("?");return Jo===-1?"":Wo.slice(Jo+1)}function Go(Wo,Jo){return Jo.parseNumbers&&!Number.isNaN(Number(Wo))&&typeof Wo=="string"&&Wo.trim()!==""?Wo=Number(Wo):Jo.parseBooleans&&Wo!==null&&(Wo.toLowerCase()==="true"||Wo.toLowerCase()==="false")&&(Wo=Wo.toLowerCase()==="true"),Wo}function Yo(Wo,Jo){Jo=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},Jo),ps(Jo.arrayFormatSeparator);const xl=hs(Jo),_l=Object.create(null);if(typeof Wo!="string"||(Wo=Wo.trim().replace(/^[?#&]/,""),!Wo))return _l;for(const Tl of Wo.split("&")){if(Tl==="")continue;let[Sl,$l]=is(Jo.decode?Tl.replace(/\+/g," "):Tl,"=");$l=$l===void 0?null:["comma","separator","bracket-separator"].includes(Jo.arrayFormat)?$l:fo($l,Jo),xl(fo(Sl,Jo),$l,_l)}for(const Tl of Object.keys(_l)){const Sl=_l[Tl];if(typeof Sl=="object"&&Sl!==null)for(const $l of Object.keys(Sl))Sl[$l]=Go(Sl[$l],Jo);else _l[Tl]=Go(Sl,Jo)}return Jo.sort===!1?_l:(Jo.sort===!0?Object.keys(_l).sort():Object.keys(_l).sort(Jo.sort)).reduce((Tl,Sl)=>{const $l=_l[Sl];return $l&&typeof $l=="object"&&!Array.isArray($l)?Tl[Sl]=mo($l):Tl[Sl]=$l,Tl},Object.create(null))}Fn.extract=Lo,Fn.parse=Yo,Fn.stringify=(Wo,Jo)=>{if(!Wo)return"";Jo=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},Jo),ps(Jo.arrayFormatSeparator);const xl=$l=>Jo.skipNull&&as(Wo[$l])||Jo.skipEmptyString&&Wo[$l]==="",_l=ds(Jo),Tl={};for(const $l of Object.keys(Wo))xl($l)||(Tl[$l]=Wo[$l]);const Sl=Object.keys(Tl);return Jo.sort!==!1&&Sl.sort(Jo.sort),Sl.map($l=>{const Pl=Wo[$l];return Pl===void 0?"":Pl===null?io($l,Jo):Array.isArray(Pl)?Pl.length===0&&Jo.arrayFormat==="bracket-separator"?io($l,Jo)+"[]":Pl.reduce(_l($l),[]).join("&"):io($l,Jo)+"="+io(Pl,Jo)}).filter($l=>$l.length>0).join("&")},Fn.parseUrl=(Wo,Jo)=>{Jo=Object.assign({decode:!0},Jo);const[xl,_l]=is(Wo,"#");return Object.assign({url:xl.split("?")[0]||"",query:Yo(Lo(Wo),Jo)},Jo&&Jo.parseFragmentIdentifier&&_l?{fragmentIdentifier:fo(_l,Jo)}:{})},Fn.stringifyUrl=(Wo,Jo)=>{Jo=Object.assign({encode:!0,strict:!0,[us]:!0},Jo);const xl=Ao(Wo.url).split("?")[0]||"",_l=Fn.extract(Wo.url),Tl=Fn.parse(_l,{sort:!1}),Sl=Object.assign(Tl,Wo.query);let $l=Fn.stringify(Sl,Jo);$l&&($l=`?${$l}`);let Pl=$o(Wo.url);return Wo.fragmentIdentifier&&(Pl=`#${Jo[us]?io(Wo.fragmentIdentifier,Jo):Wo.fragmentIdentifier}`),`${xl}${$l}${Pl}`},Fn.pick=(Wo,Jo,xl)=>{xl=Object.assign({parseFragmentIdentifier:!0,[us]:!1},xl);const{url:_l,query:Tl,fragmentIdentifier:Sl}=Fn.parseUrl(Wo,xl);return Fn.stringifyUrl({url:_l,query:os(Tl,Jo),fragmentIdentifier:Sl},xl)},Fn.exclude=(Wo,Jo,xl)=>{const _l=Array.isArray(Jo)?Tl=>!Jo.includes(Tl):(Tl,Sl)=>!Jo(Tl,Sl);return Fn.pick(Wo,_l,xl)}})(queryString$1);var chacha20poly1305={},chacha={};Object.defineProperty(chacha,"__esModule",{value:!0});var binary_1=binary,wipe_1$2=wipe$1,ROUNDS=20;function core(Fn,Mn,rs){for(var is=1634760805,os=857760878,as=2036477234,us=1797285236,ds=rs[3]<<24|rs[2]<<16|rs[1]<<8|rs[0],hs=rs[7]<<24|rs[6]<<16|rs[5]<<8|rs[4],ps=rs[11]<<24|rs[10]<<16|rs[9]<<8|rs[8],io=rs[15]<<24|rs[14]<<16|rs[13]<<8|rs[12],fo=rs[19]<<24|rs[18]<<16|rs[17]<<8|rs[16],mo=rs[23]<<24|rs[22]<<16|rs[21]<<8|rs[20],Ao=rs[27]<<24|rs[26]<<16|rs[25]<<8|rs[24],$o=rs[31]<<24|rs[30]<<16|rs[29]<<8|rs[28],Lo=Mn[3]<<24|Mn[2]<<16|Mn[1]<<8|Mn[0],Go=Mn[7]<<24|Mn[6]<<16|Mn[5]<<8|Mn[4],Yo=Mn[11]<<24|Mn[10]<<16|Mn[9]<<8|Mn[8],Wo=Mn[15]<<24|Mn[14]<<16|Mn[13]<<8|Mn[12],Jo=is,xl=os,_l=as,Tl=us,Sl=ds,$l=hs,Pl=ps,Dl=io,Ol=fo,Rl=mo,Vo=Ao,jo=$o,Ho=Lo,Qo=Go,El=Yo,Xo=Wo,Al=0;Al<ROUNDS;Al+=2)Jo=Jo+Sl|0,Ho^=Jo,Ho=Ho>>>16|Ho<<16,Ol=Ol+Ho|0,Sl^=Ol,Sl=Sl>>>20|Sl<<12,xl=xl+$l|0,Qo^=xl,Qo=Qo>>>16|Qo<<16,Rl=Rl+Qo|0,$l^=Rl,$l=$l>>>20|$l<<12,_l=_l+Pl|0,El^=_l,El=El>>>16|El<<16,Vo=Vo+El|0,Pl^=Vo,Pl=Pl>>>20|Pl<<12,Tl=Tl+Dl|0,Xo^=Tl,Xo=Xo>>>16|Xo<<16,jo=jo+Xo|0,Dl^=jo,Dl=Dl>>>20|Dl<<12,_l=_l+Pl|0,El^=_l,El=El>>>24|El<<8,Vo=Vo+El|0,Pl^=Vo,Pl=Pl>>>25|Pl<<7,Tl=Tl+Dl|0,Xo^=Tl,Xo=Xo>>>24|Xo<<8,jo=jo+Xo|0,Dl^=jo,Dl=Dl>>>25|Dl<<7,xl=xl+$l|0,Qo^=xl,Qo=Qo>>>24|Qo<<8,Rl=Rl+Qo|0,$l^=Rl,$l=$l>>>25|$l<<7,Jo=Jo+Sl|0,Ho^=Jo,Ho=Ho>>>24|Ho<<8,Ol=Ol+Ho|0,Sl^=Ol,Sl=Sl>>>25|Sl<<7,Jo=Jo+$l|0,Xo^=Jo,Xo=Xo>>>16|Xo<<16,Vo=Vo+Xo|0,$l^=Vo,$l=$l>>>20|$l<<12,xl=xl+Pl|0,Ho^=xl,Ho=Ho>>>16|Ho<<16,jo=jo+Ho|0,Pl^=jo,Pl=Pl>>>20|Pl<<12,_l=_l+Dl|0,Qo^=_l,Qo=Qo>>>16|Qo<<16,Ol=Ol+Qo|0,Dl^=Ol,Dl=Dl>>>20|Dl<<12,Tl=Tl+Sl|0,El^=Tl,El=El>>>16|El<<16,Rl=Rl+El|0,Sl^=Rl,Sl=Sl>>>20|Sl<<12,_l=_l+Dl|0,Qo^=_l,Qo=Qo>>>24|Qo<<8,Ol=Ol+Qo|0,Dl^=Ol,Dl=Dl>>>25|Dl<<7,Tl=Tl+Sl|0,El^=Tl,El=El>>>24|El<<8,Rl=Rl+El|0,Sl^=Rl,Sl=Sl>>>25|Sl<<7,xl=xl+Pl|0,Ho^=xl,Ho=Ho>>>24|Ho<<8,jo=jo+Ho|0,Pl^=jo,Pl=Pl>>>25|Pl<<7,Jo=Jo+$l|0,Xo^=Jo,Xo=Xo>>>24|Xo<<8,Vo=Vo+Xo|0,$l^=Vo,$l=$l>>>25|$l<<7;binary_1.writeUint32LE(Jo+is|0,Fn,0),binary_1.writeUint32LE(xl+os|0,Fn,4),binary_1.writeUint32LE(_l+as|0,Fn,8),binary_1.writeUint32LE(Tl+us|0,Fn,12),binary_1.writeUint32LE(Sl+ds|0,Fn,16),binary_1.writeUint32LE($l+hs|0,Fn,20),binary_1.writeUint32LE(Pl+ps|0,Fn,24),binary_1.writeUint32LE(Dl+io|0,Fn,28),binary_1.writeUint32LE(Ol+fo|0,Fn,32),binary_1.writeUint32LE(Rl+mo|0,Fn,36),binary_1.writeUint32LE(Vo+Ao|0,Fn,40),binary_1.writeUint32LE(jo+$o|0,Fn,44),binary_1.writeUint32LE(Ho+Lo|0,Fn,48),binary_1.writeUint32LE(Qo+Go|0,Fn,52),binary_1.writeUint32LE(El+Yo|0,Fn,56),binary_1.writeUint32LE(Xo+Wo|0,Fn,60)}function streamXOR(Fn,Mn,rs,is,os){if(os===void 0&&(os=0),Fn.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(is.length<rs.length)throw new Error("ChaCha: destination is shorter than source");var as,us;if(os===0){if(Mn.length!==8&&Mn.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");as=new Uint8Array(16),us=as.length-Mn.length,as.set(Mn,us)}else{if(Mn.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");as=Mn,us=os}for(var ds=new Uint8Array(64),hs=0;hs<rs.length;hs+=64){core(ds,as,Fn);for(var ps=hs;ps<hs+64&&ps<rs.length;ps++)is[ps]=rs[ps]^ds[ps-hs];incrementCounter(as,0,us)}return wipe_1$2.wipe(ds),os===0&&wipe_1$2.wipe(as),is}chacha.streamXOR=streamXOR;function stream(Fn,Mn,rs,is){return is===void 0&&(is=0),wipe_1$2.wipe(rs),streamXOR(Fn,Mn,rs,rs,is)}chacha.stream=stream;function incrementCounter(Fn,Mn,rs){for(var is=1;rs--;)is=is+(Fn[Mn]&255)|0,Fn[Mn]=is&255,is>>>=8,Mn++;if(is>0)throw new Error("ChaCha: counter overflow")}var poly1305={},constantTime={};Object.defineProperty(constantTime,"__esModule",{value:!0});function select(Fn,Mn,rs){return~(Fn-1)&Mn|Fn-1&rs}constantTime.select=select;function lessOrEqual(Fn,Mn){return(Fn|0)-(Mn|0)-1>>>31&1}constantTime.lessOrEqual=lessOrEqual;function compare(Fn,Mn){if(Fn.length!==Mn.length)return 0;for(var rs=0,is=0;is<Fn.length;is++)rs|=Fn[is]^Mn[is];return 1&rs-1>>>8}constantTime.compare=compare;function equal$1(Fn,Mn){return Fn.length===0||Mn.length===0?!1:compare(Fn,Mn)!==0}constantTime.equal=equal$1;(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});var Mn=constantTime,rs=wipe$1;Fn.DIGEST_LENGTH=16;var is=function(){function us(ds){this.digestLength=Fn.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var hs=ds[0]|ds[1]<<8;this._r[0]=hs&8191;var ps=ds[2]|ds[3]<<8;this._r[1]=(hs>>>13|ps<<3)&8191;var io=ds[4]|ds[5]<<8;this._r[2]=(ps>>>10|io<<6)&7939;var fo=ds[6]|ds[7]<<8;this._r[3]=(io>>>7|fo<<9)&8191;var mo=ds[8]|ds[9]<<8;this._r[4]=(fo>>>4|mo<<12)&255,this._r[5]=mo>>>1&8190;var Ao=ds[10]|ds[11]<<8;this._r[6]=(mo>>>14|Ao<<2)&8191;var $o=ds[12]|ds[13]<<8;this._r[7]=(Ao>>>11|$o<<5)&8065;var Lo=ds[14]|ds[15]<<8;this._r[8]=($o>>>8|Lo<<8)&8191,this._r[9]=Lo>>>5&127,this._pad[0]=ds[16]|ds[17]<<8,this._pad[1]=ds[18]|ds[19]<<8,this._pad[2]=ds[20]|ds[21]<<8,this._pad[3]=ds[22]|ds[23]<<8,this._pad[4]=ds[24]|ds[25]<<8,this._pad[5]=ds[26]|ds[27]<<8,this._pad[6]=ds[28]|ds[29]<<8,this._pad[7]=ds[30]|ds[31]<<8}return us.prototype._blocks=function(ds,hs,ps){for(var io=this._fin?0:2048,fo=this._h[0],mo=this._h[1],Ao=this._h[2],$o=this._h[3],Lo=this._h[4],Go=this._h[5],Yo=this._h[6],Wo=this._h[7],Jo=this._h[8],xl=this._h[9],_l=this._r[0],Tl=this._r[1],Sl=this._r[2],$l=this._r[3],Pl=this._r[4],Dl=this._r[5],Ol=this._r[6],Rl=this._r[7],Vo=this._r[8],jo=this._r[9];ps>=16;){var Ho=ds[hs+0]|ds[hs+1]<<8;fo+=Ho&8191;var Qo=ds[hs+2]|ds[hs+3]<<8;mo+=(Ho>>>13|Qo<<3)&8191;var El=ds[hs+4]|ds[hs+5]<<8;Ao+=(Qo>>>10|El<<6)&8191;var Xo=ds[hs+6]|ds[hs+7]<<8;$o+=(El>>>7|Xo<<9)&8191;var Al=ds[hs+8]|ds[hs+9]<<8;Lo+=(Xo>>>4|Al<<12)&8191,Go+=Al>>>1&8191;var wl=ds[hs+10]|ds[hs+11]<<8;Yo+=(Al>>>14|wl<<2)&8191;var yl=ds[hs+12]|ds[hs+13]<<8;Wo+=(wl>>>11|yl<<5)&8191;var Il=ds[hs+14]|ds[hs+15]<<8;Jo+=(yl>>>8|Il<<8)&8191,xl+=Il>>>5|io;var Bl=0,Gl=Bl;Gl+=fo*_l,Gl+=mo*(5*jo),Gl+=Ao*(5*Vo),Gl+=$o*(5*Rl),Gl+=Lo*(5*Ol),Bl=Gl>>>13,Gl&=8191,Gl+=Go*(5*Dl),Gl+=Yo*(5*Pl),Gl+=Wo*(5*$l),Gl+=Jo*(5*Sl),Gl+=xl*(5*Tl),Bl+=Gl>>>13,Gl&=8191;var Nl=Bl;Nl+=fo*Tl,Nl+=mo*_l,Nl+=Ao*(5*jo),Nl+=$o*(5*Vo),Nl+=Lo*(5*Rl),Bl=Nl>>>13,Nl&=8191,Nl+=Go*(5*Ol),Nl+=Yo*(5*Dl),Nl+=Wo*(5*Pl),Nl+=Jo*(5*$l),Nl+=xl*(5*Sl),Bl+=Nl>>>13,Nl&=8191;var zl=Bl;zl+=fo*Sl,zl+=mo*Tl,zl+=Ao*_l,zl+=$o*(5*jo),zl+=Lo*(5*Vo),Bl=zl>>>13,zl&=8191,zl+=Go*(5*Rl),zl+=Yo*(5*Ol),zl+=Wo*(5*Dl),zl+=Jo*(5*Pl),zl+=xl*(5*$l),Bl+=zl>>>13,zl&=8191;var Vl=Bl;Vl+=fo*$l,Vl+=mo*Sl,Vl+=Ao*Tl,Vl+=$o*_l,Vl+=Lo*(5*jo),Bl=Vl>>>13,Vl&=8191,Vl+=Go*(5*Vo),Vl+=Yo*(5*Rl),Vl+=Wo*(5*Ol),Vl+=Jo*(5*Dl),Vl+=xl*(5*Pl),Bl+=Vl>>>13,Vl&=8191;var Hl=Bl;Hl+=fo*Pl,Hl+=mo*$l,Hl+=Ao*Sl,Hl+=$o*Tl,Hl+=Lo*_l,Bl=Hl>>>13,Hl&=8191,Hl+=Go*(5*jo),Hl+=Yo*(5*Vo),Hl+=Wo*(5*Rl),Hl+=Jo*(5*Ol),Hl+=xl*(5*Dl),Bl+=Hl>>>13,Hl&=8191;var Yl=Bl;Yl+=fo*Dl,Yl+=mo*Pl,Yl+=Ao*$l,Yl+=$o*Sl,Yl+=Lo*Tl,Bl=Yl>>>13,Yl&=8191,Yl+=Go*_l,Yl+=Yo*(5*jo),Yl+=Wo*(5*Vo),Yl+=Jo*(5*Rl),Yl+=xl*(5*Ol),Bl+=Yl>>>13,Yl&=8191;var Ll=Bl;Ll+=fo*Ol,Ll+=mo*Dl,Ll+=Ao*Pl,Ll+=$o*$l,Ll+=Lo*Sl,Bl=Ll>>>13,Ll&=8191,Ll+=Go*Tl,Ll+=Yo*_l,Ll+=Wo*(5*jo),Ll+=Jo*(5*Vo),Ll+=xl*(5*Rl),Bl+=Ll>>>13,Ll&=8191;var Zl=Bl;Zl+=fo*Rl,Zl+=mo*Ol,Zl+=Ao*Dl,Zl+=$o*Pl,Zl+=Lo*$l,Bl=Zl>>>13,Zl&=8191,Zl+=Go*Sl,Zl+=Yo*Tl,Zl+=Wo*_l,Zl+=Jo*(5*jo),Zl+=xl*(5*Vo),Bl+=Zl>>>13,Zl&=8191;var Xl=Bl;Xl+=fo*Vo,Xl+=mo*Rl,Xl+=Ao*Ol,Xl+=$o*Dl,Xl+=Lo*Pl,Bl=Xl>>>13,Xl&=8191,Xl+=Go*$l,Xl+=Yo*Sl,Xl+=Wo*Tl,Xl+=Jo*_l,Xl+=xl*(5*jo),Bl+=Xl>>>13,Xl&=8191;var wu=Bl;wu+=fo*jo,wu+=mo*Vo,wu+=Ao*Rl,wu+=$o*Ol,wu+=Lo*Dl,Bl=wu>>>13,wu&=8191,wu+=Go*Pl,wu+=Yo*$l,wu+=Wo*Sl,wu+=Jo*Tl,wu+=xl*_l,Bl+=wu>>>13,wu&=8191,Bl=(Bl<<2)+Bl|0,Bl=Bl+Gl|0,Gl=Bl&8191,Bl=Bl>>>13,Nl+=Bl,fo=Gl,mo=Nl,Ao=zl,$o=Vl,Lo=Hl,Go=Yl,Yo=Ll,Wo=Zl,Jo=Xl,xl=wu,hs+=16,ps-=16}this._h[0]=fo,this._h[1]=mo,this._h[2]=Ao,this._h[3]=$o,this._h[4]=Lo,this._h[5]=Go,this._h[6]=Yo,this._h[7]=Wo,this._h[8]=Jo,this._h[9]=xl},us.prototype.finish=function(ds,hs){hs===void 0&&(hs=0);var ps=new Uint16Array(10),io,fo,mo,Ao;if(this._leftover){for(Ao=this._leftover,this._buffer[Ao++]=1;Ao<16;Ao++)this._buffer[Ao]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(io=this._h[1]>>>13,this._h[1]&=8191,Ao=2;Ao<10;Ao++)this._h[Ao]+=io,io=this._h[Ao]>>>13,this._h[Ao]&=8191;for(this._h[0]+=io*5,io=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=io,io=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=io,ps[0]=this._h[0]+5,io=ps[0]>>>13,ps[0]&=8191,Ao=1;Ao<10;Ao++)ps[Ao]=this._h[Ao]+io,io=ps[Ao]>>>13,ps[Ao]&=8191;for(ps[9]-=8192,fo=(io^1)-1,Ao=0;Ao<10;Ao++)ps[Ao]&=fo;for(fo=~fo,Ao=0;Ao<10;Ao++)this._h[Ao]=this._h[Ao]&fo|ps[Ao];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,mo=this._h[0]+this._pad[0],this._h[0]=mo&65535,Ao=1;Ao<8;Ao++)mo=(this._h[Ao]+this._pad[Ao]|0)+(mo>>>16)|0,this._h[Ao]=mo&65535;return ds[hs+0]=this._h[0]>>>0,ds[hs+1]=this._h[0]>>>8,ds[hs+2]=this._h[1]>>>0,ds[hs+3]=this._h[1]>>>8,ds[hs+4]=this._h[2]>>>0,ds[hs+5]=this._h[2]>>>8,ds[hs+6]=this._h[3]>>>0,ds[hs+7]=this._h[3]>>>8,ds[hs+8]=this._h[4]>>>0,ds[hs+9]=this._h[4]>>>8,ds[hs+10]=this._h[5]>>>0,ds[hs+11]=this._h[5]>>>8,ds[hs+12]=this._h[6]>>>0,ds[hs+13]=this._h[6]>>>8,ds[hs+14]=this._h[7]>>>0,ds[hs+15]=this._h[7]>>>8,this._finished=!0,this},us.prototype.update=function(ds){var hs=0,ps=ds.length,io;if(this._leftover){io=16-this._leftover,io>ps&&(io=ps);for(var fo=0;fo<io;fo++)this._buffer[this._leftover+fo]=ds[hs+fo];if(ps-=io,hs+=io,this._leftover+=io,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(ps>=16&&(io=ps-ps%16,this._blocks(ds,hs,io),hs+=io,ps-=io),ps){for(var fo=0;fo<ps;fo++)this._buffer[this._leftover+fo]=ds[hs+fo];this._leftover+=ps}return this},us.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var ds=new Uint8Array(16);return this.finish(ds),ds},us.prototype.clean=function(){return rs.wipe(this._buffer),rs.wipe(this._r),rs.wipe(this._h),rs.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},us}();Fn.Poly1305=is;function os(us,ds){var hs=new is(us);hs.update(ds);var ps=hs.digest();return hs.clean(),ps}Fn.oneTimeAuth=os;function as(us,ds){return us.length!==Fn.DIGEST_LENGTH||ds.length!==Fn.DIGEST_LENGTH?!1:Mn.equal(us,ds)}Fn.equal=as})(poly1305);(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});var Mn=chacha,rs=poly1305,is=wipe$1,os=binary,as=constantTime;Fn.KEY_LENGTH=32,Fn.NONCE_LENGTH=12,Fn.TAG_LENGTH=16;var us=new Uint8Array(16),ds=function(){function hs(ps){if(this.nonceLength=Fn.NONCE_LENGTH,this.tagLength=Fn.TAG_LENGTH,ps.length!==Fn.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(ps)}return hs.prototype.seal=function(ps,io,fo,mo){if(ps.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var Ao=new Uint8Array(16);Ao.set(ps,Ao.length-ps.length);var $o=new Uint8Array(32);Mn.stream(this._key,Ao,$o,4);var Lo=io.length+this.tagLength,Go;if(mo){if(mo.length!==Lo)throw new Error("ChaCha20Poly1305: incorrect destination length");Go=mo}else Go=new Uint8Array(Lo);return Mn.streamXOR(this._key,Ao,io,Go,4),this._authenticate(Go.subarray(Go.length-this.tagLength,Go.length),$o,Go.subarray(0,Go.length-this.tagLength),fo),is.wipe(Ao),Go},hs.prototype.open=function(ps,io,fo,mo){if(ps.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(io.length<this.tagLength)return null;var Ao=new Uint8Array(16);Ao.set(ps,Ao.length-ps.length);var $o=new Uint8Array(32);Mn.stream(this._key,Ao,$o,4);var Lo=new Uint8Array(this.tagLength);if(this._authenticate(Lo,$o,io.subarray(0,io.length-this.tagLength),fo),!as.equal(Lo,io.subarray(io.length-this.tagLength,io.length)))return null;var Go=io.length-this.tagLength,Yo;if(mo){if(mo.length!==Go)throw new Error("ChaCha20Poly1305: incorrect destination length");Yo=mo}else Yo=new Uint8Array(Go);return Mn.streamXOR(this._key,Ao,io.subarray(0,io.length-this.tagLength),Yo,4),is.wipe(Ao),Yo},hs.prototype.clean=function(){return is.wipe(this._key),this},hs.prototype._authenticate=function(ps,io,fo,mo){var Ao=new rs.Poly1305(io);mo&&(Ao.update(mo),mo.length%16>0&&Ao.update(us.subarray(mo.length%16))),Ao.update(fo),fo.length%16>0&&Ao.update(us.subarray(fo.length%16));var $o=new Uint8Array(8);mo&&os.writeUint64LE(mo.length,$o),Ao.update($o),os.writeUint64LE(fo.length,$o),Ao.update($o);for(var Lo=Ao.digest(),Go=0;Go<Lo.length;Go++)ps[Go]=Lo[Go];Ao.clean(),is.wipe(Lo),is.wipe($o)},hs}();Fn.ChaCha20Poly1305=ds})(chacha20poly1305);var hkdf={},hmac$1={},hash$2={};Object.defineProperty(hash$2,"__esModule",{value:!0});function isSerializableHash(Fn){return typeof Fn.saveState<"u"&&typeof Fn.restoreState<"u"&&typeof Fn.cleanSavedState<"u"}hash$2.isSerializableHash=isSerializableHash;Object.defineProperty(hmac$1,"__esModule",{value:!0});var hash_1=hash$2,constant_time_1=constantTime,wipe_1$1=wipe$1,HMAC=function(){function Fn(Mn,rs){this._finished=!1,this._inner=new Mn,this._outer=new Mn,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var is=new Uint8Array(this.blockSize);rs.length>this.blockSize?this._inner.update(rs).finish(is).clean():is.set(rs);for(var os=0;os<is.length;os++)is[os]^=54;this._inner.update(is);for(var os=0;os<is.length;os++)is[os]^=106;this._outer.update(is),hash_1.isSerializableHash(this._inner)&&hash_1.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),wipe_1$1.wipe(is)}return Fn.prototype.reset=function(){if(!hash_1.isSerializableHash(this._inner)||!hash_1.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},Fn.prototype.clean=function(){hash_1.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),hash_1.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},Fn.prototype.update=function(Mn){return this._inner.update(Mn),this},Fn.prototype.finish=function(Mn){return this._finished?(this._outer.finish(Mn),this):(this._inner.finish(Mn),this._outer.update(Mn.subarray(0,this.digestLength)).finish(Mn),this._finished=!0,this)},Fn.prototype.digest=function(){var Mn=new Uint8Array(this.digestLength);return this.finish(Mn),Mn},Fn.prototype.saveState=function(){if(!hash_1.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},Fn.prototype.restoreState=function(Mn){if(!hash_1.isSerializableHash(this._inner)||!hash_1.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(Mn),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},Fn.prototype.cleanSavedState=function(Mn){if(!hash_1.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(Mn)},Fn}();hmac$1.HMAC=HMAC;function hmac(Fn,Mn,rs){var is=new HMAC(Fn,Mn);is.update(rs);var os=is.digest();return is.clean(),os}hmac$1.hmac=hmac;hmac$1.equal=constant_time_1.equal;Object.defineProperty(hkdf,"__esModule",{value:!0});var hmac_1=hmac$1,wipe_1=wipe$1,HKDF=function(){function Fn(Mn,rs,is,os){is===void 0&&(is=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=Mn,this._info=os;var as=hmac_1.hmac(this._hash,is,rs);this._hmac=new hmac_1.HMAC(Mn,as),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return Fn.prototype._fillBuffer=function(){this._counter[0]++;var Mn=this._counter[0];if(Mn===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),Mn>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},Fn.prototype.expand=function(Mn){for(var rs=new Uint8Array(Mn),is=0;is<rs.length;is++)this._bufpos===this._buffer.length&&this._fillBuffer(),rs[is]=this._buffer[this._bufpos++];return rs},Fn.prototype.clean=function(){this._hmac.clean(),wipe_1.wipe(this._buffer),wipe_1.wipe(this._counter),this._bufpos=0},Fn}(),HKDF_1=hkdf.HKDF=HKDF,sha256={};(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});var Mn=binary,rs=wipe$1;Fn.DIGEST_LENGTH=32,Fn.BLOCK_SIZE=64;var is=function(){function ds(){this.digestLength=Fn.DIGEST_LENGTH,this.blockSize=Fn.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return ds.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},ds.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},ds.prototype.clean=function(){rs.wipe(this._buffer),rs.wipe(this._temp),this.reset()},ds.prototype.update=function(hs,ps){if(ps===void 0&&(ps=hs.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var io=0;if(this._bytesHashed+=ps,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&ps>0;)this._buffer[this._bufferLength++]=hs[io++],ps--;this._bufferLength===this.blockSize&&(as(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(ps>=this.blockSize&&(io=as(this._temp,this._state,hs,io,ps),ps%=this.blockSize);ps>0;)this._buffer[this._bufferLength++]=hs[io++],ps--;return this},ds.prototype.finish=function(hs){if(!this._finished){var ps=this._bytesHashed,io=this._bufferLength,fo=ps/536870912|0,mo=ps<<3,Ao=ps%64<56?64:128;this._buffer[io]=128;for(var $o=io+1;$o<Ao-8;$o++)this._buffer[$o]=0;Mn.writeUint32BE(fo,this._buffer,Ao-8),Mn.writeUint32BE(mo,this._buffer,Ao-4),as(this._temp,this._state,this._buffer,0,Ao),this._finished=!0}for(var $o=0;$o<this.digestLength/4;$o++)Mn.writeUint32BE(this._state[$o],hs,$o*4);return this},ds.prototype.digest=function(){var hs=new Uint8Array(this.digestLength);return this.finish(hs),hs},ds.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},ds.prototype.restoreState=function(hs){return this._state.set(hs.state),this._bufferLength=hs.bufferLength,hs.buffer&&this._buffer.set(hs.buffer),this._bytesHashed=hs.bytesHashed,this._finished=!1,this},ds.prototype.cleanSavedState=function(hs){rs.wipe(hs.state),hs.buffer&&rs.wipe(hs.buffer),hs.bufferLength=0,hs.bytesHashed=0},ds}();Fn.SHA256=is;var os=new Int32Array([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]);function as(ds,hs,ps,io,fo){for(;fo>=64;){for(var mo=hs[0],Ao=hs[1],$o=hs[2],Lo=hs[3],Go=hs[4],Yo=hs[5],Wo=hs[6],Jo=hs[7],xl=0;xl<16;xl++){var _l=io+xl*4;ds[xl]=Mn.readUint32BE(ps,_l)}for(var xl=16;xl<64;xl++){var Tl=ds[xl-2],Sl=(Tl>>>17|Tl<<15)^(Tl>>>19|Tl<<13)^Tl>>>10;Tl=ds[xl-15];var $l=(Tl>>>7|Tl<<25)^(Tl>>>18|Tl<<14)^Tl>>>3;ds[xl]=(Sl+ds[xl-7]|0)+($l+ds[xl-16]|0)}for(var xl=0;xl<64;xl++){var Sl=(((Go>>>6|Go<<26)^(Go>>>11|Go<<21)^(Go>>>25|Go<<7))+(Go&Yo^~Go&Wo)|0)+(Jo+(os[xl]+ds[xl]|0)|0)|0,$l=((mo>>>2|mo<<30)^(mo>>>13|mo<<19)^(mo>>>22|mo<<10))+(mo&Ao^mo&$o^Ao&$o)|0;Jo=Wo,Wo=Yo,Yo=Go,Go=Lo+Sl|0,Lo=$o,$o=Ao,Ao=mo,mo=Sl+$l|0}hs[0]+=mo,hs[1]+=Ao,hs[2]+=$o,hs[3]+=Lo,hs[4]+=Go,hs[5]+=Yo,hs[6]+=Wo,hs[7]+=Jo,io+=64,fo-=64}return io}function us(ds){var hs=new is;hs.update(ds);var ps=hs.digest();return hs.clean(),ps}Fn.hash=us})(sha256);var x25519={};(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.sharedKey=Fn.generateKeyPair=Fn.generateKeyPairFromSeed=Fn.scalarMultBase=Fn.scalarMult=Fn.SHARED_KEY_LENGTH=Fn.SECRET_KEY_LENGTH=Fn.PUBLIC_KEY_LENGTH=void 0;const Mn=random,rs=wipe$1;Fn.PUBLIC_KEY_LENGTH=32,Fn.SECRET_KEY_LENGTH=32,Fn.SHARED_KEY_LENGTH=32;function is(xl){const _l=new Float64Array(16);if(xl)for(let Tl=0;Tl<xl.length;Tl++)_l[Tl]=xl[Tl];return _l}const os=new Uint8Array(32);os[0]=9;const as=is([56129,1]);function us(xl){let _l=1;for(let Tl=0;Tl<16;Tl++){let Sl=xl[Tl]+_l+65535;_l=Math.floor(Sl/65536),xl[Tl]=Sl-_l*65536}xl[0]+=_l-1+37*(_l-1)}function ds(xl,_l,Tl){const Sl=~(Tl-1);for(let $l=0;$l<16;$l++){const Pl=Sl&(xl[$l]^_l[$l]);xl[$l]^=Pl,_l[$l]^=Pl}}function hs(xl,_l){const Tl=is(),Sl=is();for(let $l=0;$l<16;$l++)Sl[$l]=_l[$l];us(Sl),us(Sl),us(Sl);for(let $l=0;$l<2;$l++){Tl[0]=Sl[0]-65517;for(let Dl=1;Dl<15;Dl++)Tl[Dl]=Sl[Dl]-65535-(Tl[Dl-1]>>16&1),Tl[Dl-1]&=65535;Tl[15]=Sl[15]-32767-(Tl[14]>>16&1);const Pl=Tl[15]>>16&1;Tl[14]&=65535,ds(Sl,Tl,1-Pl)}for(let $l=0;$l<16;$l++)xl[2*$l]=Sl[$l]&255,xl[2*$l+1]=Sl[$l]>>8}function ps(xl,_l){for(let Tl=0;Tl<16;Tl++)xl[Tl]=_l[2*Tl]+(_l[2*Tl+1]<<8);xl[15]&=32767}function io(xl,_l,Tl){for(let Sl=0;Sl<16;Sl++)xl[Sl]=_l[Sl]+Tl[Sl]}function fo(xl,_l,Tl){for(let Sl=0;Sl<16;Sl++)xl[Sl]=_l[Sl]-Tl[Sl]}function mo(xl,_l,Tl){let Sl,$l,Pl=0,Dl=0,Ol=0,Rl=0,Vo=0,jo=0,Ho=0,Qo=0,El=0,Xo=0,Al=0,wl=0,yl=0,Il=0,Bl=0,Gl=0,Nl=0,zl=0,Vl=0,Hl=0,Yl=0,Ll=0,Zl=0,Xl=0,wu=0,yu=0,rp=0,dp=0,up=0,wp=0,vp=0,pp=Tl[0],cp=Tl[1],gp=Tl[2],mp=Tl[3],fp=Tl[4],hp=Tl[5],xp=Tl[6],Kl=Tl[7],Fl=Tl[8],Ul=Tl[9],Jl=Tl[10],fu=Tl[11],_d=Tl[12],tp=Tl[13],yp=Tl[14],_p=Tl[15];Sl=_l[0],Pl+=Sl*pp,Dl+=Sl*cp,Ol+=Sl*gp,Rl+=Sl*mp,Vo+=Sl*fp,jo+=Sl*hp,Ho+=Sl*xp,Qo+=Sl*Kl,El+=Sl*Fl,Xo+=Sl*Ul,Al+=Sl*Jl,wl+=Sl*fu,yl+=Sl*_d,Il+=Sl*tp,Bl+=Sl*yp,Gl+=Sl*_p,Sl=_l[1],Dl+=Sl*pp,Ol+=Sl*cp,Rl+=Sl*gp,Vo+=Sl*mp,jo+=Sl*fp,Ho+=Sl*hp,Qo+=Sl*xp,El+=Sl*Kl,Xo+=Sl*Fl,Al+=Sl*Ul,wl+=Sl*Jl,yl+=Sl*fu,Il+=Sl*_d,Bl+=Sl*tp,Gl+=Sl*yp,Nl+=Sl*_p,Sl=_l[2],Ol+=Sl*pp,Rl+=Sl*cp,Vo+=Sl*gp,jo+=Sl*mp,Ho+=Sl*fp,Qo+=Sl*hp,El+=Sl*xp,Xo+=Sl*Kl,Al+=Sl*Fl,wl+=Sl*Ul,yl+=Sl*Jl,Il+=Sl*fu,Bl+=Sl*_d,Gl+=Sl*tp,Nl+=Sl*yp,zl+=Sl*_p,Sl=_l[3],Rl+=Sl*pp,Vo+=Sl*cp,jo+=Sl*gp,Ho+=Sl*mp,Qo+=Sl*fp,El+=Sl*hp,Xo+=Sl*xp,Al+=Sl*Kl,wl+=Sl*Fl,yl+=Sl*Ul,Il+=Sl*Jl,Bl+=Sl*fu,Gl+=Sl*_d,Nl+=Sl*tp,zl+=Sl*yp,Vl+=Sl*_p,Sl=_l[4],Vo+=Sl*pp,jo+=Sl*cp,Ho+=Sl*gp,Qo+=Sl*mp,El+=Sl*fp,Xo+=Sl*hp,Al+=Sl*xp,wl+=Sl*Kl,yl+=Sl*Fl,Il+=Sl*Ul,Bl+=Sl*Jl,Gl+=Sl*fu,Nl+=Sl*_d,zl+=Sl*tp,Vl+=Sl*yp,Hl+=Sl*_p,Sl=_l[5],jo+=Sl*pp,Ho+=Sl*cp,Qo+=Sl*gp,El+=Sl*mp,Xo+=Sl*fp,Al+=Sl*hp,wl+=Sl*xp,yl+=Sl*Kl,Il+=Sl*Fl,Bl+=Sl*Ul,Gl+=Sl*Jl,Nl+=Sl*fu,zl+=Sl*_d,Vl+=Sl*tp,Hl+=Sl*yp,Yl+=Sl*_p,Sl=_l[6],Ho+=Sl*pp,Qo+=Sl*cp,El+=Sl*gp,Xo+=Sl*mp,Al+=Sl*fp,wl+=Sl*hp,yl+=Sl*xp,Il+=Sl*Kl,Bl+=Sl*Fl,Gl+=Sl*Ul,Nl+=Sl*Jl,zl+=Sl*fu,Vl+=Sl*_d,Hl+=Sl*tp,Yl+=Sl*yp,Ll+=Sl*_p,Sl=_l[7],Qo+=Sl*pp,El+=Sl*cp,Xo+=Sl*gp,Al+=Sl*mp,wl+=Sl*fp,yl+=Sl*hp,Il+=Sl*xp,Bl+=Sl*Kl,Gl+=Sl*Fl,Nl+=Sl*Ul,zl+=Sl*Jl,Vl+=Sl*fu,Hl+=Sl*_d,Yl+=Sl*tp,Ll+=Sl*yp,Zl+=Sl*_p,Sl=_l[8],El+=Sl*pp,Xo+=Sl*cp,Al+=Sl*gp,wl+=Sl*mp,yl+=Sl*fp,Il+=Sl*hp,Bl+=Sl*xp,Gl+=Sl*Kl,Nl+=Sl*Fl,zl+=Sl*Ul,Vl+=Sl*Jl,Hl+=Sl*fu,Yl+=Sl*_d,Ll+=Sl*tp,Zl+=Sl*yp,Xl+=Sl*_p,Sl=_l[9],Xo+=Sl*pp,Al+=Sl*cp,wl+=Sl*gp,yl+=Sl*mp,Il+=Sl*fp,Bl+=Sl*hp,Gl+=Sl*xp,Nl+=Sl*Kl,zl+=Sl*Fl,Vl+=Sl*Ul,Hl+=Sl*Jl,Yl+=Sl*fu,Ll+=Sl*_d,Zl+=Sl*tp,Xl+=Sl*yp,wu+=Sl*_p,Sl=_l[10],Al+=Sl*pp,wl+=Sl*cp,yl+=Sl*gp,Il+=Sl*mp,Bl+=Sl*fp,Gl+=Sl*hp,Nl+=Sl*xp,zl+=Sl*Kl,Vl+=Sl*Fl,Hl+=Sl*Ul,Yl+=Sl*Jl,Ll+=Sl*fu,Zl+=Sl*_d,Xl+=Sl*tp,wu+=Sl*yp,yu+=Sl*_p,Sl=_l[11],wl+=Sl*pp,yl+=Sl*cp,Il+=Sl*gp,Bl+=Sl*mp,Gl+=Sl*fp,Nl+=Sl*hp,zl+=Sl*xp,Vl+=Sl*Kl,Hl+=Sl*Fl,Yl+=Sl*Ul,Ll+=Sl*Jl,Zl+=Sl*fu,Xl+=Sl*_d,wu+=Sl*tp,yu+=Sl*yp,rp+=Sl*_p,Sl=_l[12],yl+=Sl*pp,Il+=Sl*cp,Bl+=Sl*gp,Gl+=Sl*mp,Nl+=Sl*fp,zl+=Sl*hp,Vl+=Sl*xp,Hl+=Sl*Kl,Yl+=Sl*Fl,Ll+=Sl*Ul,Zl+=Sl*Jl,Xl+=Sl*fu,wu+=Sl*_d,yu+=Sl*tp,rp+=Sl*yp,dp+=Sl*_p,Sl=_l[13],Il+=Sl*pp,Bl+=Sl*cp,Gl+=Sl*gp,Nl+=Sl*mp,zl+=Sl*fp,Vl+=Sl*hp,Hl+=Sl*xp,Yl+=Sl*Kl,Ll+=Sl*Fl,Zl+=Sl*Ul,Xl+=Sl*Jl,wu+=Sl*fu,yu+=Sl*_d,rp+=Sl*tp,dp+=Sl*yp,up+=Sl*_p,Sl=_l[14],Bl+=Sl*pp,Gl+=Sl*cp,Nl+=Sl*gp,zl+=Sl*mp,Vl+=Sl*fp,Hl+=Sl*hp,Yl+=Sl*xp,Ll+=Sl*Kl,Zl+=Sl*Fl,Xl+=Sl*Ul,wu+=Sl*Jl,yu+=Sl*fu,rp+=Sl*_d,dp+=Sl*tp,up+=Sl*yp,wp+=Sl*_p,Sl=_l[15],Gl+=Sl*pp,Nl+=Sl*cp,zl+=Sl*gp,Vl+=Sl*mp,Hl+=Sl*fp,Yl+=Sl*hp,Ll+=Sl*xp,Zl+=Sl*Kl,Xl+=Sl*Fl,wu+=Sl*Ul,yu+=Sl*Jl,rp+=Sl*fu,dp+=Sl*_d,up+=Sl*tp,wp+=Sl*yp,vp+=Sl*_p,Pl+=38*Nl,Dl+=38*zl,Ol+=38*Vl,Rl+=38*Hl,Vo+=38*Yl,jo+=38*Ll,Ho+=38*Zl,Qo+=38*Xl,El+=38*wu,Xo+=38*yu,Al+=38*rp,wl+=38*dp,yl+=38*up,Il+=38*wp,Bl+=38*vp,$l=1,Sl=Pl+$l+65535,$l=Math.floor(Sl/65536),Pl=Sl-$l*65536,Sl=Dl+$l+65535,$l=Math.floor(Sl/65536),Dl=Sl-$l*65536,Sl=Ol+$l+65535,$l=Math.floor(Sl/65536),Ol=Sl-$l*65536,Sl=Rl+$l+65535,$l=Math.floor(Sl/65536),Rl=Sl-$l*65536,Sl=Vo+$l+65535,$l=Math.floor(Sl/65536),Vo=Sl-$l*65536,Sl=jo+$l+65535,$l=Math.floor(Sl/65536),jo=Sl-$l*65536,Sl=Ho+$l+65535,$l=Math.floor(Sl/65536),Ho=Sl-$l*65536,Sl=Qo+$l+65535,$l=Math.floor(Sl/65536),Qo=Sl-$l*65536,Sl=El+$l+65535,$l=Math.floor(Sl/65536),El=Sl-$l*65536,Sl=Xo+$l+65535,$l=Math.floor(Sl/65536),Xo=Sl-$l*65536,Sl=Al+$l+65535,$l=Math.floor(Sl/65536),Al=Sl-$l*65536,Sl=wl+$l+65535,$l=Math.floor(Sl/65536),wl=Sl-$l*65536,Sl=yl+$l+65535,$l=Math.floor(Sl/65536),yl=Sl-$l*65536,Sl=Il+$l+65535,$l=Math.floor(Sl/65536),Il=Sl-$l*65536,Sl=Bl+$l+65535,$l=Math.floor(Sl/65536),Bl=Sl-$l*65536,Sl=Gl+$l+65535,$l=Math.floor(Sl/65536),Gl=Sl-$l*65536,Pl+=$l-1+37*($l-1),$l=1,Sl=Pl+$l+65535,$l=Math.floor(Sl/65536),Pl=Sl-$l*65536,Sl=Dl+$l+65535,$l=Math.floor(Sl/65536),Dl=Sl-$l*65536,Sl=Ol+$l+65535,$l=Math.floor(Sl/65536),Ol=Sl-$l*65536,Sl=Rl+$l+65535,$l=Math.floor(Sl/65536),Rl=Sl-$l*65536,Sl=Vo+$l+65535,$l=Math.floor(Sl/65536),Vo=Sl-$l*65536,Sl=jo+$l+65535,$l=Math.floor(Sl/65536),jo=Sl-$l*65536,Sl=Ho+$l+65535,$l=Math.floor(Sl/65536),Ho=Sl-$l*65536,Sl=Qo+$l+65535,$l=Math.floor(Sl/65536),Qo=Sl-$l*65536,Sl=El+$l+65535,$l=Math.floor(Sl/65536),El=Sl-$l*65536,Sl=Xo+$l+65535,$l=Math.floor(Sl/65536),Xo=Sl-$l*65536,Sl=Al+$l+65535,$l=Math.floor(Sl/65536),Al=Sl-$l*65536,Sl=wl+$l+65535,$l=Math.floor(Sl/65536),wl=Sl-$l*65536,Sl=yl+$l+65535,$l=Math.floor(Sl/65536),yl=Sl-$l*65536,Sl=Il+$l+65535,$l=Math.floor(Sl/65536),Il=Sl-$l*65536,Sl=Bl+$l+65535,$l=Math.floor(Sl/65536),Bl=Sl-$l*65536,Sl=Gl+$l+65535,$l=Math.floor(Sl/65536),Gl=Sl-$l*65536,Pl+=$l-1+37*($l-1),xl[0]=Pl,xl[1]=Dl,xl[2]=Ol,xl[3]=Rl,xl[4]=Vo,xl[5]=jo,xl[6]=Ho,xl[7]=Qo,xl[8]=El,xl[9]=Xo,xl[10]=Al,xl[11]=wl,xl[12]=yl,xl[13]=Il,xl[14]=Bl,xl[15]=Gl}function Ao(xl,_l){mo(xl,_l,_l)}function $o(xl,_l){const Tl=is();for(let Sl=0;Sl<16;Sl++)Tl[Sl]=_l[Sl];for(let Sl=253;Sl>=0;Sl--)Ao(Tl,Tl),Sl!==2&&Sl!==4&&mo(Tl,Tl,_l);for(let Sl=0;Sl<16;Sl++)xl[Sl]=Tl[Sl]}function Lo(xl,_l){const Tl=new Uint8Array(32),Sl=new Float64Array(80),$l=is(),Pl=is(),Dl=is(),Ol=is(),Rl=is(),Vo=is();for(let El=0;El<31;El++)Tl[El]=xl[El];Tl[31]=xl[31]&127|64,Tl[0]&=248,ps(Sl,_l);for(let El=0;El<16;El++)Pl[El]=Sl[El];$l[0]=Ol[0]=1;for(let El=254;El>=0;--El){const Xo=Tl[El>>>3]>>>(El&7)&1;ds($l,Pl,Xo),ds(Dl,Ol,Xo),io(Rl,$l,Dl),fo($l,$l,Dl),io(Dl,Pl,Ol),fo(Pl,Pl,Ol),Ao(Ol,Rl),Ao(Vo,$l),mo($l,Dl,$l),mo(Dl,Pl,Rl),io(Rl,$l,Dl),fo($l,$l,Dl),Ao(Pl,$l),fo(Dl,Ol,Vo),mo($l,Dl,as),io($l,$l,Ol),mo(Dl,Dl,$l),mo($l,Ol,Vo),mo(Ol,Pl,Sl),Ao(Pl,Rl),ds($l,Pl,Xo),ds(Dl,Ol,Xo)}for(let El=0;El<16;El++)Sl[El+16]=$l[El],Sl[El+32]=Dl[El],Sl[El+48]=Pl[El],Sl[El+64]=Ol[El];const jo=Sl.subarray(32),Ho=Sl.subarray(16);$o(jo,jo),mo(Ho,Ho,jo);const Qo=new Uint8Array(32);return hs(Qo,Ho),Qo}Fn.scalarMult=Lo;function Go(xl){return Lo(xl,os)}Fn.scalarMultBase=Go;function Yo(xl){if(xl.length!==Fn.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${Fn.SECRET_KEY_LENGTH} bytes`);const _l=new Uint8Array(xl);return{publicKey:Go(_l),secretKey:_l}}Fn.generateKeyPairFromSeed=Yo;function Wo(xl){const _l=(0,Mn.randomBytes)(32,xl),Tl=Yo(_l);return(0,rs.wipe)(_l),Tl}Fn.generateKeyPair=Wo;function Jo(xl,_l,Tl=!1){if(xl.length!==Fn.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(_l.length!==Fn.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const Sl=Lo(xl,_l);if(Tl){let $l=0;for(let Pl=0;Pl<Sl.length;Pl++)$l|=Sl[Pl];if($l===0)throw new Error("X25519: invalid shared key")}return Sl}Fn.sharedKey=Jo})(x25519);function allocUnsafe(Fn=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(Fn):new Uint8Array(Fn)}function concat(Fn,Mn){Mn||(Mn=Fn.reduce((os,as)=>os+as.length,0));const rs=allocUnsafe(Mn);let is=0;for(const os of Fn)rs.set(os,is),is+=os.length;return rs}function createCodec(Fn,Mn,rs,is){return{name:Fn,prefix:Mn,encoder:{name:Fn,prefix:Mn,encode:rs},decoder:{decode:is}}}const string$1=createCodec("utf8","u",Fn=>"u"+new TextDecoder("utf8").decode(Fn),Fn=>new TextEncoder().encode(Fn.substring(1))),ascii=createCodec("ascii","a",Fn=>{let Mn="a";for(let rs=0;rs<Fn.length;rs++)Mn+=String.fromCharCode(Fn[rs]);return Mn},Fn=>{Fn=Fn.substring(1);const Mn=allocUnsafe(Fn.length);for(let rs=0;rs<Fn.length;rs++)Mn[rs]=Fn.charCodeAt(rs);return Mn}),BASES={utf8:string$1,"utf-8":string$1,hex:bases.base16,latin1:ascii,ascii,binary:ascii,...bases};function fromString(Fn,Mn="utf8"){const rs=BASES[Mn];if(!rs)throw new Error(`Unsupported encoding "${Mn}"`);return(Mn==="utf8"||Mn==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(Fn,"utf8"):rs.decoder.decode(`${rs.prefix}${Fn}`)}function toString(Fn,Mn="utf8"){const rs=BASES[Mn];if(!rs)throw new Error(`Unsupported encoding "${Mn}"`);return(Mn==="utf8"||Mn==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(Fn.buffer,Fn.byteOffset,Fn.byteLength).toString("utf8"):rs.encoder.encode(Fn).substring(1)}var elliptic={};const name$1="elliptic",version$2="6.5.7",description="EC cryptography",main="lib/elliptic.js",files=["lib"],scripts={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository={type:"git",url:"git@github.com:indutny/elliptic"},keywords=["EC","Elliptic","curve","Cryptography"],author="Fedor Indutny <fedor@indutny.com>",license="MIT",bugs={url:"https://github.com/indutny/elliptic/issues"},homepage="https://github.com/indutny/elliptic",devDependencies={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},require$$0={name:name$1,version:version$2,description,main,files,scripts,repository,keywords,author,license,bugs,homepage,devDependencies,dependencies};var utils$d={},bn$1={exports:{}};bn$1.exports;(function(Fn){(function(Mn,rs){function is(Ol,Rl){if(!Ol)throw new Error(Rl||"Assertion failed")}function os(Ol,Rl){Ol.super_=Rl;var Vo=function(){};Vo.prototype=Rl.prototype,Ol.prototype=new Vo,Ol.prototype.constructor=Ol}function as(Ol,Rl,Vo){if(as.isBN(Ol))return Ol;this.negative=0,this.words=null,this.length=0,this.red=null,Ol!==null&&((Rl==="le"||Rl==="be")&&(Vo=Rl,Rl=10),this._init(Ol||0,Rl||10,Vo||"be"))}typeof Mn=="object"?Mn.exports=as:rs.BN=as,as.BN=as,as.wordSize=26;var us;try{typeof window<"u"&&typeof window.Buffer<"u"?us=window.Buffer:us=require$$3.Buffer}catch{}as.isBN=function(Rl){return Rl instanceof as?!0:Rl!==null&&typeof Rl=="object"&&Rl.constructor.wordSize===as.wordSize&&Array.isArray(Rl.words)},as.max=function(Rl,Vo){return Rl.cmp(Vo)>0?Rl:Vo},as.min=function(Rl,Vo){return Rl.cmp(Vo)<0?Rl:Vo},as.prototype._init=function(Rl,Vo,jo){if(typeof Rl=="number")return this._initNumber(Rl,Vo,jo);if(typeof Rl=="object")return this._initArray(Rl,Vo,jo);Vo==="hex"&&(Vo=16),is(Vo===(Vo|0)&&Vo>=2&&Vo<=36),Rl=Rl.toString().replace(/\s+/g,"");var Ho=0;Rl[0]==="-"&&(Ho++,this.negative=1),Ho<Rl.length&&(Vo===16?this._parseHex(Rl,Ho,jo):(this._parseBase(Rl,Vo,Ho),jo==="le"&&this._initArray(this.toArray(),Vo,jo)))},as.prototype._initNumber=function(Rl,Vo,jo){Rl<0&&(this.negative=1,Rl=-Rl),Rl<67108864?(this.words=[Rl&67108863],this.length=1):Rl<4503599627370496?(this.words=[Rl&67108863,Rl/67108864&67108863],this.length=2):(is(Rl<9007199254740992),this.words=[Rl&67108863,Rl/67108864&67108863,1],this.length=3),jo==="le"&&this._initArray(this.toArray(),Vo,jo)},as.prototype._initArray=function(Rl,Vo,jo){if(is(typeof Rl.length=="number"),Rl.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Rl.length/3),this.words=new Array(this.length);for(var Ho=0;Ho<this.length;Ho++)this.words[Ho]=0;var Qo,El,Xo=0;if(jo==="be")for(Ho=Rl.length-1,Qo=0;Ho>=0;Ho-=3)El=Rl[Ho]|Rl[Ho-1]<<8|Rl[Ho-2]<<16,this.words[Qo]|=El<<Xo&67108863,this.words[Qo+1]=El>>>26-Xo&67108863,Xo+=24,Xo>=26&&(Xo-=26,Qo++);else if(jo==="le")for(Ho=0,Qo=0;Ho<Rl.length;Ho+=3)El=Rl[Ho]|Rl[Ho+1]<<8|Rl[Ho+2]<<16,this.words[Qo]|=El<<Xo&67108863,this.words[Qo+1]=El>>>26-Xo&67108863,Xo+=24,Xo>=26&&(Xo-=26,Qo++);return this.strip()};function ds(Ol,Rl){var Vo=Ol.charCodeAt(Rl);return Vo>=65&&Vo<=70?Vo-55:Vo>=97&&Vo<=102?Vo-87:Vo-48&15}function hs(Ol,Rl,Vo){var jo=ds(Ol,Vo);return Vo-1>=Rl&&(jo|=ds(Ol,Vo-1)<<4),jo}as.prototype._parseHex=function(Rl,Vo,jo){this.length=Math.ceil((Rl.length-Vo)/6),this.words=new Array(this.length);for(var Ho=0;Ho<this.length;Ho++)this.words[Ho]=0;var Qo=0,El=0,Xo;if(jo==="be")for(Ho=Rl.length-1;Ho>=Vo;Ho-=2)Xo=hs(Rl,Vo,Ho)<<Qo,this.words[El]|=Xo&67108863,Qo>=18?(Qo-=18,El+=1,this.words[El]|=Xo>>>26):Qo+=8;else{var Al=Rl.length-Vo;for(Ho=Al%2===0?Vo+1:Vo;Ho<Rl.length;Ho+=2)Xo=hs(Rl,Vo,Ho)<<Qo,this.words[El]|=Xo&67108863,Qo>=18?(Qo-=18,El+=1,this.words[El]|=Xo>>>26):Qo+=8}this.strip()};function ps(Ol,Rl,Vo,jo){for(var Ho=0,Qo=Math.min(Ol.length,Vo),El=Rl;El<Qo;El++){var Xo=Ol.charCodeAt(El)-48;Ho*=jo,Xo>=49?Ho+=Xo-49+10:Xo>=17?Ho+=Xo-17+10:Ho+=Xo}return Ho}as.prototype._parseBase=function(Rl,Vo,jo){this.words=[0],this.length=1;for(var Ho=0,Qo=1;Qo<=67108863;Qo*=Vo)Ho++;Ho--,Qo=Qo/Vo|0;for(var El=Rl.length-jo,Xo=El%Ho,Al=Math.min(El,El-Xo)+jo,wl=0,yl=jo;yl<Al;yl+=Ho)wl=ps(Rl,yl,yl+Ho,Vo),this.imuln(Qo),this.words[0]+wl<67108864?this.words[0]+=wl:this._iaddn(wl);if(Xo!==0){var Il=1;for(wl=ps(Rl,yl,Rl.length,Vo),yl=0;yl<Xo;yl++)Il*=Vo;this.imuln(Il),this.words[0]+wl<67108864?this.words[0]+=wl:this._iaddn(wl)}this.strip()},as.prototype.copy=function(Rl){Rl.words=new Array(this.length);for(var Vo=0;Vo<this.length;Vo++)Rl.words[Vo]=this.words[Vo];Rl.length=this.length,Rl.negative=this.negative,Rl.red=this.red},as.prototype.clone=function(){var Rl=new as(null);return this.copy(Rl),Rl},as.prototype._expand=function(Rl){for(;this.length<Rl;)this.words[this.length++]=0;return this},as.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},as.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},as.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var io=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],fo=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],mo=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];as.prototype.toString=function(Rl,Vo){Rl=Rl||10,Vo=Vo|0||1;var jo;if(Rl===16||Rl==="hex"){jo="";for(var Ho=0,Qo=0,El=0;El<this.length;El++){var Xo=this.words[El],Al=((Xo<<Ho|Qo)&16777215).toString(16);Qo=Xo>>>24-Ho&16777215,Qo!==0||El!==this.length-1?jo=io[6-Al.length]+Al+jo:jo=Al+jo,Ho+=2,Ho>=26&&(Ho-=26,El--)}for(Qo!==0&&(jo=Qo.toString(16)+jo);jo.length%Vo!==0;)jo="0"+jo;return this.negative!==0&&(jo="-"+jo),jo}if(Rl===(Rl|0)&&Rl>=2&&Rl<=36){var wl=fo[Rl],yl=mo[Rl];jo="";var Il=this.clone();for(Il.negative=0;!Il.isZero();){var Bl=Il.modn(yl).toString(Rl);Il=Il.idivn(yl),Il.isZero()?jo=Bl+jo:jo=io[wl-Bl.length]+Bl+jo}for(this.isZero()&&(jo="0"+jo);jo.length%Vo!==0;)jo="0"+jo;return this.negative!==0&&(jo="-"+jo),jo}is(!1,"Base should be between 2 and 36")},as.prototype.toNumber=function(){var Rl=this.words[0];return this.length===2?Rl+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Rl+=4503599627370496+this.words[1]*67108864:this.length>2&&is(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Rl:Rl},as.prototype.toJSON=function(){return this.toString(16)},as.prototype.toBuffer=function(Rl,Vo){return is(typeof us<"u"),this.toArrayLike(us,Rl,Vo)},as.prototype.toArray=function(Rl,Vo){return this.toArrayLike(Array,Rl,Vo)},as.prototype.toArrayLike=function(Rl,Vo,jo){var Ho=this.byteLength(),Qo=jo||Math.max(1,Ho);is(Ho<=Qo,"byte array longer than desired length"),is(Qo>0,"Requested array length <= 0"),this.strip();var El=Vo==="le",Xo=new Rl(Qo),Al,wl,yl=this.clone();if(El){for(wl=0;!yl.isZero();wl++)Al=yl.andln(255),yl.iushrn(8),Xo[wl]=Al;for(;wl<Qo;wl++)Xo[wl]=0}else{for(wl=0;wl<Qo-Ho;wl++)Xo[wl]=0;for(wl=0;!yl.isZero();wl++)Al=yl.andln(255),yl.iushrn(8),Xo[Qo-wl-1]=Al}return Xo},Math.clz32?as.prototype._countBits=function(Rl){return 32-Math.clz32(Rl)}:as.prototype._countBits=function(Rl){var Vo=Rl,jo=0;return Vo>=4096&&(jo+=13,Vo>>>=13),Vo>=64&&(jo+=7,Vo>>>=7),Vo>=8&&(jo+=4,Vo>>>=4),Vo>=2&&(jo+=2,Vo>>>=2),jo+Vo},as.prototype._zeroBits=function(Rl){if(Rl===0)return 26;var Vo=Rl,jo=0;return Vo&8191||(jo+=13,Vo>>>=13),Vo&127||(jo+=7,Vo>>>=7),Vo&15||(jo+=4,Vo>>>=4),Vo&3||(jo+=2,Vo>>>=2),Vo&1||jo++,jo},as.prototype.bitLength=function(){var Rl=this.words[this.length-1],Vo=this._countBits(Rl);return(this.length-1)*26+Vo};function Ao(Ol){for(var Rl=new Array(Ol.bitLength()),Vo=0;Vo<Rl.length;Vo++){var jo=Vo/26|0,Ho=Vo%26;Rl[Vo]=(Ol.words[jo]&1<<Ho)>>>Ho}return Rl}as.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Rl=0,Vo=0;Vo<this.length;Vo++){var jo=this._zeroBits(this.words[Vo]);if(Rl+=jo,jo!==26)break}return Rl},as.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},as.prototype.toTwos=function(Rl){return this.negative!==0?this.abs().inotn(Rl).iaddn(1):this.clone()},as.prototype.fromTwos=function(Rl){return this.testn(Rl-1)?this.notn(Rl).iaddn(1).ineg():this.clone()},as.prototype.isNeg=function(){return this.negative!==0},as.prototype.neg=function(){return this.clone().ineg()},as.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},as.prototype.iuor=function(Rl){for(;this.length<Rl.length;)this.words[this.length++]=0;for(var Vo=0;Vo<Rl.length;Vo++)this.words[Vo]=this.words[Vo]|Rl.words[Vo];return this.strip()},as.prototype.ior=function(Rl){return is((this.negative|Rl.negative)===0),this.iuor(Rl)},as.prototype.or=function(Rl){return this.length>Rl.length?this.clone().ior(Rl):Rl.clone().ior(this)},as.prototype.uor=function(Rl){return this.length>Rl.length?this.clone().iuor(Rl):Rl.clone().iuor(this)},as.prototype.iuand=function(Rl){var Vo;this.length>Rl.length?Vo=Rl:Vo=this;for(var jo=0;jo<Vo.length;jo++)this.words[jo]=this.words[jo]&Rl.words[jo];return this.length=Vo.length,this.strip()},as.prototype.iand=function(Rl){return is((this.negative|Rl.negative)===0),this.iuand(Rl)},as.prototype.and=function(Rl){return this.length>Rl.length?this.clone().iand(Rl):Rl.clone().iand(this)},as.prototype.uand=function(Rl){return this.length>Rl.length?this.clone().iuand(Rl):Rl.clone().iuand(this)},as.prototype.iuxor=function(Rl){var Vo,jo;this.length>Rl.length?(Vo=this,jo=Rl):(Vo=Rl,jo=this);for(var Ho=0;Ho<jo.length;Ho++)this.words[Ho]=Vo.words[Ho]^jo.words[Ho];if(this!==Vo)for(;Ho<Vo.length;Ho++)this.words[Ho]=Vo.words[Ho];return this.length=Vo.length,this.strip()},as.prototype.ixor=function(Rl){return is((this.negative|Rl.negative)===0),this.iuxor(Rl)},as.prototype.xor=function(Rl){return this.length>Rl.length?this.clone().ixor(Rl):Rl.clone().ixor(this)},as.prototype.uxor=function(Rl){return this.length>Rl.length?this.clone().iuxor(Rl):Rl.clone().iuxor(this)},as.prototype.inotn=function(Rl){is(typeof Rl=="number"&&Rl>=0);var Vo=Math.ceil(Rl/26)|0,jo=Rl%26;this._expand(Vo),jo>0&&Vo--;for(var Ho=0;Ho<Vo;Ho++)this.words[Ho]=~this.words[Ho]&67108863;return jo>0&&(this.words[Ho]=~this.words[Ho]&67108863>>26-jo),this.strip()},as.prototype.notn=function(Rl){return this.clone().inotn(Rl)},as.prototype.setn=function(Rl,Vo){is(typeof Rl=="number"&&Rl>=0);var jo=Rl/26|0,Ho=Rl%26;return this._expand(jo+1),Vo?this.words[jo]=this.words[jo]|1<<Ho:this.words[jo]=this.words[jo]&~(1<<Ho),this.strip()},as.prototype.iadd=function(Rl){var Vo;if(this.negative!==0&&Rl.negative===0)return this.negative=0,Vo=this.isub(Rl),this.negative^=1,this._normSign();if(this.negative===0&&Rl.negative!==0)return Rl.negative=0,Vo=this.isub(Rl),Rl.negative=1,Vo._normSign();var jo,Ho;this.length>Rl.length?(jo=this,Ho=Rl):(jo=Rl,Ho=this);for(var Qo=0,El=0;El<Ho.length;El++)Vo=(jo.words[El]|0)+(Ho.words[El]|0)+Qo,this.words[El]=Vo&67108863,Qo=Vo>>>26;for(;Qo!==0&&El<jo.length;El++)Vo=(jo.words[El]|0)+Qo,this.words[El]=Vo&67108863,Qo=Vo>>>26;if(this.length=jo.length,Qo!==0)this.words[this.length]=Qo,this.length++;else if(jo!==this)for(;El<jo.length;El++)this.words[El]=jo.words[El];return this},as.prototype.add=function(Rl){var Vo;return Rl.negative!==0&&this.negative===0?(Rl.negative=0,Vo=this.sub(Rl),Rl.negative^=1,Vo):Rl.negative===0&&this.negative!==0?(this.negative=0,Vo=Rl.sub(this),this.negative=1,Vo):this.length>Rl.length?this.clone().iadd(Rl):Rl.clone().iadd(this)},as.prototype.isub=function(Rl){if(Rl.negative!==0){Rl.negative=0;var Vo=this.iadd(Rl);return Rl.negative=1,Vo._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Rl),this.negative=1,this._normSign();var jo=this.cmp(Rl);if(jo===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Ho,Qo;jo>0?(Ho=this,Qo=Rl):(Ho=Rl,Qo=this);for(var El=0,Xo=0;Xo<Qo.length;Xo++)Vo=(Ho.words[Xo]|0)-(Qo.words[Xo]|0)+El,El=Vo>>26,this.words[Xo]=Vo&67108863;for(;El!==0&&Xo<Ho.length;Xo++)Vo=(Ho.words[Xo]|0)+El,El=Vo>>26,this.words[Xo]=Vo&67108863;if(El===0&&Xo<Ho.length&&Ho!==this)for(;Xo<Ho.length;Xo++)this.words[Xo]=Ho.words[Xo];return this.length=Math.max(this.length,Xo),Ho!==this&&(this.negative=1),this.strip()},as.prototype.sub=function(Rl){return this.clone().isub(Rl)};function $o(Ol,Rl,Vo){Vo.negative=Rl.negative^Ol.negative;var jo=Ol.length+Rl.length|0;Vo.length=jo,jo=jo-1|0;var Ho=Ol.words[0]|0,Qo=Rl.words[0]|0,El=Ho*Qo,Xo=El&67108863,Al=El/67108864|0;Vo.words[0]=Xo;for(var wl=1;wl<jo;wl++){for(var yl=Al>>>26,Il=Al&67108863,Bl=Math.min(wl,Rl.length-1),Gl=Math.max(0,wl-Ol.length+1);Gl<=Bl;Gl++){var Nl=wl-Gl|0;Ho=Ol.words[Nl]|0,Qo=Rl.words[Gl]|0,El=Ho*Qo+Il,yl+=El/67108864|0,Il=El&67108863}Vo.words[wl]=Il|0,Al=yl|0}return Al!==0?Vo.words[wl]=Al|0:Vo.length--,Vo.strip()}var Lo=function(Rl,Vo,jo){var Ho=Rl.words,Qo=Vo.words,El=jo.words,Xo=0,Al,wl,yl,Il=Ho[0]|0,Bl=Il&8191,Gl=Il>>>13,Nl=Ho[1]|0,zl=Nl&8191,Vl=Nl>>>13,Hl=Ho[2]|0,Yl=Hl&8191,Ll=Hl>>>13,Zl=Ho[3]|0,Xl=Zl&8191,wu=Zl>>>13,yu=Ho[4]|0,rp=yu&8191,dp=yu>>>13,up=Ho[5]|0,wp=up&8191,vp=up>>>13,pp=Ho[6]|0,cp=pp&8191,gp=pp>>>13,mp=Ho[7]|0,fp=mp&8191,hp=mp>>>13,xp=Ho[8]|0,Kl=xp&8191,Fl=xp>>>13,Ul=Ho[9]|0,Jl=Ul&8191,fu=Ul>>>13,_d=Qo[0]|0,tp=_d&8191,yp=_d>>>13,_p=Qo[1]|0,Sp=_p&8191,Ap=_p>>>13,Op=Qo[2]|0,Zp=Op&8191,Qp=Op>>>13,Xp=Qo[3]|0,h0=Xp&8191,Wp=Xp>>>13,Np=Qo[4]|0,Rp=Np&8191,Pp=Np>>>13,Hp=Qo[5]|0,kp=Hp&8191,Gp=Hp>>>13,Yp=Qo[6]|0,Mp=Yp&8191,Ip=Yp>>>13,Dp=Qo[7]|0,Lp=Dp&8191,zp=Dp>>>13,Bp=Qo[8]|0,qp=Bp&8191,Vp=Bp>>>13,tm=Qo[9]|0,g0=tm&8191,rm=tm>>>13;jo.negative=Rl.negative^Vo.negative,jo.length=19,Al=Math.imul(Bl,tp),wl=Math.imul(Bl,yp),wl=wl+Math.imul(Gl,tp)|0,yl=Math.imul(Gl,yp);var Jp=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(Jp>>>26)|0,Jp&=67108863,Al=Math.imul(zl,tp),wl=Math.imul(zl,yp),wl=wl+Math.imul(Vl,tp)|0,yl=Math.imul(Vl,yp),Al=Al+Math.imul(Bl,Sp)|0,wl=wl+Math.imul(Bl,Ap)|0,wl=wl+Math.imul(Gl,Sp)|0,yl=yl+Math.imul(Gl,Ap)|0;var lm=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(lm>>>26)|0,lm&=67108863,Al=Math.imul(Yl,tp),wl=Math.imul(Yl,yp),wl=wl+Math.imul(Ll,tp)|0,yl=Math.imul(Ll,yp),Al=Al+Math.imul(zl,Sp)|0,wl=wl+Math.imul(zl,Ap)|0,wl=wl+Math.imul(Vl,Sp)|0,yl=yl+Math.imul(Vl,Ap)|0,Al=Al+Math.imul(Bl,Zp)|0,wl=wl+Math.imul(Bl,Qp)|0,wl=wl+Math.imul(Gl,Zp)|0,yl=yl+Math.imul(Gl,Qp)|0;var $m=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+($m>>>26)|0,$m&=67108863,Al=Math.imul(Xl,tp),wl=Math.imul(Xl,yp),wl=wl+Math.imul(wu,tp)|0,yl=Math.imul(wu,yp),Al=Al+Math.imul(Yl,Sp)|0,wl=wl+Math.imul(Yl,Ap)|0,wl=wl+Math.imul(Ll,Sp)|0,yl=yl+Math.imul(Ll,Ap)|0,Al=Al+Math.imul(zl,Zp)|0,wl=wl+Math.imul(zl,Qp)|0,wl=wl+Math.imul(Vl,Zp)|0,yl=yl+Math.imul(Vl,Qp)|0,Al=Al+Math.imul(Bl,h0)|0,wl=wl+Math.imul(Bl,Wp)|0,wl=wl+Math.imul(Gl,h0)|0,yl=yl+Math.imul(Gl,Wp)|0;var km=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(km>>>26)|0,km&=67108863,Al=Math.imul(rp,tp),wl=Math.imul(rp,yp),wl=wl+Math.imul(dp,tp)|0,yl=Math.imul(dp,yp),Al=Al+Math.imul(Xl,Sp)|0,wl=wl+Math.imul(Xl,Ap)|0,wl=wl+Math.imul(wu,Sp)|0,yl=yl+Math.imul(wu,Ap)|0,Al=Al+Math.imul(Yl,Zp)|0,wl=wl+Math.imul(Yl,Qp)|0,wl=wl+Math.imul(Ll,Zp)|0,yl=yl+Math.imul(Ll,Qp)|0,Al=Al+Math.imul(zl,h0)|0,wl=wl+Math.imul(zl,Wp)|0,wl=wl+Math.imul(Vl,h0)|0,yl=yl+Math.imul(Vl,Wp)|0,Al=Al+Math.imul(Bl,Rp)|0,wl=wl+Math.imul(Bl,Pp)|0,wl=wl+Math.imul(Gl,Rp)|0,yl=yl+Math.imul(Gl,Pp)|0;var Cm=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(Cm>>>26)|0,Cm&=67108863,Al=Math.imul(wp,tp),wl=Math.imul(wp,yp),wl=wl+Math.imul(vp,tp)|0,yl=Math.imul(vp,yp),Al=Al+Math.imul(rp,Sp)|0,wl=wl+Math.imul(rp,Ap)|0,wl=wl+Math.imul(dp,Sp)|0,yl=yl+Math.imul(dp,Ap)|0,Al=Al+Math.imul(Xl,Zp)|0,wl=wl+Math.imul(Xl,Qp)|0,wl=wl+Math.imul(wu,Zp)|0,yl=yl+Math.imul(wu,Qp)|0,Al=Al+Math.imul(Yl,h0)|0,wl=wl+Math.imul(Yl,Wp)|0,wl=wl+Math.imul(Ll,h0)|0,yl=yl+Math.imul(Ll,Wp)|0,Al=Al+Math.imul(zl,Rp)|0,wl=wl+Math.imul(zl,Pp)|0,wl=wl+Math.imul(Vl,Rp)|0,yl=yl+Math.imul(Vl,Pp)|0,Al=Al+Math.imul(Bl,kp)|0,wl=wl+Math.imul(Bl,Gp)|0,wl=wl+Math.imul(Gl,kp)|0,yl=yl+Math.imul(Gl,Gp)|0;var Am=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(Am>>>26)|0,Am&=67108863,Al=Math.imul(cp,tp),wl=Math.imul(cp,yp),wl=wl+Math.imul(gp,tp)|0,yl=Math.imul(gp,yp),Al=Al+Math.imul(wp,Sp)|0,wl=wl+Math.imul(wp,Ap)|0,wl=wl+Math.imul(vp,Sp)|0,yl=yl+Math.imul(vp,Ap)|0,Al=Al+Math.imul(rp,Zp)|0,wl=wl+Math.imul(rp,Qp)|0,wl=wl+Math.imul(dp,Zp)|0,yl=yl+Math.imul(dp,Qp)|0,Al=Al+Math.imul(Xl,h0)|0,wl=wl+Math.imul(Xl,Wp)|0,wl=wl+Math.imul(wu,h0)|0,yl=yl+Math.imul(wu,Wp)|0,Al=Al+Math.imul(Yl,Rp)|0,wl=wl+Math.imul(Yl,Pp)|0,wl=wl+Math.imul(Ll,Rp)|0,yl=yl+Math.imul(Ll,Pp)|0,Al=Al+Math.imul(zl,kp)|0,wl=wl+Math.imul(zl,Gp)|0,wl=wl+Math.imul(Vl,kp)|0,yl=yl+Math.imul(Vl,Gp)|0,Al=Al+Math.imul(Bl,Mp)|0,wl=wl+Math.imul(Bl,Ip)|0,wl=wl+Math.imul(Gl,Mp)|0,yl=yl+Math.imul(Gl,Ip)|0;var pm=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(pm>>>26)|0,pm&=67108863,Al=Math.imul(fp,tp),wl=Math.imul(fp,yp),wl=wl+Math.imul(hp,tp)|0,yl=Math.imul(hp,yp),Al=Al+Math.imul(cp,Sp)|0,wl=wl+Math.imul(cp,Ap)|0,wl=wl+Math.imul(gp,Sp)|0,yl=yl+Math.imul(gp,Ap)|0,Al=Al+Math.imul(wp,Zp)|0,wl=wl+Math.imul(wp,Qp)|0,wl=wl+Math.imul(vp,Zp)|0,yl=yl+Math.imul(vp,Qp)|0,Al=Al+Math.imul(rp,h0)|0,wl=wl+Math.imul(rp,Wp)|0,wl=wl+Math.imul(dp,h0)|0,yl=yl+Math.imul(dp,Wp)|0,Al=Al+Math.imul(Xl,Rp)|0,wl=wl+Math.imul(Xl,Pp)|0,wl=wl+Math.imul(wu,Rp)|0,yl=yl+Math.imul(wu,Pp)|0,Al=Al+Math.imul(Yl,kp)|0,wl=wl+Math.imul(Yl,Gp)|0,wl=wl+Math.imul(Ll,kp)|0,yl=yl+Math.imul(Ll,Gp)|0,Al=Al+Math.imul(zl,Mp)|0,wl=wl+Math.imul(zl,Ip)|0,wl=wl+Math.imul(Vl,Mp)|0,yl=yl+Math.imul(Vl,Ip)|0,Al=Al+Math.imul(Bl,Lp)|0,wl=wl+Math.imul(Bl,zp)|0,wl=wl+Math.imul(Gl,Lp)|0,yl=yl+Math.imul(Gl,zp)|0;var Ym=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(Ym>>>26)|0,Ym&=67108863,Al=Math.imul(Kl,tp),wl=Math.imul(Kl,yp),wl=wl+Math.imul(Fl,tp)|0,yl=Math.imul(Fl,yp),Al=Al+Math.imul(fp,Sp)|0,wl=wl+Math.imul(fp,Ap)|0,wl=wl+Math.imul(hp,Sp)|0,yl=yl+Math.imul(hp,Ap)|0,Al=Al+Math.imul(cp,Zp)|0,wl=wl+Math.imul(cp,Qp)|0,wl=wl+Math.imul(gp,Zp)|0,yl=yl+Math.imul(gp,Qp)|0,Al=Al+Math.imul(wp,h0)|0,wl=wl+Math.imul(wp,Wp)|0,wl=wl+Math.imul(vp,h0)|0,yl=yl+Math.imul(vp,Wp)|0,Al=Al+Math.imul(rp,Rp)|0,wl=wl+Math.imul(rp,Pp)|0,wl=wl+Math.imul(dp,Rp)|0,yl=yl+Math.imul(dp,Pp)|0,Al=Al+Math.imul(Xl,kp)|0,wl=wl+Math.imul(Xl,Gp)|0,wl=wl+Math.imul(wu,kp)|0,yl=yl+Math.imul(wu,Gp)|0,Al=Al+Math.imul(Yl,Mp)|0,wl=wl+Math.imul(Yl,Ip)|0,wl=wl+Math.imul(Ll,Mp)|0,yl=yl+Math.imul(Ll,Ip)|0,Al=Al+Math.imul(zl,Lp)|0,wl=wl+Math.imul(zl,zp)|0,wl=wl+Math.imul(Vl,Lp)|0,yl=yl+Math.imul(Vl,zp)|0,Al=Al+Math.imul(Bl,qp)|0,wl=wl+Math.imul(Bl,Vp)|0,wl=wl+Math.imul(Gl,qp)|0,yl=yl+Math.imul(Gl,Vp)|0;var u1=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(u1>>>26)|0,u1&=67108863,Al=Math.imul(Jl,tp),wl=Math.imul(Jl,yp),wl=wl+Math.imul(fu,tp)|0,yl=Math.imul(fu,yp),Al=Al+Math.imul(Kl,Sp)|0,wl=wl+Math.imul(Kl,Ap)|0,wl=wl+Math.imul(Fl,Sp)|0,yl=yl+Math.imul(Fl,Ap)|0,Al=Al+Math.imul(fp,Zp)|0,wl=wl+Math.imul(fp,Qp)|0,wl=wl+Math.imul(hp,Zp)|0,yl=yl+Math.imul(hp,Qp)|0,Al=Al+Math.imul(cp,h0)|0,wl=wl+Math.imul(cp,Wp)|0,wl=wl+Math.imul(gp,h0)|0,yl=yl+Math.imul(gp,Wp)|0,Al=Al+Math.imul(wp,Rp)|0,wl=wl+Math.imul(wp,Pp)|0,wl=wl+Math.imul(vp,Rp)|0,yl=yl+Math.imul(vp,Pp)|0,Al=Al+Math.imul(rp,kp)|0,wl=wl+Math.imul(rp,Gp)|0,wl=wl+Math.imul(dp,kp)|0,yl=yl+Math.imul(dp,Gp)|0,Al=Al+Math.imul(Xl,Mp)|0,wl=wl+Math.imul(Xl,Ip)|0,wl=wl+Math.imul(wu,Mp)|0,yl=yl+Math.imul(wu,Ip)|0,Al=Al+Math.imul(Yl,Lp)|0,wl=wl+Math.imul(Yl,zp)|0,wl=wl+Math.imul(Ll,Lp)|0,yl=yl+Math.imul(Ll,zp)|0,Al=Al+Math.imul(zl,qp)|0,wl=wl+Math.imul(zl,Vp)|0,wl=wl+Math.imul(Vl,qp)|0,yl=yl+Math.imul(Vl,Vp)|0,Al=Al+Math.imul(Bl,g0)|0,wl=wl+Math.imul(Bl,rm)|0,wl=wl+Math.imul(Gl,g0)|0,yl=yl+Math.imul(Gl,rm)|0;var qm=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(qm>>>26)|0,qm&=67108863,Al=Math.imul(Jl,Sp),wl=Math.imul(Jl,Ap),wl=wl+Math.imul(fu,Sp)|0,yl=Math.imul(fu,Ap),Al=Al+Math.imul(Kl,Zp)|0,wl=wl+Math.imul(Kl,Qp)|0,wl=wl+Math.imul(Fl,Zp)|0,yl=yl+Math.imul(Fl,Qp)|0,Al=Al+Math.imul(fp,h0)|0,wl=wl+Math.imul(fp,Wp)|0,wl=wl+Math.imul(hp,h0)|0,yl=yl+Math.imul(hp,Wp)|0,Al=Al+Math.imul(cp,Rp)|0,wl=wl+Math.imul(cp,Pp)|0,wl=wl+Math.imul(gp,Rp)|0,yl=yl+Math.imul(gp,Pp)|0,Al=Al+Math.imul(wp,kp)|0,wl=wl+Math.imul(wp,Gp)|0,wl=wl+Math.imul(vp,kp)|0,yl=yl+Math.imul(vp,Gp)|0,Al=Al+Math.imul(rp,Mp)|0,wl=wl+Math.imul(rp,Ip)|0,wl=wl+Math.imul(dp,Mp)|0,yl=yl+Math.imul(dp,Ip)|0,Al=Al+Math.imul(Xl,Lp)|0,wl=wl+Math.imul(Xl,zp)|0,wl=wl+Math.imul(wu,Lp)|0,yl=yl+Math.imul(wu,zp)|0,Al=Al+Math.imul(Yl,qp)|0,wl=wl+Math.imul(Yl,Vp)|0,wl=wl+Math.imul(Ll,qp)|0,yl=yl+Math.imul(Ll,Vp)|0,Al=Al+Math.imul(zl,g0)|0,wl=wl+Math.imul(zl,rm)|0,wl=wl+Math.imul(Vl,g0)|0,yl=yl+Math.imul(Vl,rm)|0;var Qm=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(Qm>>>26)|0,Qm&=67108863,Al=Math.imul(Jl,Zp),wl=Math.imul(Jl,Qp),wl=wl+Math.imul(fu,Zp)|0,yl=Math.imul(fu,Qp),Al=Al+Math.imul(Kl,h0)|0,wl=wl+Math.imul(Kl,Wp)|0,wl=wl+Math.imul(Fl,h0)|0,yl=yl+Math.imul(Fl,Wp)|0,Al=Al+Math.imul(fp,Rp)|0,wl=wl+Math.imul(fp,Pp)|0,wl=wl+Math.imul(hp,Rp)|0,yl=yl+Math.imul(hp,Pp)|0,Al=Al+Math.imul(cp,kp)|0,wl=wl+Math.imul(cp,Gp)|0,wl=wl+Math.imul(gp,kp)|0,yl=yl+Math.imul(gp,Gp)|0,Al=Al+Math.imul(wp,Mp)|0,wl=wl+Math.imul(wp,Ip)|0,wl=wl+Math.imul(vp,Mp)|0,yl=yl+Math.imul(vp,Ip)|0,Al=Al+Math.imul(rp,Lp)|0,wl=wl+Math.imul(rp,zp)|0,wl=wl+Math.imul(dp,Lp)|0,yl=yl+Math.imul(dp,zp)|0,Al=Al+Math.imul(Xl,qp)|0,wl=wl+Math.imul(Xl,Vp)|0,wl=wl+Math.imul(wu,qp)|0,yl=yl+Math.imul(wu,Vp)|0,Al=Al+Math.imul(Yl,g0)|0,wl=wl+Math.imul(Yl,rm)|0,wl=wl+Math.imul(Ll,g0)|0,yl=yl+Math.imul(Ll,rm)|0;var o1=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(o1>>>26)|0,o1&=67108863,Al=Math.imul(Jl,h0),wl=Math.imul(Jl,Wp),wl=wl+Math.imul(fu,h0)|0,yl=Math.imul(fu,Wp),Al=Al+Math.imul(Kl,Rp)|0,wl=wl+Math.imul(Kl,Pp)|0,wl=wl+Math.imul(Fl,Rp)|0,yl=yl+Math.imul(Fl,Pp)|0,Al=Al+Math.imul(fp,kp)|0,wl=wl+Math.imul(fp,Gp)|0,wl=wl+Math.imul(hp,kp)|0,yl=yl+Math.imul(hp,Gp)|0,Al=Al+Math.imul(cp,Mp)|0,wl=wl+Math.imul(cp,Ip)|0,wl=wl+Math.imul(gp,Mp)|0,yl=yl+Math.imul(gp,Ip)|0,Al=Al+Math.imul(wp,Lp)|0,wl=wl+Math.imul(wp,zp)|0,wl=wl+Math.imul(vp,Lp)|0,yl=yl+Math.imul(vp,zp)|0,Al=Al+Math.imul(rp,qp)|0,wl=wl+Math.imul(rp,Vp)|0,wl=wl+Math.imul(dp,qp)|0,yl=yl+Math.imul(dp,Vp)|0,Al=Al+Math.imul(Xl,g0)|0,wl=wl+Math.imul(Xl,rm)|0,wl=wl+Math.imul(wu,g0)|0,yl=yl+Math.imul(wu,rm)|0;var e1=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(e1>>>26)|0,e1&=67108863,Al=Math.imul(Jl,Rp),wl=Math.imul(Jl,Pp),wl=wl+Math.imul(fu,Rp)|0,yl=Math.imul(fu,Pp),Al=Al+Math.imul(Kl,kp)|0,wl=wl+Math.imul(Kl,Gp)|0,wl=wl+Math.imul(Fl,kp)|0,yl=yl+Math.imul(Fl,Gp)|0,Al=Al+Math.imul(fp,Mp)|0,wl=wl+Math.imul(fp,Ip)|0,wl=wl+Math.imul(hp,Mp)|0,yl=yl+Math.imul(hp,Ip)|0,Al=Al+Math.imul(cp,Lp)|0,wl=wl+Math.imul(cp,zp)|0,wl=wl+Math.imul(gp,Lp)|0,yl=yl+Math.imul(gp,zp)|0,Al=Al+Math.imul(wp,qp)|0,wl=wl+Math.imul(wp,Vp)|0,wl=wl+Math.imul(vp,qp)|0,yl=yl+Math.imul(vp,Vp)|0,Al=Al+Math.imul(rp,g0)|0,wl=wl+Math.imul(rp,rm)|0,wl=wl+Math.imul(dp,g0)|0,yl=yl+Math.imul(dp,rm)|0;var Zm=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(Zm>>>26)|0,Zm&=67108863,Al=Math.imul(Jl,kp),wl=Math.imul(Jl,Gp),wl=wl+Math.imul(fu,kp)|0,yl=Math.imul(fu,Gp),Al=Al+Math.imul(Kl,Mp)|0,wl=wl+Math.imul(Kl,Ip)|0,wl=wl+Math.imul(Fl,Mp)|0,yl=yl+Math.imul(Fl,Ip)|0,Al=Al+Math.imul(fp,Lp)|0,wl=wl+Math.imul(fp,zp)|0,wl=wl+Math.imul(hp,Lp)|0,yl=yl+Math.imul(hp,zp)|0,Al=Al+Math.imul(cp,qp)|0,wl=wl+Math.imul(cp,Vp)|0,wl=wl+Math.imul(gp,qp)|0,yl=yl+Math.imul(gp,Vp)|0,Al=Al+Math.imul(wp,g0)|0,wl=wl+Math.imul(wp,rm)|0,wl=wl+Math.imul(vp,g0)|0,yl=yl+Math.imul(vp,rm)|0;var t1=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(t1>>>26)|0,t1&=67108863,Al=Math.imul(Jl,Mp),wl=Math.imul(Jl,Ip),wl=wl+Math.imul(fu,Mp)|0,yl=Math.imul(fu,Ip),Al=Al+Math.imul(Kl,Lp)|0,wl=wl+Math.imul(Kl,zp)|0,wl=wl+Math.imul(Fl,Lp)|0,yl=yl+Math.imul(Fl,zp)|0,Al=Al+Math.imul(fp,qp)|0,wl=wl+Math.imul(fp,Vp)|0,wl=wl+Math.imul(hp,qp)|0,yl=yl+Math.imul(hp,Vp)|0,Al=Al+Math.imul(cp,g0)|0,wl=wl+Math.imul(cp,rm)|0,wl=wl+Math.imul(gp,g0)|0,yl=yl+Math.imul(gp,rm)|0;var Bm=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(Bm>>>26)|0,Bm&=67108863,Al=Math.imul(Jl,Lp),wl=Math.imul(Jl,zp),wl=wl+Math.imul(fu,Lp)|0,yl=Math.imul(fu,zp),Al=Al+Math.imul(Kl,qp)|0,wl=wl+Math.imul(Kl,Vp)|0,wl=wl+Math.imul(Fl,qp)|0,yl=yl+Math.imul(Fl,Vp)|0,Al=Al+Math.imul(fp,g0)|0,wl=wl+Math.imul(fp,rm)|0,wl=wl+Math.imul(hp,g0)|0,yl=yl+Math.imul(hp,rm)|0;var Dm=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(Dm>>>26)|0,Dm&=67108863,Al=Math.imul(Jl,qp),wl=Math.imul(Jl,Vp),wl=wl+Math.imul(fu,qp)|0,yl=Math.imul(fu,Vp),Al=Al+Math.imul(Kl,g0)|0,wl=wl+Math.imul(Kl,rm)|0,wl=wl+Math.imul(Fl,g0)|0,yl=yl+Math.imul(Fl,rm)|0;var Om=(Xo+Al|0)+((wl&8191)<<13)|0;Xo=(yl+(wl>>>13)|0)+(Om>>>26)|0,Om&=67108863,Al=Math.imul(Jl,g0),wl=Math.imul(Jl,rm),wl=wl+Math.imul(fu,g0)|0,yl=Math.imul(fu,rm);var r1=(Xo+Al|0)+((wl&8191)<<13)|0;return Xo=(yl+(wl>>>13)|0)+(r1>>>26)|0,r1&=67108863,El[0]=Jp,El[1]=lm,El[2]=$m,El[3]=km,El[4]=Cm,El[5]=Am,El[6]=pm,El[7]=Ym,El[8]=u1,El[9]=qm,El[10]=Qm,El[11]=o1,El[12]=e1,El[13]=Zm,El[14]=t1,El[15]=Bm,El[16]=Dm,El[17]=Om,El[18]=r1,Xo!==0&&(El[19]=Xo,jo.length++),jo};Math.imul||(Lo=$o);function Go(Ol,Rl,Vo){Vo.negative=Rl.negative^Ol.negative,Vo.length=Ol.length+Rl.length;for(var jo=0,Ho=0,Qo=0;Qo<Vo.length-1;Qo++){var El=Ho;Ho=0;for(var Xo=jo&67108863,Al=Math.min(Qo,Rl.length-1),wl=Math.max(0,Qo-Ol.length+1);wl<=Al;wl++){var yl=Qo-wl,Il=Ol.words[yl]|0,Bl=Rl.words[wl]|0,Gl=Il*Bl,Nl=Gl&67108863;El=El+(Gl/67108864|0)|0,Nl=Nl+Xo|0,Xo=Nl&67108863,El=El+(Nl>>>26)|0,Ho+=El>>>26,El&=67108863}Vo.words[Qo]=Xo,jo=El,El=Ho}return jo!==0?Vo.words[Qo]=jo:Vo.length--,Vo.strip()}function Yo(Ol,Rl,Vo){var jo=new Wo;return jo.mulp(Ol,Rl,Vo)}as.prototype.mulTo=function(Rl,Vo){var jo,Ho=this.length+Rl.length;return this.length===10&&Rl.length===10?jo=Lo(this,Rl,Vo):Ho<63?jo=$o(this,Rl,Vo):Ho<1024?jo=Go(this,Rl,Vo):jo=Yo(this,Rl,Vo),jo};function Wo(Ol,Rl){this.x=Ol,this.y=Rl}Wo.prototype.makeRBT=function(Rl){for(var Vo=new Array(Rl),jo=as.prototype._countBits(Rl)-1,Ho=0;Ho<Rl;Ho++)Vo[Ho]=this.revBin(Ho,jo,Rl);return Vo},Wo.prototype.revBin=function(Rl,Vo,jo){if(Rl===0||Rl===jo-1)return Rl;for(var Ho=0,Qo=0;Qo<Vo;Qo++)Ho|=(Rl&1)<<Vo-Qo-1,Rl>>=1;return Ho},Wo.prototype.permute=function(Rl,Vo,jo,Ho,Qo,El){for(var Xo=0;Xo<El;Xo++)Ho[Xo]=Vo[Rl[Xo]],Qo[Xo]=jo[Rl[Xo]]},Wo.prototype.transform=function(Rl,Vo,jo,Ho,Qo,El){this.permute(El,Rl,Vo,jo,Ho,Qo);for(var Xo=1;Xo<Qo;Xo<<=1)for(var Al=Xo<<1,wl=Math.cos(2*Math.PI/Al),yl=Math.sin(2*Math.PI/Al),Il=0;Il<Qo;Il+=Al)for(var Bl=wl,Gl=yl,Nl=0;Nl<Xo;Nl++){var zl=jo[Il+Nl],Vl=Ho[Il+Nl],Hl=jo[Il+Nl+Xo],Yl=Ho[Il+Nl+Xo],Ll=Bl*Hl-Gl*Yl;Yl=Bl*Yl+Gl*Hl,Hl=Ll,jo[Il+Nl]=zl+Hl,Ho[Il+Nl]=Vl+Yl,jo[Il+Nl+Xo]=zl-Hl,Ho[Il+Nl+Xo]=Vl-Yl,Nl!==Al&&(Ll=wl*Bl-yl*Gl,Gl=wl*Gl+yl*Bl,Bl=Ll)}},Wo.prototype.guessLen13b=function(Rl,Vo){var jo=Math.max(Vo,Rl)|1,Ho=jo&1,Qo=0;for(jo=jo/2|0;jo;jo=jo>>>1)Qo++;return 1<<Qo+1+Ho},Wo.prototype.conjugate=function(Rl,Vo,jo){if(!(jo<=1))for(var Ho=0;Ho<jo/2;Ho++){var Qo=Rl[Ho];Rl[Ho]=Rl[jo-Ho-1],Rl[jo-Ho-1]=Qo,Qo=Vo[Ho],Vo[Ho]=-Vo[jo-Ho-1],Vo[jo-Ho-1]=-Qo}},Wo.prototype.normalize13b=function(Rl,Vo){for(var jo=0,Ho=0;Ho<Vo/2;Ho++){var Qo=Math.round(Rl[2*Ho+1]/Vo)*8192+Math.round(Rl[2*Ho]/Vo)+jo;Rl[Ho]=Qo&67108863,Qo<67108864?jo=0:jo=Qo/67108864|0}return Rl},Wo.prototype.convert13b=function(Rl,Vo,jo,Ho){for(var Qo=0,El=0;El<Vo;El++)Qo=Qo+(Rl[El]|0),jo[2*El]=Qo&8191,Qo=Qo>>>13,jo[2*El+1]=Qo&8191,Qo=Qo>>>13;for(El=2*Vo;El<Ho;++El)jo[El]=0;is(Qo===0),is((Qo&-8192)===0)},Wo.prototype.stub=function(Rl){for(var Vo=new Array(Rl),jo=0;jo<Rl;jo++)Vo[jo]=0;return Vo},Wo.prototype.mulp=function(Rl,Vo,jo){var Ho=2*this.guessLen13b(Rl.length,Vo.length),Qo=this.makeRBT(Ho),El=this.stub(Ho),Xo=new Array(Ho),Al=new Array(Ho),wl=new Array(Ho),yl=new Array(Ho),Il=new Array(Ho),Bl=new Array(Ho),Gl=jo.words;Gl.length=Ho,this.convert13b(Rl.words,Rl.length,Xo,Ho),this.convert13b(Vo.words,Vo.length,yl,Ho),this.transform(Xo,El,Al,wl,Ho,Qo),this.transform(yl,El,Il,Bl,Ho,Qo);for(var Nl=0;Nl<Ho;Nl++){var zl=Al[Nl]*Il[Nl]-wl[Nl]*Bl[Nl];wl[Nl]=Al[Nl]*Bl[Nl]+wl[Nl]*Il[Nl],Al[Nl]=zl}return this.conjugate(Al,wl,Ho),this.transform(Al,wl,Gl,El,Ho,Qo),this.conjugate(Gl,El,Ho),this.normalize13b(Gl,Ho),jo.negative=Rl.negative^Vo.negative,jo.length=Rl.length+Vo.length,jo.strip()},as.prototype.mul=function(Rl){var Vo=new as(null);return Vo.words=new Array(this.length+Rl.length),this.mulTo(Rl,Vo)},as.prototype.mulf=function(Rl){var Vo=new as(null);return Vo.words=new Array(this.length+Rl.length),Yo(this,Rl,Vo)},as.prototype.imul=function(Rl){return this.clone().mulTo(Rl,this)},as.prototype.imuln=function(Rl){is(typeof Rl=="number"),is(Rl<67108864);for(var Vo=0,jo=0;jo<this.length;jo++){var Ho=(this.words[jo]|0)*Rl,Qo=(Ho&67108863)+(Vo&67108863);Vo>>=26,Vo+=Ho/67108864|0,Vo+=Qo>>>26,this.words[jo]=Qo&67108863}return Vo!==0&&(this.words[jo]=Vo,this.length++),this},as.prototype.muln=function(Rl){return this.clone().imuln(Rl)},as.prototype.sqr=function(){return this.mul(this)},as.prototype.isqr=function(){return this.imul(this.clone())},as.prototype.pow=function(Rl){var Vo=Ao(Rl);if(Vo.length===0)return new as(1);for(var jo=this,Ho=0;Ho<Vo.length&&Vo[Ho]===0;Ho++,jo=jo.sqr());if(++Ho<Vo.length)for(var Qo=jo.sqr();Ho<Vo.length;Ho++,Qo=Qo.sqr())Vo[Ho]!==0&&(jo=jo.mul(Qo));return jo},as.prototype.iushln=function(Rl){is(typeof Rl=="number"&&Rl>=0);var Vo=Rl%26,jo=(Rl-Vo)/26,Ho=67108863>>>26-Vo<<26-Vo,Qo;if(Vo!==0){var El=0;for(Qo=0;Qo<this.length;Qo++){var Xo=this.words[Qo]&Ho,Al=(this.words[Qo]|0)-Xo<<Vo;this.words[Qo]=Al|El,El=Xo>>>26-Vo}El&&(this.words[Qo]=El,this.length++)}if(jo!==0){for(Qo=this.length-1;Qo>=0;Qo--)this.words[Qo+jo]=this.words[Qo];for(Qo=0;Qo<jo;Qo++)this.words[Qo]=0;this.length+=jo}return this.strip()},as.prototype.ishln=function(Rl){return is(this.negative===0),this.iushln(Rl)},as.prototype.iushrn=function(Rl,Vo,jo){is(typeof Rl=="number"&&Rl>=0);var Ho;Vo?Ho=(Vo-Vo%26)/26:Ho=0;var Qo=Rl%26,El=Math.min((Rl-Qo)/26,this.length),Xo=67108863^67108863>>>Qo<<Qo,Al=jo;if(Ho-=El,Ho=Math.max(0,Ho),Al){for(var wl=0;wl<El;wl++)Al.words[wl]=this.words[wl];Al.length=El}if(El!==0)if(this.length>El)for(this.length-=El,wl=0;wl<this.length;wl++)this.words[wl]=this.words[wl+El];else this.words[0]=0,this.length=1;var yl=0;for(wl=this.length-1;wl>=0&&(yl!==0||wl>=Ho);wl--){var Il=this.words[wl]|0;this.words[wl]=yl<<26-Qo|Il>>>Qo,yl=Il&Xo}return Al&&yl!==0&&(Al.words[Al.length++]=yl),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},as.prototype.ishrn=function(Rl,Vo,jo){return is(this.negative===0),this.iushrn(Rl,Vo,jo)},as.prototype.shln=function(Rl){return this.clone().ishln(Rl)},as.prototype.ushln=function(Rl){return this.clone().iushln(Rl)},as.prototype.shrn=function(Rl){return this.clone().ishrn(Rl)},as.prototype.ushrn=function(Rl){return this.clone().iushrn(Rl)},as.prototype.testn=function(Rl){is(typeof Rl=="number"&&Rl>=0);var Vo=Rl%26,jo=(Rl-Vo)/26,Ho=1<<Vo;if(this.length<=jo)return!1;var Qo=this.words[jo];return!!(Qo&Ho)},as.prototype.imaskn=function(Rl){is(typeof Rl=="number"&&Rl>=0);var Vo=Rl%26,jo=(Rl-Vo)/26;if(is(this.negative===0,"imaskn works only with positive numbers"),this.length<=jo)return this;if(Vo!==0&&jo++,this.length=Math.min(jo,this.length),Vo!==0){var Ho=67108863^67108863>>>Vo<<Vo;this.words[this.length-1]&=Ho}return this.strip()},as.prototype.maskn=function(Rl){return this.clone().imaskn(Rl)},as.prototype.iaddn=function(Rl){return is(typeof Rl=="number"),is(Rl<67108864),Rl<0?this.isubn(-Rl):this.negative!==0?this.length===1&&(this.words[0]|0)<Rl?(this.words[0]=Rl-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Rl),this.negative=1,this):this._iaddn(Rl)},as.prototype._iaddn=function(Rl){this.words[0]+=Rl;for(var Vo=0;Vo<this.length&&this.words[Vo]>=67108864;Vo++)this.words[Vo]-=67108864,Vo===this.length-1?this.words[Vo+1]=1:this.words[Vo+1]++;return this.length=Math.max(this.length,Vo+1),this},as.prototype.isubn=function(Rl){if(is(typeof Rl=="number"),is(Rl<67108864),Rl<0)return this.iaddn(-Rl);if(this.negative!==0)return this.negative=0,this.iaddn(Rl),this.negative=1,this;if(this.words[0]-=Rl,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Vo=0;Vo<this.length&&this.words[Vo]<0;Vo++)this.words[Vo]+=67108864,this.words[Vo+1]-=1;return this.strip()},as.prototype.addn=function(Rl){return this.clone().iaddn(Rl)},as.prototype.subn=function(Rl){return this.clone().isubn(Rl)},as.prototype.iabs=function(){return this.negative=0,this},as.prototype.abs=function(){return this.clone().iabs()},as.prototype._ishlnsubmul=function(Rl,Vo,jo){var Ho=Rl.length+jo,Qo;this._expand(Ho);var El,Xo=0;for(Qo=0;Qo<Rl.length;Qo++){El=(this.words[Qo+jo]|0)+Xo;var Al=(Rl.words[Qo]|0)*Vo;El-=Al&67108863,Xo=(El>>26)-(Al/67108864|0),this.words[Qo+jo]=El&67108863}for(;Qo<this.length-jo;Qo++)El=(this.words[Qo+jo]|0)+Xo,Xo=El>>26,this.words[Qo+jo]=El&67108863;if(Xo===0)return this.strip();for(is(Xo===-1),Xo=0,Qo=0;Qo<this.length;Qo++)El=-(this.words[Qo]|0)+Xo,Xo=El>>26,this.words[Qo]=El&67108863;return this.negative=1,this.strip()},as.prototype._wordDiv=function(Rl,Vo){var jo=this.length-Rl.length,Ho=this.clone(),Qo=Rl,El=Qo.words[Qo.length-1]|0,Xo=this._countBits(El);jo=26-Xo,jo!==0&&(Qo=Qo.ushln(jo),Ho.iushln(jo),El=Qo.words[Qo.length-1]|0);var Al=Ho.length-Qo.length,wl;if(Vo!=="mod"){wl=new as(null),wl.length=Al+1,wl.words=new Array(wl.length);for(var yl=0;yl<wl.length;yl++)wl.words[yl]=0}var Il=Ho.clone()._ishlnsubmul(Qo,1,Al);Il.negative===0&&(Ho=Il,wl&&(wl.words[Al]=1));for(var Bl=Al-1;Bl>=0;Bl--){var Gl=(Ho.words[Qo.length+Bl]|0)*67108864+(Ho.words[Qo.length+Bl-1]|0);for(Gl=Math.min(Gl/El|0,67108863),Ho._ishlnsubmul(Qo,Gl,Bl);Ho.negative!==0;)Gl--,Ho.negative=0,Ho._ishlnsubmul(Qo,1,Bl),Ho.isZero()||(Ho.negative^=1);wl&&(wl.words[Bl]=Gl)}return wl&&wl.strip(),Ho.strip(),Vo!=="div"&&jo!==0&&Ho.iushrn(jo),{div:wl||null,mod:Ho}},as.prototype.divmod=function(Rl,Vo,jo){if(is(!Rl.isZero()),this.isZero())return{div:new as(0),mod:new as(0)};var Ho,Qo,El;return this.negative!==0&&Rl.negative===0?(El=this.neg().divmod(Rl,Vo),Vo!=="mod"&&(Ho=El.div.neg()),Vo!=="div"&&(Qo=El.mod.neg(),jo&&Qo.negative!==0&&Qo.iadd(Rl)),{div:Ho,mod:Qo}):this.negative===0&&Rl.negative!==0?(El=this.divmod(Rl.neg(),Vo),Vo!=="mod"&&(Ho=El.div.neg()),{div:Ho,mod:El.mod}):this.negative&Rl.negative?(El=this.neg().divmod(Rl.neg(),Vo),Vo!=="div"&&(Qo=El.mod.neg(),jo&&Qo.negative!==0&&Qo.isub(Rl)),{div:El.div,mod:Qo}):Rl.length>this.length||this.cmp(Rl)<0?{div:new as(0),mod:this}:Rl.length===1?Vo==="div"?{div:this.divn(Rl.words[0]),mod:null}:Vo==="mod"?{div:null,mod:new as(this.modn(Rl.words[0]))}:{div:this.divn(Rl.words[0]),mod:new as(this.modn(Rl.words[0]))}:this._wordDiv(Rl,Vo)},as.prototype.div=function(Rl){return this.divmod(Rl,"div",!1).div},as.prototype.mod=function(Rl){return this.divmod(Rl,"mod",!1).mod},as.prototype.umod=function(Rl){return this.divmod(Rl,"mod",!0).mod},as.prototype.divRound=function(Rl){var Vo=this.divmod(Rl);if(Vo.mod.isZero())return Vo.div;var jo=Vo.div.negative!==0?Vo.mod.isub(Rl):Vo.mod,Ho=Rl.ushrn(1),Qo=Rl.andln(1),El=jo.cmp(Ho);return El<0||Qo===1&&El===0?Vo.div:Vo.div.negative!==0?Vo.div.isubn(1):Vo.div.iaddn(1)},as.prototype.modn=function(Rl){is(Rl<=67108863);for(var Vo=(1<<26)%Rl,jo=0,Ho=this.length-1;Ho>=0;Ho--)jo=(Vo*jo+(this.words[Ho]|0))%Rl;return jo},as.prototype.idivn=function(Rl){is(Rl<=67108863);for(var Vo=0,jo=this.length-1;jo>=0;jo--){var Ho=(this.words[jo]|0)+Vo*67108864;this.words[jo]=Ho/Rl|0,Vo=Ho%Rl}return this.strip()},as.prototype.divn=function(Rl){return this.clone().idivn(Rl)},as.prototype.egcd=function(Rl){is(Rl.negative===0),is(!Rl.isZero());var Vo=this,jo=Rl.clone();Vo.negative!==0?Vo=Vo.umod(Rl):Vo=Vo.clone();for(var Ho=new as(1),Qo=new as(0),El=new as(0),Xo=new as(1),Al=0;Vo.isEven()&&jo.isEven();)Vo.iushrn(1),jo.iushrn(1),++Al;for(var wl=jo.clone(),yl=Vo.clone();!Vo.isZero();){for(var Il=0,Bl=1;!(Vo.words[0]&Bl)&&Il<26;++Il,Bl<<=1);if(Il>0)for(Vo.iushrn(Il);Il-- >0;)(Ho.isOdd()||Qo.isOdd())&&(Ho.iadd(wl),Qo.isub(yl)),Ho.iushrn(1),Qo.iushrn(1);for(var Gl=0,Nl=1;!(jo.words[0]&Nl)&&Gl<26;++Gl,Nl<<=1);if(Gl>0)for(jo.iushrn(Gl);Gl-- >0;)(El.isOdd()||Xo.isOdd())&&(El.iadd(wl),Xo.isub(yl)),El.iushrn(1),Xo.iushrn(1);Vo.cmp(jo)>=0?(Vo.isub(jo),Ho.isub(El),Qo.isub(Xo)):(jo.isub(Vo),El.isub(Ho),Xo.isub(Qo))}return{a:El,b:Xo,gcd:jo.iushln(Al)}},as.prototype._invmp=function(Rl){is(Rl.negative===0),is(!Rl.isZero());var Vo=this,jo=Rl.clone();Vo.negative!==0?Vo=Vo.umod(Rl):Vo=Vo.clone();for(var Ho=new as(1),Qo=new as(0),El=jo.clone();Vo.cmpn(1)>0&&jo.cmpn(1)>0;){for(var Xo=0,Al=1;!(Vo.words[0]&Al)&&Xo<26;++Xo,Al<<=1);if(Xo>0)for(Vo.iushrn(Xo);Xo-- >0;)Ho.isOdd()&&Ho.iadd(El),Ho.iushrn(1);for(var wl=0,yl=1;!(jo.words[0]&yl)&&wl<26;++wl,yl<<=1);if(wl>0)for(jo.iushrn(wl);wl-- >0;)Qo.isOdd()&&Qo.iadd(El),Qo.iushrn(1);Vo.cmp(jo)>=0?(Vo.isub(jo),Ho.isub(Qo)):(jo.isub(Vo),Qo.isub(Ho))}var Il;return Vo.cmpn(1)===0?Il=Ho:Il=Qo,Il.cmpn(0)<0&&Il.iadd(Rl),Il},as.prototype.gcd=function(Rl){if(this.isZero())return Rl.abs();if(Rl.isZero())return this.abs();var Vo=this.clone(),jo=Rl.clone();Vo.negative=0,jo.negative=0;for(var Ho=0;Vo.isEven()&&jo.isEven();Ho++)Vo.iushrn(1),jo.iushrn(1);do{for(;Vo.isEven();)Vo.iushrn(1);for(;jo.isEven();)jo.iushrn(1);var Qo=Vo.cmp(jo);if(Qo<0){var El=Vo;Vo=jo,jo=El}else if(Qo===0||jo.cmpn(1)===0)break;Vo.isub(jo)}while(!0);return jo.iushln(Ho)},as.prototype.invm=function(Rl){return this.egcd(Rl).a.umod(Rl)},as.prototype.isEven=function(){return(this.words[0]&1)===0},as.prototype.isOdd=function(){return(this.words[0]&1)===1},as.prototype.andln=function(Rl){return this.words[0]&Rl},as.prototype.bincn=function(Rl){is(typeof Rl=="number");var Vo=Rl%26,jo=(Rl-Vo)/26,Ho=1<<Vo;if(this.length<=jo)return this._expand(jo+1),this.words[jo]|=Ho,this;for(var Qo=Ho,El=jo;Qo!==0&&El<this.length;El++){var Xo=this.words[El]|0;Xo+=Qo,Qo=Xo>>>26,Xo&=67108863,this.words[El]=Xo}return Qo!==0&&(this.words[El]=Qo,this.length++),this},as.prototype.isZero=function(){return this.length===1&&this.words[0]===0},as.prototype.cmpn=function(Rl){var Vo=Rl<0;if(this.negative!==0&&!Vo)return-1;if(this.negative===0&&Vo)return 1;this.strip();var jo;if(this.length>1)jo=1;else{Vo&&(Rl=-Rl),is(Rl<=67108863,"Number is too big");var Ho=this.words[0]|0;jo=Ho===Rl?0:Ho<Rl?-1:1}return this.negative!==0?-jo|0:jo},as.prototype.cmp=function(Rl){if(this.negative!==0&&Rl.negative===0)return-1;if(this.negative===0&&Rl.negative!==0)return 1;var Vo=this.ucmp(Rl);return this.negative!==0?-Vo|0:Vo},as.prototype.ucmp=function(Rl){if(this.length>Rl.length)return 1;if(this.length<Rl.length)return-1;for(var Vo=0,jo=this.length-1;jo>=0;jo--){var Ho=this.words[jo]|0,Qo=Rl.words[jo]|0;if(Ho!==Qo){Ho<Qo?Vo=-1:Ho>Qo&&(Vo=1);break}}return Vo},as.prototype.gtn=function(Rl){return this.cmpn(Rl)===1},as.prototype.gt=function(Rl){return this.cmp(Rl)===1},as.prototype.gten=function(Rl){return this.cmpn(Rl)>=0},as.prototype.gte=function(Rl){return this.cmp(Rl)>=0},as.prototype.ltn=function(Rl){return this.cmpn(Rl)===-1},as.prototype.lt=function(Rl){return this.cmp(Rl)===-1},as.prototype.lten=function(Rl){return this.cmpn(Rl)<=0},as.prototype.lte=function(Rl){return this.cmp(Rl)<=0},as.prototype.eqn=function(Rl){return this.cmpn(Rl)===0},as.prototype.eq=function(Rl){return this.cmp(Rl)===0},as.red=function(Rl){return new Pl(Rl)},as.prototype.toRed=function(Rl){return is(!this.red,"Already a number in reduction context"),is(this.negative===0,"red works only with positives"),Rl.convertTo(this)._forceRed(Rl)},as.prototype.fromRed=function(){return is(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},as.prototype._forceRed=function(Rl){return this.red=Rl,this},as.prototype.forceRed=function(Rl){return is(!this.red,"Already a number in reduction context"),this._forceRed(Rl)},as.prototype.redAdd=function(Rl){return is(this.red,"redAdd works only with red numbers"),this.red.add(this,Rl)},as.prototype.redIAdd=function(Rl){return is(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Rl)},as.prototype.redSub=function(Rl){return is(this.red,"redSub works only with red numbers"),this.red.sub(this,Rl)},as.prototype.redISub=function(Rl){return is(this.red,"redISub works only with red numbers"),this.red.isub(this,Rl)},as.prototype.redShl=function(Rl){return is(this.red,"redShl works only with red numbers"),this.red.shl(this,Rl)},as.prototype.redMul=function(Rl){return is(this.red,"redMul works only with red numbers"),this.red._verify2(this,Rl),this.red.mul(this,Rl)},as.prototype.redIMul=function(Rl){return is(this.red,"redMul works only with red numbers"),this.red._verify2(this,Rl),this.red.imul(this,Rl)},as.prototype.redSqr=function(){return is(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},as.prototype.redISqr=function(){return is(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},as.prototype.redSqrt=function(){return is(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},as.prototype.redInvm=function(){return is(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},as.prototype.redNeg=function(){return is(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},as.prototype.redPow=function(Rl){return is(this.red&&!Rl.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Rl)};var Jo={k256:null,p224:null,p192:null,p25519:null};function xl(Ol,Rl){this.name=Ol,this.p=new as(Rl,16),this.n=this.p.bitLength(),this.k=new as(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}xl.prototype._tmp=function(){var Rl=new as(null);return Rl.words=new Array(Math.ceil(this.n/13)),Rl},xl.prototype.ireduce=function(Rl){var Vo=Rl,jo;do this.split(Vo,this.tmp),Vo=this.imulK(Vo),Vo=Vo.iadd(this.tmp),jo=Vo.bitLength();while(jo>this.n);var Ho=jo<this.n?-1:Vo.ucmp(this.p);return Ho===0?(Vo.words[0]=0,Vo.length=1):Ho>0?Vo.isub(this.p):Vo.strip!==void 0?Vo.strip():Vo._strip(),Vo},xl.prototype.split=function(Rl,Vo){Rl.iushrn(this.n,0,Vo)},xl.prototype.imulK=function(Rl){return Rl.imul(this.k)};function _l(){xl.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}os(_l,xl),_l.prototype.split=function(Rl,Vo){for(var jo=4194303,Ho=Math.min(Rl.length,9),Qo=0;Qo<Ho;Qo++)Vo.words[Qo]=Rl.words[Qo];if(Vo.length=Ho,Rl.length<=9){Rl.words[0]=0,Rl.length=1;return}var El=Rl.words[9];for(Vo.words[Vo.length++]=El&jo,Qo=10;Qo<Rl.length;Qo++){var Xo=Rl.words[Qo]|0;Rl.words[Qo-10]=(Xo&jo)<<4|El>>>22,El=Xo}El>>>=22,Rl.words[Qo-10]=El,El===0&&Rl.length>10?Rl.length-=10:Rl.length-=9},_l.prototype.imulK=function(Rl){Rl.words[Rl.length]=0,Rl.words[Rl.length+1]=0,Rl.length+=2;for(var Vo=0,jo=0;jo<Rl.length;jo++){var Ho=Rl.words[jo]|0;Vo+=Ho*977,Rl.words[jo]=Vo&67108863,Vo=Ho*64+(Vo/67108864|0)}return Rl.words[Rl.length-1]===0&&(Rl.length--,Rl.words[Rl.length-1]===0&&Rl.length--),Rl};function Tl(){xl.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}os(Tl,xl);function Sl(){xl.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}os(Sl,xl);function $l(){xl.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}os($l,xl),$l.prototype.imulK=function(Rl){for(var Vo=0,jo=0;jo<Rl.length;jo++){var Ho=(Rl.words[jo]|0)*19+Vo,Qo=Ho&67108863;Ho>>>=26,Rl.words[jo]=Qo,Vo=Ho}return Vo!==0&&(Rl.words[Rl.length++]=Vo),Rl},as._prime=function(Rl){if(Jo[Rl])return Jo[Rl];var Vo;if(Rl==="k256")Vo=new _l;else if(Rl==="p224")Vo=new Tl;else if(Rl==="p192")Vo=new Sl;else if(Rl==="p25519")Vo=new $l;else throw new Error("Unknown prime "+Rl);return Jo[Rl]=Vo,Vo};function Pl(Ol){if(typeof Ol=="string"){var Rl=as._prime(Ol);this.m=Rl.p,this.prime=Rl}else is(Ol.gtn(1),"modulus must be greater than 1"),this.m=Ol,this.prime=null}Pl.prototype._verify1=function(Rl){is(Rl.negative===0,"red works only with positives"),is(Rl.red,"red works only with red numbers")},Pl.prototype._verify2=function(Rl,Vo){is((Rl.negative|Vo.negative)===0,"red works only with positives"),is(Rl.red&&Rl.red===Vo.red,"red works only with red numbers")},Pl.prototype.imod=function(Rl){return this.prime?this.prime.ireduce(Rl)._forceRed(this):Rl.umod(this.m)._forceRed(this)},Pl.prototype.neg=function(Rl){return Rl.isZero()?Rl.clone():this.m.sub(Rl)._forceRed(this)},Pl.prototype.add=function(Rl,Vo){this._verify2(Rl,Vo);var jo=Rl.add(Vo);return jo.cmp(this.m)>=0&&jo.isub(this.m),jo._forceRed(this)},Pl.prototype.iadd=function(Rl,Vo){this._verify2(Rl,Vo);var jo=Rl.iadd(Vo);return jo.cmp(this.m)>=0&&jo.isub(this.m),jo},Pl.prototype.sub=function(Rl,Vo){this._verify2(Rl,Vo);var jo=Rl.sub(Vo);return jo.cmpn(0)<0&&jo.iadd(this.m),jo._forceRed(this)},Pl.prototype.isub=function(Rl,Vo){this._verify2(Rl,Vo);var jo=Rl.isub(Vo);return jo.cmpn(0)<0&&jo.iadd(this.m),jo},Pl.prototype.shl=function(Rl,Vo){return this._verify1(Rl),this.imod(Rl.ushln(Vo))},Pl.prototype.imul=function(Rl,Vo){return this._verify2(Rl,Vo),this.imod(Rl.imul(Vo))},Pl.prototype.mul=function(Rl,Vo){return this._verify2(Rl,Vo),this.imod(Rl.mul(Vo))},Pl.prototype.isqr=function(Rl){return this.imul(Rl,Rl.clone())},Pl.prototype.sqr=function(Rl){return this.mul(Rl,Rl)},Pl.prototype.sqrt=function(Rl){if(Rl.isZero())return Rl.clone();var Vo=this.m.andln(3);if(is(Vo%2===1),Vo===3){var jo=this.m.add(new as(1)).iushrn(2);return this.pow(Rl,jo)}for(var Ho=this.m.subn(1),Qo=0;!Ho.isZero()&&Ho.andln(1)===0;)Qo++,Ho.iushrn(1);is(!Ho.isZero());var El=new as(1).toRed(this),Xo=El.redNeg(),Al=this.m.subn(1).iushrn(1),wl=this.m.bitLength();for(wl=new as(2*wl*wl).toRed(this);this.pow(wl,Al).cmp(Xo)!==0;)wl.redIAdd(Xo);for(var yl=this.pow(wl,Ho),Il=this.pow(Rl,Ho.addn(1).iushrn(1)),Bl=this.pow(Rl,Ho),Gl=Qo;Bl.cmp(El)!==0;){for(var Nl=Bl,zl=0;Nl.cmp(El)!==0;zl++)Nl=Nl.redSqr();is(zl<Gl);var Vl=this.pow(yl,new as(1).iushln(Gl-zl-1));Il=Il.redMul(Vl),yl=Vl.redSqr(),Bl=Bl.redMul(yl),Gl=zl}return Il},Pl.prototype.invm=function(Rl){var Vo=Rl._invmp(this.m);return Vo.negative!==0?(Vo.negative=0,this.imod(Vo).redNeg()):this.imod(Vo)},Pl.prototype.pow=function(Rl,Vo){if(Vo.isZero())return new as(1).toRed(this);if(Vo.cmpn(1)===0)return Rl.clone();var jo=4,Ho=new Array(1<<jo);Ho[0]=new as(1).toRed(this),Ho[1]=Rl;for(var Qo=2;Qo<Ho.length;Qo++)Ho[Qo]=this.mul(Ho[Qo-1],Rl);var El=Ho[0],Xo=0,Al=0,wl=Vo.bitLength()%26;for(wl===0&&(wl=26),Qo=Vo.length-1;Qo>=0;Qo--){for(var yl=Vo.words[Qo],Il=wl-1;Il>=0;Il--){var Bl=yl>>Il&1;if(El!==Ho[0]&&(El=this.sqr(El)),Bl===0&&Xo===0){Al=0;continue}Xo<<=1,Xo|=Bl,Al++,!(Al!==jo&&(Qo!==0||Il!==0))&&(El=this.mul(El,Ho[Xo]),Al=0,Xo=0)}wl=26}return El},Pl.prototype.convertTo=function(Rl){var Vo=Rl.umod(this.m);return Vo===Rl?Vo.clone():Vo},Pl.prototype.convertFrom=function(Rl){var Vo=Rl.clone();return Vo.red=null,Vo},as.mont=function(Rl){return new Dl(Rl)};function Dl(Ol){Pl.call(this,Ol),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new as(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}os(Dl,Pl),Dl.prototype.convertTo=function(Rl){return this.imod(Rl.ushln(this.shift))},Dl.prototype.convertFrom=function(Rl){var Vo=this.imod(Rl.mul(this.rinv));return Vo.red=null,Vo},Dl.prototype.imul=function(Rl,Vo){if(Rl.isZero()||Vo.isZero())return Rl.words[0]=0,Rl.length=1,Rl;var jo=Rl.imul(Vo),Ho=jo.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Qo=jo.isub(Ho).iushrn(this.shift),El=Qo;return Qo.cmp(this.m)>=0?El=Qo.isub(this.m):Qo.cmpn(0)<0&&(El=Qo.iadd(this.m)),El._forceRed(this)},Dl.prototype.mul=function(Rl,Vo){if(Rl.isZero()||Vo.isZero())return new as(0)._forceRed(this);var jo=Rl.mul(Vo),Ho=jo.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Qo=jo.isub(Ho).iushrn(this.shift),El=Qo;return Qo.cmp(this.m)>=0?El=Qo.isub(this.m):Qo.cmpn(0)<0&&(El=Qo.iadd(this.m)),El._forceRed(this)},Dl.prototype.invm=function(Rl){var Vo=this.imod(Rl._invmp(this.m).mul(this.r2));return Vo._forceRed(this)}})(Fn,commonjsGlobal)})(bn$1);var bnExports=bn$1.exports,utils$c={};(function(Fn){var Mn=Fn;function rs(as,us){if(Array.isArray(as))return as.slice();if(!as)return[];var ds=[];if(typeof as!="string"){for(var hs=0;hs<as.length;hs++)ds[hs]=as[hs]|0;return ds}if(us==="hex"){as=as.replace(/[^a-z0-9]+/ig,""),as.length%2!==0&&(as="0"+as);for(var hs=0;hs<as.length;hs+=2)ds.push(parseInt(as[hs]+as[hs+1],16))}else for(var hs=0;hs<as.length;hs++){var ps=as.charCodeAt(hs),io=ps>>8,fo=ps&255;io?ds.push(io,fo):ds.push(fo)}return ds}Mn.toArray=rs;function is(as){return as.length===1?"0"+as:as}Mn.zero2=is;function os(as){for(var us="",ds=0;ds<as.length;ds++)us+=is(as[ds].toString(16));return us}Mn.toHex=os,Mn.encode=function(us,ds){return ds==="hex"?os(us):us}})(utils$c);(function(Fn){var Mn=Fn,rs=bnExports,is=minimalisticAssert$1,os=utils$c;Mn.assert=is,Mn.toArray=os.toArray,Mn.zero2=os.zero2,Mn.toHex=os.toHex,Mn.encode=os.encode;function as(io,fo,mo){var Ao=new Array(Math.max(io.bitLength(),mo)+1),$o;for($o=0;$o<Ao.length;$o+=1)Ao[$o]=0;var Lo=1<<fo+1,Go=io.clone();for($o=0;$o<Ao.length;$o++){var Yo,Wo=Go.andln(Lo-1);Go.isOdd()?(Wo>(Lo>>1)-1?Yo=(Lo>>1)-Wo:Yo=Wo,Go.isubn(Yo)):Yo=0,Ao[$o]=Yo,Go.iushrn(1)}return Ao}Mn.getNAF=as;function us(io,fo){var mo=[[],[]];io=io.clone(),fo=fo.clone();for(var Ao=0,$o=0,Lo;io.cmpn(-Ao)>0||fo.cmpn(-$o)>0;){var Go=io.andln(3)+Ao&3,Yo=fo.andln(3)+$o&3;Go===3&&(Go=-1),Yo===3&&(Yo=-1);var Wo;Go&1?(Lo=io.andln(7)+Ao&7,(Lo===3||Lo===5)&&Yo===2?Wo=-Go:Wo=Go):Wo=0,mo[0].push(Wo);var Jo;Yo&1?(Lo=fo.andln(7)+$o&7,(Lo===3||Lo===5)&&Go===2?Jo=-Yo:Jo=Yo):Jo=0,mo[1].push(Jo),2*Ao===Wo+1&&(Ao=1-Ao),2*$o===Jo+1&&($o=1-$o),io.iushrn(1),fo.iushrn(1)}return mo}Mn.getJSF=us;function ds(io,fo,mo){var Ao="_"+fo;io.prototype[fo]=function(){return this[Ao]!==void 0?this[Ao]:this[Ao]=mo.call(this)}}Mn.cachedProperty=ds;function hs(io){return typeof io=="string"?Mn.toArray(io,"hex"):io}Mn.parseBytes=hs;function ps(io){return new rs(io,"hex","le")}Mn.intFromLE=ps})(utils$d);var brorand={exports:{}},r$3;brorand.exports=function Fn(Mn){return r$3||(r$3=new Rand(null)),r$3.generate(Mn)};function Rand(Fn){this.rand=Fn}brorand.exports.Rand=Rand;Rand.prototype.generate=function Fn(Mn){return this._rand(Mn)};Rand.prototype._rand=function Fn(Mn){if(this.rand.getBytes)return this.rand.getBytes(Mn);for(var rs=new Uint8Array(Mn),is=0;is<rs.length;is++)rs[is]=this.rand.getByte();return rs};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?Rand.prototype._rand=function(Mn){var rs=new Uint8Array(Mn);return self.crypto.getRandomValues(rs),rs}:self.msCrypto&&self.msCrypto.getRandomValues?Rand.prototype._rand=function(Mn){var rs=new Uint8Array(Mn);return self.msCrypto.getRandomValues(rs),rs}:typeof window=="object"&&(Rand.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var crypto$2=require$$3;if(typeof crypto$2.randomBytes!="function")throw new Error("Not supported");Rand.prototype._rand=function(Mn){return crypto$2.randomBytes(Mn)}}catch{}var brorandExports=brorand.exports,curve={},BN$7=bnExports,utils$b=utils$d,getNAF=utils$b.getNAF,getJSF=utils$b.getJSF,assert$9=utils$b.assert;function BaseCurve(Fn,Mn){this.type=Fn,this.p=new BN$7(Mn.p,16),this.red=Mn.prime?BN$7.red(Mn.prime):BN$7.mont(this.p),this.zero=new BN$7(0).toRed(this.red),this.one=new BN$7(1).toRed(this.red),this.two=new BN$7(2).toRed(this.red),this.n=Mn.n&&new BN$7(Mn.n,16),this.g=Mn.g&&this.pointFromJSON(Mn.g,Mn.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var rs=this.n&&this.p.div(this.n);!rs||rs.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base=BaseCurve;BaseCurve.prototype.point=function Fn(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function Fn(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function Fn(Mn,rs){assert$9(Mn.precomputed);var is=Mn._getDoubles(),os=getNAF(rs,1,this._bitLength),as=(1<<is.step+1)-(is.step%2===0?2:1);as/=3;var us=[],ds,hs;for(ds=0;ds<os.length;ds+=is.step){hs=0;for(var ps=ds+is.step-1;ps>=ds;ps--)hs=(hs<<1)+os[ps];us.push(hs)}for(var io=this.jpoint(null,null,null),fo=this.jpoint(null,null,null),mo=as;mo>0;mo--){for(ds=0;ds<us.length;ds++)hs=us[ds],hs===mo?fo=fo.mixedAdd(is.points[ds]):hs===-mo&&(fo=fo.mixedAdd(is.points[ds].neg()));io=io.add(fo)}return io.toP()};BaseCurve.prototype._wnafMul=function Fn(Mn,rs){var is=4,os=Mn._getNAFPoints(is);is=os.wnd;for(var as=os.points,us=getNAF(rs,is,this._bitLength),ds=this.jpoint(null,null,null),hs=us.length-1;hs>=0;hs--){for(var ps=0;hs>=0&&us[hs]===0;hs--)ps++;if(hs>=0&&ps++,ds=ds.dblp(ps),hs<0)break;var io=us[hs];assert$9(io!==0),Mn.type==="affine"?io>0?ds=ds.mixedAdd(as[io-1>>1]):ds=ds.mixedAdd(as[-io-1>>1].neg()):io>0?ds=ds.add(as[io-1>>1]):ds=ds.add(as[-io-1>>1].neg())}return Mn.type==="affine"?ds.toP():ds};BaseCurve.prototype._wnafMulAdd=function Fn(Mn,rs,is,os,as){var us=this._wnafT1,ds=this._wnafT2,hs=this._wnafT3,ps=0,io,fo,mo;for(io=0;io<os;io++){mo=rs[io];var Ao=mo._getNAFPoints(Mn);us[io]=Ao.wnd,ds[io]=Ao.points}for(io=os-1;io>=1;io-=2){var $o=io-1,Lo=io;if(us[$o]!==1||us[Lo]!==1){hs[$o]=getNAF(is[$o],us[$o],this._bitLength),hs[Lo]=getNAF(is[Lo],us[Lo],this._bitLength),ps=Math.max(hs[$o].length,ps),ps=Math.max(hs[Lo].length,ps);continue}var Go=[rs[$o],null,null,rs[Lo]];rs[$o].y.cmp(rs[Lo].y)===0?(Go[1]=rs[$o].add(rs[Lo]),Go[2]=rs[$o].toJ().mixedAdd(rs[Lo].neg())):rs[$o].y.cmp(rs[Lo].y.redNeg())===0?(Go[1]=rs[$o].toJ().mixedAdd(rs[Lo]),Go[2]=rs[$o].add(rs[Lo].neg())):(Go[1]=rs[$o].toJ().mixedAdd(rs[Lo]),Go[2]=rs[$o].toJ().mixedAdd(rs[Lo].neg()));var Yo=[-3,-1,-5,-7,0,7,5,1,3],Wo=getJSF(is[$o],is[Lo]);for(ps=Math.max(Wo[0].length,ps),hs[$o]=new Array(ps),hs[Lo]=new Array(ps),fo=0;fo<ps;fo++){var Jo=Wo[0][fo]|0,xl=Wo[1][fo]|0;hs[$o][fo]=Yo[(Jo+1)*3+(xl+1)],hs[Lo][fo]=0,ds[$o]=Go}}var _l=this.jpoint(null,null,null),Tl=this._wnafT4;for(io=ps;io>=0;io--){for(var Sl=0;io>=0;){var $l=!0;for(fo=0;fo<os;fo++)Tl[fo]=hs[fo][io]|0,Tl[fo]!==0&&($l=!1);if(!$l)break;Sl++,io--}if(io>=0&&Sl++,_l=_l.dblp(Sl),io<0)break;for(fo=0;fo<os;fo++){var Pl=Tl[fo];Pl!==0&&(Pl>0?mo=ds[fo][Pl-1>>1]:Pl<0&&(mo=ds[fo][-Pl-1>>1].neg()),mo.type==="affine"?_l=_l.mixedAdd(mo):_l=_l.add(mo))}}for(io=0;io<os;io++)ds[io]=null;return as?_l:_l.toP()};function BasePoint(Fn,Mn){this.curve=Fn,this.type=Mn,this.precomputed=null}BaseCurve.BasePoint=BasePoint;BasePoint.prototype.eq=function Fn(){throw new Error("Not implemented")};BasePoint.prototype.validate=function Fn(){return this.curve.validate(this)};BaseCurve.prototype.decodePoint=function Fn(Mn,rs){Mn=utils$b.toArray(Mn,rs);var is=this.p.byteLength();if((Mn[0]===4||Mn[0]===6||Mn[0]===7)&&Mn.length-1===2*is){Mn[0]===6?assert$9(Mn[Mn.length-1]%2===0):Mn[0]===7&&assert$9(Mn[Mn.length-1]%2===1);var os=this.point(Mn.slice(1,1+is),Mn.slice(1+is,1+2*is));return os}else if((Mn[0]===2||Mn[0]===3)&&Mn.length-1===is)return this.pointFromX(Mn.slice(1,1+is),Mn[0]===3);throw new Error("Unknown point format")};BasePoint.prototype.encodeCompressed=function Fn(Mn){return this.encode(Mn,!0)};BasePoint.prototype._encode=function Fn(Mn){var rs=this.curve.p.byteLength(),is=this.getX().toArray("be",rs);return Mn?[this.getY().isEven()?2:3].concat(is):[4].concat(is,this.getY().toArray("be",rs))};BasePoint.prototype.encode=function Fn(Mn,rs){return utils$b.encode(this._encode(rs),Mn)};BasePoint.prototype.precompute=function Fn(Mn){if(this.precomputed)return this;var rs={doubles:null,naf:null,beta:null};return rs.naf=this._getNAFPoints(8),rs.doubles=this._getDoubles(4,Mn),rs.beta=this._getBeta(),this.precomputed=rs,this};BasePoint.prototype._hasDoubles=function Fn(Mn){if(!this.precomputed)return!1;var rs=this.precomputed.doubles;return rs?rs.points.length>=Math.ceil((Mn.bitLength()+1)/rs.step):!1};BasePoint.prototype._getDoubles=function Fn(Mn,rs){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var is=[this],os=this,as=0;as<rs;as+=Mn){for(var us=0;us<Mn;us++)os=os.dbl();is.push(os)}return{step:Mn,points:is}};BasePoint.prototype._getNAFPoints=function Fn(Mn){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var rs=[this],is=(1<<Mn)-1,os=is===1?null:this.dbl(),as=1;as<is;as++)rs[as]=rs[as-1].add(os);return{wnd:Mn,points:rs}};BasePoint.prototype._getBeta=function Fn(){return null};BasePoint.prototype.dblp=function Fn(Mn){for(var rs=this,is=0;is<Mn;is++)rs=rs.dbl();return rs};var utils$a=utils$d,BN$6=bnExports,inherits$2=inherits_browserExports,Base$2=base,assert$8=utils$a.assert;function ShortCurve(Fn){Base$2.call(this,"short",Fn),this.a=new BN$6(Fn.a,16).toRed(this.red),this.b=new BN$6(Fn.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(Fn),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}inherits$2(ShortCurve,Base$2);var short$1=ShortCurve;ShortCurve.prototype._getEndomorphism=function Fn(Mn){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var rs,is;if(Mn.beta)rs=new BN$6(Mn.beta,16).toRed(this.red);else{var os=this._getEndoRoots(this.p);rs=os[0].cmp(os[1])<0?os[0]:os[1],rs=rs.toRed(this.red)}if(Mn.lambda)is=new BN$6(Mn.lambda,16);else{var as=this._getEndoRoots(this.n);this.g.mul(as[0]).x.cmp(this.g.x.redMul(rs))===0?is=as[0]:(is=as[1],assert$8(this.g.mul(is).x.cmp(this.g.x.redMul(rs))===0))}var us;return Mn.basis?us=Mn.basis.map(function(ds){return{a:new BN$6(ds.a,16),b:new BN$6(ds.b,16)}}):us=this._getEndoBasis(is),{beta:rs,lambda:is,basis:us}}};ShortCurve.prototype._getEndoRoots=function Fn(Mn){var rs=Mn===this.p?this.red:BN$6.mont(Mn),is=new BN$6(2).toRed(rs).redInvm(),os=is.redNeg(),as=new BN$6(3).toRed(rs).redNeg().redSqrt().redMul(is),us=os.redAdd(as).fromRed(),ds=os.redSub(as).fromRed();return[us,ds]};ShortCurve.prototype._getEndoBasis=function Fn(Mn){for(var rs=this.n.ushrn(Math.floor(this.n.bitLength()/2)),is=Mn,os=this.n.clone(),as=new BN$6(1),us=new BN$6(0),ds=new BN$6(0),hs=new BN$6(1),ps,io,fo,mo,Ao,$o,Lo,Go=0,Yo,Wo;is.cmpn(0)!==0;){var Jo=os.div(is);Yo=os.sub(Jo.mul(is)),Wo=ds.sub(Jo.mul(as));var xl=hs.sub(Jo.mul(us));if(!fo&&Yo.cmp(rs)<0)ps=Lo.neg(),io=as,fo=Yo.neg(),mo=Wo;else if(fo&&++Go===2)break;Lo=Yo,os=is,is=Yo,ds=as,as=Wo,hs=us,us=xl}Ao=Yo.neg(),$o=Wo;var _l=fo.sqr().add(mo.sqr()),Tl=Ao.sqr().add($o.sqr());return Tl.cmp(_l)>=0&&(Ao=ps,$o=io),fo.negative&&(fo=fo.neg(),mo=mo.neg()),Ao.negative&&(Ao=Ao.neg(),$o=$o.neg()),[{a:fo,b:mo},{a:Ao,b:$o}]};ShortCurve.prototype._endoSplit=function Fn(Mn){var rs=this.endo.basis,is=rs[0],os=rs[1],as=os.b.mul(Mn).divRound(this.n),us=is.b.neg().mul(Mn).divRound(this.n),ds=as.mul(is.a),hs=us.mul(os.a),ps=as.mul(is.b),io=us.mul(os.b),fo=Mn.sub(ds).sub(hs),mo=ps.add(io).neg();return{k1:fo,k2:mo}};ShortCurve.prototype.pointFromX=function Fn(Mn,rs){Mn=new BN$6(Mn,16),Mn.red||(Mn=Mn.toRed(this.red));var is=Mn.redSqr().redMul(Mn).redIAdd(Mn.redMul(this.a)).redIAdd(this.b),os=is.redSqrt();if(os.redSqr().redSub(is).cmp(this.zero)!==0)throw new Error("invalid point");var as=os.fromRed().isOdd();return(rs&&!as||!rs&&as)&&(os=os.redNeg()),this.point(Mn,os)};ShortCurve.prototype.validate=function Fn(Mn){if(Mn.inf)return!0;var rs=Mn.x,is=Mn.y,os=this.a.redMul(rs),as=rs.redSqr().redMul(rs).redIAdd(os).redIAdd(this.b);return is.redSqr().redISub(as).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function Fn(Mn,rs,is){for(var os=this._endoWnafT1,as=this._endoWnafT2,us=0;us<Mn.length;us++){var ds=this._endoSplit(rs[us]),hs=Mn[us],ps=hs._getBeta();ds.k1.negative&&(ds.k1.ineg(),hs=hs.neg(!0)),ds.k2.negative&&(ds.k2.ineg(),ps=ps.neg(!0)),os[us*2]=hs,os[us*2+1]=ps,as[us*2]=ds.k1,as[us*2+1]=ds.k2}for(var io=this._wnafMulAdd(1,os,as,us*2,is),fo=0;fo<us*2;fo++)os[fo]=null,as[fo]=null;return io};function Point$2(Fn,Mn,rs,is){Base$2.BasePoint.call(this,Fn,"affine"),Mn===null&&rs===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN$6(Mn,16),this.y=new BN$6(rs,16),is&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}inherits$2(Point$2,Base$2.BasePoint);ShortCurve.prototype.point=function Fn(Mn,rs,is){return new Point$2(this,Mn,rs,is)};ShortCurve.prototype.pointFromJSON=function Fn(Mn,rs){return Point$2.fromJSON(this,Mn,rs)};Point$2.prototype._getBeta=function Fn(){if(this.curve.endo){var Mn=this.precomputed;if(Mn&&Mn.beta)return Mn.beta;var rs=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(Mn){var is=this.curve,os=function(as){return is.point(as.x.redMul(is.endo.beta),as.y)};Mn.beta=rs,rs.precomputed={beta:null,naf:Mn.naf&&{wnd:Mn.naf.wnd,points:Mn.naf.points.map(os)},doubles:Mn.doubles&&{step:Mn.doubles.step,points:Mn.doubles.points.map(os)}}}return rs}};Point$2.prototype.toJSON=function Fn(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Point$2.fromJSON=function Fn(Mn,rs,is){typeof rs=="string"&&(rs=JSON.parse(rs));var os=Mn.point(rs[0],rs[1],is);if(!rs[2])return os;function as(ds){return Mn.point(ds[0],ds[1],is)}var us=rs[2];return os.precomputed={beta:null,doubles:us.doubles&&{step:us.doubles.step,points:[os].concat(us.doubles.points.map(as))},naf:us.naf&&{wnd:us.naf.wnd,points:[os].concat(us.naf.points.map(as))}},os};Point$2.prototype.inspect=function Fn(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Point$2.prototype.isInfinity=function Fn(){return this.inf};Point$2.prototype.add=function Fn(Mn){if(this.inf)return Mn;if(Mn.inf)return this;if(this.eq(Mn))return this.dbl();if(this.neg().eq(Mn))return this.curve.point(null,null);if(this.x.cmp(Mn.x)===0)return this.curve.point(null,null);var rs=this.y.redSub(Mn.y);rs.cmpn(0)!==0&&(rs=rs.redMul(this.x.redSub(Mn.x).redInvm()));var is=rs.redSqr().redISub(this.x).redISub(Mn.x),os=rs.redMul(this.x.redSub(is)).redISub(this.y);return this.curve.point(is,os)};Point$2.prototype.dbl=function Fn(){if(this.inf)return this;var Mn=this.y.redAdd(this.y);if(Mn.cmpn(0)===0)return this.curve.point(null,null);var rs=this.curve.a,is=this.x.redSqr(),os=Mn.redInvm(),as=is.redAdd(is).redIAdd(is).redIAdd(rs).redMul(os),us=as.redSqr().redISub(this.x.redAdd(this.x)),ds=as.redMul(this.x.redSub(us)).redISub(this.y);return this.curve.point(us,ds)};Point$2.prototype.getX=function Fn(){return this.x.fromRed()};Point$2.prototype.getY=function Fn(){return this.y.fromRed()};Point$2.prototype.mul=function Fn(Mn){return Mn=new BN$6(Mn,16),this.isInfinity()?this:this._hasDoubles(Mn)?this.curve._fixedNafMul(this,Mn):this.curve.endo?this.curve._endoWnafMulAdd([this],[Mn]):this.curve._wnafMul(this,Mn)};Point$2.prototype.mulAdd=function Fn(Mn,rs,is){var os=[this,rs],as=[Mn,is];return this.curve.endo?this.curve._endoWnafMulAdd(os,as):this.curve._wnafMulAdd(1,os,as,2)};Point$2.prototype.jmulAdd=function Fn(Mn,rs,is){var os=[this,rs],as=[Mn,is];return this.curve.endo?this.curve._endoWnafMulAdd(os,as,!0):this.curve._wnafMulAdd(1,os,as,2,!0)};Point$2.prototype.eq=function Fn(Mn){return this===Mn||this.inf===Mn.inf&&(this.inf||this.x.cmp(Mn.x)===0&&this.y.cmp(Mn.y)===0)};Point$2.prototype.neg=function Fn(Mn){if(this.inf)return this;var rs=this.curve.point(this.x,this.y.redNeg());if(Mn&&this.precomputed){var is=this.precomputed,os=function(as){return as.neg()};rs.precomputed={naf:is.naf&&{wnd:is.naf.wnd,points:is.naf.points.map(os)},doubles:is.doubles&&{step:is.doubles.step,points:is.doubles.points.map(os)}}}return rs};Point$2.prototype.toJ=function Fn(){if(this.inf)return this.curve.jpoint(null,null,null);var Mn=this.curve.jpoint(this.x,this.y,this.curve.one);return Mn};function JPoint(Fn,Mn,rs,is){Base$2.BasePoint.call(this,Fn,"jacobian"),Mn===null&&rs===null&&is===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$6(0)):(this.x=new BN$6(Mn,16),this.y=new BN$6(rs,16),this.z=new BN$6(is,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits$2(JPoint,Base$2.BasePoint);ShortCurve.prototype.jpoint=function Fn(Mn,rs,is){return new JPoint(this,Mn,rs,is)};JPoint.prototype.toP=function Fn(){if(this.isInfinity())return this.curve.point(null,null);var Mn=this.z.redInvm(),rs=Mn.redSqr(),is=this.x.redMul(rs),os=this.y.redMul(rs).redMul(Mn);return this.curve.point(is,os)};JPoint.prototype.neg=function Fn(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function Fn(Mn){if(this.isInfinity())return Mn;if(Mn.isInfinity())return this;var rs=Mn.z.redSqr(),is=this.z.redSqr(),os=this.x.redMul(rs),as=Mn.x.redMul(is),us=this.y.redMul(rs.redMul(Mn.z)),ds=Mn.y.redMul(is.redMul(this.z)),hs=os.redSub(as),ps=us.redSub(ds);if(hs.cmpn(0)===0)return ps.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var io=hs.redSqr(),fo=io.redMul(hs),mo=os.redMul(io),Ao=ps.redSqr().redIAdd(fo).redISub(mo).redISub(mo),$o=ps.redMul(mo.redISub(Ao)).redISub(us.redMul(fo)),Lo=this.z.redMul(Mn.z).redMul(hs);return this.curve.jpoint(Ao,$o,Lo)};JPoint.prototype.mixedAdd=function Fn(Mn){if(this.isInfinity())return Mn.toJ();if(Mn.isInfinity())return this;var rs=this.z.redSqr(),is=this.x,os=Mn.x.redMul(rs),as=this.y,us=Mn.y.redMul(rs).redMul(this.z),ds=is.redSub(os),hs=as.redSub(us);if(ds.cmpn(0)===0)return hs.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ps=ds.redSqr(),io=ps.redMul(ds),fo=is.redMul(ps),mo=hs.redSqr().redIAdd(io).redISub(fo).redISub(fo),Ao=hs.redMul(fo.redISub(mo)).redISub(as.redMul(io)),$o=this.z.redMul(ds);return this.curve.jpoint(mo,Ao,$o)};JPoint.prototype.dblp=function Fn(Mn){if(Mn===0)return this;if(this.isInfinity())return this;if(!Mn)return this.dbl();var rs;if(this.curve.zeroA||this.curve.threeA){var is=this;for(rs=0;rs<Mn;rs++)is=is.dbl();return is}var os=this.curve.a,as=this.curve.tinv,us=this.x,ds=this.y,hs=this.z,ps=hs.redSqr().redSqr(),io=ds.redAdd(ds);for(rs=0;rs<Mn;rs++){var fo=us.redSqr(),mo=io.redSqr(),Ao=mo.redSqr(),$o=fo.redAdd(fo).redIAdd(fo).redIAdd(os.redMul(ps)),Lo=us.redMul(mo),Go=$o.redSqr().redISub(Lo.redAdd(Lo)),Yo=Lo.redISub(Go),Wo=$o.redMul(Yo);Wo=Wo.redIAdd(Wo).redISub(Ao);var Jo=io.redMul(hs);rs+1<Mn&&(ps=ps.redMul(Ao)),us=Go,hs=Jo,io=Wo}return this.curve.jpoint(us,io.redMul(as),hs)};JPoint.prototype.dbl=function Fn(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};JPoint.prototype._zeroDbl=function Fn(){var Mn,rs,is;if(this.zOne){var os=this.x.redSqr(),as=this.y.redSqr(),us=as.redSqr(),ds=this.x.redAdd(as).redSqr().redISub(os).redISub(us);ds=ds.redIAdd(ds);var hs=os.redAdd(os).redIAdd(os),ps=hs.redSqr().redISub(ds).redISub(ds),io=us.redIAdd(us);io=io.redIAdd(io),io=io.redIAdd(io),Mn=ps,rs=hs.redMul(ds.redISub(ps)).redISub(io),is=this.y.redAdd(this.y)}else{var fo=this.x.redSqr(),mo=this.y.redSqr(),Ao=mo.redSqr(),$o=this.x.redAdd(mo).redSqr().redISub(fo).redISub(Ao);$o=$o.redIAdd($o);var Lo=fo.redAdd(fo).redIAdd(fo),Go=Lo.redSqr(),Yo=Ao.redIAdd(Ao);Yo=Yo.redIAdd(Yo),Yo=Yo.redIAdd(Yo),Mn=Go.redISub($o).redISub($o),rs=Lo.redMul($o.redISub(Mn)).redISub(Yo),is=this.y.redMul(this.z),is=is.redIAdd(is)}return this.curve.jpoint(Mn,rs,is)};JPoint.prototype._threeDbl=function Fn(){var Mn,rs,is;if(this.zOne){var os=this.x.redSqr(),as=this.y.redSqr(),us=as.redSqr(),ds=this.x.redAdd(as).redSqr().redISub(os).redISub(us);ds=ds.redIAdd(ds);var hs=os.redAdd(os).redIAdd(os).redIAdd(this.curve.a),ps=hs.redSqr().redISub(ds).redISub(ds);Mn=ps;var io=us.redIAdd(us);io=io.redIAdd(io),io=io.redIAdd(io),rs=hs.redMul(ds.redISub(ps)).redISub(io),is=this.y.redAdd(this.y)}else{var fo=this.z.redSqr(),mo=this.y.redSqr(),Ao=this.x.redMul(mo),$o=this.x.redSub(fo).redMul(this.x.redAdd(fo));$o=$o.redAdd($o).redIAdd($o);var Lo=Ao.redIAdd(Ao);Lo=Lo.redIAdd(Lo);var Go=Lo.redAdd(Lo);Mn=$o.redSqr().redISub(Go),is=this.y.redAdd(this.z).redSqr().redISub(mo).redISub(fo);var Yo=mo.redSqr();Yo=Yo.redIAdd(Yo),Yo=Yo.redIAdd(Yo),Yo=Yo.redIAdd(Yo),rs=$o.redMul(Lo.redISub(Mn)).redISub(Yo)}return this.curve.jpoint(Mn,rs,is)};JPoint.prototype._dbl=function Fn(){var Mn=this.curve.a,rs=this.x,is=this.y,os=this.z,as=os.redSqr().redSqr(),us=rs.redSqr(),ds=is.redSqr(),hs=us.redAdd(us).redIAdd(us).redIAdd(Mn.redMul(as)),ps=rs.redAdd(rs);ps=ps.redIAdd(ps);var io=ps.redMul(ds),fo=hs.redSqr().redISub(io.redAdd(io)),mo=io.redISub(fo),Ao=ds.redSqr();Ao=Ao.redIAdd(Ao),Ao=Ao.redIAdd(Ao),Ao=Ao.redIAdd(Ao);var $o=hs.redMul(mo).redISub(Ao),Lo=is.redAdd(is).redMul(os);return this.curve.jpoint(fo,$o,Lo)};JPoint.prototype.trpl=function Fn(){if(!this.curve.zeroA)return this.dbl().add(this);var Mn=this.x.redSqr(),rs=this.y.redSqr(),is=this.z.redSqr(),os=rs.redSqr(),as=Mn.redAdd(Mn).redIAdd(Mn),us=as.redSqr(),ds=this.x.redAdd(rs).redSqr().redISub(Mn).redISub(os);ds=ds.redIAdd(ds),ds=ds.redAdd(ds).redIAdd(ds),ds=ds.redISub(us);var hs=ds.redSqr(),ps=os.redIAdd(os);ps=ps.redIAdd(ps),ps=ps.redIAdd(ps),ps=ps.redIAdd(ps);var io=as.redIAdd(ds).redSqr().redISub(us).redISub(hs).redISub(ps),fo=rs.redMul(io);fo=fo.redIAdd(fo),fo=fo.redIAdd(fo);var mo=this.x.redMul(hs).redISub(fo);mo=mo.redIAdd(mo),mo=mo.redIAdd(mo);var Ao=this.y.redMul(io.redMul(ps.redISub(io)).redISub(ds.redMul(hs)));Ao=Ao.redIAdd(Ao),Ao=Ao.redIAdd(Ao),Ao=Ao.redIAdd(Ao);var $o=this.z.redAdd(ds).redSqr().redISub(is).redISub(hs);return this.curve.jpoint(mo,Ao,$o)};JPoint.prototype.mul=function Fn(Mn,rs){return Mn=new BN$6(Mn,rs),this.curve._wnafMul(this,Mn)};JPoint.prototype.eq=function Fn(Mn){if(Mn.type==="affine")return this.eq(Mn.toJ());if(this===Mn)return!0;var rs=this.z.redSqr(),is=Mn.z.redSqr();if(this.x.redMul(is).redISub(Mn.x.redMul(rs)).cmpn(0)!==0)return!1;var os=rs.redMul(this.z),as=is.redMul(Mn.z);return this.y.redMul(as).redISub(Mn.y.redMul(os)).cmpn(0)===0};JPoint.prototype.eqXToP=function Fn(Mn){var rs=this.z.redSqr(),is=Mn.toRed(this.curve.red).redMul(rs);if(this.x.cmp(is)===0)return!0;for(var os=Mn.clone(),as=this.curve.redN.redMul(rs);;){if(os.iadd(this.curve.n),os.cmp(this.curve.p)>=0)return!1;if(is.redIAdd(as),this.x.cmp(is)===0)return!0}};JPoint.prototype.inspect=function Fn(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};JPoint.prototype.isInfinity=function Fn(){return this.z.cmpn(0)===0};var BN$5=bnExports,inherits$1=inherits_browserExports,Base$1=base,utils$9=utils$d;function MontCurve(Fn){Base$1.call(this,"mont",Fn),this.a=new BN$5(Fn.a,16).toRed(this.red),this.b=new BN$5(Fn.b,16).toRed(this.red),this.i4=new BN$5(4).toRed(this.red).redInvm(),this.two=new BN$5(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$1(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function Fn(Mn){var rs=Mn.normalize().x,is=rs.redSqr(),os=is.redMul(rs).redAdd(is.redMul(this.a)).redAdd(rs),as=os.redSqrt();return as.redSqr().cmp(os)===0};function Point$1(Fn,Mn,rs){Base$1.BasePoint.call(this,Fn,"projective"),Mn===null&&rs===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$5(Mn,16),this.z=new BN$5(rs,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$1(Point$1,Base$1.BasePoint);MontCurve.prototype.decodePoint=function Fn(Mn,rs){return this.point(utils$9.toArray(Mn,rs),1)};MontCurve.prototype.point=function Fn(Mn,rs){return new Point$1(this,Mn,rs)};MontCurve.prototype.pointFromJSON=function Fn(Mn){return Point$1.fromJSON(this,Mn)};Point$1.prototype.precompute=function Fn(){};Point$1.prototype._encode=function Fn(){return this.getX().toArray("be",this.curve.p.byteLength())};Point$1.fromJSON=function Fn(Mn,rs){return new Point$1(Mn,rs[0],rs[1]||Mn.one)};Point$1.prototype.inspect=function Fn(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Point$1.prototype.isInfinity=function Fn(){return this.z.cmpn(0)===0};Point$1.prototype.dbl=function Fn(){var Mn=this.x.redAdd(this.z),rs=Mn.redSqr(),is=this.x.redSub(this.z),os=is.redSqr(),as=rs.redSub(os),us=rs.redMul(os),ds=as.redMul(os.redAdd(this.curve.a24.redMul(as)));return this.curve.point(us,ds)};Point$1.prototype.add=function Fn(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.diffAdd=function Fn(Mn,rs){var is=this.x.redAdd(this.z),os=this.x.redSub(this.z),as=Mn.x.redAdd(Mn.z),us=Mn.x.redSub(Mn.z),ds=us.redMul(is),hs=as.redMul(os),ps=rs.z.redMul(ds.redAdd(hs).redSqr()),io=rs.x.redMul(ds.redISub(hs).redSqr());return this.curve.point(ps,io)};Point$1.prototype.mul=function Fn(Mn){for(var rs=Mn.clone(),is=this,os=this.curve.point(null,null),as=this,us=[];rs.cmpn(0)!==0;rs.iushrn(1))us.push(rs.andln(1));for(var ds=us.length-1;ds>=0;ds--)us[ds]===0?(is=is.diffAdd(os,as),os=os.dbl()):(os=is.diffAdd(os,as),is=is.dbl());return os};Point$1.prototype.mulAdd=function Fn(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.jumlAdd=function Fn(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.eq=function Fn(Mn){return this.getX().cmp(Mn.getX())===0};Point$1.prototype.normalize=function Fn(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Point$1.prototype.getX=function Fn(){return this.normalize(),this.x.fromRed()};var utils$8=utils$d,BN$4=bnExports,inherits=inherits_browserExports,Base=base,assert$7=utils$8.assert;function EdwardsCurve(Fn){this.twisted=(Fn.a|0)!==1,this.mOneA=this.twisted&&(Fn.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",Fn),this.a=new BN$4(Fn.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$4(Fn.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$4(Fn.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$7(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(Fn.c|0)===1}inherits(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function Fn(Mn){return this.mOneA?Mn.redNeg():this.a.redMul(Mn)};EdwardsCurve.prototype._mulC=function Fn(Mn){return this.oneC?Mn:this.c.redMul(Mn)};EdwardsCurve.prototype.jpoint=function Fn(Mn,rs,is,os){return this.point(Mn,rs,is,os)};EdwardsCurve.prototype.pointFromX=function Fn(Mn,rs){Mn=new BN$4(Mn,16),Mn.red||(Mn=Mn.toRed(this.red));var is=Mn.redSqr(),os=this.c2.redSub(this.a.redMul(is)),as=this.one.redSub(this.c2.redMul(this.d).redMul(is)),us=os.redMul(as.redInvm()),ds=us.redSqrt();if(ds.redSqr().redSub(us).cmp(this.zero)!==0)throw new Error("invalid point");var hs=ds.fromRed().isOdd();return(rs&&!hs||!rs&&hs)&&(ds=ds.redNeg()),this.point(Mn,ds)};EdwardsCurve.prototype.pointFromY=function Fn(Mn,rs){Mn=new BN$4(Mn,16),Mn.red||(Mn=Mn.toRed(this.red));var is=Mn.redSqr(),os=is.redSub(this.c2),as=is.redMul(this.d).redMul(this.c2).redSub(this.a),us=os.redMul(as.redInvm());if(us.cmp(this.zero)===0){if(rs)throw new Error("invalid point");return this.point(this.zero,Mn)}var ds=us.redSqrt();if(ds.redSqr().redSub(us).cmp(this.zero)!==0)throw new Error("invalid point");return ds.fromRed().isOdd()!==rs&&(ds=ds.redNeg()),this.point(ds,Mn)};EdwardsCurve.prototype.validate=function Fn(Mn){if(Mn.isInfinity())return!0;Mn.normalize();var rs=Mn.x.redSqr(),is=Mn.y.redSqr(),os=rs.redMul(this.a).redAdd(is),as=this.c2.redMul(this.one.redAdd(this.d.redMul(rs).redMul(is)));return os.cmp(as)===0};function Point(Fn,Mn,rs,is,os){Base.BasePoint.call(this,Fn,"projective"),Mn===null&&rs===null&&is===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN$4(Mn,16),this.y=new BN$4(rs,16),this.z=is?new BN$4(is,16):this.curve.one,this.t=os&&new BN$4(os,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits(Point,Base.BasePoint);EdwardsCurve.prototype.pointFromJSON=function Fn(Mn){return Point.fromJSON(this,Mn)};EdwardsCurve.prototype.point=function Fn(Mn,rs,is,os){return new Point(this,Mn,rs,is,os)};Point.fromJSON=function Fn(Mn,rs){return new Point(Mn,rs[0],rs[1],rs[2])};Point.prototype.inspect=function Fn(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Point.prototype.isInfinity=function Fn(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function Fn(){var Mn=this.x.redSqr(),rs=this.y.redSqr(),is=this.z.redSqr();is=is.redIAdd(is);var os=this.curve._mulA(Mn),as=this.x.redAdd(this.y).redSqr().redISub(Mn).redISub(rs),us=os.redAdd(rs),ds=us.redSub(is),hs=os.redSub(rs),ps=as.redMul(ds),io=us.redMul(hs),fo=as.redMul(hs),mo=ds.redMul(us);return this.curve.point(ps,io,mo,fo)};Point.prototype._projDbl=function Fn(){var Mn=this.x.redAdd(this.y).redSqr(),rs=this.x.redSqr(),is=this.y.redSqr(),os,as,us,ds,hs,ps;if(this.curve.twisted){ds=this.curve._mulA(rs);var io=ds.redAdd(is);this.zOne?(os=Mn.redSub(rs).redSub(is).redMul(io.redSub(this.curve.two)),as=io.redMul(ds.redSub(is)),us=io.redSqr().redSub(io).redSub(io)):(hs=this.z.redSqr(),ps=io.redSub(hs).redISub(hs),os=Mn.redSub(rs).redISub(is).redMul(ps),as=io.redMul(ds.redSub(is)),us=io.redMul(ps))}else ds=rs.redAdd(is),hs=this.curve._mulC(this.z).redSqr(),ps=ds.redSub(hs).redSub(hs),os=this.curve._mulC(Mn.redISub(ds)).redMul(ps),as=this.curve._mulC(ds).redMul(rs.redISub(is)),us=ds.redMul(ps);return this.curve.point(os,as,us)};Point.prototype.dbl=function Fn(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Point.prototype._extAdd=function Fn(Mn){var rs=this.y.redSub(this.x).redMul(Mn.y.redSub(Mn.x)),is=this.y.redAdd(this.x).redMul(Mn.y.redAdd(Mn.x)),os=this.t.redMul(this.curve.dd).redMul(Mn.t),as=this.z.redMul(Mn.z.redAdd(Mn.z)),us=is.redSub(rs),ds=as.redSub(os),hs=as.redAdd(os),ps=is.redAdd(rs),io=us.redMul(ds),fo=hs.redMul(ps),mo=us.redMul(ps),Ao=ds.redMul(hs);return this.curve.point(io,fo,Ao,mo)};Point.prototype._projAdd=function Fn(Mn){var rs=this.z.redMul(Mn.z),is=rs.redSqr(),os=this.x.redMul(Mn.x),as=this.y.redMul(Mn.y),us=this.curve.d.redMul(os).redMul(as),ds=is.redSub(us),hs=is.redAdd(us),ps=this.x.redAdd(this.y).redMul(Mn.x.redAdd(Mn.y)).redISub(os).redISub(as),io=rs.redMul(ds).redMul(ps),fo,mo;return this.curve.twisted?(fo=rs.redMul(hs).redMul(as.redSub(this.curve._mulA(os))),mo=ds.redMul(hs)):(fo=rs.redMul(hs).redMul(as.redSub(os)),mo=this.curve._mulC(ds).redMul(hs)),this.curve.point(io,fo,mo)};Point.prototype.add=function Fn(Mn){return this.isInfinity()?Mn:Mn.isInfinity()?this:this.curve.extended?this._extAdd(Mn):this._projAdd(Mn)};Point.prototype.mul=function Fn(Mn){return this._hasDoubles(Mn)?this.curve._fixedNafMul(this,Mn):this.curve._wnafMul(this,Mn)};Point.prototype.mulAdd=function Fn(Mn,rs,is){return this.curve._wnafMulAdd(1,[this,rs],[Mn,is],2,!1)};Point.prototype.jmulAdd=function Fn(Mn,rs,is){return this.curve._wnafMulAdd(1,[this,rs],[Mn,is],2,!0)};Point.prototype.normalize=function Fn(){if(this.zOne)return this;var Mn=this.z.redInvm();return this.x=this.x.redMul(Mn),this.y=this.y.redMul(Mn),this.t&&(this.t=this.t.redMul(Mn)),this.z=this.curve.one,this.zOne=!0,this};Point.prototype.neg=function Fn(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function Fn(){return this.normalize(),this.x.fromRed()};Point.prototype.getY=function Fn(){return this.normalize(),this.y.fromRed()};Point.prototype.eq=function Fn(Mn){return this===Mn||this.getX().cmp(Mn.getX())===0&&this.getY().cmp(Mn.getY())===0};Point.prototype.eqXToP=function Fn(Mn){var rs=Mn.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(rs)===0)return!0;for(var is=Mn.clone(),os=this.curve.redN.redMul(this.z);;){if(is.iadd(this.curve.n),is.cmp(this.curve.p)>=0)return!1;if(rs.redIAdd(os),this.x.cmp(rs)===0)return!0}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add;(function(Fn){var Mn=Fn;Mn.base=base,Mn.short=short$1,Mn.mont=mont,Mn.edwards=edwards})(curve);var curves$2={},secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1}(function(Fn){var Mn=Fn,rs=hash$5,is=curve,os=utils$d,as=os.assert;function us(ps){ps.type==="short"?this.curve=new is.short(ps):ps.type==="edwards"?this.curve=new is.edwards(ps):this.curve=new is.mont(ps),this.g=this.curve.g,this.n=this.curve.n,this.hash=ps.hash,as(this.g.validate(),"Invalid curve"),as(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}Mn.PresetCurve=us;function ds(ps,io){Object.defineProperty(Mn,ps,{configurable:!0,enumerable:!0,get:function(){var fo=new us(io);return Object.defineProperty(Mn,ps,{configurable:!0,enumerable:!0,value:fo}),fo}})}ds("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:rs.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),ds("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:rs.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),ds("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:rs.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),ds("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:rs.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),ds("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:rs.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),ds("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:rs.sha256,gRed:!1,g:["9"]}),ds("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:rs.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var hs;try{hs=requireSecp256k1()}catch{hs=void 0}ds("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:rs.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",hs]})})(curves$2);var hash$1=hash$5,utils$7=utils$c,assert$6=minimalisticAssert$1;function HmacDRBG$1(Fn){if(!(this instanceof HmacDRBG$1))return new HmacDRBG$1(Fn);this.hash=Fn.hash,this.predResist=!!Fn.predResist,this.outLen=this.hash.outSize,this.minEntropy=Fn.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var Mn=utils$7.toArray(Fn.entropy,Fn.entropyEnc||"hex"),rs=utils$7.toArray(Fn.nonce,Fn.nonceEnc||"hex"),is=utils$7.toArray(Fn.pers,Fn.persEnc||"hex");assert$6(Mn.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(Mn,rs,is)}var hmacDrbg=HmacDRBG$1;HmacDRBG$1.prototype._init=function Fn(Mn,rs,is){var os=Mn.concat(rs).concat(is);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var as=0;as<this.V.length;as++)this.K[as]=0,this.V[as]=1;this._update(os),this._reseed=1,this.reseedInterval=281474976710656};HmacDRBG$1.prototype._hmac=function Fn(){return new hash$1.hmac(this.hash,this.K)};HmacDRBG$1.prototype._update=function Fn(Mn){var rs=this._hmac().update(this.V).update([0]);Mn&&(rs=rs.update(Mn)),this.K=rs.digest(),this.V=this._hmac().update(this.V).digest(),Mn&&(this.K=this._hmac().update(this.V).update([1]).update(Mn).digest(),this.V=this._hmac().update(this.V).digest())};HmacDRBG$1.prototype.reseed=function Fn(Mn,rs,is,os){typeof rs!="string"&&(os=is,is=rs,rs=null),Mn=utils$7.toArray(Mn,rs),is=utils$7.toArray(is,os),assert$6(Mn.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Mn.concat(is||[])),this._reseed=1};HmacDRBG$1.prototype.generate=function Fn(Mn,rs,is,os){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof rs!="string"&&(os=is,is=rs,rs=null),is&&(is=utils$7.toArray(is,os||"hex"),this._update(is));for(var as=[];as.length<Mn;)this.V=this._hmac().update(this.V).digest(),as=as.concat(this.V);var us=as.slice(0,Mn);return this._update(is),this._reseed++,utils$7.encode(us,rs)};var BN$3=bnExports,utils$6=utils$d,assert$5=utils$6.assert;function KeyPair$3(Fn,Mn){this.ec=Fn,this.priv=null,this.pub=null,Mn.priv&&this._importPrivate(Mn.priv,Mn.privEnc),Mn.pub&&this._importPublic(Mn.pub,Mn.pubEnc)}var key$1=KeyPair$3;KeyPair$3.fromPublic=function Fn(Mn,rs,is){return rs instanceof KeyPair$3?rs:new KeyPair$3(Mn,{pub:rs,pubEnc:is})};KeyPair$3.fromPrivate=function Fn(Mn,rs,is){return rs instanceof KeyPair$3?rs:new KeyPair$3(Mn,{priv:rs,privEnc:is})};KeyPair$3.prototype.validate=function Fn(){var Mn=this.getPublic();return Mn.isInfinity()?{result:!1,reason:"Invalid public key"}:Mn.validate()?Mn.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};KeyPair$3.prototype.getPublic=function Fn(Mn,rs){return typeof Mn=="string"&&(rs=Mn,Mn=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),rs?this.pub.encode(rs,Mn):this.pub};KeyPair$3.prototype.getPrivate=function Fn(Mn){return Mn==="hex"?this.priv.toString(16,2):this.priv};KeyPair$3.prototype._importPrivate=function Fn(Mn,rs){this.priv=new BN$3(Mn,rs||16),this.priv=this.priv.umod(this.ec.curve.n)};KeyPair$3.prototype._importPublic=function Fn(Mn,rs){if(Mn.x||Mn.y){this.ec.curve.type==="mont"?assert$5(Mn.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$5(Mn.x&&Mn.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(Mn.x,Mn.y);return}this.pub=this.ec.curve.decodePoint(Mn,rs)};KeyPair$3.prototype.derive=function Fn(Mn){return Mn.validate()||assert$5(Mn.validate(),"public point not validated"),Mn.mul(this.priv).getX()};KeyPair$3.prototype.sign=function Fn(Mn,rs,is){return this.ec.sign(Mn,this,rs,is)};KeyPair$3.prototype.verify=function Fn(Mn,rs){return this.ec.verify(Mn,rs,this)};KeyPair$3.prototype.inspect=function Fn(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var BN$2=bnExports,utils$5=utils$d,assert$4=utils$5.assert;function Signature$3(Fn,Mn){if(Fn instanceof Signature$3)return Fn;this._importDER(Fn,Mn)||(assert$4(Fn.r&&Fn.s,"Signature without r or s"),this.r=new BN$2(Fn.r,16),this.s=new BN$2(Fn.s,16),Fn.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=Fn.recoveryParam)}var signature$1=Signature$3;function Position(){this.place=0}function getLength(Fn,Mn){var rs=Fn[Mn.place++];if(!(rs&128))return rs;var is=rs&15;if(is===0||is>4||Fn[Mn.place]===0)return!1;for(var os=0,as=0,us=Mn.place;as<is;as++,us++)os<<=8,os|=Fn[us],os>>>=0;return os<=127?!1:(Mn.place=us,os)}function rmPadding(Fn){for(var Mn=0,rs=Fn.length-1;!Fn[Mn]&&!(Fn[Mn+1]&128)&&Mn<rs;)Mn++;return Mn===0?Fn:Fn.slice(Mn)}Signature$3.prototype._importDER=function Fn(Mn,rs){Mn=utils$5.toArray(Mn,rs);var is=new Position;if(Mn[is.place++]!==48)return!1;var os=getLength(Mn,is);if(os===!1||os+is.place!==Mn.length||Mn[is.place++]!==2)return!1;var as=getLength(Mn,is);if(as===!1||Mn[is.place]&128)return!1;var us=Mn.slice(is.place,as+is.place);if(is.place+=as,Mn[is.place++]!==2)return!1;var ds=getLength(Mn,is);if(ds===!1||Mn.length!==ds+is.place||Mn[is.place]&128)return!1;var hs=Mn.slice(is.place,ds+is.place);if(us[0]===0)if(us[1]&128)us=us.slice(1);else return!1;if(hs[0]===0)if(hs[1]&128)hs=hs.slice(1);else return!1;return this.r=new BN$2(us),this.s=new BN$2(hs),this.recoveryParam=null,!0};function constructLength(Fn,Mn){if(Mn<128){Fn.push(Mn);return}var rs=1+(Math.log(Mn)/Math.LN2>>>3);for(Fn.push(rs|128);--rs;)Fn.push(Mn>>>(rs<<3)&255);Fn.push(Mn)}Signature$3.prototype.toDER=function Fn(Mn){var rs=this.r.toArray(),is=this.s.toArray();for(rs[0]&128&&(rs=[0].concat(rs)),is[0]&128&&(is=[0].concat(is)),rs=rmPadding(rs),is=rmPadding(is);!is[0]&&!(is[1]&128);)is=is.slice(1);var os=[2];constructLength(os,rs.length),os=os.concat(rs),os.push(2),constructLength(os,is.length);var as=os.concat(is),us=[48];return constructLength(us,as.length),us=us.concat(as),utils$5.encode(us,Mn)};var BN$1=bnExports,HmacDRBG=hmacDrbg,utils$4=utils$d,curves$1=curves$2,rand=brorandExports,assert$3=utils$4.assert,KeyPair$2=key$1,Signature$2=signature$1;function EC(Fn){if(!(this instanceof EC))return new EC(Fn);typeof Fn=="string"&&(assert$3(Object.prototype.hasOwnProperty.call(curves$1,Fn),"Unknown curve "+Fn),Fn=curves$1[Fn]),Fn instanceof curves$1.PresetCurve&&(Fn={curve:Fn}),this.curve=Fn.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=Fn.curve.g,this.g.precompute(Fn.curve.n.bitLength()+1),this.hash=Fn.hash||Fn.curve.hash}var ec=EC;EC.prototype.keyPair=function Fn(Mn){return new KeyPair$2(this,Mn)};EC.prototype.keyFromPrivate=function Fn(Mn,rs){return KeyPair$2.fromPrivate(this,Mn,rs)};EC.prototype.keyFromPublic=function Fn(Mn,rs){return KeyPair$2.fromPublic(this,Mn,rs)};EC.prototype.genKeyPair=function Fn(Mn){Mn||(Mn={});for(var rs=new HmacDRBG({hash:this.hash,pers:Mn.pers,persEnc:Mn.persEnc||"utf8",entropy:Mn.entropy||rand(this.hash.hmacStrength),entropyEnc:Mn.entropy&&Mn.entropyEnc||"utf8",nonce:this.n.toArray()}),is=this.n.byteLength(),os=this.n.sub(new BN$1(2));;){var as=new BN$1(rs.generate(is));if(!(as.cmp(os)>0))return as.iaddn(1),this.keyFromPrivate(as)}};EC.prototype._truncateToN=function Fn(Mn,rs){var is=Mn.byteLength()*8-this.n.bitLength();return is>0&&(Mn=Mn.ushrn(is)),!rs&&Mn.cmp(this.n)>=0?Mn.sub(this.n):Mn};EC.prototype.sign=function Fn(Mn,rs,is,os){typeof is=="object"&&(os=is,is=null),os||(os={}),rs=this.keyFromPrivate(rs,is),Mn=this._truncateToN(new BN$1(Mn,16));for(var as=this.n.byteLength(),us=rs.getPrivate().toArray("be",as),ds=Mn.toArray("be",as),hs=new HmacDRBG({hash:this.hash,entropy:us,nonce:ds,pers:os.pers,persEnc:os.persEnc||"utf8"}),ps=this.n.sub(new BN$1(1)),io=0;;io++){var fo=os.k?os.k(io):new BN$1(hs.generate(this.n.byteLength()));if(fo=this._truncateToN(fo,!0),!(fo.cmpn(1)<=0||fo.cmp(ps)>=0)){var mo=this.g.mul(fo);if(!mo.isInfinity()){var Ao=mo.getX(),$o=Ao.umod(this.n);if($o.cmpn(0)!==0){var Lo=fo.invm(this.n).mul($o.mul(rs.getPrivate()).iadd(Mn));if(Lo=Lo.umod(this.n),Lo.cmpn(0)!==0){var Go=(mo.getY().isOdd()?1:0)|(Ao.cmp($o)!==0?2:0);return os.canonical&&Lo.cmp(this.nh)>0&&(Lo=this.n.sub(Lo),Go^=1),new Signature$2({r:$o,s:Lo,recoveryParam:Go})}}}}}};EC.prototype.verify=function Fn(Mn,rs,is,os){Mn=this._truncateToN(new BN$1(Mn,16)),is=this.keyFromPublic(is,os),rs=new Signature$2(rs,"hex");var as=rs.r,us=rs.s;if(as.cmpn(1)<0||as.cmp(this.n)>=0||us.cmpn(1)<0||us.cmp(this.n)>=0)return!1;var ds=us.invm(this.n),hs=ds.mul(Mn).umod(this.n),ps=ds.mul(as).umod(this.n),io;return this.curve._maxwellTrick?(io=this.g.jmulAdd(hs,is.getPublic(),ps),io.isInfinity()?!1:io.eqXToP(as)):(io=this.g.mulAdd(hs,is.getPublic(),ps),io.isInfinity()?!1:io.getX().umod(this.n).cmp(as)===0)};EC.prototype.recoverPubKey=function(Fn,Mn,rs,is){assert$3((3&rs)===rs,"The recovery param is more than two bits"),Mn=new Signature$2(Mn,is);var os=this.n,as=new BN$1(Fn),us=Mn.r,ds=Mn.s,hs=rs&1,ps=rs>>1;if(us.cmp(this.curve.p.umod(this.curve.n))>=0&&ps)throw new Error("Unable to find sencond key candinate");ps?us=this.curve.pointFromX(us.add(this.curve.n),hs):us=this.curve.pointFromX(us,hs);var io=Mn.r.invm(os),fo=os.sub(as).mul(io).umod(os),mo=ds.mul(io).umod(os);return this.g.mulAdd(fo,us,mo)};EC.prototype.getKeyRecoveryParam=function(Fn,Mn,rs,is){if(Mn=new Signature$2(Mn,is),Mn.recoveryParam!==null)return Mn.recoveryParam;for(var os=0;os<4;os++){var as;try{as=this.recoverPubKey(Fn,Mn,os)}catch{continue}if(as.eq(rs))return os}throw new Error("Unable to find valid recovery factor")};var utils$3=utils$d,assert$2=utils$3.assert,parseBytes$2=utils$3.parseBytes,cachedProperty$1=utils$3.cachedProperty;function KeyPair$1(Fn,Mn){this.eddsa=Fn,this._secret=parseBytes$2(Mn.secret),Fn.isPoint(Mn.pub)?this._pub=Mn.pub:this._pubBytes=parseBytes$2(Mn.pub)}KeyPair$1.fromPublic=function Fn(Mn,rs){return rs instanceof KeyPair$1?rs:new KeyPair$1(Mn,{pub:rs})};KeyPair$1.fromSecret=function Fn(Mn,rs){return rs instanceof KeyPair$1?rs:new KeyPair$1(Mn,{secret:rs})};KeyPair$1.prototype.secret=function Fn(){return this._secret};cachedProperty$1(KeyPair$1,"pubBytes",function Fn(){return this.eddsa.encodePoint(this.pub())});cachedProperty$1(KeyPair$1,"pub",function Fn(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cachedProperty$1(KeyPair$1,"privBytes",function Fn(){var Mn=this.eddsa,rs=this.hash(),is=Mn.encodingLength-1,os=rs.slice(0,Mn.encodingLength);return os[0]&=248,os[is]&=127,os[is]|=64,os});cachedProperty$1(KeyPair$1,"priv",function Fn(){return this.eddsa.decodeInt(this.privBytes())});cachedProperty$1(KeyPair$1,"hash",function Fn(){return this.eddsa.hash().update(this.secret()).digest()});cachedProperty$1(KeyPair$1,"messagePrefix",function Fn(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair$1.prototype.sign=function Fn(Mn){return assert$2(this._secret,"KeyPair can only verify"),this.eddsa.sign(Mn,this)};KeyPair$1.prototype.verify=function Fn(Mn,rs){return this.eddsa.verify(Mn,rs,this)};KeyPair$1.prototype.getSecret=function Fn(Mn){return assert$2(this._secret,"KeyPair is public only"),utils$3.encode(this.secret(),Mn)};KeyPair$1.prototype.getPublic=function Fn(Mn){return utils$3.encode(this.pubBytes(),Mn)};var key=KeyPair$1,BN=bnExports,utils$2=utils$d,assert$1=utils$2.assert,cachedProperty=utils$2.cachedProperty,parseBytes$1=utils$2.parseBytes;function Signature$1(Fn,Mn){this.eddsa=Fn,typeof Mn!="object"&&(Mn=parseBytes$1(Mn)),Array.isArray(Mn)&&(assert$1(Mn.length===Fn.encodingLength*2,"Signature has invalid size"),Mn={R:Mn.slice(0,Fn.encodingLength),S:Mn.slice(Fn.encodingLength)}),assert$1(Mn.R&&Mn.S,"Signature without R or S"),Fn.isPoint(Mn.R)&&(this._R=Mn.R),Mn.S instanceof BN&&(this._S=Mn.S),this._Rencoded=Array.isArray(Mn.R)?Mn.R:Mn.Rencoded,this._Sencoded=Array.isArray(Mn.S)?Mn.S:Mn.Sencoded}cachedProperty(Signature$1,"S",function Fn(){return this.eddsa.decodeInt(this.Sencoded())});cachedProperty(Signature$1,"R",function Fn(){return this.eddsa.decodePoint(this.Rencoded())});cachedProperty(Signature$1,"Rencoded",function Fn(){return this.eddsa.encodePoint(this.R())});cachedProperty(Signature$1,"Sencoded",function Fn(){return this.eddsa.encodeInt(this.S())});Signature$1.prototype.toBytes=function Fn(){return this.Rencoded().concat(this.Sencoded())};Signature$1.prototype.toHex=function Fn(){return utils$2.encode(this.toBytes(),"hex").toUpperCase()};var signature=Signature$1,hash=hash$5,curves=curves$2,utils$1=utils$d,assert=utils$1.assert,parseBytes=utils$1.parseBytes,KeyPair=key,Signature=signature;function EDDSA(Fn){if(assert(Fn==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(Fn);Fn=curves[Fn].curve,this.curve=Fn,this.g=Fn.g,this.g.precompute(Fn.n.bitLength()+1),this.pointClass=Fn.point().constructor,this.encodingLength=Math.ceil(Fn.n.bitLength()/8),this.hash=hash.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function Fn(Mn,rs){Mn=parseBytes(Mn);var is=this.keyFromSecret(rs),os=this.hashInt(is.messagePrefix(),Mn),as=this.g.mul(os),us=this.encodePoint(as),ds=this.hashInt(us,is.pubBytes(),Mn).mul(is.priv()),hs=os.add(ds).umod(this.curve.n);return this.makeSignature({R:as,S:hs,Rencoded:us})};EDDSA.prototype.verify=function Fn(Mn,rs,is){if(Mn=parseBytes(Mn),rs=this.makeSignature(rs),rs.S().gte(rs.eddsa.curve.n)||rs.S().isNeg())return!1;var os=this.keyFromPublic(is),as=this.hashInt(rs.Rencoded(),os.pubBytes(),Mn),us=this.g.mul(rs.S()),ds=rs.R().add(os.pub().mul(as));return ds.eq(us)};EDDSA.prototype.hashInt=function Fn(){for(var Mn=this.hash(),rs=0;rs<arguments.length;rs++)Mn.update(arguments[rs]);return utils$1.intFromLE(Mn.digest()).umod(this.curve.n)};EDDSA.prototype.keyFromPublic=function Fn(Mn){return KeyPair.fromPublic(this,Mn)};EDDSA.prototype.keyFromSecret=function Fn(Mn){return KeyPair.fromSecret(this,Mn)};EDDSA.prototype.makeSignature=function Fn(Mn){return Mn instanceof Signature?Mn:new Signature(this,Mn)};EDDSA.prototype.encodePoint=function Fn(Mn){var rs=Mn.getY().toArray("le",this.encodingLength);return rs[this.encodingLength-1]|=Mn.getX().isOdd()?128:0,rs};EDDSA.prototype.decodePoint=function Fn(Mn){Mn=utils$1.parseBytes(Mn);var rs=Mn.length-1,is=Mn.slice(0,rs).concat(Mn[rs]&-129),os=(Mn[rs]&128)!==0,as=utils$1.intFromLE(is);return this.curve.pointFromY(as,os)};EDDSA.prototype.encodeInt=function Fn(Mn){return Mn.toArray("le",this.encodingLength)};EDDSA.prototype.decodeInt=function Fn(Mn){return utils$1.intFromLE(Mn)};EDDSA.prototype.isPoint=function Fn(Mn){return Mn instanceof this.pointClass};(function(Fn){var Mn=Fn;Mn.version=require$$0.version,Mn.utils=utils$d,Mn.rand=brorandExports,Mn.curve=curve,Mn.curves=curves$2,Mn.ec=ec,Mn.eddsa=eddsa})(elliptic);const C={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var define_process_env_default$1={};const Rr$1=":";function An(Fn){const[Mn,rs]=Fn.split(Rr$1);return{namespace:Mn,reference:rs}}function Or$1(Fn,Mn){return Fn.includes(":")?[Fn]:Mn.chains||[]}var Zo=Object.defineProperty,En$1=Object.getOwnPropertySymbols,ts=Object.prototype.hasOwnProperty,es=Object.prototype.propertyIsEnumerable,Sn$1=(Fn,Mn,rs)=>Mn in Fn?Zo(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,In$1=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))ts.call(Mn,rs)&&Sn$1(Fn,rs,Mn[rs]);if(En$1)for(var rs of En$1(Mn))es.call(Mn,rs)&&Sn$1(Fn,rs,Mn[rs]);return Fn};const Nn="ReactNative",qt$1={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Bn="js";function bi$1(){return typeof browser$1$1<"u"&&typeof browser$1$1.versions<"u"&&typeof browser$1$1.versions.node<"u"}function rr$1(){return!getDocument_1()&&!!getNavigator_1()&&navigator.product===Nn}function gr$1(){return!bi$1()&&!!getNavigator_1()&&!!getDocument_1()}function We(){return rr$1()?qt$1.reactNative:bi$1()?qt$1.node:gr$1()?qt$1.browser:qt$1.unknown}function ns(){var Fn;try{return rr$1()&&typeof global$2<"u"&&typeof(global$2==null?void 0:global$2.Application)<"u"?(Fn=global$2.Application)==null?void 0:Fn.applicationId:void 0}catch{return}}function Cn$1(Fn,Mn){let rs=queryString$1.parse(Fn);return rs=In$1(In$1({},rs),Mn),Fn=queryString$1.stringify(rs),Fn}function fs$1(){return getWindowMetadata_1()||{name:"",description:"",url:"",icons:[""]}}function Rn$1(){if(We()===qt$1.reactNative&&typeof global$2<"u"&&typeof(global$2==null?void 0:global$2.Platform)<"u"){const{OS:rs,Version:is}=global$2.Platform;return[rs,is].join("-")}const Fn=detect();if(Fn===null)return"unknown";const Mn=Fn.os?Fn.os.replace(" ","").toLowerCase():"unknown";return Fn.type==="browser"?[Mn,Fn.name,Fn.version].join("-"):[Mn,Fn.version].join("-")}function On$1(){var Fn;const Mn=We();return Mn===qt$1.browser?[Mn,((Fn=getLocation_1())==null?void 0:Fn.host)||"unknown"].join(":"):Mn}function Pn$1(Fn,Mn,rs){const is=Rn$1(),os=On$1();return[[Fn,Mn].join("-"),[Bn,rs].join("-"),is,os].join("/")}function ss({protocol:Fn,version:Mn,relayUrl:rs,sdkVersion:is,auth:os,projectId:as,useOnCloseEvent:us,bundleId:ds}){const hs=rs.split("?"),ps=Pn$1(Fn,Mn,is),io={auth:os,ua:ps,projectId:as,useOnCloseEvent:us||void 0,origin:ds||void 0},fo=Cn$1(hs[1]||"",io);return hs[0]+"?"+fo}function _e$2(Fn,Mn){return Fn.filter(rs=>Mn.includes(rs)).length===Fn.length}function cs(Fn){return Object.fromEntries(Fn.entries())}function ls$1(Fn){return new Map(Object.entries(Fn))}function gs(Fn=cjs$4.FIVE_MINUTES,Mn){const rs=cjs$4.toMiliseconds(Fn||cjs$4.FIVE_MINUTES);let is,os,as;return{resolve:us=>{as&&is&&(clearTimeout(as),is(us))},reject:us=>{as&&os&&(clearTimeout(as),os(us))},done:()=>new Promise((us,ds)=>{as=setTimeout(()=>{ds(new Error(Mn))},rs),is=us,os=ds})}}function ms$1(Fn,Mn,rs){return new Promise(async(is,os)=>{const as=setTimeout(()=>os(new Error(rs)),Mn);try{const us=await Fn;is(us)}catch(us){os(us)}clearTimeout(as)})}function yi$1(Fn,Mn){if(typeof Mn=="string"&&Mn.startsWith(`${Fn}:`))return Mn;if(Fn.toLowerCase()==="topic"){if(typeof Mn!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${Mn}`}else if(Fn.toLowerCase()==="id"){if(typeof Mn!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${Mn}`}throw new Error(`Unknown expirer target type: ${Fn}`)}function As$1(Fn){return yi$1("topic",Fn)}function bs$1(Fn){return yi$1("id",Fn)}function ys$1(Fn){const[Mn,rs]=Fn.split(":"),is={id:void 0,topic:void 0};if(Mn==="topic"&&typeof rs=="string")is.topic=rs;else if(Mn==="id"&&Number.isInteger(Number(rs)))is.id=Number(rs);else throw new Error(`Invalid target, expected id:number or topic:string, got ${Mn}:${rs}`);return is}function ws$1(Fn,Mn){return cjs$4.fromMiliseconds(Date.now()+cjs$4.toMiliseconds(Fn))}function xs$1(Fn){return Date.now()>=cjs$4.toMiliseconds(Fn)}function Ms$1(Fn,Mn){return`${Fn}${Mn?`:${Mn}`:""}`}function me$1(Fn=[],Mn=[]){return[...new Set([...Fn,...Mn])]}async function Es$1({id:Fn,topic:Mn,wcDeepLink:rs}){var is;try{if(!rs)return;const os=typeof rs=="string"?JSON.parse(rs):rs,as=os==null?void 0:os.href;if(typeof as!="string")return;const us=Un(as,Fn,Mn),ds=We();if(ds===qt$1.browser){if(!((is=getDocument_1())!=null&&is.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}us.startsWith("https://")||us.startsWith("http://")?window.open(us,"_blank","noreferrer noopener"):window.open(us,kn()?"_blank":"_self","noreferrer noopener")}else ds===qt$1.reactNative&&typeof(global$2==null?void 0:global$2.Linking)<"u"&&await global$2.Linking.openURL(us)}catch(os){console.error(os)}}function Un(Fn,Mn,rs){const is=`requestId=${Mn}&sessionTopic=${rs}`;Fn.endsWith("/")&&(Fn=Fn.slice(0,-1));let os=`${Fn}`;if(Fn.startsWith("https://t.me")){const as=Fn.includes("?")?"&startapp=":"?startapp=";os=`${os}${as}${qn(is,!0)}`}else os=`${os}/wc?${is}`;return os}async function Ss$2(Fn,Mn){let rs="";try{if(gr$1()&&(rs=localStorage.getItem(Mn),rs))return rs;rs=await Fn.getItem(Mn)}catch(is){console.error(is)}return rs}function Is$2(Fn,Mn){if(!Fn.includes(Mn))return null;const rs=Fn.split(/([&,?,=])/),is=rs.indexOf(Mn);return rs[is+2]}function Ns$1(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,Fn=>{const Mn=Math.random()*16|0;return(Fn==="x"?Mn:Mn&3|8).toString(16)})}function _s$1(){return typeof browser$1$1<"u"&&define_process_env_default$1.IS_VITEST==="true"}function kn(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function qn(Fn,Mn=!1){const rs=Buffer.from(Fn).toString("base64");return Mn?rs.replace(/[=]/g,""):rs}function xi(Fn){return Buffer.from(Fn,"base64").toString("utf-8")}var Kn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global$2<"u"?global$2:typeof self<"u"?self:{};function Bs$1(Fn){var Mn=Fn.default;if(typeof Mn=="function"){var rs=function(){return Mn.apply(this,arguments)};rs.prototype=Mn.prototype}else rs={};return Object.defineProperty(rs,"__esModule",{value:!0}),Object.keys(Fn).forEach(function(is){var os=Object.getOwnPropertyDescriptor(Fn,is);Object.defineProperty(rs,is,os.get?os:{enumerable:!0,get:function(){return Fn[is]}})}),rs}var Hn={exports:{}};/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/(function(Fn){(function(){var Mn="input is invalid type",rs="finalize already called",is=typeof window=="object",os=is?window:{};os.JS_SHA3_NO_WINDOW&&(is=!1);var as=!is&&typeof self=="object",us=!os.JS_SHA3_NO_NODE_JS&&typeof browser$1$1=="object"&&browser$1$1.versions&&browser$1$1.versions.node;us?os=Kn:as&&(os=self);var ds=!os.JS_SHA3_NO_COMMON_JS&&!0&&Fn.exports,hs=!os.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",ps="0123456789abcdef".split(""),io=[31,7936,2031616,520093696],fo=[4,1024,262144,67108864],mo=[1,256,65536,16777216],Ao=[6,1536,393216,100663296],$o=[0,8,16,24],Lo=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],Go=[224,256,384,512],Yo=[128,256],Wo=["hex","buffer","arrayBuffer","array","digest"],Jo={128:168,256:136};(os.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(Nl){return Object.prototype.toString.call(Nl)==="[object Array]"}),hs&&(os.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(Nl){return typeof Nl=="object"&&Nl.buffer&&Nl.buffer.constructor===ArrayBuffer});for(var xl=function(Nl,zl,Vl){return function(Hl){return new Il(Nl,zl,Nl).update(Hl)[Vl]()}},_l=function(Nl,zl,Vl){return function(Hl,Yl){return new Il(Nl,zl,Yl).update(Hl)[Vl]()}},Tl=function(Nl,zl,Vl){return function(Hl,Yl,Ll,Zl){return jo["cshake"+Nl].update(Hl,Yl,Ll,Zl)[Vl]()}},Sl=function(Nl,zl,Vl){return function(Hl,Yl,Ll,Zl){return jo["kmac"+Nl].update(Hl,Yl,Ll,Zl)[Vl]()}},$l=function(Nl,zl,Vl,Hl){for(var Yl=0;Yl<Wo.length;++Yl){var Ll=Wo[Yl];Nl[Ll]=zl(Vl,Hl,Ll)}return Nl},Pl=function(Nl,zl){var Vl=xl(Nl,zl,"hex");return Vl.create=function(){return new Il(Nl,zl,Nl)},Vl.update=function(Hl){return Vl.create().update(Hl)},$l(Vl,xl,Nl,zl)},Dl=function(Nl,zl){var Vl=_l(Nl,zl,"hex");return Vl.create=function(Hl){return new Il(Nl,zl,Hl)},Vl.update=function(Hl,Yl){return Vl.create(Yl).update(Hl)},$l(Vl,_l,Nl,zl)},Ol=function(Nl,zl){var Vl=Jo[Nl],Hl=Tl(Nl,zl,"hex");return Hl.create=function(Yl,Ll,Zl){return!Ll&&!Zl?jo["shake"+Nl].create(Yl):new Il(Nl,zl,Yl).bytepad([Ll,Zl],Vl)},Hl.update=function(Yl,Ll,Zl,Xl){return Hl.create(Ll,Zl,Xl).update(Yl)},$l(Hl,Tl,Nl,zl)},Rl=function(Nl,zl){var Vl=Jo[Nl],Hl=Sl(Nl,zl,"hex");return Hl.create=function(Yl,Ll,Zl){return new Bl(Nl,zl,Ll).bytepad(["KMAC",Zl],Vl).bytepad([Yl],Vl)},Hl.update=function(Yl,Ll,Zl,Xl){return Hl.create(Yl,Zl,Xl).update(Ll)},$l(Hl,Sl,Nl,zl)},Vo=[{name:"keccak",padding:mo,bits:Go,createMethod:Pl},{name:"sha3",padding:Ao,bits:Go,createMethod:Pl},{name:"shake",padding:io,bits:Yo,createMethod:Dl},{name:"cshake",padding:fo,bits:Yo,createMethod:Ol},{name:"kmac",padding:fo,bits:Yo,createMethod:Rl}],jo={},Ho=[],Qo=0;Qo<Vo.length;++Qo)for(var El=Vo[Qo],Xo=El.bits,Al=0;Al<Xo.length;++Al){var wl=El.name+"_"+Xo[Al];if(Ho.push(wl),jo[wl]=El.createMethod(Xo[Al],El.padding),El.name!=="sha3"){var yl=El.name+Xo[Al];Ho.push(yl),jo[yl]=jo[wl]}}function Il(Nl,zl,Vl){this.blocks=[],this.s=[],this.padding=zl,this.outputBits=Vl,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(Nl<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Vl>>5,this.extraBytes=(Vl&31)>>3;for(var Hl=0;Hl<50;++Hl)this.s[Hl]=0}Il.prototype.update=function(Nl){if(this.finalized)throw new Error(rs);var zl,Vl=typeof Nl;if(Vl!=="string"){if(Vl==="object"){if(Nl===null)throw new Error(Mn);if(hs&&Nl.constructor===ArrayBuffer)Nl=new Uint8Array(Nl);else if(!Array.isArray(Nl)&&(!hs||!ArrayBuffer.isView(Nl)))throw new Error(Mn)}else throw new Error(Mn);zl=!0}for(var Hl=this.blocks,Yl=this.byteCount,Ll=Nl.length,Zl=this.blockCount,Xl=0,wu=this.s,yu,rp;Xl<Ll;){if(this.reset)for(this.reset=!1,Hl[0]=this.block,yu=1;yu<Zl+1;++yu)Hl[yu]=0;if(zl)for(yu=this.start;Xl<Ll&&yu<Yl;++Xl)Hl[yu>>2]|=Nl[Xl]<<$o[yu++&3];else for(yu=this.start;Xl<Ll&&yu<Yl;++Xl)rp=Nl.charCodeAt(Xl),rp<128?Hl[yu>>2]|=rp<<$o[yu++&3]:rp<2048?(Hl[yu>>2]|=(192|rp>>6)<<$o[yu++&3],Hl[yu>>2]|=(128|rp&63)<<$o[yu++&3]):rp<55296||rp>=57344?(Hl[yu>>2]|=(224|rp>>12)<<$o[yu++&3],Hl[yu>>2]|=(128|rp>>6&63)<<$o[yu++&3],Hl[yu>>2]|=(128|rp&63)<<$o[yu++&3]):(rp=65536+((rp&1023)<<10|Nl.charCodeAt(++Xl)&1023),Hl[yu>>2]|=(240|rp>>18)<<$o[yu++&3],Hl[yu>>2]|=(128|rp>>12&63)<<$o[yu++&3],Hl[yu>>2]|=(128|rp>>6&63)<<$o[yu++&3],Hl[yu>>2]|=(128|rp&63)<<$o[yu++&3]);if(this.lastByteIndex=yu,yu>=Yl){for(this.start=yu-Yl,this.block=Hl[Zl],yu=0;yu<Zl;++yu)wu[yu]^=Hl[yu];Gl(wu),this.reset=!0}else this.start=yu}return this},Il.prototype.encode=function(Nl,zl){var Vl=Nl&255,Hl=1,Yl=[Vl];for(Nl=Nl>>8,Vl=Nl&255;Vl>0;)Yl.unshift(Vl),Nl=Nl>>8,Vl=Nl&255,++Hl;return zl?Yl.push(Hl):Yl.unshift(Hl),this.update(Yl),Yl.length},Il.prototype.encodeString=function(Nl){var zl,Vl=typeof Nl;if(Vl!=="string"){if(Vl==="object"){if(Nl===null)throw new Error(Mn);if(hs&&Nl.constructor===ArrayBuffer)Nl=new Uint8Array(Nl);else if(!Array.isArray(Nl)&&(!hs||!ArrayBuffer.isView(Nl)))throw new Error(Mn)}else throw new Error(Mn);zl=!0}var Hl=0,Yl=Nl.length;if(zl)Hl=Yl;else for(var Ll=0;Ll<Nl.length;++Ll){var Zl=Nl.charCodeAt(Ll);Zl<128?Hl+=1:Zl<2048?Hl+=2:Zl<55296||Zl>=57344?Hl+=3:(Zl=65536+((Zl&1023)<<10|Nl.charCodeAt(++Ll)&1023),Hl+=4)}return Hl+=this.encode(Hl*8),this.update(Nl),Hl},Il.prototype.bytepad=function(Nl,zl){for(var Vl=this.encode(zl),Hl=0;Hl<Nl.length;++Hl)Vl+=this.encodeString(Nl[Hl]);var Yl=zl-Vl%zl,Ll=[];return Ll.length=Yl,this.update(Ll),this},Il.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var Nl=this.blocks,zl=this.lastByteIndex,Vl=this.blockCount,Hl=this.s;if(Nl[zl>>2]|=this.padding[zl&3],this.lastByteIndex===this.byteCount)for(Nl[0]=Nl[Vl],zl=1;zl<Vl+1;++zl)Nl[zl]=0;for(Nl[Vl-1]|=2147483648,zl=0;zl<Vl;++zl)Hl[zl]^=Nl[zl];Gl(Hl)}},Il.prototype.toString=Il.prototype.hex=function(){this.finalize();for(var Nl=this.blockCount,zl=this.s,Vl=this.outputBlocks,Hl=this.extraBytes,Yl=0,Ll=0,Zl="",Xl;Ll<Vl;){for(Yl=0;Yl<Nl&&Ll<Vl;++Yl,++Ll)Xl=zl[Yl],Zl+=ps[Xl>>4&15]+ps[Xl&15]+ps[Xl>>12&15]+ps[Xl>>8&15]+ps[Xl>>20&15]+ps[Xl>>16&15]+ps[Xl>>28&15]+ps[Xl>>24&15];Ll%Nl===0&&(Gl(zl),Yl=0)}return Hl&&(Xl=zl[Yl],Zl+=ps[Xl>>4&15]+ps[Xl&15],Hl>1&&(Zl+=ps[Xl>>12&15]+ps[Xl>>8&15]),Hl>2&&(Zl+=ps[Xl>>20&15]+ps[Xl>>16&15])),Zl},Il.prototype.arrayBuffer=function(){this.finalize();var Nl=this.blockCount,zl=this.s,Vl=this.outputBlocks,Hl=this.extraBytes,Yl=0,Ll=0,Zl=this.outputBits>>3,Xl;Hl?Xl=new ArrayBuffer(Vl+1<<2):Xl=new ArrayBuffer(Zl);for(var wu=new Uint32Array(Xl);Ll<Vl;){for(Yl=0;Yl<Nl&&Ll<Vl;++Yl,++Ll)wu[Ll]=zl[Yl];Ll%Nl===0&&Gl(zl)}return Hl&&(wu[Yl]=zl[Yl],Xl=Xl.slice(0,Zl)),Xl},Il.prototype.buffer=Il.prototype.arrayBuffer,Il.prototype.digest=Il.prototype.array=function(){this.finalize();for(var Nl=this.blockCount,zl=this.s,Vl=this.outputBlocks,Hl=this.extraBytes,Yl=0,Ll=0,Zl=[],Xl,wu;Ll<Vl;){for(Yl=0;Yl<Nl&&Ll<Vl;++Yl,++Ll)Xl=Ll<<2,wu=zl[Yl],Zl[Xl]=wu&255,Zl[Xl+1]=wu>>8&255,Zl[Xl+2]=wu>>16&255,Zl[Xl+3]=wu>>24&255;Ll%Nl===0&&Gl(zl)}return Hl&&(Xl=Ll<<2,wu=zl[Yl],Zl[Xl]=wu&255,Hl>1&&(Zl[Xl+1]=wu>>8&255),Hl>2&&(Zl[Xl+2]=wu>>16&255)),Zl};function Bl(Nl,zl,Vl){Il.call(this,Nl,zl,Vl)}Bl.prototype=new Il,Bl.prototype.finalize=function(){return this.encode(this.outputBits,!0),Il.prototype.finalize.call(this)};var Gl=function(Nl){var zl,Vl,Hl,Yl,Ll,Zl,Xl,wu,yu,rp,dp,up,wp,vp,pp,cp,gp,mp,fp,hp,xp,Kl,Fl,Ul,Jl,fu,_d,tp,yp,_p,Sp,Ap,Op,Zp,Qp,Xp,h0,Wp,Np,Rp,Pp,Hp,kp,Gp,Yp,Mp,Ip,Dp,Lp,zp,Bp,qp,Vp,tm,g0,rm,Jp,lm,$m,km,Cm,Am,pm;for(Hl=0;Hl<48;Hl+=2)Yl=Nl[0]^Nl[10]^Nl[20]^Nl[30]^Nl[40],Ll=Nl[1]^Nl[11]^Nl[21]^Nl[31]^Nl[41],Zl=Nl[2]^Nl[12]^Nl[22]^Nl[32]^Nl[42],Xl=Nl[3]^Nl[13]^Nl[23]^Nl[33]^Nl[43],wu=Nl[4]^Nl[14]^Nl[24]^Nl[34]^Nl[44],yu=Nl[5]^Nl[15]^Nl[25]^Nl[35]^Nl[45],rp=Nl[6]^Nl[16]^Nl[26]^Nl[36]^Nl[46],dp=Nl[7]^Nl[17]^Nl[27]^Nl[37]^Nl[47],up=Nl[8]^Nl[18]^Nl[28]^Nl[38]^Nl[48],wp=Nl[9]^Nl[19]^Nl[29]^Nl[39]^Nl[49],zl=up^(Zl<<1|Xl>>>31),Vl=wp^(Xl<<1|Zl>>>31),Nl[0]^=zl,Nl[1]^=Vl,Nl[10]^=zl,Nl[11]^=Vl,Nl[20]^=zl,Nl[21]^=Vl,Nl[30]^=zl,Nl[31]^=Vl,Nl[40]^=zl,Nl[41]^=Vl,zl=Yl^(wu<<1|yu>>>31),Vl=Ll^(yu<<1|wu>>>31),Nl[2]^=zl,Nl[3]^=Vl,Nl[12]^=zl,Nl[13]^=Vl,Nl[22]^=zl,Nl[23]^=Vl,Nl[32]^=zl,Nl[33]^=Vl,Nl[42]^=zl,Nl[43]^=Vl,zl=Zl^(rp<<1|dp>>>31),Vl=Xl^(dp<<1|rp>>>31),Nl[4]^=zl,Nl[5]^=Vl,Nl[14]^=zl,Nl[15]^=Vl,Nl[24]^=zl,Nl[25]^=Vl,Nl[34]^=zl,Nl[35]^=Vl,Nl[44]^=zl,Nl[45]^=Vl,zl=wu^(up<<1|wp>>>31),Vl=yu^(wp<<1|up>>>31),Nl[6]^=zl,Nl[7]^=Vl,Nl[16]^=zl,Nl[17]^=Vl,Nl[26]^=zl,Nl[27]^=Vl,Nl[36]^=zl,Nl[37]^=Vl,Nl[46]^=zl,Nl[47]^=Vl,zl=rp^(Yl<<1|Ll>>>31),Vl=dp^(Ll<<1|Yl>>>31),Nl[8]^=zl,Nl[9]^=Vl,Nl[18]^=zl,Nl[19]^=Vl,Nl[28]^=zl,Nl[29]^=Vl,Nl[38]^=zl,Nl[39]^=Vl,Nl[48]^=zl,Nl[49]^=Vl,vp=Nl[0],pp=Nl[1],Mp=Nl[11]<<4|Nl[10]>>>28,Ip=Nl[10]<<4|Nl[11]>>>28,tp=Nl[20]<<3|Nl[21]>>>29,yp=Nl[21]<<3|Nl[20]>>>29,km=Nl[31]<<9|Nl[30]>>>23,Cm=Nl[30]<<9|Nl[31]>>>23,Hp=Nl[40]<<18|Nl[41]>>>14,kp=Nl[41]<<18|Nl[40]>>>14,Zp=Nl[2]<<1|Nl[3]>>>31,Qp=Nl[3]<<1|Nl[2]>>>31,cp=Nl[13]<<12|Nl[12]>>>20,gp=Nl[12]<<12|Nl[13]>>>20,Dp=Nl[22]<<10|Nl[23]>>>22,Lp=Nl[23]<<10|Nl[22]>>>22,_p=Nl[33]<<13|Nl[32]>>>19,Sp=Nl[32]<<13|Nl[33]>>>19,Am=Nl[42]<<2|Nl[43]>>>30,pm=Nl[43]<<2|Nl[42]>>>30,tm=Nl[5]<<30|Nl[4]>>>2,g0=Nl[4]<<30|Nl[5]>>>2,Xp=Nl[14]<<6|Nl[15]>>>26,h0=Nl[15]<<6|Nl[14]>>>26,mp=Nl[25]<<11|Nl[24]>>>21,fp=Nl[24]<<11|Nl[25]>>>21,zp=Nl[34]<<15|Nl[35]>>>17,Bp=Nl[35]<<15|Nl[34]>>>17,Ap=Nl[45]<<29|Nl[44]>>>3,Op=Nl[44]<<29|Nl[45]>>>3,Ul=Nl[6]<<28|Nl[7]>>>4,Jl=Nl[7]<<28|Nl[6]>>>4,rm=Nl[17]<<23|Nl[16]>>>9,Jp=Nl[16]<<23|Nl[17]>>>9,Wp=Nl[26]<<25|Nl[27]>>>7,Np=Nl[27]<<25|Nl[26]>>>7,hp=Nl[36]<<21|Nl[37]>>>11,xp=Nl[37]<<21|Nl[36]>>>11,qp=Nl[47]<<24|Nl[46]>>>8,Vp=Nl[46]<<24|Nl[47]>>>8,Gp=Nl[8]<<27|Nl[9]>>>5,Yp=Nl[9]<<27|Nl[8]>>>5,fu=Nl[18]<<20|Nl[19]>>>12,_d=Nl[19]<<20|Nl[18]>>>12,lm=Nl[29]<<7|Nl[28]>>>25,$m=Nl[28]<<7|Nl[29]>>>25,Rp=Nl[38]<<8|Nl[39]>>>24,Pp=Nl[39]<<8|Nl[38]>>>24,Kl=Nl[48]<<14|Nl[49]>>>18,Fl=Nl[49]<<14|Nl[48]>>>18,Nl[0]=vp^~cp&mp,Nl[1]=pp^~gp&fp,Nl[10]=Ul^~fu&tp,Nl[11]=Jl^~_d&yp,Nl[20]=Zp^~Xp&Wp,Nl[21]=Qp^~h0&Np,Nl[30]=Gp^~Mp&Dp,Nl[31]=Yp^~Ip&Lp,Nl[40]=tm^~rm&lm,Nl[41]=g0^~Jp&$m,Nl[2]=cp^~mp&hp,Nl[3]=gp^~fp&xp,Nl[12]=fu^~tp&_p,Nl[13]=_d^~yp&Sp,Nl[22]=Xp^~Wp&Rp,Nl[23]=h0^~Np&Pp,Nl[32]=Mp^~Dp&zp,Nl[33]=Ip^~Lp&Bp,Nl[42]=rm^~lm&km,Nl[43]=Jp^~$m&Cm,Nl[4]=mp^~hp&Kl,Nl[5]=fp^~xp&Fl,Nl[14]=tp^~_p&Ap,Nl[15]=yp^~Sp&Op,Nl[24]=Wp^~Rp&Hp,Nl[25]=Np^~Pp&kp,Nl[34]=Dp^~zp&qp,Nl[35]=Lp^~Bp&Vp,Nl[44]=lm^~km&Am,Nl[45]=$m^~Cm&pm,Nl[6]=hp^~Kl&vp,Nl[7]=xp^~Fl&pp,Nl[16]=_p^~Ap&Ul,Nl[17]=Sp^~Op&Jl,Nl[26]=Rp^~Hp&Zp,Nl[27]=Pp^~kp&Qp,Nl[36]=zp^~qp&Gp,Nl[37]=Bp^~Vp&Yp,Nl[46]=km^~Am&tm,Nl[47]=Cm^~pm&g0,Nl[8]=Kl^~vp&cp,Nl[9]=Fl^~pp&gp,Nl[18]=Ap^~Ul&fu,Nl[19]=Op^~Jl&_d,Nl[28]=Hp^~Zp&Xp,Nl[29]=kp^~Qp&h0,Nl[38]=qp^~Gp&Mp,Nl[39]=Vp^~Yp&Ip,Nl[48]=Am^~tm&rm,Nl[49]=pm^~g0&Jp,Nl[0]^=Lo[Hl],Nl[1]^=Lo[Hl+1]};if(ds)Fn.exports=jo;else for(Qo=0;Qo<Ho.length;++Qo)os[Ho[Qo]]=jo[Ho[Qo]]})()})(Hn);var Cs$1=Hn.exports;const Rs$2="logger/5.7.0";let Ln=!1,zn=!1;const Tr$1={debug:1,default:2,info:2,warning:3,error:4,off:5};let jn=Tr$1.default,Mi$1=null;function Os$1(){try{const Fn=[];if(["NFD","NFC","NFKD","NFKC"].forEach(Mn=>{try{if("test".normalize(Mn)!=="test")throw new Error("bad normalize")}catch{Fn.push(Mn)}}),Fn.length)throw new Error("missing "+Fn.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(Fn){return Fn.message}return null}const Qn=Os$1();var Ei;(function(Fn){Fn.DEBUG="DEBUG",Fn.INFO="INFO",Fn.WARNING="WARNING",Fn.ERROR="ERROR",Fn.OFF="OFF"})(Ei||(Ei={}));var re;(function(Fn){Fn.UNKNOWN_ERROR="UNKNOWN_ERROR",Fn.NOT_IMPLEMENTED="NOT_IMPLEMENTED",Fn.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",Fn.NETWORK_ERROR="NETWORK_ERROR",Fn.SERVER_ERROR="SERVER_ERROR",Fn.TIMEOUT="TIMEOUT",Fn.BUFFER_OVERRUN="BUFFER_OVERRUN",Fn.NUMERIC_FAULT="NUMERIC_FAULT",Fn.MISSING_NEW="MISSING_NEW",Fn.INVALID_ARGUMENT="INVALID_ARGUMENT",Fn.MISSING_ARGUMENT="MISSING_ARGUMENT",Fn.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",Fn.CALL_EXCEPTION="CALL_EXCEPTION",Fn.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",Fn.NONCE_EXPIRED="NONCE_EXPIRED",Fn.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",Fn.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",Fn.TRANSACTION_REPLACED="TRANSACTION_REPLACED",Fn.ACTION_REJECTED="ACTION_REJECTED"})(re||(re={}));const Jn="0123456789abcdef";let z$2=class R1{constructor(Mn){Object.defineProperty(this,"version",{enumerable:!0,value:Mn,writable:!1})}_log(Mn,rs){const is=Mn.toLowerCase();Tr$1[is]==null&&this.throwArgumentError("invalid log level name","logLevel",Mn),!(jn>Tr$1[is])&&console.log.apply(console,rs)}debug(...Mn){this._log(R1.levels.DEBUG,Mn)}info(...Mn){this._log(R1.levels.INFO,Mn)}warn(...Mn){this._log(R1.levels.WARNING,Mn)}makeError(Mn,rs,is){if(zn)return this.makeError("censored error",rs,{});rs||(rs=R1.errors.UNKNOWN_ERROR),is||(is={});const os=[];Object.keys(is).forEach(hs=>{const ps=is[hs];try{if(ps instanceof Uint8Array){let io="";for(let fo=0;fo<ps.length;fo++)io+=Jn[ps[fo]>>4],io+=Jn[ps[fo]&15];os.push(hs+"=Uint8Array(0x"+io+")")}else os.push(hs+"="+JSON.stringify(ps))}catch{os.push(hs+"="+JSON.stringify(is[hs].toString()))}}),os.push(`code=${rs}`),os.push(`version=${this.version}`);const as=Mn;let us="";switch(rs){case re.NUMERIC_FAULT:{us="NUMERIC_FAULT";const hs=Mn;switch(hs){case"overflow":case"underflow":case"division-by-zero":us+="-"+hs;break;case"negative-power":case"negative-width":us+="-unsupported";break;case"unbound-bitwise-result":us+="-unbound-result";break}break}case re.CALL_EXCEPTION:case re.INSUFFICIENT_FUNDS:case re.MISSING_NEW:case re.NONCE_EXPIRED:case re.REPLACEMENT_UNDERPRICED:case re.TRANSACTION_REPLACED:case re.UNPREDICTABLE_GAS_LIMIT:us=rs;break}us&&(Mn+=" [ See: https://links.ethers.org/v5-errors-"+us+" ]"),os.length&&(Mn+=" ("+os.join(", ")+")");const ds=new Error(Mn);return ds.reason=as,ds.code=rs,Object.keys(is).forEach(function(hs){ds[hs]=is[hs]}),ds}throwError(Mn,rs,is){throw this.makeError(Mn,rs,is)}throwArgumentError(Mn,rs,is){return this.throwError(Mn,R1.errors.INVALID_ARGUMENT,{argument:rs,value:is})}assert(Mn,rs,is,os){Mn||this.throwError(rs,is,os)}assertArgument(Mn,rs,is,os){Mn||this.throwArgumentError(rs,is,os)}checkNormalize(Mn){Qn&&this.throwError("platform missing String.prototype.normalize",R1.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Qn})}checkSafeUint53(Mn,rs){typeof Mn=="number"&&(rs==null&&(rs="value not safe"),(Mn<0||Mn>=9007199254740991)&&this.throwError(rs,R1.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:Mn}),Mn%1&&this.throwError(rs,R1.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:Mn}))}checkArgumentCount(Mn,rs,is){is?is=": "+is:is="",Mn<rs&&this.throwError("missing argument"+is,R1.errors.MISSING_ARGUMENT,{count:Mn,expectedCount:rs}),Mn>rs&&this.throwError("too many arguments"+is,R1.errors.UNEXPECTED_ARGUMENT,{count:Mn,expectedCount:rs})}checkNew(Mn,rs){(Mn===Object||Mn==null)&&this.throwError("missing new",R1.errors.MISSING_NEW,{name:rs.name})}checkAbstract(Mn,rs){Mn===rs?this.throwError("cannot instantiate abstract class "+JSON.stringify(rs.name)+" directly; use a sub-class",R1.errors.UNSUPPORTED_OPERATION,{name:Mn.name,operation:"new"}):(Mn===Object||Mn==null)&&this.throwError("missing new",R1.errors.MISSING_NEW,{name:rs.name})}static globalLogger(){return Mi$1||(Mi$1=new R1(Rs$2)),Mi$1}static setCensorship(Mn,rs){if(!Mn&&rs&&this.globalLogger().throwError("cannot permanently disable censorship",R1.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ln){if(!Mn)return;this.globalLogger().throwError("error censorship permanent",R1.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}zn=!!Mn,Ln=!!rs}static setLogLevel(Mn){const rs=Tr$1[Mn.toLowerCase()];if(rs==null){R1.globalLogger().warn("invalid log level - "+Mn);return}jn=rs}static from(Mn){return new R1(Mn)}};z$2.errors=re,z$2.levels=Ei;const Ps$1="bytes/5.7.0",Tt$2=new z$2(Ps$1);function Gn(Fn){return!!Fn.toHexString}function ir$1(Fn){return Fn.slice||(Fn.slice=function(){const Mn=Array.prototype.slice.call(arguments);return ir$1(new Uint8Array(Array.prototype.slice.apply(Fn,Mn)))}),Fn}function Ts$1(Fn){return Jt$1(Fn)&&!(Fn.length%2)||nr$1(Fn)}function Yn(Fn){return typeof Fn=="number"&&Fn==Fn&&Fn%1===0}function nr$1(Fn){if(Fn==null)return!1;if(Fn.constructor===Uint8Array)return!0;if(typeof Fn=="string"||!Yn(Fn.length)||Fn.length<0)return!1;for(let Mn=0;Mn<Fn.length;Mn++){const rs=Fn[Mn];if(!Yn(rs)||rs<0||rs>=256)return!1}return!0}function Ot$1(Fn,Mn){if(Mn||(Mn={}),typeof Fn=="number"){Tt$2.checkSafeUint53(Fn,"invalid arrayify value");const rs=[];for(;Fn;)rs.unshift(Fn&255),Fn=parseInt(String(Fn/256));return rs.length===0&&rs.push(0),ir$1(new Uint8Array(rs))}if(Mn.allowMissingPrefix&&typeof Fn=="string"&&Fn.substring(0,2)!=="0x"&&(Fn="0x"+Fn),Gn(Fn)&&(Fn=Fn.toHexString()),Jt$1(Fn)){let rs=Fn.substring(2);rs.length%2&&(Mn.hexPad==="left"?rs="0"+rs:Mn.hexPad==="right"?rs+="0":Tt$2.throwArgumentError("hex data is odd-length","value",Fn));const is=[];for(let os=0;os<rs.length;os+=2)is.push(parseInt(rs.substring(os,os+2),16));return ir$1(new Uint8Array(is))}return nr$1(Fn)?ir$1(new Uint8Array(Fn)):Tt$2.throwArgumentError("invalid arrayify value","value",Fn)}function Ds(Fn){const Mn=Fn.map(os=>Ot$1(os)),rs=Mn.reduce((os,as)=>os+as.length,0),is=new Uint8Array(rs);return Mn.reduce((os,as)=>(is.set(as,os),os+as.length),0),ir$1(is)}function Fs$1(Fn,Mn){Fn=Ot$1(Fn),Fn.length>Mn&&Tt$2.throwArgumentError("value out of range","value",arguments[0]);const rs=new Uint8Array(Mn);return rs.set(Fn,Mn-Fn.length),ir$1(rs)}function Jt$1(Fn,Mn){return!(typeof Fn!="string"||!Fn.match(/^0x[0-9A-Fa-f]*$/)||Mn&&Fn.length!==2+2*Mn)}const Si="0123456789abcdef";function Kt$1(Fn,Mn){if(Mn||(Mn={}),typeof Fn=="number"){Tt$2.checkSafeUint53(Fn,"invalid hexlify value");let rs="";for(;Fn;)rs=Si[Fn&15]+rs,Fn=Math.floor(Fn/16);return rs.length?(rs.length%2&&(rs="0"+rs),"0x"+rs):"0x00"}if(typeof Fn=="bigint")return Fn=Fn.toString(16),Fn.length%2?"0x0"+Fn:"0x"+Fn;if(Mn.allowMissingPrefix&&typeof Fn=="string"&&Fn.substring(0,2)!=="0x"&&(Fn="0x"+Fn),Gn(Fn))return Fn.toHexString();if(Jt$1(Fn))return Fn.length%2&&(Mn.hexPad==="left"?Fn="0x0"+Fn.substring(2):Mn.hexPad==="right"?Fn+="0":Tt$2.throwArgumentError("hex data is odd-length","value",Fn)),Fn.toLowerCase();if(nr$1(Fn)){let rs="0x";for(let is=0;is<Fn.length;is++){let os=Fn[is];rs+=Si[(os&240)>>4]+Si[os&15]}return rs}return Tt$2.throwArgumentError("invalid hexlify value","value",Fn)}function Us$1(Fn){if(typeof Fn!="string")Fn=Kt$1(Fn);else if(!Jt$1(Fn)||Fn.length%2)return null;return(Fn.length-2)/2}function Vn(Fn,Mn,rs){return typeof Fn!="string"?Fn=Kt$1(Fn):(!Jt$1(Fn)||Fn.length%2)&&Tt$2.throwArgumentError("invalid hexData","value",Fn),Mn=2+2*Mn,rs!=null?"0x"+Fn.substring(Mn,2+2*rs):"0x"+Fn.substring(Mn)}function oe$2(Fn,Mn){for(typeof Fn!="string"?Fn=Kt$1(Fn):Jt$1(Fn)||Tt$2.throwArgumentError("invalid hex string","value",Fn),Fn.length>2*Mn+2&&Tt$2.throwArgumentError("value out of range","value",arguments[1]);Fn.length<2*Mn+2;)Fn="0x0"+Fn.substring(2);return Fn}function Wn(Fn){const Mn={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Ts$1(Fn)){let rs=Ot$1(Fn);rs.length===64?(Mn.v=27+(rs[32]>>7),rs[32]&=127,Mn.r=Kt$1(rs.slice(0,32)),Mn.s=Kt$1(rs.slice(32,64))):rs.length===65?(Mn.r=Kt$1(rs.slice(0,32)),Mn.s=Kt$1(rs.slice(32,64)),Mn.v=rs[64]):Tt$2.throwArgumentError("invalid signature string","signature",Fn),Mn.v<27&&(Mn.v===0||Mn.v===1?Mn.v+=27:Tt$2.throwArgumentError("signature invalid v byte","signature",Fn)),Mn.recoveryParam=1-Mn.v%2,Mn.recoveryParam&&(rs[32]|=128),Mn._vs=Kt$1(rs.slice(32,64))}else{if(Mn.r=Fn.r,Mn.s=Fn.s,Mn.v=Fn.v,Mn.recoveryParam=Fn.recoveryParam,Mn._vs=Fn._vs,Mn._vs!=null){const os=Fs$1(Ot$1(Mn._vs),32);Mn._vs=Kt$1(os);const as=os[0]>=128?1:0;Mn.recoveryParam==null?Mn.recoveryParam=as:Mn.recoveryParam!==as&&Tt$2.throwArgumentError("signature recoveryParam mismatch _vs","signature",Fn),os[0]&=127;const us=Kt$1(os);Mn.s==null?Mn.s=us:Mn.s!==us&&Tt$2.throwArgumentError("signature v mismatch _vs","signature",Fn)}if(Mn.recoveryParam==null)Mn.v==null?Tt$2.throwArgumentError("signature missing v and recoveryParam","signature",Fn):Mn.v===0||Mn.v===1?Mn.recoveryParam=Mn.v:Mn.recoveryParam=1-Mn.v%2;else if(Mn.v==null)Mn.v=27+Mn.recoveryParam;else{const os=Mn.v===0||Mn.v===1?Mn.v:1-Mn.v%2;Mn.recoveryParam!==os&&Tt$2.throwArgumentError("signature recoveryParam mismatch v","signature",Fn)}Mn.r==null||!Jt$1(Mn.r)?Tt$2.throwArgumentError("signature missing or invalid r","signature",Fn):Mn.r=oe$2(Mn.r,32),Mn.s==null||!Jt$1(Mn.s)?Tt$2.throwArgumentError("signature missing or invalid s","signature",Fn):Mn.s=oe$2(Mn.s,32);const rs=Ot$1(Mn.s);rs[0]>=128&&Tt$2.throwArgumentError("signature s out of range","signature",Fn),Mn.recoveryParam&&(rs[0]|=128);const is=Kt$1(rs);Mn._vs&&(Jt$1(Mn._vs)||Tt$2.throwArgumentError("signature invalid _vs","signature",Fn),Mn._vs=oe$2(Mn._vs,32)),Mn._vs==null?Mn._vs=is:Mn._vs!==is&&Tt$2.throwArgumentError("signature _vs mismatch v and s","signature",Fn)}return Mn.yParityAndS=Mn._vs,Mn.compact=Mn.r+Mn.yParityAndS.substring(2),Mn}function Ii(Fn){return"0x"+Cs$1.keccak_256(Ot$1(Fn))}var Xn={exports:{}},ks$1={},qs$2=Object.freeze({__proto__:null,default:ks$1}),Ks$1=Bs$1(qs$2);(function(Fn){(function(Mn,rs){function is(Vo,jo){if(!Vo)throw new Error(jo||"Assertion failed")}function os(Vo,jo){Vo.super_=jo;var Ho=function(){};Ho.prototype=jo.prototype,Vo.prototype=new Ho,Vo.prototype.constructor=Vo}function as(Vo,jo,Ho){if(as.isBN(Vo))return Vo;this.negative=0,this.words=null,this.length=0,this.red=null,Vo!==null&&((jo==="le"||jo==="be")&&(Ho=jo,jo=10),this._init(Vo||0,jo||10,Ho||"be"))}typeof Mn=="object"?Mn.exports=as:rs.BN=as,as.BN=as,as.wordSize=26;var us;try{typeof window<"u"&&typeof window.Buffer<"u"?us=window.Buffer:us=Ks$1.Buffer}catch{}as.isBN=function(Vo){return Vo instanceof as?!0:Vo!==null&&typeof Vo=="object"&&Vo.constructor.wordSize===as.wordSize&&Array.isArray(Vo.words)},as.max=function(Vo,jo){return Vo.cmp(jo)>0?Vo:jo},as.min=function(Vo,jo){return Vo.cmp(jo)<0?Vo:jo},as.prototype._init=function(Vo,jo,Ho){if(typeof Vo=="number")return this._initNumber(Vo,jo,Ho);if(typeof Vo=="object")return this._initArray(Vo,jo,Ho);jo==="hex"&&(jo=16),is(jo===(jo|0)&&jo>=2&&jo<=36),Vo=Vo.toString().replace(/\s+/g,"");var Qo=0;Vo[0]==="-"&&(Qo++,this.negative=1),Qo<Vo.length&&(jo===16?this._parseHex(Vo,Qo,Ho):(this._parseBase(Vo,jo,Qo),Ho==="le"&&this._initArray(this.toArray(),jo,Ho)))},as.prototype._initNumber=function(Vo,jo,Ho){Vo<0&&(this.negative=1,Vo=-Vo),Vo<67108864?(this.words=[Vo&67108863],this.length=1):Vo<4503599627370496?(this.words=[Vo&67108863,Vo/67108864&67108863],this.length=2):(is(Vo<9007199254740992),this.words=[Vo&67108863,Vo/67108864&67108863,1],this.length=3),Ho==="le"&&this._initArray(this.toArray(),jo,Ho)},as.prototype._initArray=function(Vo,jo,Ho){if(is(typeof Vo.length=="number"),Vo.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Vo.length/3),this.words=new Array(this.length);for(var Qo=0;Qo<this.length;Qo++)this.words[Qo]=0;var El,Xo,Al=0;if(Ho==="be")for(Qo=Vo.length-1,El=0;Qo>=0;Qo-=3)Xo=Vo[Qo]|Vo[Qo-1]<<8|Vo[Qo-2]<<16,this.words[El]|=Xo<<Al&67108863,this.words[El+1]=Xo>>>26-Al&67108863,Al+=24,Al>=26&&(Al-=26,El++);else if(Ho==="le")for(Qo=0,El=0;Qo<Vo.length;Qo+=3)Xo=Vo[Qo]|Vo[Qo+1]<<8|Vo[Qo+2]<<16,this.words[El]|=Xo<<Al&67108863,this.words[El+1]=Xo>>>26-Al&67108863,Al+=24,Al>=26&&(Al-=26,El++);return this._strip()};function ds(Vo,jo){var Ho=Vo.charCodeAt(jo);if(Ho>=48&&Ho<=57)return Ho-48;if(Ho>=65&&Ho<=70)return Ho-55;if(Ho>=97&&Ho<=102)return Ho-87;is(!1,"Invalid character in "+Vo)}function hs(Vo,jo,Ho){var Qo=ds(Vo,Ho);return Ho-1>=jo&&(Qo|=ds(Vo,Ho-1)<<4),Qo}as.prototype._parseHex=function(Vo,jo,Ho){this.length=Math.ceil((Vo.length-jo)/6),this.words=new Array(this.length);for(var Qo=0;Qo<this.length;Qo++)this.words[Qo]=0;var El=0,Xo=0,Al;if(Ho==="be")for(Qo=Vo.length-1;Qo>=jo;Qo-=2)Al=hs(Vo,jo,Qo)<<El,this.words[Xo]|=Al&67108863,El>=18?(El-=18,Xo+=1,this.words[Xo]|=Al>>>26):El+=8;else{var wl=Vo.length-jo;for(Qo=wl%2===0?jo+1:jo;Qo<Vo.length;Qo+=2)Al=hs(Vo,jo,Qo)<<El,this.words[Xo]|=Al&67108863,El>=18?(El-=18,Xo+=1,this.words[Xo]|=Al>>>26):El+=8}this._strip()};function ps(Vo,jo,Ho,Qo){for(var El=0,Xo=0,Al=Math.min(Vo.length,Ho),wl=jo;wl<Al;wl++){var yl=Vo.charCodeAt(wl)-48;El*=Qo,yl>=49?Xo=yl-49+10:yl>=17?Xo=yl-17+10:Xo=yl,is(yl>=0&&Xo<Qo,"Invalid character"),El+=Xo}return El}as.prototype._parseBase=function(Vo,jo,Ho){this.words=[0],this.length=1;for(var Qo=0,El=1;El<=67108863;El*=jo)Qo++;Qo--,El=El/jo|0;for(var Xo=Vo.length-Ho,Al=Xo%Qo,wl=Math.min(Xo,Xo-Al)+Ho,yl=0,Il=Ho;Il<wl;Il+=Qo)yl=ps(Vo,Il,Il+Qo,jo),this.imuln(El),this.words[0]+yl<67108864?this.words[0]+=yl:this._iaddn(yl);if(Al!==0){var Bl=1;for(yl=ps(Vo,Il,Vo.length,jo),Il=0;Il<Al;Il++)Bl*=jo;this.imuln(Bl),this.words[0]+yl<67108864?this.words[0]+=yl:this._iaddn(yl)}this._strip()},as.prototype.copy=function(Vo){Vo.words=new Array(this.length);for(var jo=0;jo<this.length;jo++)Vo.words[jo]=this.words[jo];Vo.length=this.length,Vo.negative=this.negative,Vo.red=this.red};function io(Vo,jo){Vo.words=jo.words,Vo.length=jo.length,Vo.negative=jo.negative,Vo.red=jo.red}if(as.prototype._move=function(Vo){io(Vo,this)},as.prototype.clone=function(){var Vo=new as(null);return this.copy(Vo),Vo},as.prototype._expand=function(Vo){for(;this.length<Vo;)this.words[this.length++]=0;return this},as.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},as.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{as.prototype[Symbol.for("nodejs.util.inspect.custom")]=fo}catch{as.prototype.inspect=fo}else as.prototype.inspect=fo;function fo(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var mo=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],Ao=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],$o=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];as.prototype.toString=function(Vo,jo){Vo=Vo||10,jo=jo|0||1;var Ho;if(Vo===16||Vo==="hex"){Ho="";for(var Qo=0,El=0,Xo=0;Xo<this.length;Xo++){var Al=this.words[Xo],wl=((Al<<Qo|El)&16777215).toString(16);El=Al>>>24-Qo&16777215,Qo+=2,Qo>=26&&(Qo-=26,Xo--),El!==0||Xo!==this.length-1?Ho=mo[6-wl.length]+wl+Ho:Ho=wl+Ho}for(El!==0&&(Ho=El.toString(16)+Ho);Ho.length%jo!==0;)Ho="0"+Ho;return this.negative!==0&&(Ho="-"+Ho),Ho}if(Vo===(Vo|0)&&Vo>=2&&Vo<=36){var yl=Ao[Vo],Il=$o[Vo];Ho="";var Bl=this.clone();for(Bl.negative=0;!Bl.isZero();){var Gl=Bl.modrn(Il).toString(Vo);Bl=Bl.idivn(Il),Bl.isZero()?Ho=Gl+Ho:Ho=mo[yl-Gl.length]+Gl+Ho}for(this.isZero()&&(Ho="0"+Ho);Ho.length%jo!==0;)Ho="0"+Ho;return this.negative!==0&&(Ho="-"+Ho),Ho}is(!1,"Base should be between 2 and 36")},as.prototype.toNumber=function(){var Vo=this.words[0];return this.length===2?Vo+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Vo+=4503599627370496+this.words[1]*67108864:this.length>2&&is(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Vo:Vo},as.prototype.toJSON=function(){return this.toString(16,2)},us&&(as.prototype.toBuffer=function(Vo,jo){return this.toArrayLike(us,Vo,jo)}),as.prototype.toArray=function(Vo,jo){return this.toArrayLike(Array,Vo,jo)};var Lo=function(Vo,jo){return Vo.allocUnsafe?Vo.allocUnsafe(jo):new Vo(jo)};as.prototype.toArrayLike=function(Vo,jo,Ho){this._strip();var Qo=this.byteLength(),El=Ho||Math.max(1,Qo);is(Qo<=El,"byte array longer than desired length"),is(El>0,"Requested array length <= 0");var Xo=Lo(Vo,El),Al=jo==="le"?"LE":"BE";return this["_toArrayLike"+Al](Xo,Qo),Xo},as.prototype._toArrayLikeLE=function(Vo,jo){for(var Ho=0,Qo=0,El=0,Xo=0;El<this.length;El++){var Al=this.words[El]<<Xo|Qo;Vo[Ho++]=Al&255,Ho<Vo.length&&(Vo[Ho++]=Al>>8&255),Ho<Vo.length&&(Vo[Ho++]=Al>>16&255),Xo===6?(Ho<Vo.length&&(Vo[Ho++]=Al>>24&255),Qo=0,Xo=0):(Qo=Al>>>24,Xo+=2)}if(Ho<Vo.length)for(Vo[Ho++]=Qo;Ho<Vo.length;)Vo[Ho++]=0},as.prototype._toArrayLikeBE=function(Vo,jo){for(var Ho=Vo.length-1,Qo=0,El=0,Xo=0;El<this.length;El++){var Al=this.words[El]<<Xo|Qo;Vo[Ho--]=Al&255,Ho>=0&&(Vo[Ho--]=Al>>8&255),Ho>=0&&(Vo[Ho--]=Al>>16&255),Xo===6?(Ho>=0&&(Vo[Ho--]=Al>>24&255),Qo=0,Xo=0):(Qo=Al>>>24,Xo+=2)}if(Ho>=0)for(Vo[Ho--]=Qo;Ho>=0;)Vo[Ho--]=0},Math.clz32?as.prototype._countBits=function(Vo){return 32-Math.clz32(Vo)}:as.prototype._countBits=function(Vo){var jo=Vo,Ho=0;return jo>=4096&&(Ho+=13,jo>>>=13),jo>=64&&(Ho+=7,jo>>>=7),jo>=8&&(Ho+=4,jo>>>=4),jo>=2&&(Ho+=2,jo>>>=2),Ho+jo},as.prototype._zeroBits=function(Vo){if(Vo===0)return 26;var jo=Vo,Ho=0;return jo&8191||(Ho+=13,jo>>>=13),jo&127||(Ho+=7,jo>>>=7),jo&15||(Ho+=4,jo>>>=4),jo&3||(Ho+=2,jo>>>=2),jo&1||Ho++,Ho},as.prototype.bitLength=function(){var Vo=this.words[this.length-1],jo=this._countBits(Vo);return(this.length-1)*26+jo};function Go(Vo){for(var jo=new Array(Vo.bitLength()),Ho=0;Ho<jo.length;Ho++){var Qo=Ho/26|0,El=Ho%26;jo[Ho]=Vo.words[Qo]>>>El&1}return jo}as.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Vo=0,jo=0;jo<this.length;jo++){var Ho=this._zeroBits(this.words[jo]);if(Vo+=Ho,Ho!==26)break}return Vo},as.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},as.prototype.toTwos=function(Vo){return this.negative!==0?this.abs().inotn(Vo).iaddn(1):this.clone()},as.prototype.fromTwos=function(Vo){return this.testn(Vo-1)?this.notn(Vo).iaddn(1).ineg():this.clone()},as.prototype.isNeg=function(){return this.negative!==0},as.prototype.neg=function(){return this.clone().ineg()},as.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},as.prototype.iuor=function(Vo){for(;this.length<Vo.length;)this.words[this.length++]=0;for(var jo=0;jo<Vo.length;jo++)this.words[jo]=this.words[jo]|Vo.words[jo];return this._strip()},as.prototype.ior=function(Vo){return is((this.negative|Vo.negative)===0),this.iuor(Vo)},as.prototype.or=function(Vo){return this.length>Vo.length?this.clone().ior(Vo):Vo.clone().ior(this)},as.prototype.uor=function(Vo){return this.length>Vo.length?this.clone().iuor(Vo):Vo.clone().iuor(this)},as.prototype.iuand=function(Vo){var jo;this.length>Vo.length?jo=Vo:jo=this;for(var Ho=0;Ho<jo.length;Ho++)this.words[Ho]=this.words[Ho]&Vo.words[Ho];return this.length=jo.length,this._strip()},as.prototype.iand=function(Vo){return is((this.negative|Vo.negative)===0),this.iuand(Vo)},as.prototype.and=function(Vo){return this.length>Vo.length?this.clone().iand(Vo):Vo.clone().iand(this)},as.prototype.uand=function(Vo){return this.length>Vo.length?this.clone().iuand(Vo):Vo.clone().iuand(this)},as.prototype.iuxor=function(Vo){var jo,Ho;this.length>Vo.length?(jo=this,Ho=Vo):(jo=Vo,Ho=this);for(var Qo=0;Qo<Ho.length;Qo++)this.words[Qo]=jo.words[Qo]^Ho.words[Qo];if(this!==jo)for(;Qo<jo.length;Qo++)this.words[Qo]=jo.words[Qo];return this.length=jo.length,this._strip()},as.prototype.ixor=function(Vo){return is((this.negative|Vo.negative)===0),this.iuxor(Vo)},as.prototype.xor=function(Vo){return this.length>Vo.length?this.clone().ixor(Vo):Vo.clone().ixor(this)},as.prototype.uxor=function(Vo){return this.length>Vo.length?this.clone().iuxor(Vo):Vo.clone().iuxor(this)},as.prototype.inotn=function(Vo){is(typeof Vo=="number"&&Vo>=0);var jo=Math.ceil(Vo/26)|0,Ho=Vo%26;this._expand(jo),Ho>0&&jo--;for(var Qo=0;Qo<jo;Qo++)this.words[Qo]=~this.words[Qo]&67108863;return Ho>0&&(this.words[Qo]=~this.words[Qo]&67108863>>26-Ho),this._strip()},as.prototype.notn=function(Vo){return this.clone().inotn(Vo)},as.prototype.setn=function(Vo,jo){is(typeof Vo=="number"&&Vo>=0);var Ho=Vo/26|0,Qo=Vo%26;return this._expand(Ho+1),jo?this.words[Ho]=this.words[Ho]|1<<Qo:this.words[Ho]=this.words[Ho]&~(1<<Qo),this._strip()},as.prototype.iadd=function(Vo){var jo;if(this.negative!==0&&Vo.negative===0)return this.negative=0,jo=this.isub(Vo),this.negative^=1,this._normSign();if(this.negative===0&&Vo.negative!==0)return Vo.negative=0,jo=this.isub(Vo),Vo.negative=1,jo._normSign();var Ho,Qo;this.length>Vo.length?(Ho=this,Qo=Vo):(Ho=Vo,Qo=this);for(var El=0,Xo=0;Xo<Qo.length;Xo++)jo=(Ho.words[Xo]|0)+(Qo.words[Xo]|0)+El,this.words[Xo]=jo&67108863,El=jo>>>26;for(;El!==0&&Xo<Ho.length;Xo++)jo=(Ho.words[Xo]|0)+El,this.words[Xo]=jo&67108863,El=jo>>>26;if(this.length=Ho.length,El!==0)this.words[this.length]=El,this.length++;else if(Ho!==this)for(;Xo<Ho.length;Xo++)this.words[Xo]=Ho.words[Xo];return this},as.prototype.add=function(Vo){var jo;return Vo.negative!==0&&this.negative===0?(Vo.negative=0,jo=this.sub(Vo),Vo.negative^=1,jo):Vo.negative===0&&this.negative!==0?(this.negative=0,jo=Vo.sub(this),this.negative=1,jo):this.length>Vo.length?this.clone().iadd(Vo):Vo.clone().iadd(this)},as.prototype.isub=function(Vo){if(Vo.negative!==0){Vo.negative=0;var jo=this.iadd(Vo);return Vo.negative=1,jo._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Vo),this.negative=1,this._normSign();var Ho=this.cmp(Vo);if(Ho===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Qo,El;Ho>0?(Qo=this,El=Vo):(Qo=Vo,El=this);for(var Xo=0,Al=0;Al<El.length;Al++)jo=(Qo.words[Al]|0)-(El.words[Al]|0)+Xo,Xo=jo>>26,this.words[Al]=jo&67108863;for(;Xo!==0&&Al<Qo.length;Al++)jo=(Qo.words[Al]|0)+Xo,Xo=jo>>26,this.words[Al]=jo&67108863;if(Xo===0&&Al<Qo.length&&Qo!==this)for(;Al<Qo.length;Al++)this.words[Al]=Qo.words[Al];return this.length=Math.max(this.length,Al),Qo!==this&&(this.negative=1),this._strip()},as.prototype.sub=function(Vo){return this.clone().isub(Vo)};function Yo(Vo,jo,Ho){Ho.negative=jo.negative^Vo.negative;var Qo=Vo.length+jo.length|0;Ho.length=Qo,Qo=Qo-1|0;var El=Vo.words[0]|0,Xo=jo.words[0]|0,Al=El*Xo,wl=Al&67108863,yl=Al/67108864|0;Ho.words[0]=wl;for(var Il=1;Il<Qo;Il++){for(var Bl=yl>>>26,Gl=yl&67108863,Nl=Math.min(Il,jo.length-1),zl=Math.max(0,Il-Vo.length+1);zl<=Nl;zl++){var Vl=Il-zl|0;El=Vo.words[Vl]|0,Xo=jo.words[zl]|0,Al=El*Xo+Gl,Bl+=Al/67108864|0,Gl=Al&67108863}Ho.words[Il]=Gl|0,yl=Bl|0}return yl!==0?Ho.words[Il]=yl|0:Ho.length--,Ho._strip()}var Wo=function(Vo,jo,Ho){var Qo=Vo.words,El=jo.words,Xo=Ho.words,Al=0,wl,yl,Il,Bl=Qo[0]|0,Gl=Bl&8191,Nl=Bl>>>13,zl=Qo[1]|0,Vl=zl&8191,Hl=zl>>>13,Yl=Qo[2]|0,Ll=Yl&8191,Zl=Yl>>>13,Xl=Qo[3]|0,wu=Xl&8191,yu=Xl>>>13,rp=Qo[4]|0,dp=rp&8191,up=rp>>>13,wp=Qo[5]|0,vp=wp&8191,pp=wp>>>13,cp=Qo[6]|0,gp=cp&8191,mp=cp>>>13,fp=Qo[7]|0,hp=fp&8191,xp=fp>>>13,Kl=Qo[8]|0,Fl=Kl&8191,Ul=Kl>>>13,Jl=Qo[9]|0,fu=Jl&8191,_d=Jl>>>13,tp=El[0]|0,yp=tp&8191,_p=tp>>>13,Sp=El[1]|0,Ap=Sp&8191,Op=Sp>>>13,Zp=El[2]|0,Qp=Zp&8191,Xp=Zp>>>13,h0=El[3]|0,Wp=h0&8191,Np=h0>>>13,Rp=El[4]|0,Pp=Rp&8191,Hp=Rp>>>13,kp=El[5]|0,Gp=kp&8191,Yp=kp>>>13,Mp=El[6]|0,Ip=Mp&8191,Dp=Mp>>>13,Lp=El[7]|0,zp=Lp&8191,Bp=Lp>>>13,qp=El[8]|0,Vp=qp&8191,tm=qp>>>13,g0=El[9]|0,rm=g0&8191,Jp=g0>>>13;Ho.negative=Vo.negative^jo.negative,Ho.length=19,wl=Math.imul(Gl,yp),yl=Math.imul(Gl,_p),yl=yl+Math.imul(Nl,yp)|0,Il=Math.imul(Nl,_p);var lm=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(lm>>>26)|0,lm&=67108863,wl=Math.imul(Vl,yp),yl=Math.imul(Vl,_p),yl=yl+Math.imul(Hl,yp)|0,Il=Math.imul(Hl,_p),wl=wl+Math.imul(Gl,Ap)|0,yl=yl+Math.imul(Gl,Op)|0,yl=yl+Math.imul(Nl,Ap)|0,Il=Il+Math.imul(Nl,Op)|0;var $m=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+($m>>>26)|0,$m&=67108863,wl=Math.imul(Ll,yp),yl=Math.imul(Ll,_p),yl=yl+Math.imul(Zl,yp)|0,Il=Math.imul(Zl,_p),wl=wl+Math.imul(Vl,Ap)|0,yl=yl+Math.imul(Vl,Op)|0,yl=yl+Math.imul(Hl,Ap)|0,Il=Il+Math.imul(Hl,Op)|0,wl=wl+Math.imul(Gl,Qp)|0,yl=yl+Math.imul(Gl,Xp)|0,yl=yl+Math.imul(Nl,Qp)|0,Il=Il+Math.imul(Nl,Xp)|0;var km=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(km>>>26)|0,km&=67108863,wl=Math.imul(wu,yp),yl=Math.imul(wu,_p),yl=yl+Math.imul(yu,yp)|0,Il=Math.imul(yu,_p),wl=wl+Math.imul(Ll,Ap)|0,yl=yl+Math.imul(Ll,Op)|0,yl=yl+Math.imul(Zl,Ap)|0,Il=Il+Math.imul(Zl,Op)|0,wl=wl+Math.imul(Vl,Qp)|0,yl=yl+Math.imul(Vl,Xp)|0,yl=yl+Math.imul(Hl,Qp)|0,Il=Il+Math.imul(Hl,Xp)|0,wl=wl+Math.imul(Gl,Wp)|0,yl=yl+Math.imul(Gl,Np)|0,yl=yl+Math.imul(Nl,Wp)|0,Il=Il+Math.imul(Nl,Np)|0;var Cm=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(Cm>>>26)|0,Cm&=67108863,wl=Math.imul(dp,yp),yl=Math.imul(dp,_p),yl=yl+Math.imul(up,yp)|0,Il=Math.imul(up,_p),wl=wl+Math.imul(wu,Ap)|0,yl=yl+Math.imul(wu,Op)|0,yl=yl+Math.imul(yu,Ap)|0,Il=Il+Math.imul(yu,Op)|0,wl=wl+Math.imul(Ll,Qp)|0,yl=yl+Math.imul(Ll,Xp)|0,yl=yl+Math.imul(Zl,Qp)|0,Il=Il+Math.imul(Zl,Xp)|0,wl=wl+Math.imul(Vl,Wp)|0,yl=yl+Math.imul(Vl,Np)|0,yl=yl+Math.imul(Hl,Wp)|0,Il=Il+Math.imul(Hl,Np)|0,wl=wl+Math.imul(Gl,Pp)|0,yl=yl+Math.imul(Gl,Hp)|0,yl=yl+Math.imul(Nl,Pp)|0,Il=Il+Math.imul(Nl,Hp)|0;var Am=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(Am>>>26)|0,Am&=67108863,wl=Math.imul(vp,yp),yl=Math.imul(vp,_p),yl=yl+Math.imul(pp,yp)|0,Il=Math.imul(pp,_p),wl=wl+Math.imul(dp,Ap)|0,yl=yl+Math.imul(dp,Op)|0,yl=yl+Math.imul(up,Ap)|0,Il=Il+Math.imul(up,Op)|0,wl=wl+Math.imul(wu,Qp)|0,yl=yl+Math.imul(wu,Xp)|0,yl=yl+Math.imul(yu,Qp)|0,Il=Il+Math.imul(yu,Xp)|0,wl=wl+Math.imul(Ll,Wp)|0,yl=yl+Math.imul(Ll,Np)|0,yl=yl+Math.imul(Zl,Wp)|0,Il=Il+Math.imul(Zl,Np)|0,wl=wl+Math.imul(Vl,Pp)|0,yl=yl+Math.imul(Vl,Hp)|0,yl=yl+Math.imul(Hl,Pp)|0,Il=Il+Math.imul(Hl,Hp)|0,wl=wl+Math.imul(Gl,Gp)|0,yl=yl+Math.imul(Gl,Yp)|0,yl=yl+Math.imul(Nl,Gp)|0,Il=Il+Math.imul(Nl,Yp)|0;var pm=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(pm>>>26)|0,pm&=67108863,wl=Math.imul(gp,yp),yl=Math.imul(gp,_p),yl=yl+Math.imul(mp,yp)|0,Il=Math.imul(mp,_p),wl=wl+Math.imul(vp,Ap)|0,yl=yl+Math.imul(vp,Op)|0,yl=yl+Math.imul(pp,Ap)|0,Il=Il+Math.imul(pp,Op)|0,wl=wl+Math.imul(dp,Qp)|0,yl=yl+Math.imul(dp,Xp)|0,yl=yl+Math.imul(up,Qp)|0,Il=Il+Math.imul(up,Xp)|0,wl=wl+Math.imul(wu,Wp)|0,yl=yl+Math.imul(wu,Np)|0,yl=yl+Math.imul(yu,Wp)|0,Il=Il+Math.imul(yu,Np)|0,wl=wl+Math.imul(Ll,Pp)|0,yl=yl+Math.imul(Ll,Hp)|0,yl=yl+Math.imul(Zl,Pp)|0,Il=Il+Math.imul(Zl,Hp)|0,wl=wl+Math.imul(Vl,Gp)|0,yl=yl+Math.imul(Vl,Yp)|0,yl=yl+Math.imul(Hl,Gp)|0,Il=Il+Math.imul(Hl,Yp)|0,wl=wl+Math.imul(Gl,Ip)|0,yl=yl+Math.imul(Gl,Dp)|0,yl=yl+Math.imul(Nl,Ip)|0,Il=Il+Math.imul(Nl,Dp)|0;var Ym=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(Ym>>>26)|0,Ym&=67108863,wl=Math.imul(hp,yp),yl=Math.imul(hp,_p),yl=yl+Math.imul(xp,yp)|0,Il=Math.imul(xp,_p),wl=wl+Math.imul(gp,Ap)|0,yl=yl+Math.imul(gp,Op)|0,yl=yl+Math.imul(mp,Ap)|0,Il=Il+Math.imul(mp,Op)|0,wl=wl+Math.imul(vp,Qp)|0,yl=yl+Math.imul(vp,Xp)|0,yl=yl+Math.imul(pp,Qp)|0,Il=Il+Math.imul(pp,Xp)|0,wl=wl+Math.imul(dp,Wp)|0,yl=yl+Math.imul(dp,Np)|0,yl=yl+Math.imul(up,Wp)|0,Il=Il+Math.imul(up,Np)|0,wl=wl+Math.imul(wu,Pp)|0,yl=yl+Math.imul(wu,Hp)|0,yl=yl+Math.imul(yu,Pp)|0,Il=Il+Math.imul(yu,Hp)|0,wl=wl+Math.imul(Ll,Gp)|0,yl=yl+Math.imul(Ll,Yp)|0,yl=yl+Math.imul(Zl,Gp)|0,Il=Il+Math.imul(Zl,Yp)|0,wl=wl+Math.imul(Vl,Ip)|0,yl=yl+Math.imul(Vl,Dp)|0,yl=yl+Math.imul(Hl,Ip)|0,Il=Il+Math.imul(Hl,Dp)|0,wl=wl+Math.imul(Gl,zp)|0,yl=yl+Math.imul(Gl,Bp)|0,yl=yl+Math.imul(Nl,zp)|0,Il=Il+Math.imul(Nl,Bp)|0;var u1=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(u1>>>26)|0,u1&=67108863,wl=Math.imul(Fl,yp),yl=Math.imul(Fl,_p),yl=yl+Math.imul(Ul,yp)|0,Il=Math.imul(Ul,_p),wl=wl+Math.imul(hp,Ap)|0,yl=yl+Math.imul(hp,Op)|0,yl=yl+Math.imul(xp,Ap)|0,Il=Il+Math.imul(xp,Op)|0,wl=wl+Math.imul(gp,Qp)|0,yl=yl+Math.imul(gp,Xp)|0,yl=yl+Math.imul(mp,Qp)|0,Il=Il+Math.imul(mp,Xp)|0,wl=wl+Math.imul(vp,Wp)|0,yl=yl+Math.imul(vp,Np)|0,yl=yl+Math.imul(pp,Wp)|0,Il=Il+Math.imul(pp,Np)|0,wl=wl+Math.imul(dp,Pp)|0,yl=yl+Math.imul(dp,Hp)|0,yl=yl+Math.imul(up,Pp)|0,Il=Il+Math.imul(up,Hp)|0,wl=wl+Math.imul(wu,Gp)|0,yl=yl+Math.imul(wu,Yp)|0,yl=yl+Math.imul(yu,Gp)|0,Il=Il+Math.imul(yu,Yp)|0,wl=wl+Math.imul(Ll,Ip)|0,yl=yl+Math.imul(Ll,Dp)|0,yl=yl+Math.imul(Zl,Ip)|0,Il=Il+Math.imul(Zl,Dp)|0,wl=wl+Math.imul(Vl,zp)|0,yl=yl+Math.imul(Vl,Bp)|0,yl=yl+Math.imul(Hl,zp)|0,Il=Il+Math.imul(Hl,Bp)|0,wl=wl+Math.imul(Gl,Vp)|0,yl=yl+Math.imul(Gl,tm)|0,yl=yl+Math.imul(Nl,Vp)|0,Il=Il+Math.imul(Nl,tm)|0;var qm=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(qm>>>26)|0,qm&=67108863,wl=Math.imul(fu,yp),yl=Math.imul(fu,_p),yl=yl+Math.imul(_d,yp)|0,Il=Math.imul(_d,_p),wl=wl+Math.imul(Fl,Ap)|0,yl=yl+Math.imul(Fl,Op)|0,yl=yl+Math.imul(Ul,Ap)|0,Il=Il+Math.imul(Ul,Op)|0,wl=wl+Math.imul(hp,Qp)|0,yl=yl+Math.imul(hp,Xp)|0,yl=yl+Math.imul(xp,Qp)|0,Il=Il+Math.imul(xp,Xp)|0,wl=wl+Math.imul(gp,Wp)|0,yl=yl+Math.imul(gp,Np)|0,yl=yl+Math.imul(mp,Wp)|0,Il=Il+Math.imul(mp,Np)|0,wl=wl+Math.imul(vp,Pp)|0,yl=yl+Math.imul(vp,Hp)|0,yl=yl+Math.imul(pp,Pp)|0,Il=Il+Math.imul(pp,Hp)|0,wl=wl+Math.imul(dp,Gp)|0,yl=yl+Math.imul(dp,Yp)|0,yl=yl+Math.imul(up,Gp)|0,Il=Il+Math.imul(up,Yp)|0,wl=wl+Math.imul(wu,Ip)|0,yl=yl+Math.imul(wu,Dp)|0,yl=yl+Math.imul(yu,Ip)|0,Il=Il+Math.imul(yu,Dp)|0,wl=wl+Math.imul(Ll,zp)|0,yl=yl+Math.imul(Ll,Bp)|0,yl=yl+Math.imul(Zl,zp)|0,Il=Il+Math.imul(Zl,Bp)|0,wl=wl+Math.imul(Vl,Vp)|0,yl=yl+Math.imul(Vl,tm)|0,yl=yl+Math.imul(Hl,Vp)|0,Il=Il+Math.imul(Hl,tm)|0,wl=wl+Math.imul(Gl,rm)|0,yl=yl+Math.imul(Gl,Jp)|0,yl=yl+Math.imul(Nl,rm)|0,Il=Il+Math.imul(Nl,Jp)|0;var Qm=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(Qm>>>26)|0,Qm&=67108863,wl=Math.imul(fu,Ap),yl=Math.imul(fu,Op),yl=yl+Math.imul(_d,Ap)|0,Il=Math.imul(_d,Op),wl=wl+Math.imul(Fl,Qp)|0,yl=yl+Math.imul(Fl,Xp)|0,yl=yl+Math.imul(Ul,Qp)|0,Il=Il+Math.imul(Ul,Xp)|0,wl=wl+Math.imul(hp,Wp)|0,yl=yl+Math.imul(hp,Np)|0,yl=yl+Math.imul(xp,Wp)|0,Il=Il+Math.imul(xp,Np)|0,wl=wl+Math.imul(gp,Pp)|0,yl=yl+Math.imul(gp,Hp)|0,yl=yl+Math.imul(mp,Pp)|0,Il=Il+Math.imul(mp,Hp)|0,wl=wl+Math.imul(vp,Gp)|0,yl=yl+Math.imul(vp,Yp)|0,yl=yl+Math.imul(pp,Gp)|0,Il=Il+Math.imul(pp,Yp)|0,wl=wl+Math.imul(dp,Ip)|0,yl=yl+Math.imul(dp,Dp)|0,yl=yl+Math.imul(up,Ip)|0,Il=Il+Math.imul(up,Dp)|0,wl=wl+Math.imul(wu,zp)|0,yl=yl+Math.imul(wu,Bp)|0,yl=yl+Math.imul(yu,zp)|0,Il=Il+Math.imul(yu,Bp)|0,wl=wl+Math.imul(Ll,Vp)|0,yl=yl+Math.imul(Ll,tm)|0,yl=yl+Math.imul(Zl,Vp)|0,Il=Il+Math.imul(Zl,tm)|0,wl=wl+Math.imul(Vl,rm)|0,yl=yl+Math.imul(Vl,Jp)|0,yl=yl+Math.imul(Hl,rm)|0,Il=Il+Math.imul(Hl,Jp)|0;var o1=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(o1>>>26)|0,o1&=67108863,wl=Math.imul(fu,Qp),yl=Math.imul(fu,Xp),yl=yl+Math.imul(_d,Qp)|0,Il=Math.imul(_d,Xp),wl=wl+Math.imul(Fl,Wp)|0,yl=yl+Math.imul(Fl,Np)|0,yl=yl+Math.imul(Ul,Wp)|0,Il=Il+Math.imul(Ul,Np)|0,wl=wl+Math.imul(hp,Pp)|0,yl=yl+Math.imul(hp,Hp)|0,yl=yl+Math.imul(xp,Pp)|0,Il=Il+Math.imul(xp,Hp)|0,wl=wl+Math.imul(gp,Gp)|0,yl=yl+Math.imul(gp,Yp)|0,yl=yl+Math.imul(mp,Gp)|0,Il=Il+Math.imul(mp,Yp)|0,wl=wl+Math.imul(vp,Ip)|0,yl=yl+Math.imul(vp,Dp)|0,yl=yl+Math.imul(pp,Ip)|0,Il=Il+Math.imul(pp,Dp)|0,wl=wl+Math.imul(dp,zp)|0,yl=yl+Math.imul(dp,Bp)|0,yl=yl+Math.imul(up,zp)|0,Il=Il+Math.imul(up,Bp)|0,wl=wl+Math.imul(wu,Vp)|0,yl=yl+Math.imul(wu,tm)|0,yl=yl+Math.imul(yu,Vp)|0,Il=Il+Math.imul(yu,tm)|0,wl=wl+Math.imul(Ll,rm)|0,yl=yl+Math.imul(Ll,Jp)|0,yl=yl+Math.imul(Zl,rm)|0,Il=Il+Math.imul(Zl,Jp)|0;var e1=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(e1>>>26)|0,e1&=67108863,wl=Math.imul(fu,Wp),yl=Math.imul(fu,Np),yl=yl+Math.imul(_d,Wp)|0,Il=Math.imul(_d,Np),wl=wl+Math.imul(Fl,Pp)|0,yl=yl+Math.imul(Fl,Hp)|0,yl=yl+Math.imul(Ul,Pp)|0,Il=Il+Math.imul(Ul,Hp)|0,wl=wl+Math.imul(hp,Gp)|0,yl=yl+Math.imul(hp,Yp)|0,yl=yl+Math.imul(xp,Gp)|0,Il=Il+Math.imul(xp,Yp)|0,wl=wl+Math.imul(gp,Ip)|0,yl=yl+Math.imul(gp,Dp)|0,yl=yl+Math.imul(mp,Ip)|0,Il=Il+Math.imul(mp,Dp)|0,wl=wl+Math.imul(vp,zp)|0,yl=yl+Math.imul(vp,Bp)|0,yl=yl+Math.imul(pp,zp)|0,Il=Il+Math.imul(pp,Bp)|0,wl=wl+Math.imul(dp,Vp)|0,yl=yl+Math.imul(dp,tm)|0,yl=yl+Math.imul(up,Vp)|0,Il=Il+Math.imul(up,tm)|0,wl=wl+Math.imul(wu,rm)|0,yl=yl+Math.imul(wu,Jp)|0,yl=yl+Math.imul(yu,rm)|0,Il=Il+Math.imul(yu,Jp)|0;var Zm=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(Zm>>>26)|0,Zm&=67108863,wl=Math.imul(fu,Pp),yl=Math.imul(fu,Hp),yl=yl+Math.imul(_d,Pp)|0,Il=Math.imul(_d,Hp),wl=wl+Math.imul(Fl,Gp)|0,yl=yl+Math.imul(Fl,Yp)|0,yl=yl+Math.imul(Ul,Gp)|0,Il=Il+Math.imul(Ul,Yp)|0,wl=wl+Math.imul(hp,Ip)|0,yl=yl+Math.imul(hp,Dp)|0,yl=yl+Math.imul(xp,Ip)|0,Il=Il+Math.imul(xp,Dp)|0,wl=wl+Math.imul(gp,zp)|0,yl=yl+Math.imul(gp,Bp)|0,yl=yl+Math.imul(mp,zp)|0,Il=Il+Math.imul(mp,Bp)|0,wl=wl+Math.imul(vp,Vp)|0,yl=yl+Math.imul(vp,tm)|0,yl=yl+Math.imul(pp,Vp)|0,Il=Il+Math.imul(pp,tm)|0,wl=wl+Math.imul(dp,rm)|0,yl=yl+Math.imul(dp,Jp)|0,yl=yl+Math.imul(up,rm)|0,Il=Il+Math.imul(up,Jp)|0;var t1=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(t1>>>26)|0,t1&=67108863,wl=Math.imul(fu,Gp),yl=Math.imul(fu,Yp),yl=yl+Math.imul(_d,Gp)|0,Il=Math.imul(_d,Yp),wl=wl+Math.imul(Fl,Ip)|0,yl=yl+Math.imul(Fl,Dp)|0,yl=yl+Math.imul(Ul,Ip)|0,Il=Il+Math.imul(Ul,Dp)|0,wl=wl+Math.imul(hp,zp)|0,yl=yl+Math.imul(hp,Bp)|0,yl=yl+Math.imul(xp,zp)|0,Il=Il+Math.imul(xp,Bp)|0,wl=wl+Math.imul(gp,Vp)|0,yl=yl+Math.imul(gp,tm)|0,yl=yl+Math.imul(mp,Vp)|0,Il=Il+Math.imul(mp,tm)|0,wl=wl+Math.imul(vp,rm)|0,yl=yl+Math.imul(vp,Jp)|0,yl=yl+Math.imul(pp,rm)|0,Il=Il+Math.imul(pp,Jp)|0;var Bm=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(Bm>>>26)|0,Bm&=67108863,wl=Math.imul(fu,Ip),yl=Math.imul(fu,Dp),yl=yl+Math.imul(_d,Ip)|0,Il=Math.imul(_d,Dp),wl=wl+Math.imul(Fl,zp)|0,yl=yl+Math.imul(Fl,Bp)|0,yl=yl+Math.imul(Ul,zp)|0,Il=Il+Math.imul(Ul,Bp)|0,wl=wl+Math.imul(hp,Vp)|0,yl=yl+Math.imul(hp,tm)|0,yl=yl+Math.imul(xp,Vp)|0,Il=Il+Math.imul(xp,tm)|0,wl=wl+Math.imul(gp,rm)|0,yl=yl+Math.imul(gp,Jp)|0,yl=yl+Math.imul(mp,rm)|0,Il=Il+Math.imul(mp,Jp)|0;var Dm=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(Dm>>>26)|0,Dm&=67108863,wl=Math.imul(fu,zp),yl=Math.imul(fu,Bp),yl=yl+Math.imul(_d,zp)|0,Il=Math.imul(_d,Bp),wl=wl+Math.imul(Fl,Vp)|0,yl=yl+Math.imul(Fl,tm)|0,yl=yl+Math.imul(Ul,Vp)|0,Il=Il+Math.imul(Ul,tm)|0,wl=wl+Math.imul(hp,rm)|0,yl=yl+Math.imul(hp,Jp)|0,yl=yl+Math.imul(xp,rm)|0,Il=Il+Math.imul(xp,Jp)|0;var Om=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(Om>>>26)|0,Om&=67108863,wl=Math.imul(fu,Vp),yl=Math.imul(fu,tm),yl=yl+Math.imul(_d,Vp)|0,Il=Math.imul(_d,tm),wl=wl+Math.imul(Fl,rm)|0,yl=yl+Math.imul(Fl,Jp)|0,yl=yl+Math.imul(Ul,rm)|0,Il=Il+Math.imul(Ul,Jp)|0;var r1=(Al+wl|0)+((yl&8191)<<13)|0;Al=(Il+(yl>>>13)|0)+(r1>>>26)|0,r1&=67108863,wl=Math.imul(fu,rm),yl=Math.imul(fu,Jp),yl=yl+Math.imul(_d,rm)|0,Il=Math.imul(_d,Jp);var g1=(Al+wl|0)+((yl&8191)<<13)|0;return Al=(Il+(yl>>>13)|0)+(g1>>>26)|0,g1&=67108863,Xo[0]=lm,Xo[1]=$m,Xo[2]=km,Xo[3]=Cm,Xo[4]=Am,Xo[5]=pm,Xo[6]=Ym,Xo[7]=u1,Xo[8]=qm,Xo[9]=Qm,Xo[10]=o1,Xo[11]=e1,Xo[12]=Zm,Xo[13]=t1,Xo[14]=Bm,Xo[15]=Dm,Xo[16]=Om,Xo[17]=r1,Xo[18]=g1,Al!==0&&(Xo[19]=Al,Ho.length++),Ho};Math.imul||(Wo=Yo);function Jo(Vo,jo,Ho){Ho.negative=jo.negative^Vo.negative,Ho.length=Vo.length+jo.length;for(var Qo=0,El=0,Xo=0;Xo<Ho.length-1;Xo++){var Al=El;El=0;for(var wl=Qo&67108863,yl=Math.min(Xo,jo.length-1),Il=Math.max(0,Xo-Vo.length+1);Il<=yl;Il++){var Bl=Xo-Il,Gl=Vo.words[Bl]|0,Nl=jo.words[Il]|0,zl=Gl*Nl,Vl=zl&67108863;Al=Al+(zl/67108864|0)|0,Vl=Vl+wl|0,wl=Vl&67108863,Al=Al+(Vl>>>26)|0,El+=Al>>>26,Al&=67108863}Ho.words[Xo]=wl,Qo=Al,Al=El}return Qo!==0?Ho.words[Xo]=Qo:Ho.length--,Ho._strip()}function xl(Vo,jo,Ho){return Jo(Vo,jo,Ho)}as.prototype.mulTo=function(Vo,jo){var Ho,Qo=this.length+Vo.length;return this.length===10&&Vo.length===10?Ho=Wo(this,Vo,jo):Qo<63?Ho=Yo(this,Vo,jo):Qo<1024?Ho=Jo(this,Vo,jo):Ho=xl(this,Vo,jo),Ho},as.prototype.mul=function(Vo){var jo=new as(null);return jo.words=new Array(this.length+Vo.length),this.mulTo(Vo,jo)},as.prototype.mulf=function(Vo){var jo=new as(null);return jo.words=new Array(this.length+Vo.length),xl(this,Vo,jo)},as.prototype.imul=function(Vo){return this.clone().mulTo(Vo,this)},as.prototype.imuln=function(Vo){var jo=Vo<0;jo&&(Vo=-Vo),is(typeof Vo=="number"),is(Vo<67108864);for(var Ho=0,Qo=0;Qo<this.length;Qo++){var El=(this.words[Qo]|0)*Vo,Xo=(El&67108863)+(Ho&67108863);Ho>>=26,Ho+=El/67108864|0,Ho+=Xo>>>26,this.words[Qo]=Xo&67108863}return Ho!==0&&(this.words[Qo]=Ho,this.length++),jo?this.ineg():this},as.prototype.muln=function(Vo){return this.clone().imuln(Vo)},as.prototype.sqr=function(){return this.mul(this)},as.prototype.isqr=function(){return this.imul(this.clone())},as.prototype.pow=function(Vo){var jo=Go(Vo);if(jo.length===0)return new as(1);for(var Ho=this,Qo=0;Qo<jo.length&&jo[Qo]===0;Qo++,Ho=Ho.sqr());if(++Qo<jo.length)for(var El=Ho.sqr();Qo<jo.length;Qo++,El=El.sqr())jo[Qo]!==0&&(Ho=Ho.mul(El));return Ho},as.prototype.iushln=function(Vo){is(typeof Vo=="number"&&Vo>=0);var jo=Vo%26,Ho=(Vo-jo)/26,Qo=67108863>>>26-jo<<26-jo,El;if(jo!==0){var Xo=0;for(El=0;El<this.length;El++){var Al=this.words[El]&Qo,wl=(this.words[El]|0)-Al<<jo;this.words[El]=wl|Xo,Xo=Al>>>26-jo}Xo&&(this.words[El]=Xo,this.length++)}if(Ho!==0){for(El=this.length-1;El>=0;El--)this.words[El+Ho]=this.words[El];for(El=0;El<Ho;El++)this.words[El]=0;this.length+=Ho}return this._strip()},as.prototype.ishln=function(Vo){return is(this.negative===0),this.iushln(Vo)},as.prototype.iushrn=function(Vo,jo,Ho){is(typeof Vo=="number"&&Vo>=0);var Qo;jo?Qo=(jo-jo%26)/26:Qo=0;var El=Vo%26,Xo=Math.min((Vo-El)/26,this.length),Al=67108863^67108863>>>El<<El,wl=Ho;if(Qo-=Xo,Qo=Math.max(0,Qo),wl){for(var yl=0;yl<Xo;yl++)wl.words[yl]=this.words[yl];wl.length=Xo}if(Xo!==0)if(this.length>Xo)for(this.length-=Xo,yl=0;yl<this.length;yl++)this.words[yl]=this.words[yl+Xo];else this.words[0]=0,this.length=1;var Il=0;for(yl=this.length-1;yl>=0&&(Il!==0||yl>=Qo);yl--){var Bl=this.words[yl]|0;this.words[yl]=Il<<26-El|Bl>>>El,Il=Bl&Al}return wl&&Il!==0&&(wl.words[wl.length++]=Il),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},as.prototype.ishrn=function(Vo,jo,Ho){return is(this.negative===0),this.iushrn(Vo,jo,Ho)},as.prototype.shln=function(Vo){return this.clone().ishln(Vo)},as.prototype.ushln=function(Vo){return this.clone().iushln(Vo)},as.prototype.shrn=function(Vo){return this.clone().ishrn(Vo)},as.prototype.ushrn=function(Vo){return this.clone().iushrn(Vo)},as.prototype.testn=function(Vo){is(typeof Vo=="number"&&Vo>=0);var jo=Vo%26,Ho=(Vo-jo)/26,Qo=1<<jo;if(this.length<=Ho)return!1;var El=this.words[Ho];return!!(El&Qo)},as.prototype.imaskn=function(Vo){is(typeof Vo=="number"&&Vo>=0);var jo=Vo%26,Ho=(Vo-jo)/26;if(is(this.negative===0,"imaskn works only with positive numbers"),this.length<=Ho)return this;if(jo!==0&&Ho++,this.length=Math.min(Ho,this.length),jo!==0){var Qo=67108863^67108863>>>jo<<jo;this.words[this.length-1]&=Qo}return this._strip()},as.prototype.maskn=function(Vo){return this.clone().imaskn(Vo)},as.prototype.iaddn=function(Vo){return is(typeof Vo=="number"),is(Vo<67108864),Vo<0?this.isubn(-Vo):this.negative!==0?this.length===1&&(this.words[0]|0)<=Vo?(this.words[0]=Vo-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Vo),this.negative=1,this):this._iaddn(Vo)},as.prototype._iaddn=function(Vo){this.words[0]+=Vo;for(var jo=0;jo<this.length&&this.words[jo]>=67108864;jo++)this.words[jo]-=67108864,jo===this.length-1?this.words[jo+1]=1:this.words[jo+1]++;return this.length=Math.max(this.length,jo+1),this},as.prototype.isubn=function(Vo){if(is(typeof Vo=="number"),is(Vo<67108864),Vo<0)return this.iaddn(-Vo);if(this.negative!==0)return this.negative=0,this.iaddn(Vo),this.negative=1,this;if(this.words[0]-=Vo,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var jo=0;jo<this.length&&this.words[jo]<0;jo++)this.words[jo]+=67108864,this.words[jo+1]-=1;return this._strip()},as.prototype.addn=function(Vo){return this.clone().iaddn(Vo)},as.prototype.subn=function(Vo){return this.clone().isubn(Vo)},as.prototype.iabs=function(){return this.negative=0,this},as.prototype.abs=function(){return this.clone().iabs()},as.prototype._ishlnsubmul=function(Vo,jo,Ho){var Qo=Vo.length+Ho,El;this._expand(Qo);var Xo,Al=0;for(El=0;El<Vo.length;El++){Xo=(this.words[El+Ho]|0)+Al;var wl=(Vo.words[El]|0)*jo;Xo-=wl&67108863,Al=(Xo>>26)-(wl/67108864|0),this.words[El+Ho]=Xo&67108863}for(;El<this.length-Ho;El++)Xo=(this.words[El+Ho]|0)+Al,Al=Xo>>26,this.words[El+Ho]=Xo&67108863;if(Al===0)return this._strip();for(is(Al===-1),Al=0,El=0;El<this.length;El++)Xo=-(this.words[El]|0)+Al,Al=Xo>>26,this.words[El]=Xo&67108863;return this.negative=1,this._strip()},as.prototype._wordDiv=function(Vo,jo){var Ho=this.length-Vo.length,Qo=this.clone(),El=Vo,Xo=El.words[El.length-1]|0,Al=this._countBits(Xo);Ho=26-Al,Ho!==0&&(El=El.ushln(Ho),Qo.iushln(Ho),Xo=El.words[El.length-1]|0);var wl=Qo.length-El.length,yl;if(jo!=="mod"){yl=new as(null),yl.length=wl+1,yl.words=new Array(yl.length);for(var Il=0;Il<yl.length;Il++)yl.words[Il]=0}var Bl=Qo.clone()._ishlnsubmul(El,1,wl);Bl.negative===0&&(Qo=Bl,yl&&(yl.words[wl]=1));for(var Gl=wl-1;Gl>=0;Gl--){var Nl=(Qo.words[El.length+Gl]|0)*67108864+(Qo.words[El.length+Gl-1]|0);for(Nl=Math.min(Nl/Xo|0,67108863),Qo._ishlnsubmul(El,Nl,Gl);Qo.negative!==0;)Nl--,Qo.negative=0,Qo._ishlnsubmul(El,1,Gl),Qo.isZero()||(Qo.negative^=1);yl&&(yl.words[Gl]=Nl)}return yl&&yl._strip(),Qo._strip(),jo!=="div"&&Ho!==0&&Qo.iushrn(Ho),{div:yl||null,mod:Qo}},as.prototype.divmod=function(Vo,jo,Ho){if(is(!Vo.isZero()),this.isZero())return{div:new as(0),mod:new as(0)};var Qo,El,Xo;return this.negative!==0&&Vo.negative===0?(Xo=this.neg().divmod(Vo,jo),jo!=="mod"&&(Qo=Xo.div.neg()),jo!=="div"&&(El=Xo.mod.neg(),Ho&&El.negative!==0&&El.iadd(Vo)),{div:Qo,mod:El}):this.negative===0&&Vo.negative!==0?(Xo=this.divmod(Vo.neg(),jo),jo!=="mod"&&(Qo=Xo.div.neg()),{div:Qo,mod:Xo.mod}):this.negative&Vo.negative?(Xo=this.neg().divmod(Vo.neg(),jo),jo!=="div"&&(El=Xo.mod.neg(),Ho&&El.negative!==0&&El.isub(Vo)),{div:Xo.div,mod:El}):Vo.length>this.length||this.cmp(Vo)<0?{div:new as(0),mod:this}:Vo.length===1?jo==="div"?{div:this.divn(Vo.words[0]),mod:null}:jo==="mod"?{div:null,mod:new as(this.modrn(Vo.words[0]))}:{div:this.divn(Vo.words[0]),mod:new as(this.modrn(Vo.words[0]))}:this._wordDiv(Vo,jo)},as.prototype.div=function(Vo){return this.divmod(Vo,"div",!1).div},as.prototype.mod=function(Vo){return this.divmod(Vo,"mod",!1).mod},as.prototype.umod=function(Vo){return this.divmod(Vo,"mod",!0).mod},as.prototype.divRound=function(Vo){var jo=this.divmod(Vo);if(jo.mod.isZero())return jo.div;var Ho=jo.div.negative!==0?jo.mod.isub(Vo):jo.mod,Qo=Vo.ushrn(1),El=Vo.andln(1),Xo=Ho.cmp(Qo);return Xo<0||El===1&&Xo===0?jo.div:jo.div.negative!==0?jo.div.isubn(1):jo.div.iaddn(1)},as.prototype.modrn=function(Vo){var jo=Vo<0;jo&&(Vo=-Vo),is(Vo<=67108863);for(var Ho=(1<<26)%Vo,Qo=0,El=this.length-1;El>=0;El--)Qo=(Ho*Qo+(this.words[El]|0))%Vo;return jo?-Qo:Qo},as.prototype.modn=function(Vo){return this.modrn(Vo)},as.prototype.idivn=function(Vo){var jo=Vo<0;jo&&(Vo=-Vo),is(Vo<=67108863);for(var Ho=0,Qo=this.length-1;Qo>=0;Qo--){var El=(this.words[Qo]|0)+Ho*67108864;this.words[Qo]=El/Vo|0,Ho=El%Vo}return this._strip(),jo?this.ineg():this},as.prototype.divn=function(Vo){return this.clone().idivn(Vo)},as.prototype.egcd=function(Vo){is(Vo.negative===0),is(!Vo.isZero());var jo=this,Ho=Vo.clone();jo.negative!==0?jo=jo.umod(Vo):jo=jo.clone();for(var Qo=new as(1),El=new as(0),Xo=new as(0),Al=new as(1),wl=0;jo.isEven()&&Ho.isEven();)jo.iushrn(1),Ho.iushrn(1),++wl;for(var yl=Ho.clone(),Il=jo.clone();!jo.isZero();){for(var Bl=0,Gl=1;!(jo.words[0]&Gl)&&Bl<26;++Bl,Gl<<=1);if(Bl>0)for(jo.iushrn(Bl);Bl-- >0;)(Qo.isOdd()||El.isOdd())&&(Qo.iadd(yl),El.isub(Il)),Qo.iushrn(1),El.iushrn(1);for(var Nl=0,zl=1;!(Ho.words[0]&zl)&&Nl<26;++Nl,zl<<=1);if(Nl>0)for(Ho.iushrn(Nl);Nl-- >0;)(Xo.isOdd()||Al.isOdd())&&(Xo.iadd(yl),Al.isub(Il)),Xo.iushrn(1),Al.iushrn(1);jo.cmp(Ho)>=0?(jo.isub(Ho),Qo.isub(Xo),El.isub(Al)):(Ho.isub(jo),Xo.isub(Qo),Al.isub(El))}return{a:Xo,b:Al,gcd:Ho.iushln(wl)}},as.prototype._invmp=function(Vo){is(Vo.negative===0),is(!Vo.isZero());var jo=this,Ho=Vo.clone();jo.negative!==0?jo=jo.umod(Vo):jo=jo.clone();for(var Qo=new as(1),El=new as(0),Xo=Ho.clone();jo.cmpn(1)>0&&Ho.cmpn(1)>0;){for(var Al=0,wl=1;!(jo.words[0]&wl)&&Al<26;++Al,wl<<=1);if(Al>0)for(jo.iushrn(Al);Al-- >0;)Qo.isOdd()&&Qo.iadd(Xo),Qo.iushrn(1);for(var yl=0,Il=1;!(Ho.words[0]&Il)&&yl<26;++yl,Il<<=1);if(yl>0)for(Ho.iushrn(yl);yl-- >0;)El.isOdd()&&El.iadd(Xo),El.iushrn(1);jo.cmp(Ho)>=0?(jo.isub(Ho),Qo.isub(El)):(Ho.isub(jo),El.isub(Qo))}var Bl;return jo.cmpn(1)===0?Bl=Qo:Bl=El,Bl.cmpn(0)<0&&Bl.iadd(Vo),Bl},as.prototype.gcd=function(Vo){if(this.isZero())return Vo.abs();if(Vo.isZero())return this.abs();var jo=this.clone(),Ho=Vo.clone();jo.negative=0,Ho.negative=0;for(var Qo=0;jo.isEven()&&Ho.isEven();Qo++)jo.iushrn(1),Ho.iushrn(1);do{for(;jo.isEven();)jo.iushrn(1);for(;Ho.isEven();)Ho.iushrn(1);var El=jo.cmp(Ho);if(El<0){var Xo=jo;jo=Ho,Ho=Xo}else if(El===0||Ho.cmpn(1)===0)break;jo.isub(Ho)}while(!0);return Ho.iushln(Qo)},as.prototype.invm=function(Vo){return this.egcd(Vo).a.umod(Vo)},as.prototype.isEven=function(){return(this.words[0]&1)===0},as.prototype.isOdd=function(){return(this.words[0]&1)===1},as.prototype.andln=function(Vo){return this.words[0]&Vo},as.prototype.bincn=function(Vo){is(typeof Vo=="number");var jo=Vo%26,Ho=(Vo-jo)/26,Qo=1<<jo;if(this.length<=Ho)return this._expand(Ho+1),this.words[Ho]|=Qo,this;for(var El=Qo,Xo=Ho;El!==0&&Xo<this.length;Xo++){var Al=this.words[Xo]|0;Al+=El,El=Al>>>26,Al&=67108863,this.words[Xo]=Al}return El!==0&&(this.words[Xo]=El,this.length++),this},as.prototype.isZero=function(){return this.length===1&&this.words[0]===0},as.prototype.cmpn=function(Vo){var jo=Vo<0;if(this.negative!==0&&!jo)return-1;if(this.negative===0&&jo)return 1;this._strip();var Ho;if(this.length>1)Ho=1;else{jo&&(Vo=-Vo),is(Vo<=67108863,"Number is too big");var Qo=this.words[0]|0;Ho=Qo===Vo?0:Qo<Vo?-1:1}return this.negative!==0?-Ho|0:Ho},as.prototype.cmp=function(Vo){if(this.negative!==0&&Vo.negative===0)return-1;if(this.negative===0&&Vo.negative!==0)return 1;var jo=this.ucmp(Vo);return this.negative!==0?-jo|0:jo},as.prototype.ucmp=function(Vo){if(this.length>Vo.length)return 1;if(this.length<Vo.length)return-1;for(var jo=0,Ho=this.length-1;Ho>=0;Ho--){var Qo=this.words[Ho]|0,El=Vo.words[Ho]|0;if(Qo!==El){Qo<El?jo=-1:Qo>El&&(jo=1);break}}return jo},as.prototype.gtn=function(Vo){return this.cmpn(Vo)===1},as.prototype.gt=function(Vo){return this.cmp(Vo)===1},as.prototype.gten=function(Vo){return this.cmpn(Vo)>=0},as.prototype.gte=function(Vo){return this.cmp(Vo)>=0},as.prototype.ltn=function(Vo){return this.cmpn(Vo)===-1},as.prototype.lt=function(Vo){return this.cmp(Vo)===-1},as.prototype.lten=function(Vo){return this.cmpn(Vo)<=0},as.prototype.lte=function(Vo){return this.cmp(Vo)<=0},as.prototype.eqn=function(Vo){return this.cmpn(Vo)===0},as.prototype.eq=function(Vo){return this.cmp(Vo)===0},as.red=function(Vo){return new Ol(Vo)},as.prototype.toRed=function(Vo){return is(!this.red,"Already a number in reduction context"),is(this.negative===0,"red works only with positives"),Vo.convertTo(this)._forceRed(Vo)},as.prototype.fromRed=function(){return is(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},as.prototype._forceRed=function(Vo){return this.red=Vo,this},as.prototype.forceRed=function(Vo){return is(!this.red,"Already a number in reduction context"),this._forceRed(Vo)},as.prototype.redAdd=function(Vo){return is(this.red,"redAdd works only with red numbers"),this.red.add(this,Vo)},as.prototype.redIAdd=function(Vo){return is(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Vo)},as.prototype.redSub=function(Vo){return is(this.red,"redSub works only with red numbers"),this.red.sub(this,Vo)},as.prototype.redISub=function(Vo){return is(this.red,"redISub works only with red numbers"),this.red.isub(this,Vo)},as.prototype.redShl=function(Vo){return is(this.red,"redShl works only with red numbers"),this.red.shl(this,Vo)},as.prototype.redMul=function(Vo){return is(this.red,"redMul works only with red numbers"),this.red._verify2(this,Vo),this.red.mul(this,Vo)},as.prototype.redIMul=function(Vo){return is(this.red,"redMul works only with red numbers"),this.red._verify2(this,Vo),this.red.imul(this,Vo)},as.prototype.redSqr=function(){return is(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},as.prototype.redISqr=function(){return is(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},as.prototype.redSqrt=function(){return is(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},as.prototype.redInvm=function(){return is(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},as.prototype.redNeg=function(){return is(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},as.prototype.redPow=function(Vo){return is(this.red&&!Vo.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Vo)};var _l={k256:null,p224:null,p192:null,p25519:null};function Tl(Vo,jo){this.name=Vo,this.p=new as(jo,16),this.n=this.p.bitLength(),this.k=new as(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Tl.prototype._tmp=function(){var Vo=new as(null);return Vo.words=new Array(Math.ceil(this.n/13)),Vo},Tl.prototype.ireduce=function(Vo){var jo=Vo,Ho;do this.split(jo,this.tmp),jo=this.imulK(jo),jo=jo.iadd(this.tmp),Ho=jo.bitLength();while(Ho>this.n);var Qo=Ho<this.n?-1:jo.ucmp(this.p);return Qo===0?(jo.words[0]=0,jo.length=1):Qo>0?jo.isub(this.p):jo.strip!==void 0?jo.strip():jo._strip(),jo},Tl.prototype.split=function(Vo,jo){Vo.iushrn(this.n,0,jo)},Tl.prototype.imulK=function(Vo){return Vo.imul(this.k)};function Sl(){Tl.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}os(Sl,Tl),Sl.prototype.split=function(Vo,jo){for(var Ho=4194303,Qo=Math.min(Vo.length,9),El=0;El<Qo;El++)jo.words[El]=Vo.words[El];if(jo.length=Qo,Vo.length<=9){Vo.words[0]=0,Vo.length=1;return}var Xo=Vo.words[9];for(jo.words[jo.length++]=Xo&Ho,El=10;El<Vo.length;El++){var Al=Vo.words[El]|0;Vo.words[El-10]=(Al&Ho)<<4|Xo>>>22,Xo=Al}Xo>>>=22,Vo.words[El-10]=Xo,Xo===0&&Vo.length>10?Vo.length-=10:Vo.length-=9},Sl.prototype.imulK=function(Vo){Vo.words[Vo.length]=0,Vo.words[Vo.length+1]=0,Vo.length+=2;for(var jo=0,Ho=0;Ho<Vo.length;Ho++){var Qo=Vo.words[Ho]|0;jo+=Qo*977,Vo.words[Ho]=jo&67108863,jo=Qo*64+(jo/67108864|0)}return Vo.words[Vo.length-1]===0&&(Vo.length--,Vo.words[Vo.length-1]===0&&Vo.length--),Vo};function $l(){Tl.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}os($l,Tl);function Pl(){Tl.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}os(Pl,Tl);function Dl(){Tl.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}os(Dl,Tl),Dl.prototype.imulK=function(Vo){for(var jo=0,Ho=0;Ho<Vo.length;Ho++){var Qo=(Vo.words[Ho]|0)*19+jo,El=Qo&67108863;Qo>>>=26,Vo.words[Ho]=El,jo=Qo}return jo!==0&&(Vo.words[Vo.length++]=jo),Vo},as._prime=function(Vo){if(_l[Vo])return _l[Vo];var jo;if(Vo==="k256")jo=new Sl;else if(Vo==="p224")jo=new $l;else if(Vo==="p192")jo=new Pl;else if(Vo==="p25519")jo=new Dl;else throw new Error("Unknown prime "+Vo);return _l[Vo]=jo,jo};function Ol(Vo){if(typeof Vo=="string"){var jo=as._prime(Vo);this.m=jo.p,this.prime=jo}else is(Vo.gtn(1),"modulus must be greater than 1"),this.m=Vo,this.prime=null}Ol.prototype._verify1=function(Vo){is(Vo.negative===0,"red works only with positives"),is(Vo.red,"red works only with red numbers")},Ol.prototype._verify2=function(Vo,jo){is((Vo.negative|jo.negative)===0,"red works only with positives"),is(Vo.red&&Vo.red===jo.red,"red works only with red numbers")},Ol.prototype.imod=function(Vo){return this.prime?this.prime.ireduce(Vo)._forceRed(this):(io(Vo,Vo.umod(this.m)._forceRed(this)),Vo)},Ol.prototype.neg=function(Vo){return Vo.isZero()?Vo.clone():this.m.sub(Vo)._forceRed(this)},Ol.prototype.add=function(Vo,jo){this._verify2(Vo,jo);var Ho=Vo.add(jo);return Ho.cmp(this.m)>=0&&Ho.isub(this.m),Ho._forceRed(this)},Ol.prototype.iadd=function(Vo,jo){this._verify2(Vo,jo);var Ho=Vo.iadd(jo);return Ho.cmp(this.m)>=0&&Ho.isub(this.m),Ho},Ol.prototype.sub=function(Vo,jo){this._verify2(Vo,jo);var Ho=Vo.sub(jo);return Ho.cmpn(0)<0&&Ho.iadd(this.m),Ho._forceRed(this)},Ol.prototype.isub=function(Vo,jo){this._verify2(Vo,jo);var Ho=Vo.isub(jo);return Ho.cmpn(0)<0&&Ho.iadd(this.m),Ho},Ol.prototype.shl=function(Vo,jo){return this._verify1(Vo),this.imod(Vo.ushln(jo))},Ol.prototype.imul=function(Vo,jo){return this._verify2(Vo,jo),this.imod(Vo.imul(jo))},Ol.prototype.mul=function(Vo,jo){return this._verify2(Vo,jo),this.imod(Vo.mul(jo))},Ol.prototype.isqr=function(Vo){return this.imul(Vo,Vo.clone())},Ol.prototype.sqr=function(Vo){return this.mul(Vo,Vo)},Ol.prototype.sqrt=function(Vo){if(Vo.isZero())return Vo.clone();var jo=this.m.andln(3);if(is(jo%2===1),jo===3){var Ho=this.m.add(new as(1)).iushrn(2);return this.pow(Vo,Ho)}for(var Qo=this.m.subn(1),El=0;!Qo.isZero()&&Qo.andln(1)===0;)El++,Qo.iushrn(1);is(!Qo.isZero());var Xo=new as(1).toRed(this),Al=Xo.redNeg(),wl=this.m.subn(1).iushrn(1),yl=this.m.bitLength();for(yl=new as(2*yl*yl).toRed(this);this.pow(yl,wl).cmp(Al)!==0;)yl.redIAdd(Al);for(var Il=this.pow(yl,Qo),Bl=this.pow(Vo,Qo.addn(1).iushrn(1)),Gl=this.pow(Vo,Qo),Nl=El;Gl.cmp(Xo)!==0;){for(var zl=Gl,Vl=0;zl.cmp(Xo)!==0;Vl++)zl=zl.redSqr();is(Vl<Nl);var Hl=this.pow(Il,new as(1).iushln(Nl-Vl-1));Bl=Bl.redMul(Hl),Il=Hl.redSqr(),Gl=Gl.redMul(Il),Nl=Vl}return Bl},Ol.prototype.invm=function(Vo){var jo=Vo._invmp(this.m);return jo.negative!==0?(jo.negative=0,this.imod(jo).redNeg()):this.imod(jo)},Ol.prototype.pow=function(Vo,jo){if(jo.isZero())return new as(1).toRed(this);if(jo.cmpn(1)===0)return Vo.clone();var Ho=4,Qo=new Array(1<<Ho);Qo[0]=new as(1).toRed(this),Qo[1]=Vo;for(var El=2;El<Qo.length;El++)Qo[El]=this.mul(Qo[El-1],Vo);var Xo=Qo[0],Al=0,wl=0,yl=jo.bitLength()%26;for(yl===0&&(yl=26),El=jo.length-1;El>=0;El--){for(var Il=jo.words[El],Bl=yl-1;Bl>=0;Bl--){var Gl=Il>>Bl&1;if(Xo!==Qo[0]&&(Xo=this.sqr(Xo)),Gl===0&&Al===0){wl=0;continue}Al<<=1,Al|=Gl,wl++,!(wl!==Ho&&(El!==0||Bl!==0))&&(Xo=this.mul(Xo,Qo[Al]),wl=0,Al=0)}yl=26}return Xo},Ol.prototype.convertTo=function(Vo){var jo=Vo.umod(this.m);return jo===Vo?jo.clone():jo},Ol.prototype.convertFrom=function(Vo){var jo=Vo.clone();return jo.red=null,jo},as.mont=function(Vo){return new Rl(Vo)};function Rl(Vo){Ol.call(this,Vo),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new as(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}os(Rl,Ol),Rl.prototype.convertTo=function(Vo){return this.imod(Vo.ushln(this.shift))},Rl.prototype.convertFrom=function(Vo){var jo=this.imod(Vo.mul(this.rinv));return jo.red=null,jo},Rl.prototype.imul=function(Vo,jo){if(Vo.isZero()||jo.isZero())return Vo.words[0]=0,Vo.length=1,Vo;var Ho=Vo.imul(jo),Qo=Ho.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),El=Ho.isub(Qo).iushrn(this.shift),Xo=El;return El.cmp(this.m)>=0?Xo=El.isub(this.m):El.cmpn(0)<0&&(Xo=El.iadd(this.m)),Xo._forceRed(this)},Rl.prototype.mul=function(Vo,jo){if(Vo.isZero()||jo.isZero())return new as(0)._forceRed(this);var Ho=Vo.mul(jo),Qo=Ho.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),El=Ho.isub(Qo).iushrn(this.shift),Xo=El;return El.cmp(this.m)>=0?Xo=El.isub(this.m):El.cmpn(0)<0&&(Xo=El.iadd(this.m)),Xo._forceRed(this)},Rl.prototype.invm=function(Vo){var jo=this.imod(Vo._invmp(this.m).mul(this.r2));return jo._forceRed(this)}})(Fn,Kn)})(Xn);var K=Xn.exports;const $n="bignumber/5.7.0";var Dr$1=K.BN;const Ae$1=new z$2($n),Ni={},Zn=9007199254740991;function Hs$1(Fn){return Fn!=null&&(V.isBigNumber(Fn)||typeof Fn=="number"&&Fn%1===0||typeof Fn=="string"&&!!Fn.match(/^-?[0-9]+$/)||Jt$1(Fn)||typeof Fn=="bigint"||nr$1(Fn))}let tf=!1;class V{constructor(Mn,rs){Mn!==Ni&&Ae$1.throwError("cannot call constructor directly; use BigNumber.from",z$2.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=rs,this._isBigNumber=!0,Object.freeze(this)}fromTwos(Mn){return zt$1(j$2(this).fromTwos(Mn))}toTwos(Mn){return zt$1(j$2(this).toTwos(Mn))}abs(){return this._hex[0]==="-"?V.from(this._hex.substring(1)):this}add(Mn){return zt$1(j$2(this).add(j$2(Mn)))}sub(Mn){return zt$1(j$2(this).sub(j$2(Mn)))}div(Mn){return V.from(Mn).isZero()&&$t$1("division-by-zero","div"),zt$1(j$2(this).div(j$2(Mn)))}mul(Mn){return zt$1(j$2(this).mul(j$2(Mn)))}mod(Mn){const rs=j$2(Mn);return rs.isNeg()&&$t$1("division-by-zero","mod"),zt$1(j$2(this).umod(rs))}pow(Mn){const rs=j$2(Mn);return rs.isNeg()&&$t$1("negative-power","pow"),zt$1(j$2(this).pow(rs))}and(Mn){const rs=j$2(Mn);return(this.isNegative()||rs.isNeg())&&$t$1("unbound-bitwise-result","and"),zt$1(j$2(this).and(rs))}or(Mn){const rs=j$2(Mn);return(this.isNegative()||rs.isNeg())&&$t$1("unbound-bitwise-result","or"),zt$1(j$2(this).or(rs))}xor(Mn){const rs=j$2(Mn);return(this.isNegative()||rs.isNeg())&&$t$1("unbound-bitwise-result","xor"),zt$1(j$2(this).xor(rs))}mask(Mn){return(this.isNegative()||Mn<0)&&$t$1("negative-width","mask"),zt$1(j$2(this).maskn(Mn))}shl(Mn){return(this.isNegative()||Mn<0)&&$t$1("negative-width","shl"),zt$1(j$2(this).shln(Mn))}shr(Mn){return(this.isNegative()||Mn<0)&&$t$1("negative-width","shr"),zt$1(j$2(this).shrn(Mn))}eq(Mn){return j$2(this).eq(j$2(Mn))}lt(Mn){return j$2(this).lt(j$2(Mn))}lte(Mn){return j$2(this).lte(j$2(Mn))}gt(Mn){return j$2(this).gt(j$2(Mn))}gte(Mn){return j$2(this).gte(j$2(Mn))}isNegative(){return this._hex[0]==="-"}isZero(){return j$2(this).isZero()}toNumber(){try{return j$2(this).toNumber()}catch{$t$1("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ae$1.throwError("this platform does not support BigInt",z$2.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?tf||(tf=!0,Ae$1.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Ae$1.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",z$2.errors.UNEXPECTED_ARGUMENT,{}):Ae$1.throwError("BigNumber.toString does not accept parameters",z$2.errors.UNEXPECTED_ARGUMENT,{})),j$2(this).toString(10)}toHexString(){return this._hex}toJSON(Mn){return{type:"BigNumber",hex:this.toHexString()}}static from(Mn){if(Mn instanceof V)return Mn;if(typeof Mn=="string")return Mn.match(/^-?0x[0-9a-f]+$/i)?new V(Ni,mr$1(Mn)):Mn.match(/^-?[0-9]+$/)?new V(Ni,mr$1(new Dr$1(Mn))):Ae$1.throwArgumentError("invalid BigNumber string","value",Mn);if(typeof Mn=="number")return Mn%1&&$t$1("underflow","BigNumber.from",Mn),(Mn>=Zn||Mn<=-Zn)&&$t$1("overflow","BigNumber.from",Mn),V.from(String(Mn));const rs=Mn;if(typeof rs=="bigint")return V.from(rs.toString());if(nr$1(rs))return V.from(Kt$1(rs));if(rs)if(rs.toHexString){const is=rs.toHexString();if(typeof is=="string")return V.from(is)}else{let is=rs._hex;if(is==null&&rs.type==="BigNumber"&&(is=rs.hex),typeof is=="string"&&(Jt$1(is)||is[0]==="-"&&Jt$1(is.substring(1))))return V.from(is)}return Ae$1.throwArgumentError("invalid BigNumber value","value",Mn)}static isBigNumber(Mn){return!!(Mn&&Mn._isBigNumber)}}function mr$1(Fn){if(typeof Fn!="string")return mr$1(Fn.toString(16));if(Fn[0]==="-")return Fn=Fn.substring(1),Fn[0]==="-"&&Ae$1.throwArgumentError("invalid hex","value",Fn),Fn=mr$1(Fn),Fn==="0x00"?Fn:"-"+Fn;if(Fn.substring(0,2)!=="0x"&&(Fn="0x"+Fn),Fn==="0x")return"0x00";for(Fn.length%2&&(Fn="0x0"+Fn.substring(2));Fn.length>4&&Fn.substring(0,4)==="0x00";)Fn="0x"+Fn.substring(4);return Fn}function zt$1(Fn){return V.from(mr$1(Fn))}function j$2(Fn){const Mn=V.from(Fn).toHexString();return Mn[0]==="-"?new Dr$1("-"+Mn.substring(3),16):new Dr$1(Mn.substring(2),16)}function $t$1(Fn,Mn,rs){const is={fault:Fn,operation:Mn};return rs!=null&&(is.value=rs),Ae$1.throwError(Fn,z$2.errors.NUMERIC_FAULT,is)}function Ls$1(Fn){return new Dr$1(Fn,36).toString(16)}const Ht$1=new z$2($n),Ar$1={},ef=V.from(0),rf=V.from(-1);function nf(Fn,Mn,rs,is){const os={fault:Mn,operation:rs};return is!==void 0&&(os.value=is),Ht$1.throwError(Fn,z$2.errors.NUMERIC_FAULT,os)}let br$1="0";for(;br$1.length<256;)br$1+=br$1;function _i(Fn){if(typeof Fn!="number")try{Fn=V.from(Fn).toNumber()}catch{}return typeof Fn=="number"&&Fn>=0&&Fn<=256&&!(Fn%1)?"1"+br$1.substring(0,Fn):Ht$1.throwArgumentError("invalid decimal size","decimals",Fn)}function Bi$1(Fn,Mn){Mn==null&&(Mn=0);const rs=_i(Mn);Fn=V.from(Fn);const is=Fn.lt(ef);is&&(Fn=Fn.mul(rf));let os=Fn.mod(rs).toString();for(;os.length<rs.length-1;)os="0"+os;os=os.match(/^([0-9]*[1-9]|0)(0*)/)[1];const as=Fn.div(rs).toString();return rs.length===1?Fn=as:Fn=as+"."+os,is&&(Fn="-"+Fn),Fn}function be$2(Fn,Mn){Mn==null&&(Mn=0);const rs=_i(Mn);(typeof Fn!="string"||!Fn.match(/^-?[0-9.]+$/))&&Ht$1.throwArgumentError("invalid decimal value","value",Fn);const is=Fn.substring(0,1)==="-";is&&(Fn=Fn.substring(1)),Fn==="."&&Ht$1.throwArgumentError("missing value","value",Fn);const os=Fn.split(".");os.length>2&&Ht$1.throwArgumentError("too many decimal points","value",Fn);let as=os[0],us=os[1];for(as||(as="0"),us||(us="0");us[us.length-1]==="0";)us=us.substring(0,us.length-1);for(us.length>rs.length-1&&nf("fractional component exceeds decimals","underflow","parseFixed"),us===""&&(us="0");us.length<rs.length-1;)us+="0";const ds=V.from(as),hs=V.from(us);let ps=ds.mul(rs).add(hs);return is&&(ps=ps.mul(rf)),ps}let vr$1=class zw{constructor(Mn,rs,is,os){Mn!==Ar$1&&Ht$1.throwError("cannot use FixedFormat constructor; use FixedFormat.from",z$2.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=rs,this.width=is,this.decimals=os,this.name=(rs?"":"u")+"fixed"+String(is)+"x"+String(os),this._multiplier=_i(os),Object.freeze(this)}static from(Mn){if(Mn instanceof zw)return Mn;typeof Mn=="number"&&(Mn=`fixed128x${Mn}`);let rs=!0,is=128,os=18;if(typeof Mn=="string"){if(Mn!=="fixed")if(Mn==="ufixed")rs=!1;else{const as=Mn.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);as||Ht$1.throwArgumentError("invalid fixed format","format",Mn),rs=as[1]!=="u",is=parseInt(as[2]),os=parseInt(as[3])}}else if(Mn){const as=(us,ds,hs)=>Mn[us]==null?hs:(typeof Mn[us]!==ds&&Ht$1.throwArgumentError("invalid fixed format ("+us+" not "+ds+")","format."+us,Mn[us]),Mn[us]);rs=as("signed","boolean",rs),is=as("width","number",is),os=as("decimals","number",os)}return is%8&&Ht$1.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",is),os>80&&Ht$1.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",os),new zw(Ar$1,rs,is,os)}},Ut$1=class H1{constructor(Mn,rs,is,os){Mn!==Ar$1&&Ht$1.throwError("cannot use FixedNumber constructor; use FixedNumber.from",z$2.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=os,this._hex=rs,this._value=is,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(Mn){this.format.name!==Mn.format.name&&Ht$1.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",Mn)}addUnsafe(Mn){this._checkFormat(Mn);const rs=be$2(this._value,this.format.decimals),is=be$2(Mn._value,Mn.format.decimals);return H1.fromValue(rs.add(is),this.format.decimals,this.format)}subUnsafe(Mn){this._checkFormat(Mn);const rs=be$2(this._value,this.format.decimals),is=be$2(Mn._value,Mn.format.decimals);return H1.fromValue(rs.sub(is),this.format.decimals,this.format)}mulUnsafe(Mn){this._checkFormat(Mn);const rs=be$2(this._value,this.format.decimals),is=be$2(Mn._value,Mn.format.decimals);return H1.fromValue(rs.mul(is).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(Mn){this._checkFormat(Mn);const rs=be$2(this._value,this.format.decimals),is=be$2(Mn._value,Mn.format.decimals);return H1.fromValue(rs.mul(this.format._multiplier).div(is),this.format.decimals,this.format)}floor(){const Mn=this.toString().split(".");Mn.length===1&&Mn.push("0");let rs=H1.from(Mn[0],this.format);const is=!Mn[1].match(/^(0*)$/);return this.isNegative()&&is&&(rs=rs.subUnsafe(ff.toFormat(rs.format))),rs}ceiling(){const Mn=this.toString().split(".");Mn.length===1&&Mn.push("0");let rs=H1.from(Mn[0],this.format);const is=!Mn[1].match(/^(0*)$/);return!this.isNegative()&&is&&(rs=rs.addUnsafe(ff.toFormat(rs.format))),rs}round(Mn){Mn==null&&(Mn=0);const rs=this.toString().split(".");if(rs.length===1&&rs.push("0"),(Mn<0||Mn>80||Mn%1)&&Ht$1.throwArgumentError("invalid decimal count","decimals",Mn),rs[1].length<=Mn)return this;const is=H1.from("1"+br$1.substring(0,Mn),this.format),os=zs$1.toFormat(this.format);return this.mulUnsafe(is).addUnsafe(os).floor().divUnsafe(is)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(Mn){if(Mn==null)return this._hex;Mn%8&&Ht$1.throwArgumentError("invalid byte width","width",Mn);const rs=V.from(this._hex).fromTwos(this.format.width).toTwos(Mn).toHexString();return oe$2(rs,Mn/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(Mn){return H1.fromString(this._value,Mn)}static fromValue(Mn,rs,is){return is==null&&rs!=null&&!Hs$1(rs)&&(is=rs,rs=null),rs==null&&(rs=0),is==null&&(is="fixed"),H1.fromString(Bi$1(Mn,rs),vr$1.from(is))}static fromString(Mn,rs){rs==null&&(rs="fixed");const is=vr$1.from(rs),os=be$2(Mn,is.decimals);!is.signed&&os.lt(ef)&&nf("unsigned value cannot be negative","overflow","value",Mn);let as=null;is.signed?as=os.toTwos(is.width).toHexString():(as=os.toHexString(),as=oe$2(as,is.width/8));const us=Bi$1(os,is.decimals);return new H1(Ar$1,as,us,is)}static fromBytes(Mn,rs){rs==null&&(rs="fixed");const is=vr$1.from(rs);if(Ot$1(Mn).length>is.width/8)throw new Error("overflow");let os=V.from(Mn);is.signed&&(os=os.fromTwos(is.width));const as=os.toTwos((is.signed?0:1)+is.width).toHexString(),us=Bi$1(os,is.decimals);return new H1(Ar$1,as,us,is)}static from(Mn,rs){if(typeof Mn=="string")return H1.fromString(Mn,rs);if(nr$1(Mn))return H1.fromBytes(Mn,rs);try{return H1.fromValue(Mn,0,rs)}catch(is){if(is.code!==z$2.errors.INVALID_ARGUMENT)throw is}return Ht$1.throwArgumentError("invalid FixedNumber value","value",Mn)}static isFixedNumber(Mn){return!!(Mn&&Mn._isFixedNumber)}};const ff=Ut$1.from(1),zs$1=Ut$1.from("0.5"),js$1="strings/5.7.0",of=new z$2(js$1);var Fr$1;(function(Fn){Fn.current="",Fn.NFC="NFC",Fn.NFD="NFD",Fn.NFKC="NFKC",Fn.NFKD="NFKD"})(Fr$1||(Fr$1={}));var fr$1;(function(Fn){Fn.UNEXPECTED_CONTINUE="unexpected continuation byte",Fn.BAD_PREFIX="bad codepoint prefix",Fn.OVERRUN="string overrun",Fn.MISSING_CONTINUE="missing continuation byte",Fn.OUT_OF_RANGE="out of UTF-8 range",Fn.UTF16_SURROGATE="UTF-16 surrogate",Fn.OVERLONG="overlong representation"})(fr$1||(fr$1={}));function Ci(Fn,Mn=Fr$1.current){Mn!=Fr$1.current&&(of.checkNormalize(),Fn=Fn.normalize(Mn));let rs=[];for(let is=0;is<Fn.length;is++){const os=Fn.charCodeAt(is);if(os<128)rs.push(os);else if(os<2048)rs.push(os>>6|192),rs.push(os&63|128);else if((os&64512)==55296){is++;const as=Fn.charCodeAt(is);if(is>=Fn.length||(as&64512)!==56320)throw new Error("invalid utf-8 string");const us=65536+((os&1023)<<10)+(as&1023);rs.push(us>>18|240),rs.push(us>>12&63|128),rs.push(us>>6&63|128),rs.push(us&63|128)}else rs.push(os>>12|224),rs.push(os>>6&63|128),rs.push(os&63|128)}return Ot$1(rs)}function Gs$1(Fn){if(Fn.length%4!==0)throw new Error("bad data");let Mn=[];for(let rs=0;rs<Fn.length;rs+=4)Mn.push(parseInt(Fn.substring(rs,rs+4),16));return Mn}function Ri(Fn,Mn){Mn||(Mn=function(os){return[parseInt(os,16)]});let rs=0,is={};return Fn.split(",").forEach(os=>{let as=os.split(":");rs+=parseInt(as[0],16),is[rs]=Mn(as[1])}),is}function af(Fn){let Mn=0;return Fn.split(",").map(rs=>{let is=rs.split("-");is.length===1?is[1]="0":is[1]===""&&(is[1]="1");let os=Mn+parseInt(is[0],16);return Mn=parseInt(is[1],16),{l:os,h:Mn}})}af("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(Fn=>parseInt(Fn,16)),Ri("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Ri("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Ri("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",Gs$1),af("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function Ys$1(Fn){Fn=atob(Fn);const Mn=[];for(let rs=0;rs<Fn.length;rs++)Mn.push(Fn.charCodeAt(rs));return Ot$1(Mn)}function hf(Fn,Mn){Mn==null&&(Mn=1);const rs=[],is=rs.forEach,os=function(as,us){is.call(as,function(ds){us>0&&Array.isArray(ds)?os(ds,us-1):rs.push(ds)})};return os(Fn,Mn),rs}function Vs$1(Fn){const Mn={};for(let rs=0;rs<Fn.length;rs++){const is=Fn[rs];Mn[is[0]]=is[1]}return Mn}function Ws$1(Fn){let Mn=0;function rs(){return Fn[Mn++]<<8|Fn[Mn++]}let is=rs(),os=1,as=[0,1];for(let _l=1;_l<is;_l++)as.push(os+=rs());let us=rs(),ds=Mn;Mn+=us;let hs=0,ps=0;function io(){return hs==0&&(ps=ps<<8|Fn[Mn++],hs=8),ps>>--hs&1}const fo=31,mo=Math.pow(2,fo),Ao=mo>>>1,$o=Ao>>1,Lo=mo-1;let Go=0;for(let _l=0;_l<fo;_l++)Go=Go<<1|io();let Yo=[],Wo=0,Jo=mo;for(;;){let _l=Math.floor(((Go-Wo+1)*os-1)/Jo),Tl=0,Sl=is;for(;Sl-Tl>1;){let Dl=Tl+Sl>>>1;_l<as[Dl]?Sl=Dl:Tl=Dl}if(Tl==0)break;Yo.push(Tl);let $l=Wo+Math.floor(Jo*as[Tl]/os),Pl=Wo+Math.floor(Jo*as[Tl+1]/os)-1;for(;!(($l^Pl)&Ao);)Go=Go<<1&Lo|io(),$l=$l<<1&Lo,Pl=Pl<<1&Lo|1;for(;$l&~Pl&$o;)Go=Go&Ao|Go<<1&Lo>>>1|io(),$l=$l<<1^Ao,Pl=(Pl^Ao)<<1|Ao|1;Wo=$l,Jo=1+Pl-$l}let xl=is-4;return Yo.map(_l=>{switch(_l-xl){case 3:return xl+65792+(Fn[ds++]<<16|Fn[ds++]<<8|Fn[ds++]);case 2:return xl+256+(Fn[ds++]<<8|Fn[ds++]);case 1:return xl+Fn[ds++];default:return _l-1}})}function Xs$1(Fn){let Mn=0;return()=>Fn[Mn++]}function $s$1(Fn){return Xs$1(Ws$1(Fn))}function Zs$1(Fn){return Fn&1?~Fn>>1:Fn>>1}function t0(Fn,Mn){let rs=Array(Fn);for(let is=0;is<Fn;is++)rs[is]=1+Mn();return rs}function cf(Fn,Mn){let rs=Array(Fn);for(let is=0,os=-1;is<Fn;is++)rs[is]=os+=1+Mn();return rs}function e0(Fn,Mn){let rs=Array(Fn);for(let is=0,os=0;is<Fn;is++)rs[is]=os+=Zs$1(Mn());return rs}function Ur$1(Fn,Mn){let rs=cf(Fn(),Fn),is=Fn(),os=cf(is,Fn),as=t0(is,Fn);for(let us=0;us<is;us++)for(let ds=0;ds<as[us];ds++)rs.push(os[us]+ds);return Mn?rs.map(us=>Mn[us]):rs}function r0(Fn){let Mn=[];for(;;){let rs=Fn();if(rs==0)break;Mn.push(n0(rs,Fn))}for(;;){let rs=Fn()-1;if(rs<0)break;Mn.push(f0(rs,Fn))}return Vs$1(hf(Mn))}function i0(Fn){let Mn=[];for(;;){let rs=Fn();if(rs==0)break;Mn.push(rs)}return Mn}function lf(Fn,Mn,rs){let is=Array(Fn).fill(void 0).map(()=>[]);for(let os=0;os<Mn;os++)e0(Fn,rs).forEach((as,us)=>is[us].push(as));return is}function n0(Fn,Mn){let rs=1+Mn(),is=Mn(),os=i0(Mn),as=lf(os.length,1+Fn,Mn);return hf(as.map((us,ds)=>{const hs=us[0],ps=us.slice(1);return Array(os[ds]).fill(void 0).map((io,fo)=>{let mo=fo*is;return[hs+fo*rs,ps.map(Ao=>Ao+mo)]})}))}function f0(Fn,Mn){let rs=1+Mn();return lf(rs,1+Fn,Mn).map(is=>[is[0],is.slice(1)])}function o0(Fn){let Mn=Ur$1(Fn).sort((is,os)=>is-os);return rs();function rs(){let is=[];for(;;){let ps=Ur$1(Fn,Mn);if(ps.length==0)break;is.push({set:new Set(ps),node:rs()})}is.sort((ps,io)=>io.set.size-ps.set.size);let os=Fn(),as=os%3;os=os/3|0;let us=!!(os&1);os>>=1;let ds=os==1,hs=os==2;return{branches:is,valid:as,fe0f:us,save:ds,check:hs}}}function s0(){return $s$1(Ys$1("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const kr$1=s0();new Set(Ur$1(kr$1)),new Set(Ur$1(kr$1)),r0(kr$1),o0(kr$1);const a0=new Uint8Array(32);a0.fill(0);const u0=`Ethereum Signed Message:
`;function df(Fn){return typeof Fn=="string"&&(Fn=Ci(Fn)),Ii(Ds([Ci(u0),Ci(String(Fn.length)),Fn]))}const c0="address/5.7.0",yr$1=new z$2(c0);function pf(Fn){Jt$1(Fn,20)||yr$1.throwArgumentError("invalid address","address",Fn),Fn=Fn.toLowerCase();const Mn=Fn.substring(2).split(""),rs=new Uint8Array(40);for(let os=0;os<40;os++)rs[os]=Mn[os].charCodeAt(0);const is=Ot$1(Ii(rs));for(let os=0;os<40;os+=2)is[os>>1]>>4>=8&&(Mn[os]=Mn[os].toUpperCase()),(is[os>>1]&15)>=8&&(Mn[os+1]=Mn[os+1].toUpperCase());return"0x"+Mn.join("")}const l0=9007199254740991;function d0(Fn){return Math.log10?Math.log10(Fn):Math.log(Fn)/Math.LN10}const Oi={};for(let Fn=0;Fn<10;Fn++)Oi[String(Fn)]=String(Fn);for(let Fn=0;Fn<26;Fn++)Oi[String.fromCharCode(65+Fn)]=String(10+Fn);const vf=Math.floor(d0(l0));function p0(Fn){Fn=Fn.toUpperCase(),Fn=Fn.substring(4)+Fn.substring(0,2)+"00";let Mn=Fn.split("").map(is=>Oi[is]).join("");for(;Mn.length>=vf;){let is=Mn.substring(0,vf);Mn=parseInt(is,10)%97+Mn.substring(is.length)}let rs=String(98-parseInt(Mn,10)%97);for(;rs.length<2;)rs="0"+rs;return rs}function v0(Fn){let Mn=null;if(typeof Fn!="string"&&yr$1.throwArgumentError("invalid address","address",Fn),Fn.match(/^(0x)?[0-9a-fA-F]{40}$/))Fn.substring(0,2)!=="0x"&&(Fn="0x"+Fn),Mn=pf(Fn),Fn.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&Mn!==Fn&&yr$1.throwArgumentError("bad address checksum","address",Fn);else if(Fn.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(Fn.substring(2,4)!==p0(Fn)&&yr$1.throwArgumentError("bad icap checksum","address",Fn),Mn=Ls$1(Fn.substring(4));Mn.length<40;)Mn="0"+Mn;Mn=pf("0x"+Mn)}else yr$1.throwArgumentError("invalid address","address",Fn);return Mn}function wr$1(Fn,Mn,rs){Object.defineProperty(Fn,Mn,{enumerable:!0,value:rs,writable:!1})}const m0=new Uint8Array(32);m0.fill(0),V.from(-1);const A0=V.from(0),b0=V.from(1);V.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),oe$2(b0.toHexString(),32),oe$2(A0.toHexString(),32);var se={},Q$1={},xr$1=gf;function gf(Fn,Mn){if(!Fn)throw new Error(Mn||"Assertion failed")}gf.equal=function(Fn,Mn,rs){if(Fn!=Mn)throw new Error(rs||"Assertion failed: "+Fn+" != "+Mn)};var Pi={exports:{}};typeof Object.create=="function"?Pi.exports=function(Fn,Mn){Mn&&(Fn.super_=Mn,Fn.prototype=Object.create(Mn.prototype,{constructor:{value:Fn,enumerable:!1,writable:!0,configurable:!0}}))}:Pi.exports=function(Fn,Mn){if(Mn){Fn.super_=Mn;var rs=function(){};rs.prototype=Mn.prototype,Fn.prototype=new rs,Fn.prototype.constructor=Fn}};var y0=xr$1,w0=Pi.exports;Q$1.inherits=w0;function x0(Fn,Mn){return(Fn.charCodeAt(Mn)&64512)!==55296||Mn<0||Mn+1>=Fn.length?!1:(Fn.charCodeAt(Mn+1)&64512)===56320}function M0(Fn,Mn){if(Array.isArray(Fn))return Fn.slice();if(!Fn)return[];var rs=[];if(typeof Fn=="string")if(Mn){if(Mn==="hex")for(Fn=Fn.replace(/[^a-z0-9]+/ig,""),Fn.length%2!==0&&(Fn="0"+Fn),os=0;os<Fn.length;os+=2)rs.push(parseInt(Fn[os]+Fn[os+1],16))}else for(var is=0,os=0;os<Fn.length;os++){var as=Fn.charCodeAt(os);as<128?rs[is++]=as:as<2048?(rs[is++]=as>>6|192,rs[is++]=as&63|128):x0(Fn,os)?(as=65536+((as&1023)<<10)+(Fn.charCodeAt(++os)&1023),rs[is++]=as>>18|240,rs[is++]=as>>12&63|128,rs[is++]=as>>6&63|128,rs[is++]=as&63|128):(rs[is++]=as>>12|224,rs[is++]=as>>6&63|128,rs[is++]=as&63|128)}else for(os=0;os<Fn.length;os++)rs[os]=Fn[os]|0;return rs}Q$1.toArray=M0;function E0(Fn){for(var Mn="",rs=0;rs<Fn.length;rs++)Mn+=Af(Fn[rs].toString(16));return Mn}Q$1.toHex=E0;function mf(Fn){var Mn=Fn>>>24|Fn>>>8&65280|Fn<<8&16711680|(Fn&255)<<24;return Mn>>>0}Q$1.htonl=mf;function S0$1(Fn,Mn){for(var rs="",is=0;is<Fn.length;is++){var os=Fn[is];Mn==="little"&&(os=mf(os)),rs+=bf(os.toString(16))}return rs}Q$1.toHex32=S0$1;function Af(Fn){return Fn.length===1?"0"+Fn:Fn}Q$1.zero2=Af;function bf(Fn){return Fn.length===7?"0"+Fn:Fn.length===6?"00"+Fn:Fn.length===5?"000"+Fn:Fn.length===4?"0000"+Fn:Fn.length===3?"00000"+Fn:Fn.length===2?"000000"+Fn:Fn.length===1?"0000000"+Fn:Fn}Q$1.zero8=bf;function I0(Fn,Mn,rs,is){var os=rs-Mn;y0(os%4===0);for(var as=new Array(os/4),us=0,ds=Mn;us<as.length;us++,ds+=4){var hs;is==="big"?hs=Fn[ds]<<24|Fn[ds+1]<<16|Fn[ds+2]<<8|Fn[ds+3]:hs=Fn[ds+3]<<24|Fn[ds+2]<<16|Fn[ds+1]<<8|Fn[ds],as[us]=hs>>>0}return as}Q$1.join32=I0;function N0(Fn,Mn){for(var rs=new Array(Fn.length*4),is=0,os=0;is<Fn.length;is++,os+=4){var as=Fn[is];Mn==="big"?(rs[os]=as>>>24,rs[os+1]=as>>>16&255,rs[os+2]=as>>>8&255,rs[os+3]=as&255):(rs[os+3]=as>>>24,rs[os+2]=as>>>16&255,rs[os+1]=as>>>8&255,rs[os]=as&255)}return rs}Q$1.split32=N0;function _0(Fn,Mn){return Fn>>>Mn|Fn<<32-Mn}Q$1.rotr32=_0;function B0(Fn,Mn){return Fn<<Mn|Fn>>>32-Mn}Q$1.rotl32=B0;function C0(Fn,Mn){return Fn+Mn>>>0}Q$1.sum32=C0;function R0(Fn,Mn,rs){return Fn+Mn+rs>>>0}Q$1.sum32_3=R0;function O0(Fn,Mn,rs,is){return Fn+Mn+rs+is>>>0}Q$1.sum32_4=O0;function P0(Fn,Mn,rs,is,os){return Fn+Mn+rs+is+os>>>0}Q$1.sum32_5=P0;function T0$1(Fn,Mn,rs,is){var os=Fn[Mn],as=Fn[Mn+1],us=is+as>>>0,ds=(us<is?1:0)+rs+os;Fn[Mn]=ds>>>0,Fn[Mn+1]=us}Q$1.sum64=T0$1;function D0(Fn,Mn,rs,is){var os=Mn+is>>>0,as=(os<Mn?1:0)+Fn+rs;return as>>>0}Q$1.sum64_hi=D0;function F0(Fn,Mn,rs,is){var os=Mn+is;return os>>>0}Q$1.sum64_lo=F0;function U0(Fn,Mn,rs,is,os,as,us,ds){var hs=0,ps=Mn;ps=ps+is>>>0,hs+=ps<Mn?1:0,ps=ps+as>>>0,hs+=ps<as?1:0,ps=ps+ds>>>0,hs+=ps<ds?1:0;var io=Fn+rs+os+us+hs;return io>>>0}Q$1.sum64_4_hi=U0;function k0(Fn,Mn,rs,is,os,as,us,ds){var hs=Mn+is+as+ds;return hs>>>0}Q$1.sum64_4_lo=k0;function q0(Fn,Mn,rs,is,os,as,us,ds,hs,ps){var io=0,fo=Mn;fo=fo+is>>>0,io+=fo<Mn?1:0,fo=fo+as>>>0,io+=fo<as?1:0,fo=fo+ds>>>0,io+=fo<ds?1:0,fo=fo+ps>>>0,io+=fo<ps?1:0;var mo=Fn+rs+os+us+hs+io;return mo>>>0}Q$1.sum64_5_hi=q0;function K0(Fn,Mn,rs,is,os,as,us,ds,hs,ps){var io=Mn+is+as+ds+ps;return io>>>0}Q$1.sum64_5_lo=K0;function H0(Fn,Mn,rs){var is=Mn<<32-rs|Fn>>>rs;return is>>>0}Q$1.rotr64_hi=H0;function L0$1(Fn,Mn,rs){var is=Fn<<32-rs|Mn>>>rs;return is>>>0}Q$1.rotr64_lo=L0$1;function z0(Fn,Mn,rs){return Fn>>>rs}Q$1.shr64_hi=z0;function j0(Fn,Mn,rs){var is=Fn<<32-rs|Mn>>>rs;return is>>>0}Q$1.shr64_lo=j0;var or$1={},yf=Q$1,Q0=xr$1;function qr$1(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}or$1.BlockHash=qr$1,qr$1.prototype.update=function(Fn,Mn){if(Fn=yf.toArray(Fn,Mn),this.pending?this.pending=this.pending.concat(Fn):this.pending=Fn,this.pendingTotal+=Fn.length,this.pending.length>=this._delta8){Fn=this.pending;var rs=Fn.length%this._delta8;this.pending=Fn.slice(Fn.length-rs,Fn.length),this.pending.length===0&&(this.pending=null),Fn=yf.join32(Fn,0,Fn.length-rs,this.endian);for(var is=0;is<Fn.length;is+=this._delta32)this._update(Fn,is,is+this._delta32)}return this},qr$1.prototype.digest=function(Fn){return this.update(this._pad()),Q0(this.pending===null),this._digest(Fn)},qr$1.prototype._pad=function(){var Fn=this.pendingTotal,Mn=this._delta8,rs=Mn-(Fn+this.padLength)%Mn,is=new Array(rs+this.padLength);is[0]=128;for(var os=1;os<rs;os++)is[os]=0;if(Fn<<=3,this.endian==="big"){for(var as=8;as<this.padLength;as++)is[os++]=0;is[os++]=0,is[os++]=0,is[os++]=0,is[os++]=0,is[os++]=Fn>>>24&255,is[os++]=Fn>>>16&255,is[os++]=Fn>>>8&255,is[os++]=Fn&255}else for(is[os++]=Fn&255,is[os++]=Fn>>>8&255,is[os++]=Fn>>>16&255,is[os++]=Fn>>>24&255,is[os++]=0,is[os++]=0,is[os++]=0,is[os++]=0,as=8;as<this.padLength;as++)is[os++]=0;return is};var sr$1={},ae$2={},J0=Q$1,ue=J0.rotr32;function G0(Fn,Mn,rs,is){if(Fn===0)return wf(Mn,rs,is);if(Fn===1||Fn===3)return Mf(Mn,rs,is);if(Fn===2)return xf(Mn,rs,is)}ae$2.ft_1=G0;function wf(Fn,Mn,rs){return Fn&Mn^~Fn&rs}ae$2.ch32=wf;function xf(Fn,Mn,rs){return Fn&Mn^Fn&rs^Mn&rs}ae$2.maj32=xf;function Mf(Fn,Mn,rs){return Fn^Mn^rs}ae$2.p32=Mf;function Y0(Fn){return ue(Fn,2)^ue(Fn,13)^ue(Fn,22)}ae$2.s0_256=Y0;function V0$1(Fn){return ue(Fn,6)^ue(Fn,11)^ue(Fn,25)}ae$2.s1_256=V0$1;function W0(Fn){return ue(Fn,7)^ue(Fn,18)^Fn>>>3}ae$2.g0_256=W0;function X0(Fn){return ue(Fn,17)^ue(Fn,19)^Fn>>>10}ae$2.g1_256=X0;var ar$1=Q$1,$0=or$1,Z0=ae$2,Ti=ar$1.rotl32,Mr$1=ar$1.sum32,ta=ar$1.sum32_5,ea=Z0.ft_1,Ef=$0.BlockHash,ra=[1518500249,1859775393,2400959708,3395469782];function he(){if(!(this instanceof he))return new he;Ef.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}ar$1.inherits(he,Ef);var ia=he;he.blockSize=512,he.outSize=160,he.hmacStrength=80,he.padLength=64,he.prototype._update=function(Fn,Mn){for(var rs=this.W,is=0;is<16;is++)rs[is]=Fn[Mn+is];for(;is<rs.length;is++)rs[is]=Ti(rs[is-3]^rs[is-8]^rs[is-14]^rs[is-16],1);var os=this.h[0],as=this.h[1],us=this.h[2],ds=this.h[3],hs=this.h[4];for(is=0;is<rs.length;is++){var ps=~~(is/20),io=ta(Ti(os,5),ea(ps,as,us,ds),hs,rs[is],ra[ps]);hs=ds,ds=us,us=Ti(as,30),as=os,os=io}this.h[0]=Mr$1(this.h[0],os),this.h[1]=Mr$1(this.h[1],as),this.h[2]=Mr$1(this.h[2],us),this.h[3]=Mr$1(this.h[3],ds),this.h[4]=Mr$1(this.h[4],hs)},he.prototype._digest=function(Fn){return Fn==="hex"?ar$1.toHex32(this.h,"big"):ar$1.split32(this.h,"big")};var ur$1=Q$1,na=or$1,hr$1=ae$2,fa=xr$1,ie=ur$1.sum32,oa=ur$1.sum32_4,sa=ur$1.sum32_5,aa=hr$1.ch32,ua=hr$1.maj32,ha=hr$1.s0_256,ca=hr$1.s1_256,la=hr$1.g0_256,da=hr$1.g1_256,Sf=na.BlockHash,pa=[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];function ce$1(){if(!(this instanceof ce$1))return new ce$1;Sf.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=pa,this.W=new Array(64)}ur$1.inherits(ce$1,Sf);var If=ce$1;ce$1.blockSize=512,ce$1.outSize=256,ce$1.hmacStrength=192,ce$1.padLength=64,ce$1.prototype._update=function(Fn,Mn){for(var rs=this.W,is=0;is<16;is++)rs[is]=Fn[Mn+is];for(;is<rs.length;is++)rs[is]=oa(da(rs[is-2]),rs[is-7],la(rs[is-15]),rs[is-16]);var os=this.h[0],as=this.h[1],us=this.h[2],ds=this.h[3],hs=this.h[4],ps=this.h[5],io=this.h[6],fo=this.h[7];for(fa(this.k.length===rs.length),is=0;is<rs.length;is++){var mo=sa(fo,ca(hs),aa(hs,ps,io),this.k[is],rs[is]),Ao=ie(ha(os),ua(os,as,us));fo=io,io=ps,ps=hs,hs=ie(ds,mo),ds=us,us=as,as=os,os=ie(mo,Ao)}this.h[0]=ie(this.h[0],os),this.h[1]=ie(this.h[1],as),this.h[2]=ie(this.h[2],us),this.h[3]=ie(this.h[3],ds),this.h[4]=ie(this.h[4],hs),this.h[5]=ie(this.h[5],ps),this.h[6]=ie(this.h[6],io),this.h[7]=ie(this.h[7],fo)},ce$1.prototype._digest=function(Fn){return Fn==="hex"?ur$1.toHex32(this.h,"big"):ur$1.split32(this.h,"big")};var Di$1=Q$1,Nf=If;function ye$1(){if(!(this instanceof ye$1))return new ye$1;Nf.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Di$1.inherits(ye$1,Nf);var va=ye$1;ye$1.blockSize=512,ye$1.outSize=224,ye$1.hmacStrength=192,ye$1.padLength=64,ye$1.prototype._digest=function(Fn){return Fn==="hex"?Di$1.toHex32(this.h.slice(0,7),"big"):Di$1.split32(this.h.slice(0,7),"big")};var jt$1=Q$1,ga=or$1,ma=xr$1,le=jt$1.rotr64_hi,de=jt$1.rotr64_lo,_f=jt$1.shr64_hi,Bf=jt$1.shr64_lo,Be=jt$1.sum64,Fi$1=jt$1.sum64_hi,Ui=jt$1.sum64_lo,Aa=jt$1.sum64_4_hi,ba$1=jt$1.sum64_4_lo,ya$1=jt$1.sum64_5_hi,wa=jt$1.sum64_5_lo,Cf=ga.BlockHash,xa=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ne$1(){if(!(this instanceof ne$1))return new ne$1;Cf.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=xa,this.W=new Array(160)}jt$1.inherits(ne$1,Cf);var Rf=ne$1;ne$1.blockSize=1024,ne$1.outSize=512,ne$1.hmacStrength=192,ne$1.padLength=128,ne$1.prototype._prepareBlock=function(Fn,Mn){for(var rs=this.W,is=0;is<32;is++)rs[is]=Fn[Mn+is];for(;is<rs.length;is+=2){var os=Pa(rs[is-4],rs[is-3]),as=Ta$1(rs[is-4],rs[is-3]),us=rs[is-14],ds=rs[is-13],hs=Ra$1(rs[is-30],rs[is-29]),ps=Oa$1(rs[is-30],rs[is-29]),io=rs[is-32],fo=rs[is-31];rs[is]=Aa(os,as,us,ds,hs,ps,io,fo),rs[is+1]=ba$1(os,as,us,ds,hs,ps,io,fo)}},ne$1.prototype._update=function(Fn,Mn){this._prepareBlock(Fn,Mn);var rs=this.W,is=this.h[0],os=this.h[1],as=this.h[2],us=this.h[3],ds=this.h[4],hs=this.h[5],ps=this.h[6],io=this.h[7],fo=this.h[8],mo=this.h[9],Ao=this.h[10],$o=this.h[11],Lo=this.h[12],Go=this.h[13],Yo=this.h[14],Wo=this.h[15];ma(this.k.length===rs.length);for(var Jo=0;Jo<rs.length;Jo+=2){var xl=Yo,_l=Wo,Tl=Ba(fo,mo),Sl=Ca(fo,mo),$l=Ma(fo,mo,Ao,$o,Lo),Pl=Ea(fo,mo,Ao,$o,Lo,Go),Dl=this.k[Jo],Ol=this.k[Jo+1],Rl=rs[Jo],Vo=rs[Jo+1],jo=ya$1(xl,_l,Tl,Sl,$l,Pl,Dl,Ol,Rl,Vo),Ho=wa(xl,_l,Tl,Sl,$l,Pl,Dl,Ol,Rl,Vo);xl=Na$1(is,os),_l=_a(is,os),Tl=Sa$1(is,os,as,us,ds),Sl=Ia(is,os,as,us,ds,hs);var Qo=Fi$1(xl,_l,Tl,Sl),El=Ui(xl,_l,Tl,Sl);Yo=Lo,Wo=Go,Lo=Ao,Go=$o,Ao=fo,$o=mo,fo=Fi$1(ps,io,jo,Ho),mo=Ui(io,io,jo,Ho),ps=ds,io=hs,ds=as,hs=us,as=is,us=os,is=Fi$1(jo,Ho,Qo,El),os=Ui(jo,Ho,Qo,El)}Be(this.h,0,is,os),Be(this.h,2,as,us),Be(this.h,4,ds,hs),Be(this.h,6,ps,io),Be(this.h,8,fo,mo),Be(this.h,10,Ao,$o),Be(this.h,12,Lo,Go),Be(this.h,14,Yo,Wo)},ne$1.prototype._digest=function(Fn){return Fn==="hex"?jt$1.toHex32(this.h,"big"):jt$1.split32(this.h,"big")};function Ma(Fn,Mn,rs,is,os){var as=Fn&rs^~Fn&os;return as<0&&(as+=4294967296),as}function Ea(Fn,Mn,rs,is,os,as){var us=Mn&is^~Mn&as;return us<0&&(us+=4294967296),us}function Sa$1(Fn,Mn,rs,is,os){var as=Fn&rs^Fn&os^rs&os;return as<0&&(as+=4294967296),as}function Ia(Fn,Mn,rs,is,os,as){var us=Mn&is^Mn&as^is&as;return us<0&&(us+=4294967296),us}function Na$1(Fn,Mn){var rs=le(Fn,Mn,28),is=le(Mn,Fn,2),os=le(Mn,Fn,7),as=rs^is^os;return as<0&&(as+=4294967296),as}function _a(Fn,Mn){var rs=de(Fn,Mn,28),is=de(Mn,Fn,2),os=de(Mn,Fn,7),as=rs^is^os;return as<0&&(as+=4294967296),as}function Ba(Fn,Mn){var rs=le(Fn,Mn,14),is=le(Fn,Mn,18),os=le(Mn,Fn,9),as=rs^is^os;return as<0&&(as+=4294967296),as}function Ca(Fn,Mn){var rs=de(Fn,Mn,14),is=de(Fn,Mn,18),os=de(Mn,Fn,9),as=rs^is^os;return as<0&&(as+=4294967296),as}function Ra$1(Fn,Mn){var rs=le(Fn,Mn,1),is=le(Fn,Mn,8),os=_f(Fn,Mn,7),as=rs^is^os;return as<0&&(as+=4294967296),as}function Oa$1(Fn,Mn){var rs=de(Fn,Mn,1),is=de(Fn,Mn,8),os=Bf(Fn,Mn,7),as=rs^is^os;return as<0&&(as+=4294967296),as}function Pa(Fn,Mn){var rs=le(Fn,Mn,19),is=le(Mn,Fn,29),os=_f(Fn,Mn,6),as=rs^is^os;return as<0&&(as+=4294967296),as}function Ta$1(Fn,Mn){var rs=de(Fn,Mn,19),is=de(Mn,Fn,29),os=Bf(Fn,Mn,6),as=rs^is^os;return as<0&&(as+=4294967296),as}var ki=Q$1,Of=Rf;function we$2(){if(!(this instanceof we$2))return new we$2;Of.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}ki.inherits(we$2,Of);var Da$1=we$2;we$2.blockSize=1024,we$2.outSize=384,we$2.hmacStrength=192,we$2.padLength=128,we$2.prototype._digest=function(Fn){return Fn==="hex"?ki.toHex32(this.h.slice(0,12),"big"):ki.split32(this.h.slice(0,12),"big")},sr$1.sha1=ia,sr$1.sha224=va,sr$1.sha256=If,sr$1.sha384=Da$1,sr$1.sha512=Rf;var Pf={},Xe$1=Q$1,Fa$1=or$1,Kr$1=Xe$1.rotl32,Tf=Xe$1.sum32,Er$1=Xe$1.sum32_3,Df=Xe$1.sum32_4,Ff=Fa$1.BlockHash;function pe(){if(!(this instanceof pe))return new pe;Ff.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Xe$1.inherits(pe,Ff),Pf.ripemd160=pe,pe.blockSize=512,pe.outSize=160,pe.hmacStrength=192,pe.padLength=64,pe.prototype._update=function(Fn,Mn){for(var rs=this.h[0],is=this.h[1],os=this.h[2],as=this.h[3],us=this.h[4],ds=rs,hs=is,ps=os,io=as,fo=us,mo=0;mo<80;mo++){var Ao=Tf(Kr$1(Df(rs,Uf(mo,is,os,as),Fn[qa$1[mo]+Mn],Ua$1(mo)),Ha$1[mo]),us);rs=us,us=as,as=Kr$1(os,10),os=is,is=Ao,Ao=Tf(Kr$1(Df(ds,Uf(79-mo,hs,ps,io),Fn[Ka[mo]+Mn],ka(mo)),La$1[mo]),fo),ds=fo,fo=io,io=Kr$1(ps,10),ps=hs,hs=Ao}Ao=Er$1(this.h[1],os,io),this.h[1]=Er$1(this.h[2],as,fo),this.h[2]=Er$1(this.h[3],us,ds),this.h[3]=Er$1(this.h[4],rs,hs),this.h[4]=Er$1(this.h[0],is,ps),this.h[0]=Ao},pe.prototype._digest=function(Fn){return Fn==="hex"?Xe$1.toHex32(this.h,"little"):Xe$1.split32(this.h,"little")};function Uf(Fn,Mn,rs,is){return Fn<=15?Mn^rs^is:Fn<=31?Mn&rs|~Mn&is:Fn<=47?(Mn|~rs)^is:Fn<=63?Mn&is|rs&~is:Mn^(rs|~is)}function Ua$1(Fn){return Fn<=15?0:Fn<=31?1518500249:Fn<=47?1859775393:Fn<=63?2400959708:2840853838}function ka(Fn){return Fn<=15?1352829926:Fn<=31?1548603684:Fn<=47?1836072691:Fn<=63?2053994217:0}var qa$1=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Ka=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Ha$1=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],La$1=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],za=Q$1,ja=xr$1;function cr$1(Fn,Mn,rs){if(!(this instanceof cr$1))return new cr$1(Fn,Mn,rs);this.Hash=Fn,this.blockSize=Fn.blockSize/8,this.outSize=Fn.outSize/8,this.inner=null,this.outer=null,this._init(za.toArray(Mn,rs))}var Qa=cr$1;cr$1.prototype._init=function(Fn){Fn.length>this.blockSize&&(Fn=new this.Hash().update(Fn).digest()),ja(Fn.length<=this.blockSize);for(var Mn=Fn.length;Mn<this.blockSize;Mn++)Fn.push(0);for(Mn=0;Mn<Fn.length;Mn++)Fn[Mn]^=54;for(this.inner=new this.Hash().update(Fn),Mn=0;Mn<Fn.length;Mn++)Fn[Mn]^=106;this.outer=new this.Hash().update(Fn)},cr$1.prototype.update=function(Fn,Mn){return this.inner.update(Fn,Mn),this},cr$1.prototype.digest=function(Fn){return this.outer.update(this.inner.digest()),this.outer.digest(Fn)},function(Fn){var Mn=Fn;Mn.utils=Q$1,Mn.common=or$1,Mn.sha=sr$1,Mn.ripemd=Pf,Mn.hmac=Qa,Mn.sha1=Mn.sha.sha1,Mn.sha256=Mn.sha.sha256,Mn.sha224=Mn.sha.sha224,Mn.sha384=Mn.sha.sha384,Mn.sha512=Mn.sha.sha512,Mn.ripemd160=Mn.ripemd.ripemd160}(se);function lr$2(Fn,Mn,rs){return rs={path:Mn,exports:{},require:function(is,os){return Ja(is,os??rs.path)}},Fn(rs,rs.exports),rs.exports}function Ja(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var qi$1=kf;function kf(Fn,Mn){if(!Fn)throw new Error(Mn||"Assertion failed")}kf.equal=function(Fn,Mn,rs){if(Fn!=Mn)throw new Error(rs||"Assertion failed: "+Fn+" != "+Mn)};var fe$1=lr$2(function(Fn,Mn){var rs=Mn;function is(us,ds){if(Array.isArray(us))return us.slice();if(!us)return[];var hs=[];if(typeof us!="string"){for(var ps=0;ps<us.length;ps++)hs[ps]=us[ps]|0;return hs}if(ds==="hex"){us=us.replace(/[^a-z0-9]+/ig,""),us.length%2!==0&&(us="0"+us);for(var ps=0;ps<us.length;ps+=2)hs.push(parseInt(us[ps]+us[ps+1],16))}else for(var ps=0;ps<us.length;ps++){var io=us.charCodeAt(ps),fo=io>>8,mo=io&255;fo?hs.push(fo,mo):hs.push(mo)}return hs}rs.toArray=is;function os(us){return us.length===1?"0"+us:us}rs.zero2=os;function as(us){for(var ds="",hs=0;hs<us.length;hs++)ds+=os(us[hs].toString(16));return ds}rs.toHex=as,rs.encode=function(us,ds){return ds==="hex"?as(us):us}}),Gt$1=lr$2(function(Fn,Mn){var rs=Mn;rs.assert=qi$1,rs.toArray=fe$1.toArray,rs.zero2=fe$1.zero2,rs.toHex=fe$1.toHex,rs.encode=fe$1.encode;function is(hs,ps,io){var fo=new Array(Math.max(hs.bitLength(),io)+1);fo.fill(0);for(var mo=1<<ps+1,Ao=hs.clone(),$o=0;$o<fo.length;$o++){var Lo,Go=Ao.andln(mo-1);Ao.isOdd()?(Go>(mo>>1)-1?Lo=(mo>>1)-Go:Lo=Go,Ao.isubn(Lo)):Lo=0,fo[$o]=Lo,Ao.iushrn(1)}return fo}rs.getNAF=is;function os(hs,ps){var io=[[],[]];hs=hs.clone(),ps=ps.clone();for(var fo=0,mo=0,Ao;hs.cmpn(-fo)>0||ps.cmpn(-mo)>0;){var $o=hs.andln(3)+fo&3,Lo=ps.andln(3)+mo&3;$o===3&&($o=-1),Lo===3&&(Lo=-1);var Go;$o&1?(Ao=hs.andln(7)+fo&7,(Ao===3||Ao===5)&&Lo===2?Go=-$o:Go=$o):Go=0,io[0].push(Go);var Yo;Lo&1?(Ao=ps.andln(7)+mo&7,(Ao===3||Ao===5)&&$o===2?Yo=-Lo:Yo=Lo):Yo=0,io[1].push(Yo),2*fo===Go+1&&(fo=1-fo),2*mo===Yo+1&&(mo=1-mo),hs.iushrn(1),ps.iushrn(1)}return io}rs.getJSF=os;function as(hs,ps,io){var fo="_"+ps;hs.prototype[ps]=function(){return this[fo]!==void 0?this[fo]:this[fo]=io.call(this)}}rs.cachedProperty=as;function us(hs){return typeof hs=="string"?rs.toArray(hs,"hex"):hs}rs.parseBytes=us;function ds(hs){return new K(hs,"hex","le")}rs.intFromLE=ds}),Hr$1=Gt$1.getNAF,Ga=Gt$1.getJSF,Lr$1=Gt$1.assert;function Ce$2(Fn,Mn){this.type=Fn,this.p=new K(Mn.p,16),this.red=Mn.prime?K.red(Mn.prime):K.mont(this.p),this.zero=new K(0).toRed(this.red),this.one=new K(1).toRed(this.red),this.two=new K(2).toRed(this.red),this.n=Mn.n&&new K(Mn.n,16),this.g=Mn.g&&this.pointFromJSON(Mn.g,Mn.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var rs=this.n&&this.p.div(this.n);!rs||rs.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var $e=Ce$2;Ce$2.prototype.point=function(){throw new Error("Not implemented")},Ce$2.prototype.validate=function(){throw new Error("Not implemented")},Ce$2.prototype._fixedNafMul=function(Fn,Mn){Lr$1(Fn.precomputed);var rs=Fn._getDoubles(),is=Hr$1(Mn,1,this._bitLength),os=(1<<rs.step+1)-(rs.step%2===0?2:1);os/=3;var as=[],us,ds;for(us=0;us<is.length;us+=rs.step){ds=0;for(var hs=us+rs.step-1;hs>=us;hs--)ds=(ds<<1)+is[hs];as.push(ds)}for(var ps=this.jpoint(null,null,null),io=this.jpoint(null,null,null),fo=os;fo>0;fo--){for(us=0;us<as.length;us++)ds=as[us],ds===fo?io=io.mixedAdd(rs.points[us]):ds===-fo&&(io=io.mixedAdd(rs.points[us].neg()));ps=ps.add(io)}return ps.toP()},Ce$2.prototype._wnafMul=function(Fn,Mn){var rs=4,is=Fn._getNAFPoints(rs);rs=is.wnd;for(var os=is.points,as=Hr$1(Mn,rs,this._bitLength),us=this.jpoint(null,null,null),ds=as.length-1;ds>=0;ds--){for(var hs=0;ds>=0&&as[ds]===0;ds--)hs++;if(ds>=0&&hs++,us=us.dblp(hs),ds<0)break;var ps=as[ds];Lr$1(ps!==0),Fn.type==="affine"?ps>0?us=us.mixedAdd(os[ps-1>>1]):us=us.mixedAdd(os[-ps-1>>1].neg()):ps>0?us=us.add(os[ps-1>>1]):us=us.add(os[-ps-1>>1].neg())}return Fn.type==="affine"?us.toP():us},Ce$2.prototype._wnafMulAdd=function(Fn,Mn,rs,is,os){var as=this._wnafT1,us=this._wnafT2,ds=this._wnafT3,hs=0,ps,io,fo;for(ps=0;ps<is;ps++){fo=Mn[ps];var mo=fo._getNAFPoints(Fn);as[ps]=mo.wnd,us[ps]=mo.points}for(ps=is-1;ps>=1;ps-=2){var Ao=ps-1,$o=ps;if(as[Ao]!==1||as[$o]!==1){ds[Ao]=Hr$1(rs[Ao],as[Ao],this._bitLength),ds[$o]=Hr$1(rs[$o],as[$o],this._bitLength),hs=Math.max(ds[Ao].length,hs),hs=Math.max(ds[$o].length,hs);continue}var Lo=[Mn[Ao],null,null,Mn[$o]];Mn[Ao].y.cmp(Mn[$o].y)===0?(Lo[1]=Mn[Ao].add(Mn[$o]),Lo[2]=Mn[Ao].toJ().mixedAdd(Mn[$o].neg())):Mn[Ao].y.cmp(Mn[$o].y.redNeg())===0?(Lo[1]=Mn[Ao].toJ().mixedAdd(Mn[$o]),Lo[2]=Mn[Ao].add(Mn[$o].neg())):(Lo[1]=Mn[Ao].toJ().mixedAdd(Mn[$o]),Lo[2]=Mn[Ao].toJ().mixedAdd(Mn[$o].neg()));var Go=[-3,-1,-5,-7,0,7,5,1,3],Yo=Ga(rs[Ao],rs[$o]);for(hs=Math.max(Yo[0].length,hs),ds[Ao]=new Array(hs),ds[$o]=new Array(hs),io=0;io<hs;io++){var Wo=Yo[0][io]|0,Jo=Yo[1][io]|0;ds[Ao][io]=Go[(Wo+1)*3+(Jo+1)],ds[$o][io]=0,us[Ao]=Lo}}var xl=this.jpoint(null,null,null),_l=this._wnafT4;for(ps=hs;ps>=0;ps--){for(var Tl=0;ps>=0;){var Sl=!0;for(io=0;io<is;io++)_l[io]=ds[io][ps]|0,_l[io]!==0&&(Sl=!1);if(!Sl)break;Tl++,ps--}if(ps>=0&&Tl++,xl=xl.dblp(Tl),ps<0)break;for(io=0;io<is;io++){var $l=_l[io];$l!==0&&($l>0?fo=us[io][$l-1>>1]:$l<0&&(fo=us[io][-$l-1>>1].neg()),fo.type==="affine"?xl=xl.mixedAdd(fo):xl=xl.add(fo))}}for(ps=0;ps<is;ps++)us[ps]=null;return os?xl:xl.toP()};function Zt$1(Fn,Mn){this.curve=Fn,this.type=Mn,this.precomputed=null}Ce$2.BasePoint=Zt$1,Zt$1.prototype.eq=function(){throw new Error("Not implemented")},Zt$1.prototype.validate=function(){return this.curve.validate(this)},Ce$2.prototype.decodePoint=function(Fn,Mn){Fn=Gt$1.toArray(Fn,Mn);var rs=this.p.byteLength();if((Fn[0]===4||Fn[0]===6||Fn[0]===7)&&Fn.length-1===2*rs){Fn[0]===6?Lr$1(Fn[Fn.length-1]%2===0):Fn[0]===7&&Lr$1(Fn[Fn.length-1]%2===1);var is=this.point(Fn.slice(1,1+rs),Fn.slice(1+rs,1+2*rs));return is}else if((Fn[0]===2||Fn[0]===3)&&Fn.length-1===rs)return this.pointFromX(Fn.slice(1,1+rs),Fn[0]===3);throw new Error("Unknown point format")},Zt$1.prototype.encodeCompressed=function(Fn){return this.encode(Fn,!0)},Zt$1.prototype._encode=function(Fn){var Mn=this.curve.p.byteLength(),rs=this.getX().toArray("be",Mn);return Fn?[this.getY().isEven()?2:3].concat(rs):[4].concat(rs,this.getY().toArray("be",Mn))},Zt$1.prototype.encode=function(Fn,Mn){return Gt$1.encode(this._encode(Mn),Fn)},Zt$1.prototype.precompute=function(Fn){if(this.precomputed)return this;var Mn={doubles:null,naf:null,beta:null};return Mn.naf=this._getNAFPoints(8),Mn.doubles=this._getDoubles(4,Fn),Mn.beta=this._getBeta(),this.precomputed=Mn,this},Zt$1.prototype._hasDoubles=function(Fn){if(!this.precomputed)return!1;var Mn=this.precomputed.doubles;return Mn?Mn.points.length>=Math.ceil((Fn.bitLength()+1)/Mn.step):!1},Zt$1.prototype._getDoubles=function(Fn,Mn){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var rs=[this],is=this,os=0;os<Mn;os+=Fn){for(var as=0;as<Fn;as++)is=is.dbl();rs.push(is)}return{step:Fn,points:rs}},Zt$1.prototype._getNAFPoints=function(Fn){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var Mn=[this],rs=(1<<Fn)-1,is=rs===1?null:this.dbl(),os=1;os<rs;os++)Mn[os]=Mn[os-1].add(is);return{wnd:Fn,points:Mn}},Zt$1.prototype._getBeta=function(){return null},Zt$1.prototype.dblp=function(Fn){for(var Mn=this,rs=0;rs<Fn;rs++)Mn=Mn.dbl();return Mn};var Ki=lr$2(function(Fn){typeof Object.create=="function"?Fn.exports=function(Mn,rs){rs&&(Mn.super_=rs,Mn.prototype=Object.create(rs.prototype,{constructor:{value:Mn,enumerable:!1,writable:!0,configurable:!0}}))}:Fn.exports=function(Mn,rs){if(rs){Mn.super_=rs;var is=function(){};is.prototype=rs.prototype,Mn.prototype=new is,Mn.prototype.constructor=Mn}}}),Ya=Gt$1.assert;function te$1(Fn){$e.call(this,"short",Fn),this.a=new K(Fn.a,16).toRed(this.red),this.b=new K(Fn.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(Fn),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Ki(te$1,$e);var Va=te$1;te$1.prototype._getEndomorphism=function(Fn){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var Mn,rs;if(Fn.beta)Mn=new K(Fn.beta,16).toRed(this.red);else{var is=this._getEndoRoots(this.p);Mn=is[0].cmp(is[1])<0?is[0]:is[1],Mn=Mn.toRed(this.red)}if(Fn.lambda)rs=new K(Fn.lambda,16);else{var os=this._getEndoRoots(this.n);this.g.mul(os[0]).x.cmp(this.g.x.redMul(Mn))===0?rs=os[0]:(rs=os[1],Ya(this.g.mul(rs).x.cmp(this.g.x.redMul(Mn))===0))}var as;return Fn.basis?as=Fn.basis.map(function(us){return{a:new K(us.a,16),b:new K(us.b,16)}}):as=this._getEndoBasis(rs),{beta:Mn,lambda:rs,basis:as}}},te$1.prototype._getEndoRoots=function(Fn){var Mn=Fn===this.p?this.red:K.mont(Fn),rs=new K(2).toRed(Mn).redInvm(),is=rs.redNeg(),os=new K(3).toRed(Mn).redNeg().redSqrt().redMul(rs),as=is.redAdd(os).fromRed(),us=is.redSub(os).fromRed();return[as,us]},te$1.prototype._getEndoBasis=function(Fn){for(var Mn=this.n.ushrn(Math.floor(this.n.bitLength()/2)),rs=Fn,is=this.n.clone(),os=new K(1),as=new K(0),us=new K(0),ds=new K(1),hs,ps,io,fo,mo,Ao,$o,Lo=0,Go,Yo;rs.cmpn(0)!==0;){var Wo=is.div(rs);Go=is.sub(Wo.mul(rs)),Yo=us.sub(Wo.mul(os));var Jo=ds.sub(Wo.mul(as));if(!io&&Go.cmp(Mn)<0)hs=$o.neg(),ps=os,io=Go.neg(),fo=Yo;else if(io&&++Lo===2)break;$o=Go,is=rs,rs=Go,us=os,os=Yo,ds=as,as=Jo}mo=Go.neg(),Ao=Yo;var xl=io.sqr().add(fo.sqr()),_l=mo.sqr().add(Ao.sqr());return _l.cmp(xl)>=0&&(mo=hs,Ao=ps),io.negative&&(io=io.neg(),fo=fo.neg()),mo.negative&&(mo=mo.neg(),Ao=Ao.neg()),[{a:io,b:fo},{a:mo,b:Ao}]},te$1.prototype._endoSplit=function(Fn){var Mn=this.endo.basis,rs=Mn[0],is=Mn[1],os=is.b.mul(Fn).divRound(this.n),as=rs.b.neg().mul(Fn).divRound(this.n),us=os.mul(rs.a),ds=as.mul(is.a),hs=os.mul(rs.b),ps=as.mul(is.b),io=Fn.sub(us).sub(ds),fo=hs.add(ps).neg();return{k1:io,k2:fo}},te$1.prototype.pointFromX=function(Fn,Mn){Fn=new K(Fn,16),Fn.red||(Fn=Fn.toRed(this.red));var rs=Fn.redSqr().redMul(Fn).redIAdd(Fn.redMul(this.a)).redIAdd(this.b),is=rs.redSqrt();if(is.redSqr().redSub(rs).cmp(this.zero)!==0)throw new Error("invalid point");var os=is.fromRed().isOdd();return(Mn&&!os||!Mn&&os)&&(is=is.redNeg()),this.point(Fn,is)},te$1.prototype.validate=function(Fn){if(Fn.inf)return!0;var Mn=Fn.x,rs=Fn.y,is=this.a.redMul(Mn),os=Mn.redSqr().redMul(Mn).redIAdd(is).redIAdd(this.b);return rs.redSqr().redISub(os).cmpn(0)===0},te$1.prototype._endoWnafMulAdd=function(Fn,Mn,rs){for(var is=this._endoWnafT1,os=this._endoWnafT2,as=0;as<Fn.length;as++){var us=this._endoSplit(Mn[as]),ds=Fn[as],hs=ds._getBeta();us.k1.negative&&(us.k1.ineg(),ds=ds.neg(!0)),us.k2.negative&&(us.k2.ineg(),hs=hs.neg(!0)),is[as*2]=ds,is[as*2+1]=hs,os[as*2]=us.k1,os[as*2+1]=us.k2}for(var ps=this._wnafMulAdd(1,is,os,as*2,rs),io=0;io<as*2;io++)is[io]=null,os[io]=null;return ps};function Dt$1(Fn,Mn,rs,is){$e.BasePoint.call(this,Fn,"affine"),Mn===null&&rs===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new K(Mn,16),this.y=new K(rs,16),is&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}Ki(Dt$1,$e.BasePoint),te$1.prototype.point=function(Fn,Mn,rs){return new Dt$1(this,Fn,Mn,rs)},te$1.prototype.pointFromJSON=function(Fn,Mn){return Dt$1.fromJSON(this,Fn,Mn)},Dt$1.prototype._getBeta=function(){if(this.curve.endo){var Fn=this.precomputed;if(Fn&&Fn.beta)return Fn.beta;var Mn=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(Fn){var rs=this.curve,is=function(os){return rs.point(os.x.redMul(rs.endo.beta),os.y)};Fn.beta=Mn,Mn.precomputed={beta:null,naf:Fn.naf&&{wnd:Fn.naf.wnd,points:Fn.naf.points.map(is)},doubles:Fn.doubles&&{step:Fn.doubles.step,points:Fn.doubles.points.map(is)}}}return Mn}},Dt$1.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Dt$1.fromJSON=function(Fn,Mn,rs){typeof Mn=="string"&&(Mn=JSON.parse(Mn));var is=Fn.point(Mn[0],Mn[1],rs);if(!Mn[2])return is;function os(us){return Fn.point(us[0],us[1],rs)}var as=Mn[2];return is.precomputed={beta:null,doubles:as.doubles&&{step:as.doubles.step,points:[is].concat(as.doubles.points.map(os))},naf:as.naf&&{wnd:as.naf.wnd,points:[is].concat(as.naf.points.map(os))}},is},Dt$1.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Dt$1.prototype.isInfinity=function(){return this.inf},Dt$1.prototype.add=function(Fn){if(this.inf)return Fn;if(Fn.inf)return this;if(this.eq(Fn))return this.dbl();if(this.neg().eq(Fn))return this.curve.point(null,null);if(this.x.cmp(Fn.x)===0)return this.curve.point(null,null);var Mn=this.y.redSub(Fn.y);Mn.cmpn(0)!==0&&(Mn=Mn.redMul(this.x.redSub(Fn.x).redInvm()));var rs=Mn.redSqr().redISub(this.x).redISub(Fn.x),is=Mn.redMul(this.x.redSub(rs)).redISub(this.y);return this.curve.point(rs,is)},Dt$1.prototype.dbl=function(){if(this.inf)return this;var Fn=this.y.redAdd(this.y);if(Fn.cmpn(0)===0)return this.curve.point(null,null);var Mn=this.curve.a,rs=this.x.redSqr(),is=Fn.redInvm(),os=rs.redAdd(rs).redIAdd(rs).redIAdd(Mn).redMul(is),as=os.redSqr().redISub(this.x.redAdd(this.x)),us=os.redMul(this.x.redSub(as)).redISub(this.y);return this.curve.point(as,us)},Dt$1.prototype.getX=function(){return this.x.fromRed()},Dt$1.prototype.getY=function(){return this.y.fromRed()},Dt$1.prototype.mul=function(Fn){return Fn=new K(Fn,16),this.isInfinity()?this:this._hasDoubles(Fn)?this.curve._fixedNafMul(this,Fn):this.curve.endo?this.curve._endoWnafMulAdd([this],[Fn]):this.curve._wnafMul(this,Fn)},Dt$1.prototype.mulAdd=function(Fn,Mn,rs){var is=[this,Mn],os=[Fn,rs];return this.curve.endo?this.curve._endoWnafMulAdd(is,os):this.curve._wnafMulAdd(1,is,os,2)},Dt$1.prototype.jmulAdd=function(Fn,Mn,rs){var is=[this,Mn],os=[Fn,rs];return this.curve.endo?this.curve._endoWnafMulAdd(is,os,!0):this.curve._wnafMulAdd(1,is,os,2,!0)},Dt$1.prototype.eq=function(Fn){return this===Fn||this.inf===Fn.inf&&(this.inf||this.x.cmp(Fn.x)===0&&this.y.cmp(Fn.y)===0)},Dt$1.prototype.neg=function(Fn){if(this.inf)return this;var Mn=this.curve.point(this.x,this.y.redNeg());if(Fn&&this.precomputed){var rs=this.precomputed,is=function(os){return os.neg()};Mn.precomputed={naf:rs.naf&&{wnd:rs.naf.wnd,points:rs.naf.points.map(is)},doubles:rs.doubles&&{step:rs.doubles.step,points:rs.doubles.points.map(is)}}}return Mn},Dt$1.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var Fn=this.curve.jpoint(this.x,this.y,this.curve.one);return Fn};function Ft$1(Fn,Mn,rs,is){$e.BasePoint.call(this,Fn,"jacobian"),Mn===null&&rs===null&&is===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new K(0)):(this.x=new K(Mn,16),this.y=new K(rs,16),this.z=new K(is,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Ki(Ft$1,$e.BasePoint),te$1.prototype.jpoint=function(Fn,Mn,rs){return new Ft$1(this,Fn,Mn,rs)},Ft$1.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var Fn=this.z.redInvm(),Mn=Fn.redSqr(),rs=this.x.redMul(Mn),is=this.y.redMul(Mn).redMul(Fn);return this.curve.point(rs,is)},Ft$1.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ft$1.prototype.add=function(Fn){if(this.isInfinity())return Fn;if(Fn.isInfinity())return this;var Mn=Fn.z.redSqr(),rs=this.z.redSqr(),is=this.x.redMul(Mn),os=Fn.x.redMul(rs),as=this.y.redMul(Mn.redMul(Fn.z)),us=Fn.y.redMul(rs.redMul(this.z)),ds=is.redSub(os),hs=as.redSub(us);if(ds.cmpn(0)===0)return hs.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ps=ds.redSqr(),io=ps.redMul(ds),fo=is.redMul(ps),mo=hs.redSqr().redIAdd(io).redISub(fo).redISub(fo),Ao=hs.redMul(fo.redISub(mo)).redISub(as.redMul(io)),$o=this.z.redMul(Fn.z).redMul(ds);return this.curve.jpoint(mo,Ao,$o)},Ft$1.prototype.mixedAdd=function(Fn){if(this.isInfinity())return Fn.toJ();if(Fn.isInfinity())return this;var Mn=this.z.redSqr(),rs=this.x,is=Fn.x.redMul(Mn),os=this.y,as=Fn.y.redMul(Mn).redMul(this.z),us=rs.redSub(is),ds=os.redSub(as);if(us.cmpn(0)===0)return ds.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var hs=us.redSqr(),ps=hs.redMul(us),io=rs.redMul(hs),fo=ds.redSqr().redIAdd(ps).redISub(io).redISub(io),mo=ds.redMul(io.redISub(fo)).redISub(os.redMul(ps)),Ao=this.z.redMul(us);return this.curve.jpoint(fo,mo,Ao)},Ft$1.prototype.dblp=function(Fn){if(Fn===0)return this;if(this.isInfinity())return this;if(!Fn)return this.dbl();var Mn;if(this.curve.zeroA||this.curve.threeA){var rs=this;for(Mn=0;Mn<Fn;Mn++)rs=rs.dbl();return rs}var is=this.curve.a,os=this.curve.tinv,as=this.x,us=this.y,ds=this.z,hs=ds.redSqr().redSqr(),ps=us.redAdd(us);for(Mn=0;Mn<Fn;Mn++){var io=as.redSqr(),fo=ps.redSqr(),mo=fo.redSqr(),Ao=io.redAdd(io).redIAdd(io).redIAdd(is.redMul(hs)),$o=as.redMul(fo),Lo=Ao.redSqr().redISub($o.redAdd($o)),Go=$o.redISub(Lo),Yo=Ao.redMul(Go);Yo=Yo.redIAdd(Yo).redISub(mo);var Wo=ps.redMul(ds);Mn+1<Fn&&(hs=hs.redMul(mo)),as=Lo,ds=Wo,ps=Yo}return this.curve.jpoint(as,ps.redMul(os),ds)},Ft$1.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Ft$1.prototype._zeroDbl=function(){var Fn,Mn,rs;if(this.zOne){var is=this.x.redSqr(),os=this.y.redSqr(),as=os.redSqr(),us=this.x.redAdd(os).redSqr().redISub(is).redISub(as);us=us.redIAdd(us);var ds=is.redAdd(is).redIAdd(is),hs=ds.redSqr().redISub(us).redISub(us),ps=as.redIAdd(as);ps=ps.redIAdd(ps),ps=ps.redIAdd(ps),Fn=hs,Mn=ds.redMul(us.redISub(hs)).redISub(ps),rs=this.y.redAdd(this.y)}else{var io=this.x.redSqr(),fo=this.y.redSqr(),mo=fo.redSqr(),Ao=this.x.redAdd(fo).redSqr().redISub(io).redISub(mo);Ao=Ao.redIAdd(Ao);var $o=io.redAdd(io).redIAdd(io),Lo=$o.redSqr(),Go=mo.redIAdd(mo);Go=Go.redIAdd(Go),Go=Go.redIAdd(Go),Fn=Lo.redISub(Ao).redISub(Ao),Mn=$o.redMul(Ao.redISub(Fn)).redISub(Go),rs=this.y.redMul(this.z),rs=rs.redIAdd(rs)}return this.curve.jpoint(Fn,Mn,rs)},Ft$1.prototype._threeDbl=function(){var Fn,Mn,rs;if(this.zOne){var is=this.x.redSqr(),os=this.y.redSqr(),as=os.redSqr(),us=this.x.redAdd(os).redSqr().redISub(is).redISub(as);us=us.redIAdd(us);var ds=is.redAdd(is).redIAdd(is).redIAdd(this.curve.a),hs=ds.redSqr().redISub(us).redISub(us);Fn=hs;var ps=as.redIAdd(as);ps=ps.redIAdd(ps),ps=ps.redIAdd(ps),Mn=ds.redMul(us.redISub(hs)).redISub(ps),rs=this.y.redAdd(this.y)}else{var io=this.z.redSqr(),fo=this.y.redSqr(),mo=this.x.redMul(fo),Ao=this.x.redSub(io).redMul(this.x.redAdd(io));Ao=Ao.redAdd(Ao).redIAdd(Ao);var $o=mo.redIAdd(mo);$o=$o.redIAdd($o);var Lo=$o.redAdd($o);Fn=Ao.redSqr().redISub(Lo),rs=this.y.redAdd(this.z).redSqr().redISub(fo).redISub(io);var Go=fo.redSqr();Go=Go.redIAdd(Go),Go=Go.redIAdd(Go),Go=Go.redIAdd(Go),Mn=Ao.redMul($o.redISub(Fn)).redISub(Go)}return this.curve.jpoint(Fn,Mn,rs)},Ft$1.prototype._dbl=function(){var Fn=this.curve.a,Mn=this.x,rs=this.y,is=this.z,os=is.redSqr().redSqr(),as=Mn.redSqr(),us=rs.redSqr(),ds=as.redAdd(as).redIAdd(as).redIAdd(Fn.redMul(os)),hs=Mn.redAdd(Mn);hs=hs.redIAdd(hs);var ps=hs.redMul(us),io=ds.redSqr().redISub(ps.redAdd(ps)),fo=ps.redISub(io),mo=us.redSqr();mo=mo.redIAdd(mo),mo=mo.redIAdd(mo),mo=mo.redIAdd(mo);var Ao=ds.redMul(fo).redISub(mo),$o=rs.redAdd(rs).redMul(is);return this.curve.jpoint(io,Ao,$o)},Ft$1.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var Fn=this.x.redSqr(),Mn=this.y.redSqr(),rs=this.z.redSqr(),is=Mn.redSqr(),os=Fn.redAdd(Fn).redIAdd(Fn),as=os.redSqr(),us=this.x.redAdd(Mn).redSqr().redISub(Fn).redISub(is);us=us.redIAdd(us),us=us.redAdd(us).redIAdd(us),us=us.redISub(as);var ds=us.redSqr(),hs=is.redIAdd(is);hs=hs.redIAdd(hs),hs=hs.redIAdd(hs),hs=hs.redIAdd(hs);var ps=os.redIAdd(us).redSqr().redISub(as).redISub(ds).redISub(hs),io=Mn.redMul(ps);io=io.redIAdd(io),io=io.redIAdd(io);var fo=this.x.redMul(ds).redISub(io);fo=fo.redIAdd(fo),fo=fo.redIAdd(fo);var mo=this.y.redMul(ps.redMul(hs.redISub(ps)).redISub(us.redMul(ds)));mo=mo.redIAdd(mo),mo=mo.redIAdd(mo),mo=mo.redIAdd(mo);var Ao=this.z.redAdd(us).redSqr().redISub(rs).redISub(ds);return this.curve.jpoint(fo,mo,Ao)},Ft$1.prototype.mul=function(Fn,Mn){return Fn=new K(Fn,Mn),this.curve._wnafMul(this,Fn)},Ft$1.prototype.eq=function(Fn){if(Fn.type==="affine")return this.eq(Fn.toJ());if(this===Fn)return!0;var Mn=this.z.redSqr(),rs=Fn.z.redSqr();if(this.x.redMul(rs).redISub(Fn.x.redMul(Mn)).cmpn(0)!==0)return!1;var is=Mn.redMul(this.z),os=rs.redMul(Fn.z);return this.y.redMul(os).redISub(Fn.y.redMul(is)).cmpn(0)===0},Ft$1.prototype.eqXToP=function(Fn){var Mn=this.z.redSqr(),rs=Fn.toRed(this.curve.red).redMul(Mn);if(this.x.cmp(rs)===0)return!0;for(var is=Fn.clone(),os=this.curve.redN.redMul(Mn);;){if(is.iadd(this.curve.n),is.cmp(this.curve.p)>=0)return!1;if(rs.redIAdd(os),this.x.cmp(rs)===0)return!0}},Ft$1.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Ft$1.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var zr$1=lr$2(function(Fn,Mn){var rs=Mn;rs.base=$e,rs.short=Va,rs.mont=null,rs.edwards=null}),jr$1=lr$2(function(Fn,Mn){var rs=Mn,is=Gt$1.assert;function os(ds){ds.type==="short"?this.curve=new zr$1.short(ds):ds.type==="edwards"?this.curve=new zr$1.edwards(ds):this.curve=new zr$1.mont(ds),this.g=this.curve.g,this.n=this.curve.n,this.hash=ds.hash,is(this.g.validate(),"Invalid curve"),is(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}rs.PresetCurve=os;function as(ds,hs){Object.defineProperty(rs,ds,{configurable:!0,enumerable:!0,get:function(){var ps=new os(hs);return Object.defineProperty(rs,ds,{configurable:!0,enumerable:!0,value:ps}),ps}})}as("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:se.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),as("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:se.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),as("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:se.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),as("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:se.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),as("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:se.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),as("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:se.sha256,gRed:!1,g:["9"]}),as("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:se.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var us;try{us=null.crash()}catch{us=void 0}as("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:se.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",us]})});function Re(Fn){if(!(this instanceof Re))return new Re(Fn);this.hash=Fn.hash,this.predResist=!!Fn.predResist,this.outLen=this.hash.outSize,this.minEntropy=Fn.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var Mn=fe$1.toArray(Fn.entropy,Fn.entropyEnc||"hex"),rs=fe$1.toArray(Fn.nonce,Fn.nonceEnc||"hex"),is=fe$1.toArray(Fn.pers,Fn.persEnc||"hex");qi$1(Mn.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(Mn,rs,is)}var qf=Re;Re.prototype._init=function(Fn,Mn,rs){var is=Fn.concat(Mn).concat(rs);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var os=0;os<this.V.length;os++)this.K[os]=0,this.V[os]=1;this._update(is),this._reseed=1,this.reseedInterval=281474976710656},Re.prototype._hmac=function(){return new se.hmac(this.hash,this.K)},Re.prototype._update=function(Fn){var Mn=this._hmac().update(this.V).update([0]);Fn&&(Mn=Mn.update(Fn)),this.K=Mn.digest(),this.V=this._hmac().update(this.V).digest(),Fn&&(this.K=this._hmac().update(this.V).update([1]).update(Fn).digest(),this.V=this._hmac().update(this.V).digest())},Re.prototype.reseed=function(Fn,Mn,rs,is){typeof Mn!="string"&&(is=rs,rs=Mn,Mn=null),Fn=fe$1.toArray(Fn,Mn),rs=fe$1.toArray(rs,is),qi$1(Fn.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Fn.concat(rs||[])),this._reseed=1},Re.prototype.generate=function(Fn,Mn,rs,is){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof Mn!="string"&&(is=rs,rs=Mn,Mn=null),rs&&(rs=fe$1.toArray(rs,is||"hex"),this._update(rs));for(var os=[];os.length<Fn;)this.V=this._hmac().update(this.V).digest(),os=os.concat(this.V);var as=os.slice(0,Fn);return this._update(rs),this._reseed++,fe$1.encode(as,Mn)};var Hi=Gt$1.assert;function kt$1(Fn,Mn){this.ec=Fn,this.priv=null,this.pub=null,Mn.priv&&this._importPrivate(Mn.priv,Mn.privEnc),Mn.pub&&this._importPublic(Mn.pub,Mn.pubEnc)}var Li=kt$1;kt$1.fromPublic=function(Fn,Mn,rs){return Mn instanceof kt$1?Mn:new kt$1(Fn,{pub:Mn,pubEnc:rs})},kt$1.fromPrivate=function(Fn,Mn,rs){return Mn instanceof kt$1?Mn:new kt$1(Fn,{priv:Mn,privEnc:rs})},kt$1.prototype.validate=function(){var Fn=this.getPublic();return Fn.isInfinity()?{result:!1,reason:"Invalid public key"}:Fn.validate()?Fn.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},kt$1.prototype.getPublic=function(Fn,Mn){return typeof Fn=="string"&&(Mn=Fn,Fn=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),Mn?this.pub.encode(Mn,Fn):this.pub},kt$1.prototype.getPrivate=function(Fn){return Fn==="hex"?this.priv.toString(16,2):this.priv},kt$1.prototype._importPrivate=function(Fn,Mn){this.priv=new K(Fn,Mn||16),this.priv=this.priv.umod(this.ec.curve.n)},kt$1.prototype._importPublic=function(Fn,Mn){if(Fn.x||Fn.y){this.ec.curve.type==="mont"?Hi(Fn.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Hi(Fn.x&&Fn.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(Fn.x,Fn.y);return}this.pub=this.ec.curve.decodePoint(Fn,Mn)},kt$1.prototype.derive=function(Fn){return Fn.validate()||Hi(Fn.validate(),"public point not validated"),Fn.mul(this.priv).getX()},kt$1.prototype.sign=function(Fn,Mn,rs){return this.ec.sign(Fn,this,Mn,rs)},kt$1.prototype.verify=function(Fn,Mn){return this.ec.verify(Fn,Mn,this)},kt$1.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Wa$1=Gt$1.assert;function Qr$1(Fn,Mn){if(Fn instanceof Qr$1)return Fn;this._importDER(Fn,Mn)||(Wa$1(Fn.r&&Fn.s,"Signature without r or s"),this.r=new K(Fn.r,16),this.s=new K(Fn.s,16),Fn.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=Fn.recoveryParam)}var Jr$1=Qr$1;function Xa(){this.place=0}function zi(Fn,Mn){var rs=Fn[Mn.place++];if(!(rs&128))return rs;var is=rs&15;if(is===0||is>4)return!1;for(var os=0,as=0,us=Mn.place;as<is;as++,us++)os<<=8,os|=Fn[us],os>>>=0;return os<=127?!1:(Mn.place=us,os)}function Kf(Fn){for(var Mn=0,rs=Fn.length-1;!Fn[Mn]&&!(Fn[Mn+1]&128)&&Mn<rs;)Mn++;return Mn===0?Fn:Fn.slice(Mn)}Qr$1.prototype._importDER=function(Fn,Mn){Fn=Gt$1.toArray(Fn,Mn);var rs=new Xa;if(Fn[rs.place++]!==48)return!1;var is=zi(Fn,rs);if(is===!1||is+rs.place!==Fn.length||Fn[rs.place++]!==2)return!1;var os=zi(Fn,rs);if(os===!1)return!1;var as=Fn.slice(rs.place,os+rs.place);if(rs.place+=os,Fn[rs.place++]!==2)return!1;var us=zi(Fn,rs);if(us===!1||Fn.length!==us+rs.place)return!1;var ds=Fn.slice(rs.place,us+rs.place);if(as[0]===0)if(as[1]&128)as=as.slice(1);else return!1;if(ds[0]===0)if(ds[1]&128)ds=ds.slice(1);else return!1;return this.r=new K(as),this.s=new K(ds),this.recoveryParam=null,!0};function ji(Fn,Mn){if(Mn<128){Fn.push(Mn);return}var rs=1+(Math.log(Mn)/Math.LN2>>>3);for(Fn.push(rs|128);--rs;)Fn.push(Mn>>>(rs<<3)&255);Fn.push(Mn)}Qr$1.prototype.toDER=function(Fn){var Mn=this.r.toArray(),rs=this.s.toArray();for(Mn[0]&128&&(Mn=[0].concat(Mn)),rs[0]&128&&(rs=[0].concat(rs)),Mn=Kf(Mn),rs=Kf(rs);!rs[0]&&!(rs[1]&128);)rs=rs.slice(1);var is=[2];ji(is,Mn.length),is=is.concat(Mn),is.push(2),ji(is,rs.length);var os=is.concat(rs),as=[48];return ji(as,os.length),as=as.concat(os),Gt$1.encode(as,Fn)};var $a$1=function(){throw new Error("unsupported")},Hf=Gt$1.assert;function ee$1(Fn){if(!(this instanceof ee$1))return new ee$1(Fn);typeof Fn=="string"&&(Hf(Object.prototype.hasOwnProperty.call(jr$1,Fn),"Unknown curve "+Fn),Fn=jr$1[Fn]),Fn instanceof jr$1.PresetCurve&&(Fn={curve:Fn}),this.curve=Fn.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=Fn.curve.g,this.g.precompute(Fn.curve.n.bitLength()+1),this.hash=Fn.hash||Fn.curve.hash}var Za=ee$1;ee$1.prototype.keyPair=function(Fn){return new Li(this,Fn)},ee$1.prototype.keyFromPrivate=function(Fn,Mn){return Li.fromPrivate(this,Fn,Mn)},ee$1.prototype.keyFromPublic=function(Fn,Mn){return Li.fromPublic(this,Fn,Mn)},ee$1.prototype.genKeyPair=function(Fn){Fn||(Fn={});for(var Mn=new qf({hash:this.hash,pers:Fn.pers,persEnc:Fn.persEnc||"utf8",entropy:Fn.entropy||$a$1(this.hash.hmacStrength),entropyEnc:Fn.entropy&&Fn.entropyEnc||"utf8",nonce:this.n.toArray()}),rs=this.n.byteLength(),is=this.n.sub(new K(2));;){var os=new K(Mn.generate(rs));if(!(os.cmp(is)>0))return os.iaddn(1),this.keyFromPrivate(os)}},ee$1.prototype._truncateToN=function(Fn,Mn){var rs=Fn.byteLength()*8-this.n.bitLength();return rs>0&&(Fn=Fn.ushrn(rs)),!Mn&&Fn.cmp(this.n)>=0?Fn.sub(this.n):Fn},ee$1.prototype.sign=function(Fn,Mn,rs,is){typeof rs=="object"&&(is=rs,rs=null),is||(is={}),Mn=this.keyFromPrivate(Mn,rs),Fn=this._truncateToN(new K(Fn,16));for(var os=this.n.byteLength(),as=Mn.getPrivate().toArray("be",os),us=Fn.toArray("be",os),ds=new qf({hash:this.hash,entropy:as,nonce:us,pers:is.pers,persEnc:is.persEnc||"utf8"}),hs=this.n.sub(new K(1)),ps=0;;ps++){var io=is.k?is.k(ps):new K(ds.generate(this.n.byteLength()));if(io=this._truncateToN(io,!0),!(io.cmpn(1)<=0||io.cmp(hs)>=0)){var fo=this.g.mul(io);if(!fo.isInfinity()){var mo=fo.getX(),Ao=mo.umod(this.n);if(Ao.cmpn(0)!==0){var $o=io.invm(this.n).mul(Ao.mul(Mn.getPrivate()).iadd(Fn));if($o=$o.umod(this.n),$o.cmpn(0)!==0){var Lo=(fo.getY().isOdd()?1:0)|(mo.cmp(Ao)!==0?2:0);return is.canonical&&$o.cmp(this.nh)>0&&($o=this.n.sub($o),Lo^=1),new Jr$1({r:Ao,s:$o,recoveryParam:Lo})}}}}}},ee$1.prototype.verify=function(Fn,Mn,rs,is){Fn=this._truncateToN(new K(Fn,16)),rs=this.keyFromPublic(rs,is),Mn=new Jr$1(Mn,"hex");var os=Mn.r,as=Mn.s;if(os.cmpn(1)<0||os.cmp(this.n)>=0||as.cmpn(1)<0||as.cmp(this.n)>=0)return!1;var us=as.invm(this.n),ds=us.mul(Fn).umod(this.n),hs=us.mul(os).umod(this.n),ps;return this.curve._maxwellTrick?(ps=this.g.jmulAdd(ds,rs.getPublic(),hs),ps.isInfinity()?!1:ps.eqXToP(os)):(ps=this.g.mulAdd(ds,rs.getPublic(),hs),ps.isInfinity()?!1:ps.getX().umod(this.n).cmp(os)===0)},ee$1.prototype.recoverPubKey=function(Fn,Mn,rs,is){Hf((3&rs)===rs,"The recovery param is more than two bits"),Mn=new Jr$1(Mn,is);var os=this.n,as=new K(Fn),us=Mn.r,ds=Mn.s,hs=rs&1,ps=rs>>1;if(us.cmp(this.curve.p.umod(this.curve.n))>=0&&ps)throw new Error("Unable to find sencond key candinate");ps?us=this.curve.pointFromX(us.add(this.curve.n),hs):us=this.curve.pointFromX(us,hs);var io=Mn.r.invm(os),fo=os.sub(as).mul(io).umod(os),mo=ds.mul(io).umod(os);return this.g.mulAdd(fo,us,mo)},ee$1.prototype.getKeyRecoveryParam=function(Fn,Mn,rs,is){if(Mn=new Jr$1(Mn,is),Mn.recoveryParam!==null)return Mn.recoveryParam;for(var os=0;os<4;os++){var as;try{as=this.recoverPubKey(Fn,Mn,os)}catch{continue}if(as.eq(rs))return os}throw new Error("Unable to find valid recovery factor")};var tu=lr$2(function(Fn,Mn){var rs=Mn;rs.version="6.5.4",rs.utils=Gt$1,rs.rand=function(){throw new Error("unsupported")},rs.curve=zr$1,rs.curves=jr$1,rs.ec=Za,rs.eddsa=null}),eu=tu.ec;const ru="signing-key/5.7.0",Qi=new z$2(ru);let Ji=null;function ve$1(){return Ji||(Ji=new eu("secp256k1")),Ji}class iu{constructor(Mn){wr$1(this,"curve","secp256k1"),wr$1(this,"privateKey",Kt$1(Mn)),Us$1(this.privateKey)!==32&&Qi.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const rs=ve$1().keyFromPrivate(Ot$1(this.privateKey));wr$1(this,"publicKey","0x"+rs.getPublic(!1,"hex")),wr$1(this,"compressedPublicKey","0x"+rs.getPublic(!0,"hex")),wr$1(this,"_isSigningKey",!0)}_addPoint(Mn){const rs=ve$1().keyFromPublic(Ot$1(this.publicKey)),is=ve$1().keyFromPublic(Ot$1(Mn));return"0x"+rs.pub.add(is.pub).encodeCompressed("hex")}signDigest(Mn){const rs=ve$1().keyFromPrivate(Ot$1(this.privateKey)),is=Ot$1(Mn);is.length!==32&&Qi.throwArgumentError("bad digest length","digest",Mn);const os=rs.sign(is,{canonical:!0});return Wn({recoveryParam:os.recoveryParam,r:oe$2("0x"+os.r.toString(16),32),s:oe$2("0x"+os.s.toString(16),32)})}computeSharedSecret(Mn){const rs=ve$1().keyFromPrivate(Ot$1(this.privateKey)),is=ve$1().keyFromPublic(Ot$1(Lf(Mn)));return oe$2("0x"+rs.derive(is.getPublic()).toString(16),32)}static isSigningKey(Mn){return!!(Mn&&Mn._isSigningKey)}}function nu(Fn,Mn){const rs=Wn(Mn),is={r:Ot$1(rs.r),s:Ot$1(rs.s)};return"0x"+ve$1().recoverPubKey(Ot$1(Fn),is,rs.recoveryParam).encode("hex",!1)}function Lf(Fn,Mn){const rs=Ot$1(Fn);return rs.length===32?new iu(rs).publicKey:rs.length===33?"0x"+ve$1().keyFromPublic(rs).getPublic(!1,"hex"):rs.length===65?Kt$1(rs):Qi.throwArgumentError("invalid public or private key","key","[REDACTED]")}var zf;(function(Fn){Fn[Fn.legacy=0]="legacy",Fn[Fn.eip2930=1]="eip2930",Fn[Fn.eip1559=2]="eip1559"})(zf||(zf={}));function ou(Fn){const Mn=Lf(Fn);return v0(Vn(Ii(Vn(Mn,1)),12))}function su(Fn,Mn){return ou(nu(Ot$1(Fn),Mn))}const au="https://rpc.walletconnect.org/v1";async function jf(Fn,Mn,rs,is,os,as){switch(rs.t){case"eip191":return Qf(Fn,Mn,rs.s);case"eip1271":return await Jf(Fn,Mn,rs.s,is,os,as);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${rs.t}`)}}function Qf(Fn,Mn,rs){return su(df(Mn),rs).toLowerCase()===Fn.toLowerCase()}async function Jf(Fn,Mn,rs,is,os,as){try{const us="0x1626ba7e",ds="0000000000000000000000000000000000000000000000000000000000000040",hs="0000000000000000000000000000000000000000000000000000000000000041",ps=rs.substring(2),io=df(Mn).substring(2),fo=us+io+ds+hs+ps,mo=await fetch(`${as||au}/?chainId=${is}&projectId=${os}`,{method:"POST",body:JSON.stringify({id:uu(),jsonrpc:"2.0",method:"eth_call",params:[{to:Fn,data:fo},"latest"]})}),{result:Ao}=await mo.json();return Ao?Ao.slice(0,us.length).toLowerCase()===us.toLowerCase():!1}catch(us){return console.error("isValidEip1271Signature: ",us),!1}}function uu(){return Date.now()+Math.floor(Math.random()*1e3)}var hu=Object.defineProperty,cu=Object.defineProperties,lu=Object.getOwnPropertyDescriptors,Gf=Object.getOwnPropertySymbols,du=Object.prototype.hasOwnProperty,pu=Object.prototype.propertyIsEnumerable,Yf=(Fn,Mn,rs)=>Mn in Fn?hu(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,Gi=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))du.call(Mn,rs)&&Yf(Fn,rs,Mn[rs]);if(Gf)for(var rs of Gf(Mn))pu.call(Mn,rs)&&Yf(Fn,rs,Mn[rs]);return Fn},Vf=(Fn,Mn)=>cu(Fn,lu(Mn));const vu="did:pkh:",Gr$1=Fn=>Fn==null?void 0:Fn.split(":"),Yi=Fn=>{const Mn=Fn&&Gr$1(Fn);if(Mn)return Fn.includes(vu)?Mn[3]:Mn[1]},gu=Fn=>{const Mn=Fn&&Gr$1(Fn);if(Mn)return Mn[2]+":"+Mn[3]},Vi=Fn=>{const Mn=Fn&&Gr$1(Fn);if(Mn)return Mn.pop()};async function mu(Fn){const{cacao:Mn,projectId:rs}=Fn,{s:is,p:os}=Mn,as=Wf(os,os.iss),us=Vi(os.iss);return await jf(us,as,is,Yi(os.iss),rs)}const Wf=(Fn,Mn)=>{const rs=`${Fn.domain} wants you to sign in with your Ethereum account:`,is=Vi(Mn);if(!Fn.aud&&!Fn.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let os=Fn.statement||void 0;const as=`URI: ${Fn.aud||Fn.uri}`,us=`Version: ${Fn.version}`,ds=`Chain ID: ${Yi(Mn)}`,hs=`Nonce: ${Fn.nonce}`,ps=`Issued At: ${Fn.iat}`,io=Fn.exp?`Expiration Time: ${Fn.exp}`:void 0,fo=Fn.nbf?`Not Before: ${Fn.nbf}`:void 0,mo=Fn.requestId?`Request ID: ${Fn.requestId}`:void 0,Ao=Fn.resources?`Resources:${Fn.resources.map(Lo=>`
- ${Lo}`).join("")}`:void 0,$o=Vr$1(Fn.resources);if($o){const Lo=Oe($o);os=$i(os,Lo)}return[rs,is,"",os,"",as,us,ds,hs,ps,io,fo,mo,Ao].filter(Lo=>Lo!=null).join(`
`)};function to$1(Fn){return Buffer.from(JSON.stringify(Fn)).toString("base64")}function eo(Fn){return JSON.parse(Buffer.from(Fn,"base64").toString("utf-8"))}function ge(Fn){if(!Fn)throw new Error("No recap provided, value is undefined");if(!Fn.att)throw new Error("No `att` property found");const Mn=Object.keys(Fn.att);if(!(Mn!=null&&Mn.length))throw new Error("No resources found in `att` property");Mn.forEach(rs=>{const is=Fn.att[rs];if(Array.isArray(is))throw new Error(`Resource must be an object: ${rs}`);if(typeof is!="object")throw new Error(`Resource must be an object: ${rs}`);if(!Object.keys(is).length)throw new Error(`Resource object is empty: ${rs}`);Object.keys(is).forEach(os=>{const as=is[os];if(!Array.isArray(as))throw new Error(`Ability limits ${os} must be an array of objects, found: ${as}`);if(!as.length)throw new Error(`Value of ${os} is empty array, must be an array with objects`);as.forEach(us=>{if(typeof us!="object")throw new Error(`Ability limits (${os}) must be an array of objects, found: ${us}`)})})})}function ro(Fn,Mn,rs,is={}){return rs==null||rs.sort((os,as)=>os.localeCompare(as)),{att:{[Fn]:Wi$1(Mn,rs,is)}}}function Wi$1(Fn,Mn,rs={}){Mn=Mn==null?void 0:Mn.sort((os,as)=>os.localeCompare(as));const is=Mn.map(os=>({[`${Fn}/${os}`]:[rs]}));return Object.assign({},...is)}function Yr$1(Fn){return ge(Fn),`urn:recap:${to$1(Fn).replace(/=/g,"")}`}function Oe(Fn){const Mn=eo(Fn.replace("urn:recap:",""));return ge(Mn),Mn}function xu(Fn,Mn,rs){const is=ro(Fn,Mn,rs);return Yr$1(is)}function Xi(Fn){return Fn&&Fn.includes("urn:recap:")}function Mu(Fn,Mn){const rs=Oe(Fn),is=Oe(Mn),os=no(rs,is);return Yr$1(os)}function no(Fn,Mn){ge(Fn),ge(Mn);const rs=Object.keys(Fn.att).concat(Object.keys(Mn.att)).sort((os,as)=>os.localeCompare(as)),is={att:{}};return rs.forEach(os=>{var as,us;Object.keys(((as=Fn.att)==null?void 0:as[os])||{}).concat(Object.keys(((us=Mn.att)==null?void 0:us[os])||{})).sort((ds,hs)=>ds.localeCompare(hs)).forEach(ds=>{var hs,ps;is.att[os]=Vf(Gi({},is.att[os]),{[ds]:((hs=Fn.att[os])==null?void 0:hs[ds])||((ps=Mn.att[os])==null?void 0:ps[ds])})})}),is}function $i(Fn="",Mn){ge(Mn);const rs="I further authorize the stated URI to perform the following actions on my behalf: ";if(Fn.includes(rs))return Fn;const is=[];let os=0;Object.keys(Mn.att).forEach(ds=>{const hs=Object.keys(Mn.att[ds]).map(fo=>({ability:fo.split("/")[0],action:fo.split("/")[1]}));hs.sort((fo,mo)=>fo.action.localeCompare(mo.action));const ps={};hs.forEach(fo=>{ps[fo.ability]||(ps[fo.ability]=[]),ps[fo.ability].push(fo.action)});const io=Object.keys(ps).map(fo=>(os++,`(${os}) '${fo}': '${ps[fo].join("', '")}' for '${ds}'.`));is.push(io.join(", ").replace(".,","."))});const as=is.join(" "),us=`${rs}${as}`;return`${Fn?Fn+" ":""}${us}`}function Eu(Fn){var Mn;const rs=Oe(Fn);ge(rs);const is=(Mn=rs.att)==null?void 0:Mn.eip155;return is?Object.keys(is).map(os=>os.split("/")[1]):[]}function Su(Fn){const Mn=Oe(Fn);ge(Mn);const rs=[];return Object.values(Mn.att).forEach(is=>{Object.values(is).forEach(os=>{var as;(as=os==null?void 0:os[0])!=null&&as.chains&&rs.push(os[0].chains)})}),[...new Set(rs.flat())]}function Vr$1(Fn){if(!Fn)return;const Mn=Fn==null?void 0:Fn[Fn.length-1];return Xi(Mn)?Mn:void 0}const Zi="base10",Lt$2="base16",tn$1="base64pad",Iu="base64url",dr$2="utf8",en$2=0,pr$2=1,Sr$1=2,Nu=0,oo=1,Ir$1=12,rn$1=32;function _u(){const Fn=x25519.generateKeyPair();return{privateKey:toString(Fn.secretKey,Lt$2),publicKey:toString(Fn.publicKey,Lt$2)}}function Bu(){const Fn=random.randomBytes(rn$1);return toString(Fn,Lt$2)}function Cu(Fn,Mn){const rs=x25519.sharedKey(fromString(Fn,Lt$2),fromString(Mn,Lt$2),!0),is=new HKDF_1(sha256.SHA256,rs).expand(rn$1);return toString(is,Lt$2)}function Ru(Fn){const Mn=sha256.hash(fromString(Fn,Lt$2));return toString(Mn,Lt$2)}function Ou(Fn){const Mn=sha256.hash(fromString(Fn,dr$2));return toString(Mn,Lt$2)}function nn$1(Fn){return fromString(`${Fn}`,Zi)}function Ze$1(Fn){return Number(toString(Fn,Zi))}function Pu(Fn){const Mn=nn$1(typeof Fn.type<"u"?Fn.type:en$2);if(Ze$1(Mn)===pr$2&&typeof Fn.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const rs=typeof Fn.senderPublicKey<"u"?fromString(Fn.senderPublicKey,Lt$2):void 0,is=typeof Fn.iv<"u"?fromString(Fn.iv,Lt$2):random.randomBytes(Ir$1),os=new chacha20poly1305.ChaCha20Poly1305(fromString(Fn.symKey,Lt$2)).seal(is,fromString(Fn.message,dr$2));return fn$1({type:Mn,sealed:os,iv:is,senderPublicKey:rs,encoding:Fn.encoding})}function Tu(Fn,Mn){const rs=nn$1(Sr$1),is=random.randomBytes(Ir$1),os=fromString(Fn,dr$2);return fn$1({type:rs,sealed:os,iv:is,encoding:Mn})}function Du(Fn){const Mn=new chacha20poly1305.ChaCha20Poly1305(fromString(Fn.symKey,Lt$2)),{sealed:rs,iv:is}=Wr$1({encoded:Fn.encoded,encoding:Fn==null?void 0:Fn.encoding}),os=Mn.open(is,rs);if(os===null)throw new Error("Failed to decrypt");return toString(os,dr$2)}function Fu(Fn,Mn){const{sealed:rs}=Wr$1({encoded:Fn,encoding:Mn});return toString(rs,dr$2)}function fn$1(Fn){const{encoding:Mn=tn$1}=Fn;if(Ze$1(Fn.type)===Sr$1)return toString(concat([Fn.type,Fn.sealed]),Mn);if(Ze$1(Fn.type)===pr$2){if(typeof Fn.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return toString(concat([Fn.type,Fn.senderPublicKey,Fn.iv,Fn.sealed]),Mn)}return toString(concat([Fn.type,Fn.iv,Fn.sealed]),Mn)}function Wr$1(Fn){const{encoded:Mn,encoding:rs=tn$1}=Fn,is=fromString(Mn,rs),os=is.slice(Nu,oo),as=oo;if(Ze$1(os)===pr$2){const ps=as+rn$1,io=ps+Ir$1,fo=is.slice(as,ps),mo=is.slice(ps,io),Ao=is.slice(io);return{type:os,sealed:Ao,iv:mo,senderPublicKey:fo}}if(Ze$1(os)===Sr$1){const ps=is.slice(as),io=random.randomBytes(Ir$1);return{type:os,sealed:ps,iv:io}}const us=as+Ir$1,ds=is.slice(as,us),hs=is.slice(us);return{type:os,sealed:hs,iv:ds}}function Uu(Fn,Mn){const rs=Wr$1({encoded:Fn,encoding:Mn==null?void 0:Mn.encoding});return so({type:Ze$1(rs.type),senderPublicKey:typeof rs.senderPublicKey<"u"?toString(rs.senderPublicKey,Lt$2):void 0,receiverPublicKey:Mn==null?void 0:Mn.receiverPublicKey})}function so(Fn){const Mn=(Fn==null?void 0:Fn.type)||en$2;if(Mn===pr$2){if(typeof(Fn==null?void 0:Fn.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(Fn==null?void 0:Fn.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:Mn,senderPublicKey:Fn==null?void 0:Fn.senderPublicKey,receiverPublicKey:Fn==null?void 0:Fn.receiverPublicKey}}function ku(Fn){return Fn.type===pr$2&&typeof Fn.senderPublicKey=="string"&&typeof Fn.receiverPublicKey=="string"}function qu(Fn){return Fn.type===Sr$1}function ao(Fn){return new elliptic.ec("p256").keyFromPublic({x:Buffer.from(Fn.x,"base64").toString("hex"),y:Buffer.from(Fn.y,"base64").toString("hex")},"hex")}function Ku(Fn){let Mn=Fn.replace(/-/g,"+").replace(/_/g,"/");const rs=Mn.length%4;return rs>0&&(Mn+="=".repeat(4-rs)),Mn}function Hu(Fn){return Buffer.from(Ku(Fn),"base64")}function Lu(Fn,Mn){const[rs,is,os]=Fn.split("."),as=Hu(os);if(as.length!==64)throw new Error("Invalid signature length");const us=as.slice(0,32).toString("hex"),ds=as.slice(32,64).toString("hex"),hs=`${rs}.${is}`,ps=new sha256.SHA256().update(Buffer.from(hs)).digest(),io=ao(Mn),fo=Buffer.from(ps).toString("hex");if(!io.verify(fo,{r:us,s:ds}))throw new Error("Invalid signature");return decodeJWT(Fn).payload}const uo="irn";function zu(Fn){return(Fn==null?void 0:Fn.relay)||{protocol:uo}}function ju(Fn){const Mn=C[Fn];if(typeof Mn>"u")throw new Error(`Relay Protocol not supported: ${Fn}`);return Mn}var Qu=Object.defineProperty,Ju=Object.defineProperties,Gu=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,Yu=Object.prototype.hasOwnProperty,Vu=Object.prototype.propertyIsEnumerable,co=(Fn,Mn,rs)=>Mn in Fn?Qu(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,lo=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))Yu.call(Mn,rs)&&co(Fn,rs,Mn[rs]);if(ho)for(var rs of ho(Mn))Vu.call(Mn,rs)&&co(Fn,rs,Mn[rs]);return Fn},Wu=(Fn,Mn)=>Ju(Fn,Gu(Mn));function po(Fn,Mn="-"){const rs={},is="relay"+Mn;return Object.keys(Fn).forEach(os=>{if(os.startsWith(is)){const as=os.replace(is,""),us=Fn[os];rs[as]=us}}),rs}function Xu(Fn){if(!Fn.includes("wc:")){const hs=xi(Fn);hs!=null&&hs.includes("wc:")&&(Fn=hs)}Fn=Fn.includes("wc://")?Fn.replace("wc://",""):Fn,Fn=Fn.includes("wc:")?Fn.replace("wc:",""):Fn;const Mn=Fn.indexOf(":"),rs=Fn.indexOf("?")!==-1?Fn.indexOf("?"):void 0,is=Fn.substring(0,Mn),os=Fn.substring(Mn+1,rs).split("@"),as=typeof rs<"u"?Fn.substring(rs):"",us=queryString$1.parse(as),ds=typeof us.methods=="string"?us.methods.split(","):void 0;return{protocol:is,topic:vo(os[0]),version:parseInt(os[1],10),symKey:us.symKey,relay:po(us),methods:ds,expiryTimestamp:us.expiryTimestamp?parseInt(us.expiryTimestamp,10):void 0}}function vo(Fn){return Fn.startsWith("//")?Fn.substring(2):Fn}function go(Fn,Mn="-"){const rs="relay",is={};return Object.keys(Fn).forEach(os=>{const as=rs+Mn+os;Fn[os]&&(is[as]=Fn[os])}),is}function $u(Fn){return`${Fn.protocol}:${Fn.topic}@${Fn.version}?`+queryString$1.stringify(lo(Wu(lo({symKey:Fn.symKey},go(Fn.relay)),{expiryTimestamp:Fn.expiryTimestamp}),Fn.methods?{methods:Fn.methods.join(",")}:{}))}function Zu(Fn,Mn,rs){return`${Fn}?wc_ev=${rs}&topic=${Mn}`}function tr$1(Fn){const Mn=[];return Fn.forEach(rs=>{const[is,os]=rs.split(":");Mn.push(`${is}:${os}`)}),Mn}function bo(Fn){const Mn=[];return Object.values(Fn).forEach(rs=>{Mn.push(...tr$1(rs.accounts))}),Mn}function yo(Fn,Mn){const rs=[];return Object.values(Fn).forEach(is=>{tr$1(is.accounts).includes(Mn)&&rs.push(...is.methods)}),rs}function wo(Fn,Mn){const rs=[];return Object.values(Fn).forEach(is=>{tr$1(is.accounts).includes(Mn)&&rs.push(...is.events)}),rs}function on$1(Fn){return Fn.includes(":")}function xo(Fn){return on$1(Fn)?Fn.split(":")[0]:Fn}function Mo(Fn){const Mn={};return Fn==null||Fn.forEach(rs=>{const[is,os]=rs.split(":");Mn[is]||(Mn[is]={accounts:[],chains:[],events:[]}),Mn[is].accounts.push(rs),Mn[is].chains.push(`${is}:${os}`)}),Mn}function uh(Fn,Mn){Mn=Mn.map(is=>is.replace("did:pkh:",""));const rs=Mo(Mn);for(const[is,os]of Object.entries(rs))os.methods?os.methods=me$1(os.methods,Fn):os.methods=Fn,os.events=["chainChanged","accountsChanged"];return rs}const Eo={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},So={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function xe$1(Fn,Mn){const{message:rs,code:is}=So[Fn];return{message:Mn?`${rs} ${Mn}`:rs,code:is}}function er$1(Fn,Mn){const{message:rs,code:is}=Eo[Fn];return{message:Mn?`${rs} ${Mn}`:rs,code:is}}function Nr$1(Fn,Mn){return!!Array.isArray(Fn)}function Xr$1(Fn){return Object.getPrototypeOf(Fn)===Object.prototype&&Object.keys(Fn).length}function Pe(Fn){return typeof Fn>"u"}function Yt$1(Fn,Mn){return Mn&&Pe(Fn)?!0:typeof Fn=="string"&&!!Fn.trim().length}function $r$1(Fn,Mn){return typeof Fn=="number"&&!isNaN(Fn)}function hh(Fn,Mn){const{requiredNamespaces:rs}=Mn,is=Object.keys(Fn.namespaces),os=Object.keys(rs);let as=!0;return _e$2(os,is)?(is.forEach(us=>{const{accounts:ds,methods:hs,events:ps}=Fn.namespaces[us],io=tr$1(ds),fo=rs[us];(!_e$2(Or$1(us,fo),io)||!_e$2(fo.methods,hs)||!_e$2(fo.events,ps))&&(as=!1)}),as):!1}function _r$1(Fn){return Yt$1(Fn,!1)&&Fn.includes(":")?Fn.split(":").length===2:!1}function Io(Fn){if(Yt$1(Fn,!1)&&Fn.includes(":")){const Mn=Fn.split(":");if(Mn.length===3){const rs=Mn[0]+":"+Mn[1];return!!Mn[2]&&_r$1(rs)}}return!1}function ch(Fn){function Mn(rs){try{return typeof new URL(rs)<"u"}catch{return!1}}try{if(Yt$1(Fn,!1)){if(Mn(Fn))return!0;const rs=xi(Fn);return Mn(rs)}}catch{}return!1}function lh(Fn){var Mn;return(Mn=Fn==null?void 0:Fn.proposer)==null?void 0:Mn.publicKey}function dh(Fn){return Fn==null?void 0:Fn.topic}function ph(Fn,Mn){let rs=null;return Yt$1(Fn==null?void 0:Fn.publicKey,!1)||(rs=xe$1("MISSING_OR_INVALID",`${Mn} controller public key should be a string`)),rs}function an$1(Fn){let Mn=!0;return Nr$1(Fn)?Fn.length&&(Mn=Fn.every(rs=>Yt$1(rs,!1))):Mn=!1,Mn}function No(Fn,Mn,rs){let is=null;return Nr$1(Mn)&&Mn.length?Mn.forEach(os=>{is||_r$1(os)||(is=er$1("UNSUPPORTED_CHAINS",`${rs}, chain ${os} should be a string and conform to "namespace:chainId" format`))}):_r$1(Fn)||(is=er$1("UNSUPPORTED_CHAINS",`${rs}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),is}function _o(Fn,Mn,rs){let is=null;return Object.entries(Fn).forEach(([os,as])=>{if(is)return;const us=No(os,Or$1(os,as),`${Mn} ${rs}`);us&&(is=us)}),is}function Bo(Fn,Mn){let rs=null;return Nr$1(Fn)?Fn.forEach(is=>{rs||Io(is)||(rs=er$1("UNSUPPORTED_ACCOUNTS",`${Mn}, account ${is} should be a string and conform to "namespace:chainId:address" format`))}):rs=er$1("UNSUPPORTED_ACCOUNTS",`${Mn}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),rs}function Co(Fn,Mn){let rs=null;return Object.values(Fn).forEach(is=>{if(rs)return;const os=Bo(is==null?void 0:is.accounts,`${Mn} namespace`);os&&(rs=os)}),rs}function Ro(Fn,Mn){let rs=null;return an$1(Fn==null?void 0:Fn.methods)?an$1(Fn==null?void 0:Fn.events)||(rs=er$1("UNSUPPORTED_EVENTS",`${Mn}, events should be an array of strings or empty array for no events`)):rs=er$1("UNSUPPORTED_METHODS",`${Mn}, methods should be an array of strings or empty array for no methods`),rs}function un$1(Fn,Mn){let rs=null;return Object.values(Fn).forEach(is=>{if(rs)return;const os=Ro(is,`${Mn}, namespace`);os&&(rs=os)}),rs}function vh(Fn,Mn,rs){let is=null;if(Fn&&Xr$1(Fn)){const os=un$1(Fn,Mn);os&&(is=os);const as=_o(Fn,Mn,rs);as&&(is=as)}else is=xe$1("MISSING_OR_INVALID",`${Mn}, ${rs} should be an object with data`);return is}function Oo(Fn,Mn){let rs=null;if(Fn&&Xr$1(Fn)){const is=un$1(Fn,Mn);is&&(rs=is);const os=Co(Fn,Mn);os&&(rs=os)}else rs=xe$1("MISSING_OR_INVALID",`${Mn}, namespaces should be an object with data`);return rs}function Po(Fn){return Yt$1(Fn.protocol,!0)}function gh(Fn,Mn){let rs=!1;return Fn?Fn&&Nr$1(Fn)&&Fn.length&&Fn.forEach(is=>{rs=Po(is)}):rs=!0,rs}function mh(Fn){return typeof Fn=="number"}function Ah(Fn){return typeof Fn<"u"&&typeof Fn!==null}function bh(Fn){return!(!Fn||typeof Fn!="object"||!Fn.code||!$r$1(Fn.code)||!Fn.message||!Yt$1(Fn.message,!1))}function yh(Fn){return!(Pe(Fn)||!Yt$1(Fn.method,!1))}function wh(Fn){return!(Pe(Fn)||Pe(Fn.result)&&Pe(Fn.error)||!$r$1(Fn.id)||!Yt$1(Fn.jsonrpc,!1))}function xh(Fn){return!(Pe(Fn)||!Yt$1(Fn.name,!1))}function Mh(Fn,Mn){return!(!_r$1(Mn)||!bo(Fn).includes(Mn))}function Eh(Fn,Mn,rs){return Yt$1(rs,!1)?yo(Fn,Mn).includes(rs):!1}function Sh(Fn,Mn,rs){return Yt$1(rs,!1)?wo(Fn,Mn).includes(rs):!1}function To(Fn,Mn,rs){let is=null;const os=Ih(Fn),as=Nh(Mn),us=Object.keys(os),ds=Object.keys(as),hs=Do(Object.keys(Fn)),ps=Do(Object.keys(Mn)),io=hs.filter(fo=>!ps.includes(fo));return io.length&&(is=xe$1("NON_CONFORMING_NAMESPACES",`${rs} namespaces keys don't satisfy requiredNamespaces.
      Required: ${io.toString()}
      Received: ${Object.keys(Mn).toString()}`)),_e$2(us,ds)||(is=xe$1("NON_CONFORMING_NAMESPACES",`${rs} namespaces chains don't satisfy required namespaces.
      Required: ${us.toString()}
      Approved: ${ds.toString()}`)),Object.keys(Mn).forEach(fo=>{if(!fo.includes(":")||is)return;const mo=tr$1(Mn[fo].accounts);mo.includes(fo)||(is=xe$1("NON_CONFORMING_NAMESPACES",`${rs} namespaces accounts don't satisfy namespace accounts for ${fo}
        Required: ${fo}
        Approved: ${mo.toString()}`))}),us.forEach(fo=>{is||(_e$2(os[fo].methods,as[fo].methods)?_e$2(os[fo].events,as[fo].events)||(is=xe$1("NON_CONFORMING_NAMESPACES",`${rs} namespaces events don't satisfy namespace events for ${fo}`)):is=xe$1("NON_CONFORMING_NAMESPACES",`${rs} namespaces methods don't satisfy namespace methods for ${fo}`))}),is}function Ih(Fn){const Mn={};return Object.keys(Fn).forEach(rs=>{var is;rs.includes(":")?Mn[rs]=Fn[rs]:(is=Fn[rs].chains)==null||is.forEach(os=>{Mn[os]={methods:Fn[rs].methods,events:Fn[rs].events}})}),Mn}function Do(Fn){return[...new Set(Fn.map(Mn=>Mn.includes(":")?Mn.split(":")[0]:Mn))]}function Nh(Fn){const Mn={};return Object.keys(Fn).forEach(rs=>{if(rs.includes(":"))Mn[rs]=Fn[rs];else{const is=tr$1(Fn[rs].accounts);is==null||is.forEach(os=>{Mn[os]={accounts:Fn[rs].accounts.filter(as=>as.includes(`${os}:`)),methods:Fn[rs].methods,events:Fn[rs].events}})}}),Mn}function _h(Fn,Mn){return $r$1(Fn)&&Fn<=Mn.max&&Fn>=Mn.min}function Bh(){const Fn=We();return new Promise(Mn=>{switch(Fn){case qt$1.browser:Mn(Fo());break;case qt$1.reactNative:Mn(Uo());break;case qt$1.node:Mn(ko());break;default:Mn(!0)}})}function Fo(){return gr$1()&&(navigator==null?void 0:navigator.onLine)}async function Uo(){if(rr$1()&&typeof global$2<"u"&&global$2!=null&&global$2.NetInfo){const Fn=await(global$2==null?void 0:global$2.NetInfo.fetch());return Fn==null?void 0:Fn.isConnected}return!0}function ko(){return!0}function Ch(Fn){switch(We()){case qt$1.browser:qo(Fn);break;case qt$1.reactNative:Ko(Fn);break}}function qo(Fn){!rr$1()&&gr$1()&&(window.addEventListener("online",()=>Fn(!0)),window.addEventListener("offline",()=>Fn(!1)))}function Ko(Fn){rr$1()&&typeof global$2<"u"&&global$2!=null&&global$2.NetInfo&&(global$2==null||global$2.NetInfo.addEventListener(Mn=>Fn(Mn==null?void 0:Mn.isConnected)))}const hn$1={};class Rh{static get(Mn){return hn$1[Mn]}static set(Mn,rs){hn$1[Mn]=rs}static delete(Mn){delete hn$1[Mn]}}const PARSE_ERROR="PARSE_ERROR",INVALID_REQUEST="INVALID_REQUEST",METHOD_NOT_FOUND="METHOD_NOT_FOUND",INVALID_PARAMS="INVALID_PARAMS",INTERNAL_ERROR="INTERNAL_ERROR",SERVER_ERROR="SERVER_ERROR",RESERVED_ERROR_CODES=[-32700,-32600,-32601,-32602,-32603],STANDARD_ERROR_MAP={[PARSE_ERROR]:{code:-32700,message:"Parse error"},[INVALID_REQUEST]:{code:-32600,message:"Invalid Request"},[METHOD_NOT_FOUND]:{code:-32601,message:"Method not found"},[INVALID_PARAMS]:{code:-32602,message:"Invalid params"},[INTERNAL_ERROR]:{code:-32603,message:"Internal error"},[SERVER_ERROR]:{code:-32e3,message:"Server error"}},DEFAULT_ERROR=SERVER_ERROR;function isReservedErrorCode(Fn){return RESERVED_ERROR_CODES.includes(Fn)}function getError(Fn){return Object.keys(STANDARD_ERROR_MAP).includes(Fn)?STANDARD_ERROR_MAP[Fn]:STANDARD_ERROR_MAP[DEFAULT_ERROR]}function getErrorByCode(Fn){const Mn=Object.values(STANDARD_ERROR_MAP).find(rs=>rs.code===Fn);return Mn||STANDARD_ERROR_MAP[DEFAULT_ERROR]}function parseConnectionError(Fn,Mn,rs){return Fn.message.includes("getaddrinfo ENOTFOUND")||Fn.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${rs} RPC url at ${Mn}`):Fn}var cjs$1={},crypto$1={},hasRequiredCrypto;function requireCrypto(){if(hasRequiredCrypto)return crypto$1;hasRequiredCrypto=1,Object.defineProperty(crypto$1,"__esModule",{value:!0}),crypto$1.isBrowserCryptoAvailable=crypto$1.getSubtleCrypto=crypto$1.getBrowerCrypto=void 0;function Fn(){return(commonjsGlobal==null?void 0:commonjsGlobal.crypto)||(commonjsGlobal==null?void 0:commonjsGlobal.msCrypto)||{}}crypto$1.getBrowerCrypto=Fn;function Mn(){const is=Fn();return is.subtle||is.webkitSubtle}crypto$1.getSubtleCrypto=Mn;function rs(){return!!Fn()&&!!Mn()}return crypto$1.isBrowserCryptoAvailable=rs,crypto$1}var env={},hasRequiredEnv;function requireEnv(){if(hasRequiredEnv)return env;hasRequiredEnv=1,Object.defineProperty(env,"__esModule",{value:!0}),env.isBrowser=env.isNode=env.isReactNative=void 0;function Fn(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}env.isReactNative=Fn;function Mn(){return typeof browser$1$1<"u"&&typeof browser$1$1.versions<"u"&&typeof browser$1$1.versions.node<"u"}env.isNode=Mn;function rs(){return!Fn()&&!Mn()}return env.isBrowser=rs,env}(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0});const Mn=require$$0$1;Mn.__exportStar(requireCrypto(),Fn),Mn.__exportStar(requireEnv(),Fn)})(cjs$1);function payloadId(Fn=3){const Mn=Date.now()*Math.pow(10,Fn),rs=Math.floor(Math.random()*Math.pow(10,Fn));return Mn+rs}function getBigIntRpcId(Fn=6){return BigInt(payloadId(Fn))}function formatJsonRpcRequest(Fn,Mn,rs){return{id:rs||payloadId(),jsonrpc:"2.0",method:Fn,params:Mn}}function formatJsonRpcResult(Fn,Mn){return{id:Fn,jsonrpc:"2.0",result:Mn}}function formatJsonRpcError(Fn,Mn,rs){return{id:Fn,jsonrpc:"2.0",error:formatErrorMessage(Mn)}}function formatErrorMessage(Fn,Mn){return typeof Fn>"u"?getError(INTERNAL_ERROR):(typeof Fn=="string"&&(Fn=Object.assign(Object.assign({},getError(SERVER_ERROR)),{message:Fn})),isReservedErrorCode(Fn.code)&&(Fn=getErrorByCode(Fn.code)),Fn)}let e$1=class{},n$1=class extends e$1{constructor(){super()}},r$2=class extends n$1{constructor(Mn){super()}};const HTTP_REGEX="^https?:",WS_REGEX="^wss?:";function getUrlProtocol(Fn){const Mn=Fn.match(new RegExp(/^\w+:/,"gi"));if(!(!Mn||!Mn.length))return Mn[0]}function matchRegexProtocol(Fn,Mn){const rs=getUrlProtocol(Fn);return typeof rs>"u"?!1:new RegExp(Mn).test(rs)}function isHttpUrl(Fn){return matchRegexProtocol(Fn,HTTP_REGEX)}function isWsUrl(Fn){return matchRegexProtocol(Fn,WS_REGEX)}function isLocalhostUrl(Fn){return new RegExp("wss?://localhost(:d{2,5})?").test(Fn)}function isJsonRpcPayload(Fn){return typeof Fn=="object"&&"id"in Fn&&"jsonrpc"in Fn&&Fn.jsonrpc==="2.0"}function isJsonRpcRequest(Fn){return isJsonRpcPayload(Fn)&&"method"in Fn}function isJsonRpcResponse(Fn){return isJsonRpcPayload(Fn)&&(isJsonRpcResult(Fn)||isJsonRpcError(Fn))}function isJsonRpcResult(Fn){return"result"in Fn}function isJsonRpcError(Fn){return"error"in Fn}let o$2=class extends r$2{constructor(Mn){super(Mn),this.events=new eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(Mn),this.connection.connected&&this.registerEventListeners()}async connect(Mn=this.connection){await this.open(Mn)}async disconnect(){await this.close()}on(Mn,rs){this.events.on(Mn,rs)}once(Mn,rs){this.events.once(Mn,rs)}off(Mn,rs){this.events.off(Mn,rs)}removeListener(Mn,rs){this.events.removeListener(Mn,rs)}async request(Mn,rs){return this.requestStrict(formatJsonRpcRequest(Mn.method,Mn.params||[],Mn.id||getBigIntRpcId().toString()),rs)}async requestStrict(Mn,rs){return new Promise(async(is,os)=>{if(!this.connection.connected)try{await this.open()}catch(as){os(as)}this.events.on(`${Mn.id}`,as=>{isJsonRpcError(as)?os(as.error):is(as.result)});try{await this.connection.send(Mn,rs)}catch(as){os(as)}})}setConnection(Mn=this.connection){return Mn}onPayload(Mn){this.events.emit("payload",Mn),isJsonRpcResponse(Mn)?this.events.emit(`${Mn.id}`,Mn):this.events.emit("message",{type:Mn.method,data:Mn.params})}onClose(Mn){Mn&&Mn.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${Mn.code} ${Mn.reason?`(${Mn.reason})`:""}`)),this.events.emit("disconnect")}async open(Mn=this.connection){this.connection===Mn&&this.connection.connected||(this.connection.connected&&this.close(),typeof Mn=="string"&&(await this.connection.open(Mn),Mn=this.connection),this.connection=this.setConnection(Mn),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",Mn=>this.onPayload(Mn)),this.connection.on("close",Mn=>this.onClose(Mn)),this.connection.on("error",Mn=>this.events.emit("error",Mn)),this.connection.on("register_error",Mn=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const w$2=()=>typeof WebSocket<"u"?WebSocket:typeof global$2<"u"&&typeof global$2.WebSocket<"u"?global$2.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),b=()=>typeof WebSocket<"u"||typeof global$2<"u"&&typeof global$2.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",a=Fn=>Fn.split("?")[0],h=10,S=w$2();let f$1=class{constructor(Mn){if(this.url=Mn,this.events=new eventsExports.EventEmitter,this.registering=!1,!isWsUrl(Mn))throw new Error(`Provided URL is not compatible with WebSocket connection: ${Mn}`);this.url=Mn}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(Mn,rs){this.events.on(Mn,rs)}once(Mn,rs){this.events.once(Mn,rs)}off(Mn,rs){this.events.off(Mn,rs)}removeListener(Mn,rs){this.events.removeListener(Mn,rs)}async open(Mn=this.url){await this.register(Mn)}async close(){return new Promise((Mn,rs)=>{if(typeof this.socket>"u"){rs(new Error("Connection already closed"));return}this.socket.onclose=is=>{this.onClose(is),Mn()},this.socket.close()})}async send(Mn){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(safeJsonStringify(Mn))}catch(rs){this.onError(Mn.id,rs)}}register(Mn=this.url){if(!isWsUrl(Mn))throw new Error(`Provided URL is not compatible with WebSocket connection: ${Mn}`);if(this.registering){const rs=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=rs||this.events.listenerCount("open")>=rs)&&this.events.setMaxListeners(rs+1),new Promise((is,os)=>{this.events.once("register_error",as=>{this.resetMaxListeners(),os(as)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return os(new Error("WebSocket connection is missing or invalid"));is(this.socket)})})}return this.url=Mn,this.registering=!0,new Promise((rs,is)=>{const os=new URLSearchParams(Mn).get("origin"),as=cjs$1.isReactNative()?{headers:{origin:os}}:{rejectUnauthorized:!isLocalhostUrl(Mn)},us=new S(Mn,[],as);b()?us.onerror=ds=>{const hs=ds;is(this.emitError(hs.error))}:us.on("error",ds=>{is(this.emitError(ds))}),us.onopen=()=>{this.onOpen(us),rs(us)}})}onOpen(Mn){Mn.onmessage=rs=>this.onPayload(rs),Mn.onclose=rs=>this.onClose(rs),this.socket=Mn,this.registering=!1,this.events.emit("open")}onClose(Mn){this.socket=void 0,this.registering=!1,this.events.emit("close",Mn)}onPayload(Mn){if(typeof Mn.data>"u")return;const rs=typeof Mn.data=="string"?safeJsonParse(Mn.data):Mn.data;this.events.emit("payload",rs)}onError(Mn,rs){const is=this.parseError(rs),os=is.message||is.toString(),as=formatJsonRpcError(Mn,os);this.events.emit("payload",as)}parseError(Mn,rs=this.url){return parseConnectionError(Mn,a(rs),"WS")}resetMaxListeners(){this.events.getMaxListeners()>h&&this.events.setMaxListeners(h)}emitError(Mn){const rs=this.parseError(new Error((Mn==null?void 0:Mn.message)||`WebSocket connection failed for host: ${a(this.url)}`));return this.events.emit("register_error",rs),rs}};var lodash_isequal={exports:{}};lodash_isequal.exports;(function(Fn,Mn){var rs=200,is="__lodash_hash_undefined__",os=1,as=2,us=9007199254740991,ds="[object Arguments]",hs="[object Array]",ps="[object AsyncFunction]",io="[object Boolean]",fo="[object Date]",mo="[object Error]",Ao="[object Function]",$o="[object GeneratorFunction]",Lo="[object Map]",Go="[object Number]",Yo="[object Null]",Wo="[object Object]",Jo="[object Promise]",xl="[object Proxy]",_l="[object RegExp]",Tl="[object Set]",Sl="[object String]",$l="[object Symbol]",Pl="[object Undefined]",Dl="[object WeakMap]",Ol="[object ArrayBuffer]",Rl="[object DataView]",Vo="[object Float32Array]",jo="[object Float64Array]",Ho="[object Int8Array]",Qo="[object Int16Array]",El="[object Int32Array]",Xo="[object Uint8Array]",Al="[object Uint8ClampedArray]",wl="[object Uint16Array]",yl="[object Uint32Array]",Il=/[\\^$.*+?()[\]{}|]/g,Bl=/^\[object .+?Constructor\]$/,Gl=/^(?:0|[1-9]\d*)$/,Nl={};Nl[Vo]=Nl[jo]=Nl[Ho]=Nl[Qo]=Nl[El]=Nl[Xo]=Nl[Al]=Nl[wl]=Nl[yl]=!0,Nl[ds]=Nl[hs]=Nl[Ol]=Nl[io]=Nl[Rl]=Nl[fo]=Nl[mo]=Nl[Ao]=Nl[Lo]=Nl[Go]=Nl[Wo]=Nl[_l]=Nl[Tl]=Nl[Sl]=Nl[Dl]=!1;var zl=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Vl=typeof self=="object"&&self&&self.Object===Object&&self,Hl=zl||Vl||Function("return this")(),Yl=Mn&&!Mn.nodeType&&Mn,Ll=Yl&&!0&&Fn&&!Fn.nodeType&&Fn,Zl=Ll&&Ll.exports===Yl,Xl=Zl&&zl.process,wu=function(){try{return Xl&&Xl.binding&&Xl.binding("util")}catch{}}(),yu=wu&&wu.isTypedArray;function rp(Au,sp){for(var jp=-1,sm=Au==null?0:Au.length,Hm=0,ym=[];++jp<sm;){var Jm=Au[jp];sp(Jm,jp,Au)&&(ym[Hm++]=Jm)}return ym}function dp(Au,sp){for(var jp=-1,sm=sp.length,Hm=Au.length;++jp<sm;)Au[Hm+jp]=sp[jp];return Au}function up(Au,sp){for(var jp=-1,sm=Au==null?0:Au.length;++jp<sm;)if(sp(Au[jp],jp,Au))return!0;return!1}function wp(Au,sp){for(var jp=-1,sm=Array(Au);++jp<Au;)sm[jp]=sp(jp);return sm}function vp(Au){return function(sp){return Au(sp)}}function pp(Au,sp){return Au.has(sp)}function cp(Au,sp){return Au==null?void 0:Au[sp]}function gp(Au){var sp=-1,jp=Array(Au.size);return Au.forEach(function(sm,Hm){jp[++sp]=[Hm,sm]}),jp}function mp(Au,sp){return function(jp){return Au(sp(jp))}}function fp(Au){var sp=-1,jp=Array(Au.size);return Au.forEach(function(sm){jp[++sp]=sm}),jp}var hp=Array.prototype,xp=Function.prototype,Kl=Object.prototype,Fl=Hl["__core-js_shared__"],Ul=xp.toString,Jl=Kl.hasOwnProperty,fu=function(){var Au=/[^.]+$/.exec(Fl&&Fl.keys&&Fl.keys.IE_PROTO||"");return Au?"Symbol(src)_1."+Au:""}(),_d=Kl.toString,tp=RegExp("^"+Ul.call(Jl).replace(Il,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yp=Zl?Hl.Buffer:void 0,_p=Hl.Symbol,Sp=Hl.Uint8Array,Ap=Kl.propertyIsEnumerable,Op=hp.splice,Zp=_p?_p.toStringTag:void 0,Qp=Object.getOwnPropertySymbols,Xp=yp?yp.isBuffer:void 0,h0=mp(Object.keys,Object),Wp=E1(Hl,"DataView"),Np=E1(Hl,"Map"),Rp=E1(Hl,"Promise"),Pp=E1(Hl,"Set"),Hp=E1(Hl,"WeakMap"),kp=E1(Object,"create"),Gp=Up(Wp),Yp=Up(Np),Mp=Up(Rp),Ip=Up(Pp),Dp=Up(Hp),Lp=_p?_p.prototype:void 0,zp=Lp?Lp.valueOf:void 0;function Bp(Au){var sp=-1,jp=Au==null?0:Au.length;for(this.clear();++sp<jp;){var sm=Au[sp];this.set(sm[0],sm[1])}}function qp(){this.__data__=kp?kp(null):{},this.size=0}function Vp(Au){var sp=this.has(Au)&&delete this.__data__[Au];return this.size-=sp?1:0,sp}function tm(Au){var sp=this.__data__;if(kp){var jp=sp[Au];return jp===is?void 0:jp}return Jl.call(sp,Au)?sp[Au]:void 0}function g0(Au){var sp=this.__data__;return kp?sp[Au]!==void 0:Jl.call(sp,Au)}function rm(Au,sp){var jp=this.__data__;return this.size+=this.has(Au)?0:1,jp[Au]=kp&&sp===void 0?is:sp,this}Bp.prototype.clear=qp,Bp.prototype.delete=Vp,Bp.prototype.get=tm,Bp.prototype.has=g0,Bp.prototype.set=rm;function Jp(Au){var sp=-1,jp=Au==null?0:Au.length;for(this.clear();++sp<jp;){var sm=Au[sp];this.set(sm[0],sm[1])}}function lm(){this.__data__=[],this.size=0}function $m(Au){var sp=this.__data__,jp=P1(sp,Au);if(jp<0)return!1;var sm=sp.length-1;return jp==sm?sp.pop():Op.call(sp,jp,1),--this.size,!0}function km(Au){var sp=this.__data__,jp=P1(sp,Au);return jp<0?void 0:sp[jp][1]}function Cm(Au){return P1(this.__data__,Au)>-1}function Am(Au,sp){var jp=this.__data__,sm=P1(jp,Au);return sm<0?(++this.size,jp.push([Au,sp])):jp[sm][1]=sp,this}Jp.prototype.clear=lm,Jp.prototype.delete=$m,Jp.prototype.get=km,Jp.prototype.has=Cm,Jp.prototype.set=Am;function pm(Au){var sp=-1,jp=Au==null?0:Au.length;for(this.clear();++sp<jp;){var sm=Au[sp];this.set(sm[0],sm[1])}}function Ym(){this.size=0,this.__data__={hash:new Bp,map:new(Np||Jp),string:new Bp}}function u1(Au){var sp=k1(this,Au).delete(Au);return this.size-=sp?1:0,sp}function qm(Au){return k1(this,Au).get(Au)}function Qm(Au){return k1(this,Au).has(Au)}function o1(Au,sp){var jp=k1(this,Au),sm=jp.size;return jp.set(Au,sp),this.size+=jp.size==sm?0:1,this}pm.prototype.clear=Ym,pm.prototype.delete=u1,pm.prototype.get=qm,pm.prototype.has=Qm,pm.prototype.set=o1;function e1(Au){var sp=-1,jp=Au==null?0:Au.length;for(this.__data__=new pm;++sp<jp;)this.add(Au[sp])}function Zm(Au){return this.__data__.set(Au,is),this}function t1(Au){return this.__data__.has(Au)}e1.prototype.add=e1.prototype.push=Zm,e1.prototype.has=t1;function Bm(Au){var sp=this.__data__=new Jp(Au);this.size=sp.size}function Dm(){this.__data__=new Jp,this.size=0}function Om(Au){var sp=this.__data__,jp=sp.delete(Au);return this.size=sp.size,jp}function r1(Au){return this.__data__.get(Au)}function g1(Au){return this.__data__.has(Au)}function b1(Au,sp){var jp=this.__data__;if(jp instanceof Jp){var sm=jp.__data__;if(!Np||sm.length<rs-1)return sm.push([Au,sp]),this.size=++jp.size,this;jp=this.__data__=new pm(sm)}return jp.set(Au,sp),this.size=jp.size,this}Bm.prototype.clear=Dm,Bm.prototype.delete=Om,Bm.prototype.get=r1,Bm.prototype.has=g1,Bm.prototype.set=b1;function F1(Au,sp){var jp=Wm(Au),sm=!jp&&mm(Au),Hm=!jp&&!sm&&Kp(Au),ym=!jp&&!sm&&!Hm&&$v(Au),Jm=jp||sm||Hm||ym,y1=Jm?wp(Au.length,String):[],Rm=y1.length;for(var Gm in Au)Jl.call(Au,Gm)&&!(Jm&&(Gm=="length"||Hm&&(Gm=="offset"||Gm=="parent")||ym&&(Gm=="buffer"||Gm=="byteLength"||Gm=="byteOffset")||Z1(Gm,Rm)))&&y1.push(Gm);return y1}function P1(Au,sp){for(var jp=Au.length;jp--;)if(im(Au[jp][0],sp))return jp;return-1}function K1(Au,sp,jp){var sm=sp(Au);return Wm(Au)?sm:dp(sm,jp(Au))}function w1(Au){return Au==null?Au===void 0?Pl:Yo:Zp&&Zp in Object(Au)?v1(Au):m2(Au)}function S2(Au){return g2(Au)&&w1(Au)==ds}function n2(Au,sp,jp,sm,Hm){return Au===sp?!0:Au==null||sp==null||!g2(Au)&&!g2(sp)?Au!==Au&&sp!==sp:i2(Au,sp,jp,sm,n2,Hm)}function i2(Au,sp,jp,sm,Hm,ym){var Jm=Wm(Au),y1=Wm(sp),Rm=Jm?hs:a1(Au),Gm=y1?hs:a1(sp);Rm=Rm==ds?Wo:Rm,Gm=Gm==ds?Wo:Gm;var d1=Rm==Wo,J1=Gm==Wo,x1=Rm==Gm;if(x1&&Kp(Au)){if(!Kp(sp))return!1;Jm=!0,d1=!1}if(x1&&!d1)return ym||(ym=new Bm),Jm||$v(Au)?s2(Au,sp,jp,sm,Hm,ym):D2(Au,sp,Rm,jp,sm,Hm,ym);if(!(jp&os)){var Xm=d1&&Jl.call(Au,"__wrapped__"),B1=J1&&Jl.call(sp,"__wrapped__");if(Xm||B1){var T2=Xm?Au.value():Au,v2=B1?sp.value():sp;return ym||(ym=new Bm),Hm(T2,v2,jp,sm,ym)}}return x1?(ym||(ym=new Bm),L2(Au,sp,jp,sm,Hm,ym)):!1}function p2(Au){if(!zm(Au)||Q1(Au))return!1;var sp=Lm(Au)?tp:Bl;return sp.test(Up(Au))}function O2(Au){return g2(Au)&&n1(Au.length)&&!!Nl[w1(Au)]}function M2(Au){if(!o2(Au))return h0(Au);var sp=[];for(var jp in Object(Au))Jl.call(Au,jp)&&jp!="constructor"&&sp.push(jp);return sp}function s2(Au,sp,jp,sm,Hm,ym){var Jm=jp&os,y1=Au.length,Rm=sp.length;if(y1!=Rm&&!(Jm&&Rm>y1))return!1;var Gm=ym.get(Au);if(Gm&&ym.get(sp))return Gm==sp;var d1=-1,J1=!0,x1=jp&as?new e1:void 0;for(ym.set(Au,sp),ym.set(sp,Au);++d1<y1;){var Xm=Au[d1],B1=sp[d1];if(sm)var T2=Jm?sm(B1,Xm,d1,sp,Au,ym):sm(Xm,B1,d1,Au,sp,ym);if(T2!==void 0){if(T2)continue;J1=!1;break}if(x1){if(!up(sp,function(v2,F2){if(!pp(x1,F2)&&(Xm===v2||Hm(Xm,v2,jp,sm,ym)))return x1.push(F2)})){J1=!1;break}}else if(!(Xm===B1||Hm(Xm,B1,jp,sm,ym))){J1=!1;break}}return ym.delete(Au),ym.delete(sp),J1}function D2(Au,sp,jp,sm,Hm,ym,Jm){switch(jp){case Rl:if(Au.byteLength!=sp.byteLength||Au.byteOffset!=sp.byteOffset)return!1;Au=Au.buffer,sp=sp.buffer;case Ol:return!(Au.byteLength!=sp.byteLength||!ym(new Sp(Au),new Sp(sp)));case io:case fo:case Go:return im(+Au,+sp);case mo:return Au.name==sp.name&&Au.message==sp.message;case _l:case Sl:return Au==sp+"";case Lo:var y1=gp;case Tl:var Rm=sm&os;if(y1||(y1=fp),Au.size!=sp.size&&!Rm)return!1;var Gm=Jm.get(Au);if(Gm)return Gm==sp;sm|=as,Jm.set(Au,sp);var d1=s2(y1(Au),y1(sp),sm,Hm,ym,Jm);return Jm.delete(Au),d1;case $l:if(zp)return zp.call(Au)==zp.call(sp)}return!1}function L2(Au,sp,jp,sm,Hm,ym){var Jm=jp&os,y1=q1(Au),Rm=y1.length,Gm=q1(sp),d1=Gm.length;if(Rm!=d1&&!Jm)return!1;for(var J1=Rm;J1--;){var x1=y1[J1];if(!(Jm?x1 in sp:Jl.call(sp,x1)))return!1}var Xm=ym.get(Au);if(Xm&&ym.get(sp))return Xm==sp;var B1=!0;ym.set(Au,sp),ym.set(sp,Au);for(var T2=Jm;++J1<Rm;){x1=y1[J1];var v2=Au[x1],F2=sp[x1];if(sm)var Iy=Jm?sm(F2,v2,x1,sp,Au,ym):sm(v2,F2,x1,Au,sp,ym);if(!(Iy===void 0?v2===F2||Hm(v2,F2,jp,sm,ym):Iy)){B1=!1;break}T2||(T2=x1=="constructor")}if(B1&&!T2){var qv=Au.constructor,I1=sp.constructor;qv!=I1&&"constructor"in Au&&"constructor"in sp&&!(typeof qv=="function"&&qv instanceof qv&&typeof I1=="function"&&I1 instanceof I1)&&(B1=!1)}return ym.delete(Au),ym.delete(sp),B1}function q1(Au){return K1(Au,ay,$2)}function k1(Au,sp){var jp=Au.__data__;return Y1(sp)?jp[typeof sp=="string"?"string":"hash"]:jp.map}function E1(Au,sp){var jp=cp(Au,sp);return p2(jp)?jp:void 0}function v1(Au){var sp=Jl.call(Au,Zp),jp=Au[Zp];try{Au[Zp]=void 0;var sm=!0}catch{}var Hm=_d.call(Au);return sm&&(sp?Au[Zp]=jp:delete Au[Zp]),Hm}var $2=Qp?function(Au){return Au==null?[]:(Au=Object(Au),rp(Qp(Au),function(sp){return Ap.call(Au,sp)}))}:jm,a1=w1;(Wp&&a1(new Wp(new ArrayBuffer(1)))!=Rl||Np&&a1(new Np)!=Lo||Rp&&a1(Rp.resolve())!=Jo||Pp&&a1(new Pp)!=Tl||Hp&&a1(new Hp)!=Dl)&&(a1=function(Au){var sp=w1(Au),jp=sp==Wo?Au.constructor:void 0,sm=jp?Up(jp):"";if(sm)switch(sm){case Gp:return Rl;case Yp:return Lo;case Mp:return Jo;case Ip:return Tl;case Dp:return Dl}return sp});function Z1(Au,sp){return sp=sp??us,!!sp&&(typeof Au=="number"||Gl.test(Au))&&Au>-1&&Au%1==0&&Au<sp}function Y1(Au){var sp=typeof Au;return sp=="string"||sp=="number"||sp=="symbol"||sp=="boolean"?Au!=="__proto__":Au===null}function Q1(Au){return!!fu&&fu in Au}function o2(Au){var sp=Au&&Au.constructor,jp=typeof sp=="function"&&sp.prototype||Kl;return Au===jp}function m2(Au){return _d.call(Au)}function Up(Au){if(Au!=null){try{return Ul.call(Au)}catch{}try{return Au+""}catch{}}return""}function im(Au,sp){return Au===sp||Au!==Au&&sp!==sp}var mm=S2(function(){return arguments}())?S2:function(Au){return g2(Au)&&Jl.call(Au,"callee")&&!Ap.call(Au,"callee")},Wm=Array.isArray;function Pm(Au){return Au!=null&&n1(Au.length)&&!Lm(Au)}var Kp=Xp||Vm;function cm(Au,sp){return n2(Au,sp)}function Lm(Au){if(!zm(Au))return!1;var sp=w1(Au);return sp==Ao||sp==$o||sp==ps||sp==xl}function n1(Au){return typeof Au=="number"&&Au>-1&&Au%1==0&&Au<=us}function zm(Au){var sp=typeof Au;return Au!=null&&(sp=="object"||sp=="function")}function g2(Au){return Au!=null&&typeof Au=="object"}var $v=yu?vp(yu):O2;function ay(Au){return Pm(Au)?F1(Au):M2(Au)}function jm(){return[]}function Vm(){return!1}Fn.exports=cm})(lodash_isequal,lodash_isequal.exports);var lodash_isequalExports=lodash_isequal.exports;const bs=getDefaultExportFromCjs(lodash_isequalExports),be$1="wc",fe=2,ne="core",O$1=`${be$1}@2:${ne}:`,Xe={name:ne,logger:"error"},Ze={database:":memory:"},Qe="crypto",_e$1="client_ed25519_seed",et=cjs$4.ONE_DAY,tt="keychain",it$1="0.3",st$1="messages",rt$1="0.3",nt$1=cjs$4.SIX_HOURS,ot$1="publisher",at$1="irn",ct$1="error",Ee="wss://relay.walletconnect.org",ht$1="relayer",w$1={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},lt$1="_subscription",T$1={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},ut$1=.1,oe$1="2.17.0",F$1={link_mode:"link_mode",relay:"relay"},dt$1="0.3",gt$1="WALLETCONNECT_CLIENT_ID",ve="WALLETCONNECT_LINK_MODE_APPS",A={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},pt$1="subscription",yt$1="0.3",Dt=cjs$4.FIVE_SECONDS*1e3,mt="pairing",bt="0.3",j$1={wc_pairingDelete:{req:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:cjs$4.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:cjs$4.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:0},res:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:0}}},q={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},P$1={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},ft="history",_t="0.3",Et="expirer",R={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},vt="0.3",wt="verify-api",Is$1="https://verify.walletconnect.com",It="https://verify.walletconnect.org",Z=It,Tt$1=`${Z}/v3`,Ct=[Is$1,It],St="echo",Pt="https://echo.walletconnect.com",z$1={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},M={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Cs={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},Ss$1={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},Ps={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},Rs$1={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},Rt=.1,xt="event-client",Ot=86400,At="https://pulse.walletconnect.org/batch";function xs(Fn,Mn){if(Fn.length>=255)throw new TypeError("Alphabet too long");for(var rs=new Uint8Array(256),is=0;is<rs.length;is++)rs[is]=255;for(var os=0;os<Fn.length;os++){var as=Fn.charAt(os),us=as.charCodeAt(0);if(rs[us]!==255)throw new TypeError(as+" is ambiguous");rs[us]=os}var ds=Fn.length,hs=Fn.charAt(0),ps=Math.log(ds)/Math.log(256),io=Math.log(256)/Math.log(ds);function fo($o){if($o instanceof Uint8Array||(ArrayBuffer.isView($o)?$o=new Uint8Array($o.buffer,$o.byteOffset,$o.byteLength):Array.isArray($o)&&($o=Uint8Array.from($o))),!($o instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if($o.length===0)return"";for(var Lo=0,Go=0,Yo=0,Wo=$o.length;Yo!==Wo&&$o[Yo]===0;)Yo++,Lo++;for(var Jo=(Wo-Yo)*io+1>>>0,xl=new Uint8Array(Jo);Yo!==Wo;){for(var _l=$o[Yo],Tl=0,Sl=Jo-1;(_l!==0||Tl<Go)&&Sl!==-1;Sl--,Tl++)_l+=256*xl[Sl]>>>0,xl[Sl]=_l%ds>>>0,_l=_l/ds>>>0;if(_l!==0)throw new Error("Non-zero carry");Go=Tl,Yo++}for(var $l=Jo-Go;$l!==Jo&&xl[$l]===0;)$l++;for(var Pl=hs.repeat(Lo);$l<Jo;++$l)Pl+=Fn.charAt(xl[$l]);return Pl}function mo($o){if(typeof $o!="string")throw new TypeError("Expected String");if($o.length===0)return new Uint8Array;var Lo=0;if($o[Lo]!==" "){for(var Go=0,Yo=0;$o[Lo]===hs;)Go++,Lo++;for(var Wo=($o.length-Lo)*ps+1>>>0,Jo=new Uint8Array(Wo);$o[Lo];){var xl=rs[$o.charCodeAt(Lo)];if(xl===255)return;for(var _l=0,Tl=Wo-1;(xl!==0||_l<Yo)&&Tl!==-1;Tl--,_l++)xl+=ds*Jo[Tl]>>>0,Jo[Tl]=xl%256>>>0,xl=xl/256>>>0;if(xl!==0)throw new Error("Non-zero carry");Yo=_l,Lo++}if($o[Lo]!==" "){for(var Sl=Wo-Yo;Sl!==Wo&&Jo[Sl]===0;)Sl++;for(var $l=new Uint8Array(Go+(Wo-Sl)),Pl=Go;Sl!==Wo;)$l[Pl++]=Jo[Sl++];return $l}}}function Ao($o){var Lo=mo($o);if(Lo)return Lo;throw new Error(`Non-${Mn} character`)}return{encode:fo,decodeUnsafe:mo,decode:Ao}}var Os=xs,As=Os;const Nt=Fn=>{if(Fn instanceof Uint8Array&&Fn.constructor.name==="Uint8Array")return Fn;if(Fn instanceof ArrayBuffer)return new Uint8Array(Fn);if(ArrayBuffer.isView(Fn))return new Uint8Array(Fn.buffer,Fn.byteOffset,Fn.byteLength);throw new Error("Unknown type, must be binary type")},Ns=Fn=>new TextEncoder().encode(Fn),Ls=Fn=>new TextDecoder().decode(Fn);class zs{constructor(Mn,rs,is){this.name=Mn,this.prefix=rs,this.baseEncode=is}encode(Mn){if(Mn instanceof Uint8Array)return`${this.prefix}${this.baseEncode(Mn)}`;throw Error("Unknown type, must be binary type")}}class ks{constructor(Mn,rs,is){if(this.name=Mn,this.prefix=rs,rs.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=rs.codePointAt(0),this.baseDecode=is}decode(Mn){if(typeof Mn=="string"){if(Mn.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(Mn)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(Mn.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(Mn){return Lt$1(this,Mn)}}class Ms{constructor(Mn){this.decoders=Mn}or(Mn){return Lt$1(this,Mn)}decode(Mn){const rs=Mn[0],is=this.decoders[rs];if(is)return is.decode(Mn);throw RangeError(`Unable to decode multibase string ${JSON.stringify(Mn)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Lt$1=(Fn,Mn)=>new Ms({...Fn.decoders||{[Fn.prefix]:Fn},...Mn.decoders||{[Mn.prefix]:Mn}});class $s{constructor(Mn,rs,is,os){this.name=Mn,this.prefix=rs,this.baseEncode=is,this.baseDecode=os,this.encoder=new zs(Mn,rs,is),this.decoder=new ks(Mn,rs,os)}encode(Mn){return this.encoder.encode(Mn)}decode(Mn){return this.decoder.decode(Mn)}}const ae$1=({name:Fn,prefix:Mn,encode:rs,decode:is})=>new $s(Fn,Mn,rs,is),Q=({prefix:Fn,name:Mn,alphabet:rs})=>{const{encode:is,decode:os}=As(rs,Mn);return ae$1({prefix:Fn,name:Mn,encode:is,decode:as=>Nt(os(as))})},Fs=(Fn,Mn,rs,is)=>{const os={};for(let io=0;io<Mn.length;++io)os[Mn[io]]=io;let as=Fn.length;for(;Fn[as-1]==="=";)--as;const us=new Uint8Array(as*rs/8|0);let ds=0,hs=0,ps=0;for(let io=0;io<as;++io){const fo=os[Fn[io]];if(fo===void 0)throw new SyntaxError(`Non-${is} character`);hs=hs<<rs|fo,ds+=rs,ds>=8&&(ds-=8,us[ps++]=255&hs>>ds)}if(ds>=rs||255&hs<<8-ds)throw new SyntaxError("Unexpected end of data");return us},Us=(Fn,Mn,rs)=>{const is=Mn[Mn.length-1]==="=",os=(1<<rs)-1;let as="",us=0,ds=0;for(let hs=0;hs<Fn.length;++hs)for(ds=ds<<8|Fn[hs],us+=8;us>rs;)us-=rs,as+=Mn[os&ds>>us];if(us&&(as+=Mn[os&ds<<rs-us]),is)for(;as.length*rs&7;)as+="=";return as},_=({name:Fn,prefix:Mn,bitsPerChar:rs,alphabet:is})=>ae$1({prefix:Mn,name:Fn,encode(os){return Us(os,is,rs)},decode(os){return Fs(os,is,rs,Fn)}}),Ks=ae$1({prefix:"\0",name:"identity",encode:Fn=>Ls(Fn),decode:Fn=>Ns(Fn)});var Bs=Object.freeze({__proto__:null,identity:Ks});const Vs=_({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var js=Object.freeze({__proto__:null,base2:Vs});const qs$1=_({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Gs=Object.freeze({__proto__:null,base8:qs$1});const Hs=Q({prefix:"9",name:"base10",alphabet:"0123456789"});var Ys=Object.freeze({__proto__:null,base10:Hs});const Js=_({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ws=_({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Xs=Object.freeze({__proto__:null,base16:Js,base16upper:Ws});const Zs=_({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qs=_({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),er=_({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),tr=_({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ir=_({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),sr=_({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rr=_({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),nr=_({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),or=_({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ar=Object.freeze({__proto__:null,base32:Zs,base32upper:Qs,base32pad:er,base32padupper:tr,base32hex:ir,base32hexupper:sr,base32hexpad:rr,base32hexpadupper:nr,base32z:or});const cr=Q({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),hr=Q({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var lr$1=Object.freeze({__proto__:null,base36:cr,base36upper:hr});const ur=Q({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),dr$1=Q({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var gr=Object.freeze({__proto__:null,base58btc:ur,base58flickr:dr$1});const pr$1=_({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),yr=_({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Dr=_({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),mr=_({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var br=Object.freeze({__proto__:null,base64:pr$1,base64pad:yr,base64url:Dr,base64urlpad:mr});const zt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),fr=zt.reduce((Fn,Mn,rs)=>(Fn[rs]=Mn,Fn),[]),_r=zt.reduce((Fn,Mn,rs)=>(Fn[Mn.codePointAt(0)]=rs,Fn),[]);function Er(Fn){return Fn.reduce((Mn,rs)=>(Mn+=fr[rs],Mn),"")}function vr(Fn){const Mn=[];for(const rs of Fn){const is=_r[rs.codePointAt(0)];if(is===void 0)throw new Error(`Non-base256emoji character: ${rs}`);Mn.push(is)}return new Uint8Array(Mn)}const wr=ae$1({prefix:"🚀",name:"base256emoji",encode:Er,decode:vr});var Ir=Object.freeze({__proto__:null,base256emoji:wr}),Tr=Mt,kt=128,Cr=127,Sr=~Cr,Pr=Math.pow(2,31);function Mt(Fn,Mn,rs){Mn=Mn||[],rs=rs||0;for(var is=rs;Fn>=Pr;)Mn[rs++]=Fn&255|kt,Fn/=128;for(;Fn&Sr;)Mn[rs++]=Fn&255|kt,Fn>>>=7;return Mn[rs]=Fn|0,Mt.bytes=rs-is+1,Mn}var Rr=we$1,xr=128,$t=127;function we$1(Fn,is){var rs=0,is=is||0,os=0,as=is,us,ds=Fn.length;do{if(as>=ds)throw we$1.bytes=0,new RangeError("Could not decode varint");us=Fn[as++],rs+=os<28?(us&$t)<<os:(us&$t)*Math.pow(2,os),os+=7}while(us>=xr);return we$1.bytes=as-is,rs}var Or=Math.pow(2,7),Ar=Math.pow(2,14),Nr=Math.pow(2,21),Lr=Math.pow(2,28),zr=Math.pow(2,35),kr=Math.pow(2,42),Mr=Math.pow(2,49),$r=Math.pow(2,56),Fr=Math.pow(2,63),Ur=function(Fn){return Fn<Or?1:Fn<Ar?2:Fn<Nr?3:Fn<Lr?4:Fn<zr?5:Fn<kr?6:Fn<Mr?7:Fn<$r?8:Fn<Fr?9:10},Kr={encode:Tr,decode:Rr,encodingLength:Ur},Ft=Kr;const Ut=(Fn,Mn,rs=0)=>(Ft.encode(Fn,Mn,rs),Mn),Kt=Fn=>Ft.encodingLength(Fn),Ie=(Fn,Mn)=>{const rs=Mn.byteLength,is=Kt(Fn),os=is+Kt(rs),as=new Uint8Array(os+rs);return Ut(Fn,as,0),Ut(rs,as,is),as.set(Mn,os),new Br(Fn,rs,Mn,as)};class Br{constructor(Mn,rs,is,os){this.code=Mn,this.size=rs,this.digest=is,this.bytes=os}}const Bt=({name:Fn,code:Mn,encode:rs})=>new Vr(Fn,Mn,rs);class Vr{constructor(Mn,rs,is){this.name=Mn,this.code=rs,this.encode=is}digest(Mn){if(Mn instanceof Uint8Array){const rs=this.encode(Mn);return rs instanceof Uint8Array?Ie(this.code,rs):rs.then(is=>Ie(this.code,is))}else throw Error("Unknown type, must be binary type")}}const Vt=Fn=>async Mn=>new Uint8Array(await crypto.subtle.digest(Fn,Mn)),jr=Bt({name:"sha2-256",code:18,encode:Vt("SHA-256")}),qr=Bt({name:"sha2-512",code:19,encode:Vt("SHA-512")});var Gr=Object.freeze({__proto__:null,sha256:jr,sha512:qr});const jt=0,Hr="identity",qt=Nt,Yr=Fn=>Ie(jt,qt(Fn)),Jr={code:jt,name:Hr,encode:qt,digest:Yr};var Wr=Object.freeze({__proto__:null,identity:Jr});new TextEncoder,new TextDecoder;const Gt={...Bs,...js,...Gs,...Ys,...Xs,...ar,...lr$1,...gr,...br,...Ir};({...Gr,...Wr});function Xr(Fn=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(Fn):new Uint8Array(Fn)}function Ht(Fn,Mn,rs,is){return{name:Fn,prefix:Mn,encoder:{name:Fn,prefix:Mn,encode:rs},decoder:{decode:is}}}const Yt=Ht("utf8","u",Fn=>"u"+new TextDecoder("utf8").decode(Fn),Fn=>new TextEncoder().encode(Fn.substring(1))),Te=Ht("ascii","a",Fn=>{let Mn="a";for(let rs=0;rs<Fn.length;rs++)Mn+=String.fromCharCode(Fn[rs]);return Mn},Fn=>{Fn=Fn.substring(1);const Mn=Xr(Fn.length);for(let rs=0;rs<Fn.length;rs++)Mn[rs]=Fn.charCodeAt(rs);return Mn}),Zr={utf8:Yt,"utf-8":Yt,hex:Gt.base16,latin1:Te,ascii:Te,binary:Te,...Gt};function Qr(Fn,Mn="utf8"){const rs=Zr[Mn];if(!rs)throw new Error(`Unsupported encoding "${Mn}"`);return(Mn==="utf8"||Mn==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(Fn,"utf8"):rs.decoder.decode(`${rs.prefix}${Fn}`)}class Jt{constructor(Mn,rs){this.core=Mn,this.logger=rs,this.keychain=new Map,this.name=tt,this.version=it$1,this.initialized=!1,this.storagePrefix=O$1,this.init=async()=>{if(!this.initialized){const is=await this.getKeyChain();typeof is<"u"&&(this.keychain=is),this.initialized=!0}},this.has=is=>(this.isInitialized(),this.keychain.has(is)),this.set=async(is,os)=>{this.isInitialized(),this.keychain.set(is,os),await this.persist()},this.get=is=>{this.isInitialized();const os=this.keychain.get(is);if(typeof os>"u"){const{message:as}=xe$1("NO_MATCHING_KEY",`${this.name}: ${is}`);throw new Error(as)}return os},this.del=async is=>{this.isInitialized(),this.keychain.delete(is),await this.persist()},this.core=Mn,this.logger=E$3(rs,this.name)}get context(){return y$4(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(Mn){await this.core.storage.setItem(this.storageKey,cs(Mn))}async getKeyChain(){const Mn=await this.core.storage.getItem(this.storageKey);return typeof Mn<"u"?ls$1(Mn):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:Mn}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Mn)}}}class Wt{constructor(Mn,rs,is){this.core=Mn,this.logger=rs,this.name=Qe,this.randomSessionIdentifier=Bu(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=os=>(this.isInitialized(),this.keychain.has(os)),this.getClientId=async()=>{this.isInitialized();const os=await this.getClientSeed(),as=generateKeyPair(os);return encodeIss(as.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const os=_u();return this.setPrivateKey(os.publicKey,os.privateKey)},this.signJWT=async os=>{this.isInitialized();const as=await this.getClientSeed(),us=generateKeyPair(as),ds=this.randomSessionIdentifier;return await signJWT(ds,os,et,us)},this.generateSharedKey=(os,as,us)=>{this.isInitialized();const ds=this.getPrivateKey(os),hs=Cu(ds,as);return this.setSymKey(hs,us)},this.setSymKey=async(os,as)=>{this.isInitialized();const us=as||Ru(os);return await this.keychain.set(us,os),us},this.deleteKeyPair=async os=>{this.isInitialized(),await this.keychain.del(os)},this.deleteSymKey=async os=>{this.isInitialized(),await this.keychain.del(os)},this.encode=async(os,as,us)=>{this.isInitialized();const ds=so(us),hs=safeJsonStringify(as);if(qu(ds))return Tu(hs,us==null?void 0:us.encoding);if(ku(ds)){const mo=ds.senderPublicKey,Ao=ds.receiverPublicKey;os=await this.generateSharedKey(mo,Ao)}const ps=this.getSymKey(os),{type:io,senderPublicKey:fo}=ds;return Pu({type:io,symKey:ps,message:hs,senderPublicKey:fo,encoding:us==null?void 0:us.encoding})},this.decode=async(os,as,us)=>{this.isInitialized();const ds=Uu(as,us);if(qu(ds)){const hs=Fu(as,us==null?void 0:us.encoding);return safeJsonParse(hs)}if(ku(ds)){const hs=ds.receiverPublicKey,ps=ds.senderPublicKey;os=await this.generateSharedKey(hs,ps)}try{const hs=this.getSymKey(os),ps=Du({symKey:hs,encoded:as,encoding:us==null?void 0:us.encoding});return safeJsonParse(ps)}catch(hs){this.logger.error(`Failed to decode message from topic: '${os}', clientId: '${await this.getClientId()}'`),this.logger.error(hs)}},this.getPayloadType=(os,as=tn$1)=>{const us=Wr$1({encoded:os,encoding:as});return Ze$1(us.type)},this.getPayloadSenderPublicKey=(os,as=tn$1)=>{const us=Wr$1({encoded:os,encoding:as});return us.senderPublicKey?toString(us.senderPublicKey,Lt$2):void 0},this.core=Mn,this.logger=E$3(rs,this.name),this.keychain=is||new Jt(this.core,this.logger)}get context(){return y$4(this.logger)}async setPrivateKey(Mn,rs){return await this.keychain.set(Mn,rs),Mn}getPrivateKey(Mn){return this.keychain.get(Mn)}async getClientSeed(){let Mn="";try{Mn=this.keychain.get(_e$1)}catch{Mn=Bu(),await this.keychain.set(_e$1,Mn)}return Qr(Mn,"base16")}getSymKey(Mn){return this.keychain.get(Mn)}isInitialized(){if(!this.initialized){const{message:Mn}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Mn)}}}class Xt extends a$1{constructor(Mn,rs){super(Mn,rs),this.logger=Mn,this.core=rs,this.messages=new Map,this.name=st$1,this.version=rt$1,this.initialized=!1,this.storagePrefix=O$1,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const is=await this.getRelayerMessages();typeof is<"u"&&(this.messages=is),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(is){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(is)}finally{this.initialized=!0}}},this.set=async(is,os)=>{this.isInitialized();const as=Ou(os);let us=this.messages.get(is);return typeof us>"u"&&(us={}),typeof us[as]<"u"||(us[as]=os,this.messages.set(is,us),await this.persist()),as},this.get=is=>{this.isInitialized();let os=this.messages.get(is);return typeof os>"u"&&(os={}),os},this.has=(is,os)=>{this.isInitialized();const as=this.get(is),us=Ou(os);return typeof as[us]<"u"},this.del=async is=>{this.isInitialized(),this.messages.delete(is),await this.persist()},this.logger=E$3(Mn,this.name),this.core=rs}get context(){return y$4(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(Mn){await this.core.storage.setItem(this.storageKey,cs(Mn))}async getRelayerMessages(){const Mn=await this.core.storage.getItem(this.storageKey);return typeof Mn<"u"?ls$1(Mn):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:Mn}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Mn)}}}let en$1=class extends g$1{constructor(Mn,rs){super(Mn,rs),this.relayer=Mn,this.logger=rs,this.events=new eventsExports.EventEmitter,this.name=ot$1,this.queue=new Map,this.publishTimeout=cjs$4.toMiliseconds(cjs$4.ONE_MINUTE),this.failedPublishTimeout=cjs$4.toMiliseconds(cjs$4.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(is,os,as)=>{var us;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:is,message:os,opts:as}});const ds=(as==null?void 0:as.ttl)||nt$1,hs=zu(as),ps=(as==null?void 0:as.prompt)||!1,io=(as==null?void 0:as.tag)||0,fo=(as==null?void 0:as.id)||getBigIntRpcId().toString(),mo={topic:is,message:os,opts:{ttl:ds,relay:hs,prompt:ps,tag:io,id:fo,attestation:as==null?void 0:as.attestation}},Ao=`Failed to publish payload, please try again. id:${fo} tag:${io}`,$o=Date.now();let Lo,Go=1;try{for(;Lo===void 0;){if(Date.now()-$o>this.publishTimeout)throw new Error(Ao);this.logger.trace({id:fo,attempts:Go},`publisher.publish - attempt ${Go}`),Lo=await await ms$1(this.rpcPublish(is,os,ds,hs,ps,io,fo,as==null?void 0:as.attestation).catch(Yo=>this.logger.warn(Yo)),this.publishTimeout,Ao),Go++,Lo||await new Promise(Yo=>setTimeout(Yo,this.failedPublishTimeout))}this.relayer.events.emit(w$1.publish,mo),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:fo,topic:is,message:os,opts:as}})}catch(Yo){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(Yo),(us=as==null?void 0:as.internal)!=null&&us.throwOnFailedPublish)throw Yo;this.queue.set(fo,mo)}},this.on=(is,os)=>{this.events.on(is,os)},this.once=(is,os)=>{this.events.once(is,os)},this.off=(is,os)=>{this.events.off(is,os)},this.removeListener=(is,os)=>{this.events.removeListener(is,os)},this.relayer=Mn,this.logger=E$3(rs,this.name),this.registerEventListeners()}get context(){return y$4(this.logger)}rpcPublish(Mn,rs,is,os,as,us,ds,hs){var ps,io,fo,mo;const Ao={method:ju(os.protocol).publish,params:{topic:Mn,message:rs,ttl:is,prompt:as,tag:us,attestation:hs},id:ds};return Pe((ps=Ao.params)==null?void 0:ps.prompt)&&((io=Ao.params)==null||delete io.prompt),Pe((fo=Ao.params)==null?void 0:fo.tag)&&((mo=Ao.params)==null||delete mo.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:Ao}),this.relayer.request(Ao)}removeRequestFromQueue(Mn){this.queue.delete(Mn)}checkQueue(){this.queue.forEach(async Mn=>{const{topic:rs,message:is,opts:os}=Mn;await this.publish(rs,is,os)})}registerEventListeners(){this.relayer.core.heartbeat.on(r$4.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(w$1.connection_stalled);return}this.checkQueue()}),this.relayer.on(w$1.message_ack,Mn=>{this.removeRequestFromQueue(Mn.id.toString())})}};class tn{constructor(){this.map=new Map,this.set=(Mn,rs)=>{const is=this.get(Mn);this.exists(Mn,rs)||this.map.set(Mn,[...is,rs])},this.get=Mn=>this.map.get(Mn)||[],this.exists=(Mn,rs)=>this.get(Mn).includes(rs),this.delete=(Mn,rs)=>{if(typeof rs>"u"){this.map.delete(Mn);return}if(!this.map.has(Mn))return;const is=this.get(Mn);if(!this.exists(Mn,rs))return;const os=is.filter(as=>as!==rs);if(!os.length){this.map.delete(Mn);return}this.map.set(Mn,os)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var sn=Object.defineProperty,rn=Object.defineProperties,nn=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable,Qt=(Fn,Mn,rs)=>Mn in Fn?sn(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,ee=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))on.call(Mn,rs)&&Qt(Fn,rs,Mn[rs]);if(Zt)for(var rs of Zt(Mn))an.call(Mn,rs)&&Qt(Fn,rs,Mn[rs]);return Fn},Ce$1=(Fn,Mn)=>rn(Fn,nn(Mn));class ei extends d$1{constructor(Mn,rs){super(Mn,rs),this.relayer=Mn,this.logger=rs,this.subscriptions=new Map,this.topicMap=new tn,this.events=new eventsExports.EventEmitter,this.name=pt$1,this.version=yt$1,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=O$1,this.subscribeTimeout=cjs$4.toMiliseconds(cjs$4.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(is,os)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:is,opts:os}});try{const as=zu(os),us={topic:is,relay:as,transportType:os==null?void 0:os.transportType};this.pending.set(is,us);const ds=await this.rpcSubscribe(is,as,os==null?void 0:os.transportType);return typeof ds=="string"&&(this.onSubscribe(ds,us),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:is,opts:os}})),ds}catch(as){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(as),as}},this.unsubscribe=async(is,os)=>{await this.restartToComplete(),this.isInitialized(),typeof(os==null?void 0:os.id)<"u"?await this.unsubscribeById(is,os.id,os):await this.unsubscribeByTopic(is,os)},this.isSubscribed=async is=>{if(this.topics.includes(is))return!0;const os=`${this.pendingSubscriptionWatchLabel}_${is}`;return await new Promise((as,us)=>{const ds=new cjs$4.Watch;ds.start(os);const hs=setInterval(()=>{!this.pending.has(is)&&this.topics.includes(is)&&(clearInterval(hs),ds.stop(os),as(!0)),ds.elapsed(os)>=Dt&&(clearInterval(hs),ds.stop(os),us(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(is,os)=>{this.events.on(is,os)},this.once=(is,os)=>{this.events.once(is,os)},this.off=(is,os)=>{this.events.off(is,os)},this.removeListener=(is,os)=>{this.events.removeListener(is,os)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=Mn,this.logger=E$3(rs,this.name),this.clientId=""}get context(){return y$4(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(Mn,rs){let is=!1;try{is=this.getSubscription(Mn).topic===rs}catch{}return is}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(Mn,rs){const is=this.topicMap.get(Mn);await Promise.all(is.map(async os=>await this.unsubscribeById(Mn,os,rs)))}async unsubscribeById(Mn,rs,is){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:Mn,id:rs,opts:is}});try{const os=zu(is);await this.rpcUnsubscribe(Mn,rs,os);const as=er$1("USER_DISCONNECTED",`${this.name}, ${Mn}`);await this.onUnsubscribe(Mn,rs,as),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:Mn,id:rs,opts:is}})}catch(os){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(os),os}}async rpcSubscribe(Mn,rs,is=F$1.relay){is===F$1.relay&&await this.restartToComplete();const os={method:ju(rs.protocol).subscribe,params:{topic:Mn}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:os});try{const as=Ou(Mn+this.clientId);return is===F$1.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(os).catch(us=>this.logger.warn(us))},cjs$4.toMiliseconds(cjs$4.ONE_SECOND)),as):await await ms$1(this.relayer.request(os).catch(us=>this.logger.warn(us)),this.subscribeTimeout)?as:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(w$1.connection_stalled)}return null}async rpcBatchSubscribe(Mn){if(!Mn.length)return;const rs=Mn[0].relay,is={method:ju(rs.protocol).batchSubscribe,params:{topics:Mn.map(os=>os.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:is});try{return await await ms$1(this.relayer.request(is).catch(os=>this.logger.warn(os)),this.subscribeTimeout)}catch{this.relayer.events.emit(w$1.connection_stalled)}}async rpcBatchFetchMessages(Mn){if(!Mn.length)return;const rs=Mn[0].relay,is={method:ju(rs.protocol).batchFetchMessages,params:{topics:Mn.map(as=>as.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:is});let os;try{os=await await ms$1(this.relayer.request(is).catch(as=>this.logger.warn(as)),this.subscribeTimeout)}catch{this.relayer.events.emit(w$1.connection_stalled)}return os}rpcUnsubscribe(Mn,rs,is){const os={method:ju(is.protocol).unsubscribe,params:{topic:Mn,id:rs}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:os}),this.relayer.request(os)}onSubscribe(Mn,rs){this.setSubscription(Mn,Ce$1(ee({},rs),{id:Mn})),this.pending.delete(rs.topic)}onBatchSubscribe(Mn){Mn.length&&Mn.forEach(rs=>{this.setSubscription(rs.id,ee({},rs)),this.pending.delete(rs.topic)})}async onUnsubscribe(Mn,rs,is){this.events.removeAllListeners(rs),this.hasSubscription(rs,Mn)&&this.deleteSubscription(rs,is),await this.relayer.messages.del(Mn)}async setRelayerSubscriptions(Mn){await this.relayer.core.storage.setItem(this.storageKey,Mn)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(Mn,rs){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:Mn,subscription:rs}),this.addSubscription(Mn,rs)}addSubscription(Mn,rs){this.subscriptions.set(Mn,ee({},rs)),this.topicMap.set(rs.topic,Mn),this.events.emit(A.created,rs)}getSubscription(Mn){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:Mn});const rs=this.subscriptions.get(Mn);if(!rs){const{message:is}=xe$1("NO_MATCHING_KEY",`${this.name}: ${Mn}`);throw new Error(is)}return rs}deleteSubscription(Mn,rs){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:Mn,reason:rs});const is=this.getSubscription(Mn);this.subscriptions.delete(Mn),this.topicMap.delete(is.topic,Mn),this.events.emit(A.deleted,Ce$1(ee({},is),{reason:rs}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(A.sync)}async reset(){if(this.cached.length){const Mn=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let rs=0;rs<Mn;rs++){const is=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(is),await this.batchSubscribe(is)}}this.events.emit(A.resubscribed)}async restore(){try{const Mn=await this.getRelayerSubscriptions();if(typeof Mn>"u"||!Mn.length)return;if(this.subscriptions.size){const{message:rs}=xe$1("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(rs),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(rs)}this.cached=Mn,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(Mn){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(Mn)}}async batchSubscribe(Mn){if(!Mn.length)return;const rs=await this.rpcBatchSubscribe(Mn);Nr$1(rs)&&this.onBatchSubscribe(rs.map((is,os)=>Ce$1(ee({},Mn[os]),{id:is})))}async batchFetchMessages(Mn){if(!Mn.length)return;this.logger.trace(`Fetching batch messages for ${Mn.length} subscriptions`);const rs=await this.rpcBatchFetchMessages(Mn);rs&&rs.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(rs.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const Mn=[];this.pending.forEach(rs=>{Mn.push(rs)}),await this.batchSubscribe(Mn),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(r$4.pulse,async()=>{await this.checkPending()}),this.events.on(A.created,async Mn=>{const rs=A.created;this.logger.info(`Emitting ${rs}`),this.logger.debug({type:"event",event:rs,data:Mn}),await this.persist()}),this.events.on(A.deleted,async Mn=>{const rs=A.deleted;this.logger.info(`Emitting ${rs}`),this.logger.debug({type:"event",event:rs,data:Mn}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:Mn}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Mn)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(Mn=>{const rs=setInterval(()=>{this.restartInProgress||(clearInterval(rs),Mn())},this.pollingInterval)})}}var cn=Object.defineProperty,ti=Object.getOwnPropertySymbols,hn=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable,ii=(Fn,Mn,rs)=>Mn in Fn?cn(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,un=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))hn.call(Mn,rs)&&ii(Fn,rs,Mn[rs]);if(ti)for(var rs of ti(Mn))ln.call(Mn,rs)&&ii(Fn,rs,Mn[rs]);return Fn};class si extends u{constructor(Mn){super(Mn),this.protocol="wc",this.version=2,this.events=new eventsExports.EventEmitter,this.name=ht$1,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=cjs$4.toMiliseconds(cjs$4.THIRTY_SECONDS+cjs$4.ONE_SECOND),this.request=async rs=>{var is,os;this.logger.debug("Publishing Request Payload");const as=rs.id||getBigIntRpcId().toString();await this.toEstablishConnection();try{const us=this.provider.request(rs);this.requestsInFlight.set(as,{promise:us,request:rs}),this.logger.trace({id:as,method:rs.method,topic:(is=rs.params)==null?void 0:is.topic},"relayer.request - attempt to publish...");const ds=await new Promise(async(hs,ps)=>{const io=()=>{ps(new Error(`relayer.request - publish interrupted, id: ${as}`))};this.provider.on(T$1.disconnect,io);const fo=await us;this.provider.off(T$1.disconnect,io),hs(fo)});return this.logger.trace({id:as,method:rs.method,topic:(os=rs.params)==null?void 0:os.topic},"relayer.request - published"),ds}catch(us){throw this.logger.debug(`Failed to Publish Request: ${as}`),us}finally{this.requestsInFlight.delete(as)}},this.resetPingTimeout=()=>{if(bi$1())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var rs,is,os;(os=(is=(rs=this.provider)==null?void 0:rs.connection)==null?void 0:is.socket)==null||os.terminate()},this.heartBeatTimeout)}catch(rs){this.logger.warn(rs)}},this.onPayloadHandler=rs=>{this.onProviderPayload(rs),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(w$1.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=rs=>{this.logger.error(rs),this.events.emit(w$1.error,rs),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(T$1.payload,this.onPayloadHandler),this.provider.on(T$1.connect,this.onConnectHandler),this.provider.on(T$1.disconnect,this.onDisconnectHandler),this.provider.on(T$1.error,this.onProviderErrorHandler)},this.core=Mn.core,this.logger=typeof Mn.logger<"u"&&typeof Mn.logger!="string"?E$3(Mn.logger,this.name):Mg(k$2({level:Mn.logger||ct$1})),this.messages=new Xt(this.logger,Mn.core),this.subscriber=new ei(this,this.logger),this.publisher=new en$1(this,this.logger),this.relayUrl=(Mn==null?void 0:Mn.relayUrl)||Ee,this.projectId=Mn.projectId,this.bundleId=ns(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(Mn){this.logger.warn(Mn)}}get context(){return y$4(this.logger)}get connected(){var Mn,rs,is;return((is=(rs=(Mn=this.provider)==null?void 0:Mn.connection)==null?void 0:rs.socket)==null?void 0:is.readyState)===1}get connecting(){var Mn,rs,is;return((is=(rs=(Mn=this.provider)==null?void 0:Mn.connection)==null?void 0:rs.socket)==null?void 0:is.readyState)===0}async publish(Mn,rs,is){this.isInitialized(),await this.publisher.publish(Mn,rs,is),await this.recordMessageEvent({topic:Mn,message:rs,publishedAt:Date.now(),transportType:F$1.relay})}async subscribe(Mn,rs){var is;this.isInitialized(),(rs==null?void 0:rs.transportType)==="relay"&&await this.toEstablishConnection();let os=((is=this.subscriber.topicMap.get(Mn))==null?void 0:is[0])||"",as;const us=ds=>{ds.topic===Mn&&(this.subscriber.off(A.created,us),as())};return await Promise.all([new Promise(ds=>{as=ds,this.subscriber.on(A.created,us)}),new Promise(async ds=>{os=await this.subscriber.subscribe(Mn,rs)||os,ds()})]),os}async unsubscribe(Mn,rs){this.isInitialized(),await this.subscriber.unsubscribe(Mn,rs)}on(Mn,rs){this.events.on(Mn,rs)}once(Mn,rs){this.events.once(Mn,rs)}off(Mn,rs){this.events.off(Mn,rs)}removeListener(Mn,rs){this.events.removeListener(Mn,rs)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(Mn=>Mn.promise))}catch(Mn){this.logger.warn(Mn)}this.hasExperiencedNetworkDisruption||this.connected?await ms$1(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(Mn){await this.confirmOnlineStateOrThrow(),Mn&&Mn!==this.relayUrl&&(this.relayUrl=Mn,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(rs,is)=>{const os=()=>{this.provider.off(T$1.disconnect,os),is(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(T$1.disconnect,os),await ms$1(this.provider.connect(),cjs$4.toMiliseconds(cjs$4.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(as=>{is(as)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(as=>{this.logger.error(as),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,rs()})}catch(rs){this.logger.error(rs);const is=rs;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(is.message))throw rs}finally{this.connectionAttemptInProgress=!1}}async restartTransport(Mn){this.connectionAttemptInProgress||(this.relayUrl=Mn||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Bh())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(Mn){if((Mn==null?void 0:Mn.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const rs=Mn.sort((is,os)=>is.publishedAt-os.publishedAt);this.logger.trace(`Batch of ${rs.length} message events sorted`);for(const is of rs)try{await this.onMessageEvent(is)}catch(os){this.logger.warn(os)}this.logger.trace(`Batch of ${rs.length} message events processed`)}async onLinkMessageEvent(Mn,rs){const{topic:is}=Mn;if(!rs.sessionExists){const os=ws$1(cjs$4.FIVE_MINUTES),as={topic:is,expiry:os,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(is,as)}this.events.emit(w$1.message,Mn),await this.recordMessageEvent(Mn)}startPingTimeout(){var Mn,rs,is,os,as;if(bi$1())try{(rs=(Mn=this.provider)==null?void 0:Mn.connection)!=null&&rs.socket&&((as=(os=(is=this.provider)==null?void 0:is.connection)==null?void 0:os.socket)==null||as.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(us){this.logger.warn(us)}}isConnectionStalled(Mn){return this.staleConnectionErrors.some(rs=>Mn.includes(rs))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const Mn=await this.core.crypto.signJWT(this.relayUrl);this.provider=new o$2(new f$1(ss({sdkVersion:oe$1,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:Mn,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(Mn){const{topic:rs,message:is}=Mn;await this.messages.set(rs,is)}async shouldIgnoreMessageEvent(Mn){const{topic:rs,message:is}=Mn;if(!is||is.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${is}`),!0;if(!await this.subscriber.isSubscribed(rs))return this.logger.debug(`Ignoring message for non-subscribed topic ${rs}`),!0;const os=this.messages.has(rs,is);return os&&this.logger.debug(`Ignoring duplicate message: ${is}`),os}async onProviderPayload(Mn){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:Mn}),isJsonRpcRequest(Mn)){if(!Mn.method.endsWith(lt$1))return;const rs=Mn.params,{topic:is,message:os,publishedAt:as,attestation:us}=rs.data,ds={topic:is,message:os,publishedAt:as,transportType:F$1.relay,attestation:us};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(un({type:"event",event:rs.id},ds)),this.events.emit(rs.id,ds),await this.acknowledgePayload(Mn),await this.onMessageEvent(ds)}else isJsonRpcResponse(Mn)&&this.events.emit(w$1.message_ack,Mn)}async onMessageEvent(Mn){await this.shouldIgnoreMessageEvent(Mn)||(this.events.emit(w$1.message,Mn),await this.recordMessageEvent(Mn))}async acknowledgePayload(Mn){const rs=formatJsonRpcResult(Mn.id,!0);await this.provider.connection.send(rs)}unregisterProviderListeners(){this.provider.off(T$1.payload,this.onPayloadHandler),this.provider.off(T$1.connect,this.onConnectHandler),this.provider.off(T$1.disconnect,this.onDisconnectHandler),this.provider.off(T$1.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let Mn=await Bh();Ch(async rs=>{Mn!==rs&&(Mn=rs,rs?await this.restartTransport().catch(is=>this.logger.error(is)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(w$1.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(Mn=>this.logger.error(Mn))},cjs$4.toMiliseconds(ut$1))))}isInitialized(){if(!this.initialized){const{message:Mn}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Mn)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(Mn=>{const rs=setInterval(()=>{this.connected&&(clearInterval(rs),Mn())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var dn=Object.defineProperty,ri=Object.getOwnPropertySymbols,gn=Object.prototype.hasOwnProperty,pn=Object.prototype.propertyIsEnumerable,ni=(Fn,Mn,rs)=>Mn in Fn?dn(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,oi=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))gn.call(Mn,rs)&&ni(Fn,rs,Mn[rs]);if(ri)for(var rs of ri(Mn))pn.call(Mn,rs)&&ni(Fn,rs,Mn[rs]);return Fn};class ai extends p$1{constructor(Mn,rs,is,os=O$1,as=void 0){super(Mn,rs,is,os),this.core=Mn,this.logger=rs,this.name=is,this.map=new Map,this.version=dt$1,this.cached=[],this.initialized=!1,this.storagePrefix=O$1,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(us=>{this.getKey&&us!==null&&!Pe(us)?this.map.set(this.getKey(us),us):lh(us)?this.map.set(us.id,us):dh(us)&&this.map.set(us.topic,us)}),this.cached=[],this.initialized=!0)},this.set=async(us,ds)=>{this.isInitialized(),this.map.has(us)?await this.update(us,ds):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:us,value:ds}),this.map.set(us,ds),await this.persist())},this.get=us=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:us}),this.getData(us)),this.getAll=us=>(this.isInitialized(),us?this.values.filter(ds=>Object.keys(us).every(hs=>bs(ds[hs],us[hs]))):this.values),this.update=async(us,ds)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:us,update:ds});const hs=oi(oi({},this.getData(us)),ds);this.map.set(us,hs),await this.persist()},this.delete=async(us,ds)=>{this.isInitialized(),this.map.has(us)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:us,reason:ds}),this.map.delete(us),this.addToRecentlyDeleted(us),await this.persist())},this.logger=E$3(rs,this.name),this.storagePrefix=os,this.getKey=as}get context(){return y$4(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(Mn){this.recentlyDeleted.push(Mn),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(Mn){await this.core.storage.setItem(this.storageKey,Mn)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(Mn){const rs=this.map.get(Mn);if(!rs){if(this.recentlyDeleted.includes(Mn)){const{message:os}=xe$1("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${Mn}`);throw this.logger.error(os),new Error(os)}const{message:is}=xe$1("NO_MATCHING_KEY",`${this.name}: ${Mn}`);throw this.logger.error(is),new Error(is)}return rs}async persist(){await this.setDataStore(this.values)}async restore(){try{const Mn=await this.getDataStore();if(typeof Mn>"u"||!Mn.length)return;if(this.map.size){const{message:rs}=xe$1("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(rs),new Error(rs)}this.cached=Mn,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(Mn){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(Mn)}}isInitialized(){if(!this.initialized){const{message:Mn}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Mn)}}}class ci{constructor(Mn,rs){this.core=Mn,this.logger=rs,this.name=mt,this.version=bt,this.events=new Jg,this.initialized=!1,this.storagePrefix=O$1,this.ignoredPayloadTypes=[pr$2],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:is})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...is])]},this.create=async is=>{this.isInitialized();const os=Bu(),as=await this.core.crypto.setSymKey(os),us=ws$1(cjs$4.FIVE_MINUTES),ds={protocol:at$1},hs={topic:as,expiry:us,relay:ds,active:!1,methods:is==null?void 0:is.methods},ps=$u({protocol:this.core.protocol,version:this.core.version,topic:as,symKey:os,relay:ds,expiryTimestamp:us,methods:is==null?void 0:is.methods});return this.events.emit(q.create,hs),this.core.expirer.set(as,us),await this.pairings.set(as,hs),await this.core.relayer.subscribe(as,{transportType:is==null?void 0:is.transportType}),{topic:as,uri:ps}},this.pair=async is=>{this.isInitialized();const os=this.core.eventClient.createEvent({properties:{topic:is==null?void 0:is.uri,trace:[z$1.pairing_started]}});this.isValidPair(is,os);const{topic:as,symKey:us,relay:ds,expiryTimestamp:hs,methods:ps}=Xu(is.uri);os.props.properties.topic=as,os.addTrace(z$1.pairing_uri_validation_success),os.addTrace(z$1.pairing_uri_not_expired);let io;if(this.pairings.keys.includes(as)){if(io=this.pairings.get(as),os.addTrace(z$1.existing_pairing),io.active)throw os.setError(M.active_pairing_already_exists),new Error(`Pairing already exists: ${as}. Please try again with a new connection URI.`);os.addTrace(z$1.pairing_not_expired)}const fo=hs||ws$1(cjs$4.FIVE_MINUTES),mo={topic:as,relay:ds,expiry:fo,active:!1,methods:ps};this.core.expirer.set(as,fo),await this.pairings.set(as,mo),os.addTrace(z$1.store_new_pairing),is.activatePairing&&await this.activate({topic:as}),this.events.emit(q.create,mo),os.addTrace(z$1.emit_inactive_pairing),this.core.crypto.keychain.has(as)||await this.core.crypto.setSymKey(us,as),os.addTrace(z$1.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{os.setError(M.no_internet_connection)}try{await this.core.relayer.subscribe(as,{relay:ds})}catch(Ao){throw os.setError(M.subscribe_pairing_topic_failure),Ao}return os.addTrace(z$1.subscribe_pairing_topic_success),mo},this.activate=async({topic:is})=>{this.isInitialized();const os=ws$1(cjs$4.THIRTY_DAYS);this.core.expirer.set(is,os),await this.pairings.update(is,{active:!0,expiry:os})},this.ping=async is=>{this.isInitialized(),await this.isValidPing(is);const{topic:os}=is;if(this.pairings.keys.includes(os)){const as=await this.sendRequest(os,"wc_pairingPing",{}),{done:us,resolve:ds,reject:hs}=gs();this.events.once(Ms$1("pairing_ping",as),({error:ps})=>{ps?hs(ps):ds()}),await us()}},this.updateExpiry=async({topic:is,expiry:os})=>{this.isInitialized(),await this.pairings.update(is,{expiry:os})},this.updateMetadata=async({topic:is,metadata:os})=>{this.isInitialized(),await this.pairings.update(is,{peerMetadata:os})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async is=>{this.isInitialized(),await this.isValidDisconnect(is);const{topic:os}=is;this.pairings.keys.includes(os)&&(await this.sendRequest(os,"wc_pairingDelete",er$1("USER_DISCONNECTED")),await this.deletePairing(os))},this.formatUriFromPairing=is=>{this.isInitialized();const{topic:os,relay:as,expiry:us,methods:ds}=is,hs=this.core.crypto.keychain.get(os);return $u({protocol:this.core.protocol,version:this.core.version,topic:os,symKey:hs,relay:as,expiryTimestamp:us,methods:ds})},this.sendRequest=async(is,os,as)=>{const us=formatJsonRpcRequest(os,as),ds=await this.core.crypto.encode(is,us),hs=j$1[os].req;return this.core.history.set(is,us),this.core.relayer.publish(is,ds,hs),us.id},this.sendResult=async(is,os,as)=>{const us=formatJsonRpcResult(is,as),ds=await this.core.crypto.encode(os,us),hs=await this.core.history.get(os,is),ps=j$1[hs.request.method].res;await this.core.relayer.publish(os,ds,ps),await this.core.history.resolve(us)},this.sendError=async(is,os,as)=>{const us=formatJsonRpcError(is,as),ds=await this.core.crypto.encode(os,us),hs=await this.core.history.get(os,is),ps=j$1[hs.request.method]?j$1[hs.request.method].res:j$1.unregistered_method.res;await this.core.relayer.publish(os,ds,ps),await this.core.history.resolve(us)},this.deletePairing=async(is,os)=>{await this.core.relayer.unsubscribe(is),await Promise.all([this.pairings.delete(is,er$1("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(is),os?Promise.resolve():this.core.expirer.del(is)])},this.cleanup=async()=>{const is=this.pairings.getAll().filter(os=>xs$1(os.expiry));await Promise.all(is.map(os=>this.deletePairing(os.topic)))},this.onRelayEventRequest=is=>{const{topic:os,payload:as}=is;switch(as.method){case"wc_pairingPing":return this.onPairingPingRequest(os,as);case"wc_pairingDelete":return this.onPairingDeleteRequest(os,as);default:return this.onUnknownRpcMethodRequest(os,as)}},this.onRelayEventResponse=async is=>{const{topic:os,payload:as}=is,us=(await this.core.history.get(os,as.id)).request.method;switch(us){case"wc_pairingPing":return this.onPairingPingResponse(os,as);default:return this.onUnknownRpcMethodResponse(us)}},this.onPairingPingRequest=async(is,os)=>{const{id:as}=os;try{this.isValidPing({topic:is}),await this.sendResult(as,is,!0),this.events.emit(q.ping,{id:as,topic:is})}catch(us){await this.sendError(as,is,us),this.logger.error(us)}},this.onPairingPingResponse=(is,os)=>{const{id:as}=os;setTimeout(()=>{isJsonRpcResult(os)?this.events.emit(Ms$1("pairing_ping",as),{}):isJsonRpcError(os)&&this.events.emit(Ms$1("pairing_ping",as),{error:os.error})},500)},this.onPairingDeleteRequest=async(is,os)=>{const{id:as}=os;try{this.isValidDisconnect({topic:is}),await this.deletePairing(is),this.events.emit(q.delete,{id:as,topic:is})}catch(us){await this.sendError(as,is,us),this.logger.error(us)}},this.onUnknownRpcMethodRequest=async(is,os)=>{const{id:as,method:us}=os;try{if(this.registeredMethods.includes(us))return;const ds=er$1("WC_METHOD_UNSUPPORTED",us);await this.sendError(as,is,ds),this.logger.error(ds)}catch(ds){await this.sendError(as,is,ds),this.logger.error(ds)}},this.onUnknownRpcMethodResponse=is=>{this.registeredMethods.includes(is)||this.logger.error(er$1("WC_METHOD_UNSUPPORTED",is))},this.isValidPair=(is,os)=>{var as;if(!Ah(is)){const{message:ds}=xe$1("MISSING_OR_INVALID",`pair() params: ${is}`);throw os.setError(M.malformed_pairing_uri),new Error(ds)}if(!ch(is.uri)){const{message:ds}=xe$1("MISSING_OR_INVALID",`pair() uri: ${is.uri}`);throw os.setError(M.malformed_pairing_uri),new Error(ds)}const us=Xu(is==null?void 0:is.uri);if(!((as=us==null?void 0:us.relay)!=null&&as.protocol)){const{message:ds}=xe$1("MISSING_OR_INVALID","pair() uri#relay-protocol");throw os.setError(M.malformed_pairing_uri),new Error(ds)}if(!(us!=null&&us.symKey)){const{message:ds}=xe$1("MISSING_OR_INVALID","pair() uri#symKey");throw os.setError(M.malformed_pairing_uri),new Error(ds)}if(us!=null&&us.expiryTimestamp&&cjs$4.toMiliseconds(us==null?void 0:us.expiryTimestamp)<Date.now()){os.setError(M.pairing_expired);const{message:ds}=xe$1("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(ds)}},this.isValidPing=async is=>{if(!Ah(is)){const{message:as}=xe$1("MISSING_OR_INVALID",`ping() params: ${is}`);throw new Error(as)}const{topic:os}=is;await this.isValidPairingTopic(os)},this.isValidDisconnect=async is=>{if(!Ah(is)){const{message:as}=xe$1("MISSING_OR_INVALID",`disconnect() params: ${is}`);throw new Error(as)}const{topic:os}=is;await this.isValidPairingTopic(os)},this.isValidPairingTopic=async is=>{if(!Yt$1(is,!1)){const{message:os}=xe$1("MISSING_OR_INVALID",`pairing topic should be a string: ${is}`);throw new Error(os)}if(!this.pairings.keys.includes(is)){const{message:os}=xe$1("NO_MATCHING_KEY",`pairing topic doesn't exist: ${is}`);throw new Error(os)}if(xs$1(this.pairings.get(is).expiry)){await this.deletePairing(is);const{message:os}=xe$1("EXPIRED",`pairing topic: ${is}`);throw new Error(os)}},this.core=Mn,this.logger=E$3(rs,this.name),this.pairings=new ai(this.core,this.logger,this.name,this.storagePrefix)}get context(){return y$4(this.logger)}isInitialized(){if(!this.initialized){const{message:Mn}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Mn)}}registerRelayerEvents(){this.core.relayer.on(w$1.message,async Mn=>{const{topic:rs,message:is,transportType:os}=Mn;if(!this.pairings.keys.includes(rs)||os===F$1.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(is)))return;const as=await this.core.crypto.decode(rs,is);try{isJsonRpcRequest(as)?(this.core.history.set(rs,as),this.onRelayEventRequest({topic:rs,payload:as})):isJsonRpcResponse(as)&&(await this.core.history.resolve(as),await this.onRelayEventResponse({topic:rs,payload:as}),this.core.history.delete(rs,as.id))}catch(us){this.logger.error(us)}})}registerExpirerEvents(){this.core.expirer.on(R.expired,async Mn=>{const{topic:rs}=ys$1(Mn.target);rs&&this.pairings.keys.includes(rs)&&(await this.deletePairing(rs,!0),this.events.emit(q.expire,{topic:rs}))})}}class hi extends h$1{constructor(Mn,rs){super(Mn,rs),this.core=Mn,this.logger=rs,this.records=new Map,this.events=new eventsExports.EventEmitter,this.name=ft,this.version=_t,this.cached=[],this.initialized=!1,this.storagePrefix=O$1,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(is=>this.records.set(is.id,is)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(is,os,as)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:is,request:os,chainId:as}),this.records.has(os.id))return;const us={id:os.id,topic:is,request:{method:os.method,params:os.params||null},chainId:as,expiry:ws$1(cjs$4.THIRTY_DAYS)};this.records.set(us.id,us),this.persist(),this.events.emit(P$1.created,us)},this.resolve=async is=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:is}),!this.records.has(is.id))return;const os=await this.getRecord(is.id);typeof os.response>"u"&&(os.response=isJsonRpcError(is)?{error:is.error}:{result:is.result},this.records.set(os.id,os),this.persist(),this.events.emit(P$1.updated,os))},this.get=async(is,os)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:is,id:os}),await this.getRecord(os)),this.delete=(is,os)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:os}),this.values.forEach(as=>{if(as.topic===is){if(typeof os<"u"&&as.id!==os)return;this.records.delete(as.id),this.events.emit(P$1.deleted,as)}}),this.persist()},this.exists=async(is,os)=>(this.isInitialized(),this.records.has(os)?(await this.getRecord(os)).topic===is:!1),this.on=(is,os)=>{this.events.on(is,os)},this.once=(is,os)=>{this.events.once(is,os)},this.off=(is,os)=>{this.events.off(is,os)},this.removeListener=(is,os)=>{this.events.removeListener(is,os)},this.logger=E$3(rs,this.name)}get context(){return y$4(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const Mn=[];return this.values.forEach(rs=>{if(typeof rs.response<"u")return;const is={topic:rs.topic,request:formatJsonRpcRequest(rs.request.method,rs.request.params,rs.id),chainId:rs.chainId};return Mn.push(is)}),Mn}async setJsonRpcRecords(Mn){await this.core.storage.setItem(this.storageKey,Mn)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(Mn){this.isInitialized();const rs=this.records.get(Mn);if(!rs){const{message:is}=xe$1("NO_MATCHING_KEY",`${this.name}: ${Mn}`);throw new Error(is)}return rs}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(P$1.sync)}async restore(){try{const Mn=await this.getJsonRpcRecords();if(typeof Mn>"u"||!Mn.length)return;if(this.records.size){const{message:rs}=xe$1("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(rs),new Error(rs)}this.cached=Mn,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(Mn){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(Mn)}}registerEventListeners(){this.events.on(P$1.created,Mn=>{const rs=P$1.created;this.logger.info(`Emitting ${rs}`),this.logger.debug({type:"event",event:rs,record:Mn})}),this.events.on(P$1.updated,Mn=>{const rs=P$1.updated;this.logger.info(`Emitting ${rs}`),this.logger.debug({type:"event",event:rs,record:Mn})}),this.events.on(P$1.deleted,Mn=>{const rs=P$1.deleted;this.logger.info(`Emitting ${rs}`),this.logger.debug({type:"event",event:rs,record:Mn})}),this.core.heartbeat.on(r$4.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let Mn=!1;this.records.forEach(rs=>{cjs$4.toMiliseconds(rs.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${rs.id}`),this.records.delete(rs.id),this.events.emit(P$1.deleted,rs,!1),Mn=!0)}),Mn&&this.persist()}catch(Mn){this.logger.warn(Mn)}}isInitialized(){if(!this.initialized){const{message:Mn}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Mn)}}}class li extends x$1{constructor(Mn,rs){super(Mn,rs),this.core=Mn,this.logger=rs,this.expirations=new Map,this.events=new eventsExports.EventEmitter,this.name=Et,this.version=vt,this.cached=[],this.initialized=!1,this.storagePrefix=O$1,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(is=>this.expirations.set(is.target,is)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=is=>{try{const os=this.formatTarget(is);return typeof this.getExpiration(os)<"u"}catch{return!1}},this.set=(is,os)=>{this.isInitialized();const as=this.formatTarget(is),us={target:as,expiry:os};this.expirations.set(as,us),this.checkExpiry(as,us),this.events.emit(R.created,{target:as,expiration:us})},this.get=is=>{this.isInitialized();const os=this.formatTarget(is);return this.getExpiration(os)},this.del=is=>{if(this.isInitialized(),this.has(is)){const os=this.formatTarget(is),as=this.getExpiration(os);this.expirations.delete(os),this.events.emit(R.deleted,{target:os,expiration:as})}},this.on=(is,os)=>{this.events.on(is,os)},this.once=(is,os)=>{this.events.once(is,os)},this.off=(is,os)=>{this.events.off(is,os)},this.removeListener=(is,os)=>{this.events.removeListener(is,os)},this.logger=E$3(rs,this.name)}get context(){return y$4(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(Mn){if(typeof Mn=="string")return As$1(Mn);if(typeof Mn=="number")return bs$1(Mn);const{message:rs}=xe$1("UNKNOWN_TYPE",`Target type: ${typeof Mn}`);throw new Error(rs)}async setExpirations(Mn){await this.core.storage.setItem(this.storageKey,Mn)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(R.sync)}async restore(){try{const Mn=await this.getExpirations();if(typeof Mn>"u"||!Mn.length)return;if(this.expirations.size){const{message:rs}=xe$1("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(rs),new Error(rs)}this.cached=Mn,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(Mn){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(Mn)}}getExpiration(Mn){const rs=this.expirations.get(Mn);if(!rs){const{message:is}=xe$1("NO_MATCHING_KEY",`${this.name}: ${Mn}`);throw this.logger.warn(is),new Error(is)}return rs}checkExpiry(Mn,rs){const{expiry:is}=rs;cjs$4.toMiliseconds(is)-Date.now()<=0&&this.expire(Mn,rs)}expire(Mn,rs){this.expirations.delete(Mn),this.events.emit(R.expired,{target:Mn,expiration:rs})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((Mn,rs)=>this.checkExpiry(rs,Mn))}registerEventListeners(){this.core.heartbeat.on(r$4.pulse,()=>this.checkExpirations()),this.events.on(R.created,Mn=>{const rs=R.created;this.logger.info(`Emitting ${rs}`),this.logger.debug({type:"event",event:rs,data:Mn}),this.persist()}),this.events.on(R.expired,Mn=>{const rs=R.expired;this.logger.info(`Emitting ${rs}`),this.logger.debug({type:"event",event:rs,data:Mn}),this.persist()}),this.events.on(R.deleted,Mn=>{const rs=R.deleted;this.logger.info(`Emitting ${rs}`),this.logger.debug({type:"event",event:rs,data:Mn}),this.persist()})}isInitialized(){if(!this.initialized){const{message:Mn}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Mn)}}}var y={};Object.defineProperty(y,"__esModule",{value:!0}),y.getLocalStorage=y.getLocalStorageOrThrow=y.getCrypto=y.getCryptoOrThrow=y.getLocation=y.getLocationOrThrow=y.getNavigator=y.getNavigatorOrThrow=ui=y.getDocument=y.getDocumentOrThrow=y.getFromWindowOrThrow=y.getFromWindow=void 0;function U(Fn){let Mn;return typeof window<"u"&&typeof window[Fn]<"u"&&(Mn=window[Fn]),Mn}y.getFromWindow=U;function G(Fn){const Mn=U(Fn);if(!Mn)throw new Error(`${Fn} is not defined in Window`);return Mn}y.getFromWindowOrThrow=G;function yn(){return G("document")}y.getDocumentOrThrow=yn;function Dn(){return U("document")}var ui=y.getDocument=Dn;function mn(){return G("navigator")}y.getNavigatorOrThrow=mn;function bn(){return U("navigator")}y.getNavigator=bn;function fn(){return G("location")}y.getLocationOrThrow=fn;function _n$1(){return U("location")}y.getLocation=_n$1;function En(){return G("crypto")}y.getCryptoOrThrow=En;function vn(){return U("crypto")}y.getCrypto=vn;function wn(){return G("localStorage")}y.getLocalStorageOrThrow=wn;function In(){return U("localStorage")}y.getLocalStorage=In;class di extends y$1{constructor(Mn,rs,is){super(Mn,rs,is),this.core=Mn,this.logger=rs,this.store=is,this.name=wt,this.verifyUrlV3=Tt$1,this.storagePrefix=O$1,this.version=fe,this.init=async()=>{var os;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&cjs$4.toMiliseconds((os=this.publicKey)==null?void 0:os.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))},this.register=async os=>{if(!gr$1()||this.isDevEnv)return;const as=window.location.origin,{id:us,decryptedId:ds}=os,hs=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${as}&id=${us}&decryptedId=${ds}`;try{const ps=ui(),io=this.startAbortTimer(cjs$4.ONE_SECOND*5),fo=await new Promise((mo,Ao)=>{const $o=()=>{window.removeEventListener("message",Go),ps.body.removeChild(Lo),Ao("attestation aborted")};this.abortController.signal.addEventListener("abort",$o);const Lo=ps.createElement("iframe");Lo.src=hs,Lo.style.display="none",Lo.addEventListener("error",$o,{signal:this.abortController.signal});const Go=Yo=>{if(Yo.data&&typeof Yo.data=="string")try{const Wo=JSON.parse(Yo.data);if(Wo.type==="verify_attestation"){if(decodeJWT(Wo.attestation).payload.id!==us)return;clearInterval(io),ps.body.removeChild(Lo),this.abortController.signal.removeEventListener("abort",$o),window.removeEventListener("message",Go),mo(Wo.attestation===null?"":Wo.attestation)}}catch(Wo){this.logger.warn(Wo)}};ps.body.appendChild(Lo),window.addEventListener("message",Go,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",fo),fo}catch(ps){this.logger.warn(ps)}return""},this.resolve=async os=>{if(this.isDevEnv)return"";const{attestationId:as,hash:us,encryptedId:ds}=os;if(as===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(as){if(decodeJWT(as).payload.id!==ds)return;const ps=await this.isValidJwtAttestation(as);if(ps){if(!ps.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return ps}}if(!us)return;const hs=this.getVerifyUrl(os==null?void 0:os.verifyUrl);return this.fetchAttestation(us,hs)},this.fetchAttestation=async(os,as)=>{this.logger.debug(`resolving attestation: ${os} from url: ${as}`);const us=this.startAbortTimer(cjs$4.ONE_SECOND*5),ds=await fetch(`${as}/attestation/${os}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(us),ds.status===200?await ds.json():void 0},this.getVerifyUrl=os=>{let as=os||Z;return Ct.includes(as)||(this.logger.info(`verify url: ${as}, not included in trusted list, assigning default: ${Z}`),as=Z),as},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const os=this.startAbortTimer(cjs$4.FIVE_SECONDS),as=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(os),await as.json()}catch(os){this.logger.warn(os)}},this.persistPublicKey=async os=>{this.logger.debug("persisting public key to local storage",os),await this.store.setItem(this.storeKey,os),this.publicKey=os},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async os=>{const as=await this.getPublicKey();try{if(as)return this.validateAttestation(os,as)}catch(ds){this.logger.error(ds),this.logger.warn("error validating attestation")}const us=await this.fetchAndPersistPublicKey();try{if(us)return this.validateAttestation(os,us)}catch(ds){this.logger.error(ds),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async as=>{const us=await this.fetchPublicKey();us&&(await this.persistPublicKey(us),as(us))});const os=await this.fetchPromise;return this.fetchPromise=void 0,os},this.validateAttestation=(os,as)=>{const us=Lu(os,as.publicKey),ds={hasExpired:cjs$4.toMiliseconds(us.exp)<Date.now(),payload:us};if(ds.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:ds.payload.origin,isScam:ds.payload.isScam,isVerified:ds.payload.isVerified}},this.logger=E$3(rs,this.name),this.abortController=new AbortController,this.isDevEnv=_s$1(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return y$4(this.logger)}startAbortTimer(Mn){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),cjs$4.toMiliseconds(Mn))}}class gi extends v$2{constructor(Mn,rs){super(Mn,rs),this.projectId=Mn,this.logger=rs,this.context=St,this.registerDeviceToken=async is=>{const{clientId:os,token:as,notificationType:us,enableEncrypted:ds=!1}=is,hs=`${Pt}/${this.projectId}/clients`;await fetch(hs,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:os,type:us,token:as,always_raw:ds})})},this.logger=E$3(rs,this.context)}}var Tn=Object.defineProperty,pi=Object.getOwnPropertySymbols,Cn=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable,yi=(Fn,Mn,rs)=>Mn in Fn?Tn(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,te=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))Cn.call(Mn,rs)&&yi(Fn,rs,Mn[rs]);if(pi)for(var rs of pi(Mn))Sn.call(Mn,rs)&&yi(Fn,rs,Mn[rs]);return Fn};class Di extends C$1{constructor(Mn,rs,is=!0){super(Mn,rs,is),this.core=Mn,this.logger=rs,this.context=xt,this.storagePrefix=O$1,this.storageVersion=Rt,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!_s$1())try{const os={eventId:Ns$1(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Pn$1(this.core.relayer.protocol,this.core.relayer.version,oe$1)}}};await this.sendEvent([os])}catch(os){this.logger.warn(os)}},this.createEvent=os=>{const{event:as="ERROR",type:us="",properties:{topic:ds,trace:hs}}=os,ps=Ns$1(),io=this.core.projectId||"",fo=Date.now(),mo=te({eventId:ps,timestamp:fo,props:{event:as,type:us,properties:{topic:ds,trace:hs}},bundleId:io,domain:this.getAppDomain()},this.setMethods(ps));return this.telemetryEnabled&&(this.events.set(ps,mo),this.shouldPersist=!0),mo},this.getEvent=os=>{const{eventId:as,topic:us}=os;if(as)return this.events.get(as);const ds=Array.from(this.events.values()).find(hs=>hs.props.properties.topic===us);if(ds)return te(te({},ds),this.setMethods(ds.eventId))},this.deleteEvent=os=>{const{eventId:as}=os;this.events.delete(as),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(r$4.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(os=>{cjs$4.fromMiliseconds(Date.now())-cjs$4.fromMiliseconds(os.timestamp)>Ot&&(this.events.delete(os.eventId),this.shouldPersist=!0)})})},this.setMethods=os=>({addTrace:as=>this.addTrace(os,as),setError:as=>this.setError(os,as)}),this.addTrace=(os,as)=>{const us=this.events.get(os);us&&(us.props.properties.trace.push(as),this.events.set(os,us),this.shouldPersist=!0)},this.setError=(os,as)=>{const us=this.events.get(os);us&&(us.props.type=as,us.timestamp=Date.now(),this.events.set(os,us),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const os=await this.core.storage.getItem(this.storageKey)||[];if(!os.length)return;os.forEach(as=>{this.events.set(as.eventId,te(te({},as),this.setMethods(as.eventId)))})}catch(os){this.logger.warn(os)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const os=[];for(const[as,us]of this.events)us.props.type&&os.push(us);if(os.length!==0)try{if((await this.sendEvent(os)).ok)for(const as of os)this.events.delete(as.eventId),this.shouldPersist=!0}catch(as){this.logger.warn(as)}},this.sendEvent=async os=>{const as=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${At}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${oe$1}${as}`,{method:"POST",body:JSON.stringify(os)})},this.getAppDomain=()=>fs$1().url,this.logger=E$3(rs,this.context),this.telemetryEnabled=is,is?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var Pn=Object.defineProperty,mi=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,xn=Object.prototype.propertyIsEnumerable,bi=(Fn,Mn,rs)=>Mn in Fn?Pn(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,fi=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))Rn.call(Mn,rs)&&bi(Fn,rs,Mn[rs]);if(mi)for(var rs of mi(Mn))xn.call(Mn,rs)&&bi(Fn,rs,Mn[rs]);return Fn};class ce extends n$2{constructor(Mn){var rs;super(Mn),this.protocol=be$1,this.version=fe,this.name=ne,this.events=new eventsExports.EventEmitter,this.initialized=!1,this.on=(us,ds)=>this.events.on(us,ds),this.once=(us,ds)=>this.events.once(us,ds),this.off=(us,ds)=>this.events.off(us,ds),this.removeListener=(us,ds)=>this.events.removeListener(us,ds),this.dispatchEnvelope=({topic:us,message:ds,sessionExists:hs})=>{if(!us||!ds)return;const ps={topic:us,message:ds,publishedAt:Date.now(),transportType:F$1.link_mode};this.relayer.onLinkMessageEvent(ps,{sessionExists:hs})},this.projectId=Mn==null?void 0:Mn.projectId,this.relayUrl=(Mn==null?void 0:Mn.relayUrl)||Ee,this.customStoragePrefix=Mn!=null&&Mn.customStoragePrefix?`:${Mn.customStoragePrefix}`:"";const is=k$2({level:typeof(Mn==null?void 0:Mn.logger)=="string"&&Mn.logger?Mn.logger:Xe.logger}),{logger:os,chunkLoggerController:as}=A$1({opts:is,maxSizeInBytes:Mn==null?void 0:Mn.maxLogBlobSizeInBytes,loggerOverride:Mn==null?void 0:Mn.logger});this.logChunkController=as,(rs=this.logChunkController)!=null&&rs.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var us,ds;(us=this.logChunkController)!=null&&us.downloadLogsBlobInBrowser&&((ds=this.logChunkController)==null||ds.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=E$3(os,this.name),this.heartbeat=new i$1,this.crypto=new Wt(this,this.logger,Mn==null?void 0:Mn.keychain),this.history=new hi(this,this.logger),this.expirer=new li(this,this.logger),this.storage=Mn!=null&&Mn.storage?Mn.storage:new h$2(fi(fi({},Ze),Mn==null?void 0:Mn.storageOptions)),this.relayer=new si({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new ci(this,this.logger),this.verify=new di(this,this.logger,this.storage),this.echoClient=new gi(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new Di(this,this.logger,Mn==null?void 0:Mn.telemetryEnabled)}static async init(Mn){const rs=new ce(Mn);await rs.initialize();const is=await rs.crypto.getClientId();return await rs.storage.setItem(gt$1,is),rs}get context(){return y$4(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var Mn;return(Mn=this.logChunkController)==null?void 0:Mn.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(Mn){this.linkModeSupportedApps.includes(Mn)||(this.linkModeSupportedApps.push(Mn),await this.storage.setItem(ve,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(ve)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(Mn){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,Mn),this.logger.error(Mn.message),Mn}}}const On=ce,be="wc",Ce=2,Le="client",ye=`${be}@${Ce}:${Le}:`,we={name:Le,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},xe="WALLETCONNECT_DEEPLINK_CHOICE",st="proposal",it="Proposal expired",rt="session",z=cjs$4.SEVEN_DAYS,nt="engine",v$1={wc_sessionPropose:{req:{ttl:cjs$4.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:cjs$4.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:cjs$4.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:cjs$4.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:cjs$4.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:cjs$4.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:1104},res:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:1106},res:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:cjs$4.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:cjs$4.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:cjs$4.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:cjs$4.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:1112},res:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:1114},res:{ttl:cjs$4.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:cjs$4.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:cjs$4.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:cjs$4.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:cjs$4.FIVE_MINUTES,prompt:!1,tag:1119}}},me={min:cjs$4.FIVE_MINUTES,max:cjs$4.SEVEN_DAYS},x={idle:"IDLE",active:"ACTIVE"},ot="request",at=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],ct="wc",lt="auth",pt="authKeys",ht="pairingTopics",dt="requests",oe=`${ct}@${1.5}:${lt}:`,ae=`${oe}:PUB_KEY`;var ys=Object.defineProperty,ws=Object.defineProperties,ms=Object.getOwnPropertyDescriptors,ut=Object.getOwnPropertySymbols,_s=Object.prototype.hasOwnProperty,Es=Object.prototype.propertyIsEnumerable,gt=(Fn,Mn,rs)=>Mn in Fn?ys(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,I=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))_s.call(Mn,rs)&&gt(Fn,rs,Mn[rs]);if(ut)for(var rs of ut(Mn))Es.call(Mn,rs)&&gt(Fn,rs,Mn[rs]);return Fn},D=(Fn,Mn)=>ws(Fn,ms(Mn));class Rs extends M$1{constructor(Mn){super(Mn),this.name=nt,this.events=new Jg,this.initialized=!1,this.requestQueue={state:x.idle,queue:[]},this.sessionRequestQueue={state:x.idle,queue:[]},this.requestQueueDelay=cjs$4.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(v$1)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},cjs$4.toMiliseconds(this.requestQueueDelay)))},this.connect=async rs=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const is=D(I({},rs),{requiredNamespaces:rs.requiredNamespaces||{},optionalNamespaces:rs.optionalNamespaces||{}});await this.isValidConnect(is);const{pairingTopic:os,requiredNamespaces:as,optionalNamespaces:us,sessionProperties:ds,relays:hs}=is;let ps=os,io,fo=!1;try{ps&&(fo=this.client.core.pairing.pairings.get(ps).active)}catch(xl){throw this.client.logger.error(`connect() -> pairing.get(${ps}) failed`),xl}if(!ps||!fo){const{topic:xl,uri:_l}=await this.client.core.pairing.create();ps=xl,io=_l}if(!ps){const{message:xl}=xe$1("NO_MATCHING_KEY",`connect() pairing topic: ${ps}`);throw new Error(xl)}const mo=await this.client.core.crypto.generateKeyPair(),Ao=v$1.wc_sessionPropose.req.ttl||cjs$4.FIVE_MINUTES,$o=ws$1(Ao),Lo=I({requiredNamespaces:as,optionalNamespaces:us,relays:hs??[{protocol:at$1}],proposer:{publicKey:mo,metadata:this.client.metadata},expiryTimestamp:$o,pairingTopic:ps},ds&&{sessionProperties:ds}),{reject:Go,resolve:Yo,done:Wo}=gs(Ao,it);this.events.once(Ms$1("session_connect"),async({error:xl,session:_l})=>{if(xl)Go(xl);else if(_l){_l.self.publicKey=mo;const Tl=D(I({},_l),{pairingTopic:Lo.pairingTopic,requiredNamespaces:Lo.requiredNamespaces,optionalNamespaces:Lo.optionalNamespaces,transportType:F$1.relay});await this.client.session.set(_l.topic,Tl),await this.setExpiry(_l.topic,_l.expiry),ps&&await this.client.core.pairing.updateMetadata({topic:ps,metadata:_l.peer.metadata}),this.cleanupDuplicatePairings(Tl),Yo(Tl)}});const Jo=await this.sendRequest({topic:ps,method:"wc_sessionPropose",params:Lo,throwOnFailedPublish:!0});return await this.setProposal(Jo,I({id:Jo},Lo)),{uri:io,approval:Wo}},this.pair=async rs=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(rs)}catch(is){throw this.client.logger.error("pair() failed"),is}},this.approve=async rs=>{var is,os,as;const us=this.client.core.eventClient.createEvent({properties:{topic:(is=rs==null?void 0:rs.id)==null?void 0:is.toString(),trace:[Cs.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch($l){throw us.setError(Ss$1.no_internet_connection),$l}try{await this.isValidProposalId(rs==null?void 0:rs.id)}catch($l){throw this.client.logger.error(`approve() -> proposal.get(${rs==null?void 0:rs.id}) failed`),us.setError(Ss$1.proposal_not_found),$l}try{await this.isValidApprove(rs)}catch($l){throw this.client.logger.error("approve() -> isValidApprove() failed"),us.setError(Ss$1.session_approve_namespace_validation_failure),$l}const{id:ds,relayProtocol:hs,namespaces:ps,sessionProperties:io,sessionConfig:fo}=rs,mo=this.client.proposal.get(ds);this.client.core.eventClient.deleteEvent({eventId:us.eventId});const{pairingTopic:Ao,proposer:$o,requiredNamespaces:Lo,optionalNamespaces:Go}=mo;let Yo=(os=this.client.core.eventClient)==null?void 0:os.getEvent({topic:Ao});Yo||(Yo=(as=this.client.core.eventClient)==null?void 0:as.createEvent({type:Cs.session_approve_started,properties:{topic:Ao,trace:[Cs.session_approve_started,Cs.session_namespaces_validation_success]}}));const Wo=await this.client.core.crypto.generateKeyPair(),Jo=$o.publicKey,xl=await this.client.core.crypto.generateSharedKey(Wo,Jo),_l=I(I({relay:{protocol:hs??"irn"},namespaces:ps,controller:{publicKey:Wo,metadata:this.client.metadata},expiry:ws$1(z)},io&&{sessionProperties:io}),fo&&{sessionConfig:fo}),Tl=F$1.relay;Yo.addTrace(Cs.subscribing_session_topic);try{await this.client.core.relayer.subscribe(xl,{transportType:Tl})}catch($l){throw Yo.setError(Ss$1.subscribe_session_topic_failure),$l}Yo.addTrace(Cs.subscribe_session_topic_success);const Sl=D(I({},_l),{topic:xl,requiredNamespaces:Lo,optionalNamespaces:Go,pairingTopic:Ao,acknowledged:!1,self:_l.controller,peer:{publicKey:$o.publicKey,metadata:$o.metadata},controller:Wo,transportType:F$1.relay});await this.client.session.set(xl,Sl),Yo.addTrace(Cs.store_session);try{Yo.addTrace(Cs.publishing_session_settle),await this.sendRequest({topic:xl,method:"wc_sessionSettle",params:_l,throwOnFailedPublish:!0}).catch($l=>{throw Yo==null||Yo.setError(Ss$1.session_settle_publish_failure),$l}),Yo.addTrace(Cs.session_settle_publish_success),Yo.addTrace(Cs.publishing_session_approve),await this.sendResult({id:ds,topic:Ao,result:{relay:{protocol:hs??"irn"},responderPublicKey:Wo},throwOnFailedPublish:!0}).catch($l=>{throw Yo==null||Yo.setError(Ss$1.session_approve_publish_failure),$l}),Yo.addTrace(Cs.session_approve_publish_success)}catch($l){throw this.client.logger.error($l),this.client.session.delete(xl,er$1("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(xl),$l}return this.client.core.eventClient.deleteEvent({eventId:Yo.eventId}),await this.client.core.pairing.updateMetadata({topic:Ao,metadata:$o.metadata}),await this.client.proposal.delete(ds,er$1("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:Ao}),await this.setExpiry(xl,ws$1(z)),{topic:xl,acknowledged:()=>Promise.resolve(this.client.session.get(xl))}},this.reject=async rs=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(rs)}catch(us){throw this.client.logger.error("reject() -> isValidReject() failed"),us}const{id:is,reason:os}=rs;let as;try{as=this.client.proposal.get(is).pairingTopic}catch(us){throw this.client.logger.error(`reject() -> proposal.get(${is}) failed`),us}as&&(await this.sendError({id:is,topic:as,error:os,rpcOpts:v$1.wc_sessionPropose.reject}),await this.client.proposal.delete(is,er$1("USER_DISCONNECTED")))},this.update=async rs=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(rs)}catch(fo){throw this.client.logger.error("update() -> isValidUpdate() failed"),fo}const{topic:is,namespaces:os}=rs,{done:as,resolve:us,reject:ds}=gs(),hs=payloadId(),ps=getBigIntRpcId().toString(),io=this.client.session.get(is).namespaces;return this.events.once(Ms$1("session_update",hs),({error:fo})=>{fo?ds(fo):us()}),await this.client.session.update(is,{namespaces:os}),await this.sendRequest({topic:is,method:"wc_sessionUpdate",params:{namespaces:os},throwOnFailedPublish:!0,clientRpcId:hs,relayRpcId:ps}).catch(fo=>{this.client.logger.error(fo),this.client.session.update(is,{namespaces:io}),ds(fo)}),{acknowledged:as}},this.extend=async rs=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(rs)}catch(hs){throw this.client.logger.error("extend() -> isValidExtend() failed"),hs}const{topic:is}=rs,os=payloadId(),{done:as,resolve:us,reject:ds}=gs();return this.events.once(Ms$1("session_extend",os),({error:hs})=>{hs?ds(hs):us()}),await this.setExpiry(is,ws$1(z)),this.sendRequest({topic:is,method:"wc_sessionExtend",params:{},clientRpcId:os,throwOnFailedPublish:!0}).catch(hs=>{ds(hs)}),{acknowledged:as}},this.request=async rs=>{this.isInitialized();try{await this.isValidRequest(rs)}catch($o){throw this.client.logger.error("request() -> isValidRequest() failed"),$o}const{chainId:is,request:os,topic:as,expiry:us=v$1.wc_sessionRequest.req.ttl}=rs,ds=this.client.session.get(as);(ds==null?void 0:ds.transportType)===F$1.relay&&await this.confirmOnlineStateOrThrow();const hs=payloadId(),ps=getBigIntRpcId().toString(),{done:io,resolve:fo,reject:mo}=gs(us,"Request expired. Please try again.");this.events.once(Ms$1("session_request",hs),({error:$o,result:Lo})=>{$o?mo($o):fo(Lo)});const Ao=this.getAppLinkIfEnabled(ds.peer.metadata,ds.transportType);return Ao?(await this.sendRequest({clientRpcId:hs,relayRpcId:ps,topic:as,method:"wc_sessionRequest",params:{request:D(I({},os),{expiryTimestamp:ws$1(us)}),chainId:is},expiry:us,throwOnFailedPublish:!0,appLink:Ao}).catch($o=>mo($o)),this.client.events.emit("session_request_sent",{topic:as,request:os,chainId:is,id:hs}),await io()):await Promise.all([new Promise(async $o=>{await this.sendRequest({clientRpcId:hs,relayRpcId:ps,topic:as,method:"wc_sessionRequest",params:{request:D(I({},os),{expiryTimestamp:ws$1(us)}),chainId:is},expiry:us,throwOnFailedPublish:!0}).catch(Lo=>mo(Lo)),this.client.events.emit("session_request_sent",{topic:as,request:os,chainId:is,id:hs}),$o()}),new Promise(async $o=>{var Lo;if(!((Lo=ds.sessionConfig)!=null&&Lo.disableDeepLink)){const Go=await Ss$2(this.client.core.storage,xe);await Es$1({id:hs,topic:as,wcDeepLink:Go})}$o()}),io()]).then($o=>$o[2])},this.respond=async rs=>{this.isInitialized(),await this.isValidRespond(rs);const{topic:is,response:os}=rs,{id:as}=os,us=this.client.session.get(is);us.transportType===F$1.relay&&await this.confirmOnlineStateOrThrow();const ds=this.getAppLinkIfEnabled(us.peer.metadata,us.transportType);isJsonRpcResult(os)?await this.sendResult({id:as,topic:is,result:os.result,throwOnFailedPublish:!0,appLink:ds}):isJsonRpcError(os)&&await this.sendError({id:as,topic:is,error:os.error,appLink:ds}),this.cleanupAfterResponse(rs)},this.ping=async rs=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(rs)}catch(os){throw this.client.logger.error("ping() -> isValidPing() failed"),os}const{topic:is}=rs;if(this.client.session.keys.includes(is)){const os=payloadId(),as=getBigIntRpcId().toString(),{done:us,resolve:ds,reject:hs}=gs();this.events.once(Ms$1("session_ping",os),({error:ps})=>{ps?hs(ps):ds()}),await Promise.all([this.sendRequest({topic:is,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:os,relayRpcId:as}),us()])}else this.client.core.pairing.pairings.keys.includes(is)&&await this.client.core.pairing.ping({topic:is})},this.emit=async rs=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(rs);const{topic:is,event:os,chainId:as}=rs,us=getBigIntRpcId().toString();await this.sendRequest({topic:is,method:"wc_sessionEvent",params:{event:os,chainId:as},throwOnFailedPublish:!0,relayRpcId:us})},this.disconnect=async rs=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(rs);const{topic:is}=rs;if(this.client.session.keys.includes(is))await this.sendRequest({topic:is,method:"wc_sessionDelete",params:er$1("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:is,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(is))await this.client.core.pairing.disconnect({topic:is});else{const{message:os}=xe$1("MISMATCHED_TOPIC",`Session or pairing topic not found: ${is}`);throw new Error(os)}},this.find=rs=>(this.isInitialized(),this.client.session.getAll().filter(is=>hh(is,rs))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(rs,is)=>{var os;this.isInitialized(),this.isValidAuthenticate(rs);const as=is&&this.client.core.linkModeSupportedApps.includes(is)&&((os=this.client.metadata.redirect)==null?void 0:os.linkMode),us=as?F$1.link_mode:F$1.relay;us===F$1.relay&&await this.confirmOnlineStateOrThrow();const{chains:ds,statement:hs="",uri:ps,domain:io,nonce:fo,type:mo,exp:Ao,nbf:$o,methods:Lo=[],expiry:Go}=rs,Yo=[...rs.resources||[]],{topic:Wo,uri:Jo}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:us});this.client.logger.info({message:"Generated new pairing",pairing:{topic:Wo,uri:Jo}});const xl=await this.client.core.crypto.generateKeyPair(),_l=Ru(xl);if(await Promise.all([this.client.auth.authKeys.set(ae,{responseTopic:_l,publicKey:xl}),this.client.auth.pairingTopics.set(_l,{topic:_l,pairingTopic:Wo})]),await this.client.core.relayer.subscribe(_l,{transportType:us}),this.client.logger.info(`sending request to new pairing topic: ${Wo}`),Lo.length>0){const{namespace:Xo}=An(ds[0]);let Al=xu(Xo,"request",Lo);Vr$1(Yo)&&(Al=Mu(Al,Yo.pop())),Yo.push(Al)}const Tl=Go&&Go>v$1.wc_sessionAuthenticate.req.ttl?Go:v$1.wc_sessionAuthenticate.req.ttl,Sl={authPayload:{type:mo??"caip122",chains:ds,statement:hs,aud:ps,domain:io,version:"1",nonce:fo,iat:new Date().toISOString(),exp:Ao,nbf:$o,resources:Yo},requester:{publicKey:xl,metadata:this.client.metadata},expiryTimestamp:ws$1(Tl)},$l={eip155:{chains:ds,methods:[...new Set(["personal_sign",...Lo])],events:["chainChanged","accountsChanged"]}},Pl={requiredNamespaces:{},optionalNamespaces:$l,relays:[{protocol:"irn"}],pairingTopic:Wo,proposer:{publicKey:xl,metadata:this.client.metadata},expiryTimestamp:ws$1(v$1.wc_sessionPropose.req.ttl)},{done:Dl,resolve:Ol,reject:Rl}=gs(Tl,"Request expired"),Vo=async({error:Xo,session:Al})=>{if(this.events.off(Ms$1("session_request",Ho),jo),Xo)Rl(Xo);else if(Al){Al.self.publicKey=xl,await this.client.session.set(Al.topic,Al),await this.setExpiry(Al.topic,Al.expiry),Wo&&await this.client.core.pairing.updateMetadata({topic:Wo,metadata:Al.peer.metadata});const wl=this.client.session.get(Al.topic);await this.deleteProposal(Qo),Ol({session:wl})}},jo=async Xo=>{var Al,wl,yl;if(await this.deletePendingAuthRequest(Ho,{message:"fulfilled",code:0}),Xo.error){const Hl=er$1("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return Xo.error.code===Hl.code?void 0:(this.events.off(Ms$1("session_connect"),Vo),Rl(Xo.error.message))}await this.deleteProposal(Qo),this.events.off(Ms$1("session_connect"),Vo);const{cacaos:Il,responder:Bl}=Xo.result,Gl=[],Nl=[];for(const Hl of Il){await mu({cacao:Hl,projectId:this.client.core.projectId})||(this.client.logger.error(Hl,"Signature verification failed"),Rl(er$1("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:Yl}=Hl,Ll=Vr$1(Yl.resources),Zl=[gu(Yl.iss)],Xl=Vi(Yl.iss);if(Ll){const wu=Eu(Ll),yu=Su(Ll);Gl.push(...wu),Zl.push(...yu)}for(const wu of Zl)Nl.push(`${wu}:${Xl}`)}const zl=await this.client.core.crypto.generateSharedKey(xl,Bl.publicKey);let Vl;Gl.length>0&&(Vl={topic:zl,acknowledged:!0,self:{publicKey:xl,metadata:this.client.metadata},peer:Bl,controller:Bl.publicKey,expiry:ws$1(z),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:Wo,namespaces:uh([...new Set(Gl)],[...new Set(Nl)]),transportType:us},await this.client.core.relayer.subscribe(zl,{transportType:us}),await this.client.session.set(zl,Vl),Wo&&await this.client.core.pairing.updateMetadata({topic:Wo,metadata:Bl.metadata}),Vl=this.client.session.get(zl)),(Al=this.client.metadata.redirect)!=null&&Al.linkMode&&(wl=Bl.metadata.redirect)!=null&&wl.linkMode&&(yl=Bl.metadata.redirect)!=null&&yl.universal&&is&&(this.client.core.addLinkModeSupportedApp(Bl.metadata.redirect.universal),this.client.session.update(zl,{transportType:F$1.link_mode})),Ol({auths:Il,session:Vl})},Ho=payloadId(),Qo=payloadId();this.events.once(Ms$1("session_connect"),Vo),this.events.once(Ms$1("session_request",Ho),jo);let El;try{if(as){const Xo=formatJsonRpcRequest("wc_sessionAuthenticate",Sl,Ho);this.client.core.history.set(Wo,Xo);const Al=await this.client.core.crypto.encode("",Xo,{type:Sr$1,encoding:Iu});El=Zu(is,Wo,Al)}else await Promise.all([this.sendRequest({topic:Wo,method:"wc_sessionAuthenticate",params:Sl,expiry:rs.expiry,throwOnFailedPublish:!0,clientRpcId:Ho}),this.sendRequest({topic:Wo,method:"wc_sessionPropose",params:Pl,expiry:v$1.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:Qo})])}catch(Xo){throw this.events.off(Ms$1("session_connect"),Vo),this.events.off(Ms$1("session_request",Ho),jo),Xo}return await this.setProposal(Qo,I({id:Qo},Pl)),await this.setAuthRequest(Ho,{request:D(I({},Sl),{verifyContext:{}}),pairingTopic:Wo,transportType:us}),{uri:El??Jo,response:Dl}},this.approveSessionAuthenticate=async rs=>{const{id:is,auths:os}=rs,as=this.client.core.eventClient.createEvent({properties:{topic:is.toString(),trace:[Ps.authenticated_session_approve_started]}});try{this.isInitialized()}catch(Go){throw as.setError(Rs$1.no_internet_connection),Go}const us=this.getPendingAuthRequest(is);if(!us)throw as.setError(Rs$1.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${is}`);const ds=us.transportType||F$1.relay;ds===F$1.relay&&await this.confirmOnlineStateOrThrow();const hs=us.requester.publicKey,ps=await this.client.core.crypto.generateKeyPair(),io=Ru(hs),fo={type:pr$2,receiverPublicKey:hs,senderPublicKey:ps},mo=[],Ao=[];for(const Go of os){if(!await mu({cacao:Go,projectId:this.client.core.projectId})){as.setError(Rs$1.invalid_cacao);const _l=er$1("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:is,topic:io,error:_l,encodeOpts:fo}),new Error(_l.message)}as.addTrace(Ps.cacaos_verified);const{p:Yo}=Go,Wo=Vr$1(Yo.resources),Jo=[gu(Yo.iss)],xl=Vi(Yo.iss);if(Wo){const _l=Eu(Wo),Tl=Su(Wo);mo.push(..._l),Jo.push(...Tl)}for(const _l of Jo)Ao.push(`${_l}:${xl}`)}const $o=await this.client.core.crypto.generateSharedKey(ps,hs);as.addTrace(Ps.create_authenticated_session_topic);let Lo;if((mo==null?void 0:mo.length)>0){Lo={topic:$o,acknowledged:!0,self:{publicKey:ps,metadata:this.client.metadata},peer:{publicKey:hs,metadata:us.requester.metadata},controller:hs,expiry:ws$1(z),authentication:os,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:us.pairingTopic,namespaces:uh([...new Set(mo)],[...new Set(Ao)]),transportType:ds},as.addTrace(Ps.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe($o,{transportType:ds})}catch(Go){throw as.setError(Rs$1.subscribe_authenticated_session_topic_failure),Go}as.addTrace(Ps.subscribe_authenticated_session_topic_success),await this.client.session.set($o,Lo),as.addTrace(Ps.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:us.pairingTopic,metadata:us.requester.metadata})}as.addTrace(Ps.publishing_authenticated_session_approve);try{await this.sendResult({topic:io,id:is,result:{cacaos:os,responder:{publicKey:ps,metadata:this.client.metadata}},encodeOpts:fo,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(us.requester.metadata,ds)})}catch(Go){throw as.setError(Rs$1.authenticated_session_approve_publish_failure),Go}return await this.client.auth.requests.delete(is,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:us.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:as.eventId}),{session:Lo}},this.rejectSessionAuthenticate=async rs=>{this.isInitialized();const{id:is,reason:os}=rs,as=this.getPendingAuthRequest(is);if(!as)throw new Error(`Could not find pending auth request with id ${is}`);as.transportType===F$1.relay&&await this.confirmOnlineStateOrThrow();const us=as.requester.publicKey,ds=await this.client.core.crypto.generateKeyPair(),hs=Ru(us),ps={type:pr$2,receiverPublicKey:us,senderPublicKey:ds};await this.sendError({id:is,topic:hs,error:os,encodeOpts:ps,rpcOpts:v$1.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(as.requester.metadata,as.transportType)}),await this.client.auth.requests.delete(is,{message:"rejected",code:0}),await this.client.proposal.delete(is,er$1("USER_DISCONNECTED"))},this.formatAuthMessage=rs=>{this.isInitialized();const{request:is,iss:os}=rs;return Wf(is,os)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const rs=this.relayMessageCache.shift();rs&&await this.onRelayMessage(rs)}catch(rs){this.client.logger.error(rs)}},50)},this.cleanupDuplicatePairings=async rs=>{if(rs.pairingTopic)try{const is=this.client.core.pairing.pairings.get(rs.pairingTopic),os=this.client.core.pairing.pairings.getAll().filter(as=>{var us,ds;return((us=as.peerMetadata)==null?void 0:us.url)&&((ds=as.peerMetadata)==null?void 0:ds.url)===rs.peer.metadata.url&&as.topic&&as.topic!==is.topic});if(os.length===0)return;this.client.logger.info(`Cleaning up ${os.length} duplicate pairing(s)`),await Promise.all(os.map(as=>this.client.core.pairing.disconnect({topic:as.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(is){this.client.logger.error(is)}},this.deleteSession=async rs=>{var is;const{topic:os,expirerHasDeleted:as=!1,emitEvent:us=!0,id:ds=0}=rs,{self:hs}=this.client.session.get(os);await this.client.core.relayer.unsubscribe(os),await this.client.session.delete(os,er$1("USER_DISCONNECTED")),this.addToRecentlyDeleted(os,"session"),this.client.core.crypto.keychain.has(hs.publicKey)&&await this.client.core.crypto.deleteKeyPair(hs.publicKey),this.client.core.crypto.keychain.has(os)&&await this.client.core.crypto.deleteSymKey(os),as||this.client.core.expirer.del(os),this.client.core.storage.removeItem(xe).catch(ps=>this.client.logger.warn(ps)),this.getPendingSessionRequests().forEach(ps=>{ps.topic===os&&this.deletePendingSessionRequest(ps.id,er$1("USER_DISCONNECTED"))}),os===((is=this.sessionRequestQueue.queue[0])==null?void 0:is.topic)&&(this.sessionRequestQueue.state=x.idle),us&&this.client.events.emit("session_delete",{id:ds,topic:os})},this.deleteProposal=async(rs,is)=>{if(is)try{const os=this.client.proposal.get(rs),as=this.client.core.eventClient.getEvent({topic:os.pairingTopic});as==null||as.setError(Ss$1.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(rs,er$1("USER_DISCONNECTED")),is?Promise.resolve():this.client.core.expirer.del(rs)]),this.addToRecentlyDeleted(rs,"proposal")},this.deletePendingSessionRequest=async(rs,is,os=!1)=>{await Promise.all([this.client.pendingRequest.delete(rs,is),os?Promise.resolve():this.client.core.expirer.del(rs)]),this.addToRecentlyDeleted(rs,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(as=>as.id!==rs),os&&(this.sessionRequestQueue.state=x.idle,this.client.events.emit("session_request_expire",{id:rs}))},this.deletePendingAuthRequest=async(rs,is,os=!1)=>{await Promise.all([this.client.auth.requests.delete(rs,is),os?Promise.resolve():this.client.core.expirer.del(rs)])},this.setExpiry=async(rs,is)=>{this.client.session.keys.includes(rs)&&(this.client.core.expirer.set(rs,is),await this.client.session.update(rs,{expiry:is}))},this.setProposal=async(rs,is)=>{this.client.core.expirer.set(rs,ws$1(v$1.wc_sessionPropose.req.ttl)),await this.client.proposal.set(rs,is)},this.setAuthRequest=async(rs,is)=>{const{request:os,pairingTopic:as,transportType:us=F$1.relay}=is;this.client.core.expirer.set(rs,os.expiryTimestamp),await this.client.auth.requests.set(rs,{authPayload:os.authPayload,requester:os.requester,expiryTimestamp:os.expiryTimestamp,id:rs,pairingTopic:as,verifyContext:os.verifyContext,transportType:us})},this.setPendingSessionRequest=async rs=>{const{id:is,topic:os,params:as,verifyContext:us}=rs,ds=as.request.expiryTimestamp||ws$1(v$1.wc_sessionRequest.req.ttl);this.client.core.expirer.set(is,ds),await this.client.pendingRequest.set(is,{id:is,topic:os,params:as,verifyContext:us})},this.sendRequest=async rs=>{const{topic:is,method:os,params:as,expiry:us,relayRpcId:ds,clientRpcId:hs,throwOnFailedPublish:ps,appLink:io}=rs,fo=formatJsonRpcRequest(os,as,hs);let mo;const Ao=!!io;try{const Go=Ao?Iu:tn$1;mo=await this.client.core.crypto.encode(is,fo,{encoding:Go})}catch(Go){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${is} failed`),Go}let $o;if(at.includes(os)){const Go=Ou(JSON.stringify(fo)),Yo=Ou(mo);$o=await this.client.core.verify.register({id:Yo,decryptedId:Go})}const Lo=v$1[os].req;if(Lo.attestation=$o,us&&(Lo.ttl=us),ds&&(Lo.id=ds),this.client.core.history.set(is,fo),Ao){const Go=Zu(io,is,mo);await global$2.Linking.openURL(Go,this.client.name)}else{const Go=v$1[os].req;us&&(Go.ttl=us),ds&&(Go.id=ds),ps?(Go.internal=D(I({},Go.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(is,mo,Go)):this.client.core.relayer.publish(is,mo,Go).catch(Yo=>this.client.logger.error(Yo))}return fo.id},this.sendResult=async rs=>{const{id:is,topic:os,result:as,throwOnFailedPublish:us,encodeOpts:ds,appLink:hs}=rs,ps=formatJsonRpcResult(is,as);let io;const fo=hs&&typeof(global$2==null?void 0:global$2.Linking)<"u";try{const Ao=fo?Iu:tn$1;io=await this.client.core.crypto.encode(os,ps,D(I({},ds||{}),{encoding:Ao}))}catch(Ao){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${os} failed`),Ao}let mo;try{mo=await this.client.core.history.get(os,is)}catch(Ao){throw this.client.logger.error(`sendResult() -> history.get(${os}, ${is}) failed`),Ao}if(fo){const Ao=Zu(hs,os,io);await global$2.Linking.openURL(Ao,this.client.name)}else{const Ao=v$1[mo.request.method].res;us?(Ao.internal=D(I({},Ao.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(os,io,Ao)):this.client.core.relayer.publish(os,io,Ao).catch($o=>this.client.logger.error($o))}await this.client.core.history.resolve(ps)},this.sendError=async rs=>{const{id:is,topic:os,error:as,encodeOpts:us,rpcOpts:ds,appLink:hs}=rs,ps=formatJsonRpcError(is,as);let io;const fo=hs&&typeof(global$2==null?void 0:global$2.Linking)<"u";try{const Ao=fo?Iu:tn$1;io=await this.client.core.crypto.encode(os,ps,D(I({},us||{}),{encoding:Ao}))}catch(Ao){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${os} failed`),Ao}let mo;try{mo=await this.client.core.history.get(os,is)}catch(Ao){throw this.client.logger.error(`sendError() -> history.get(${os}, ${is}) failed`),Ao}if(fo){const Ao=Zu(hs,os,io);await global$2.Linking.openURL(Ao,this.client.name)}else{const Ao=ds||v$1[mo.request.method].res;this.client.core.relayer.publish(os,io,Ao)}await this.client.core.history.resolve(ps)},this.cleanup=async()=>{const rs=[],is=[];this.client.session.getAll().forEach(os=>{let as=!1;xs$1(os.expiry)&&(as=!0),this.client.core.crypto.keychain.has(os.topic)||(as=!0),as&&rs.push(os.topic)}),this.client.proposal.getAll().forEach(os=>{xs$1(os.expiryTimestamp)&&is.push(os.id)}),await Promise.all([...rs.map(os=>this.deleteSession({topic:os})),...is.map(os=>this.deleteProposal(os))])},this.onRelayEventRequest=async rs=>{this.requestQueue.queue.push(rs),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===x.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=x.active;const rs=this.requestQueue.queue.shift();if(rs)try{await this.processRequest(rs)}catch(is){this.client.logger.warn(is)}}this.requestQueue.state=x.idle},this.processRequest=async rs=>{const{topic:is,payload:os,attestation:as,transportType:us,encryptedId:ds}=rs,hs=os.method;if(!this.shouldIgnorePairingRequest({topic:is,requestMethod:hs}))switch(hs){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:is,payload:os,attestation:as,encryptedId:ds});case"wc_sessionSettle":return await this.onSessionSettleRequest(is,os);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(is,os);case"wc_sessionExtend":return await this.onSessionExtendRequest(is,os);case"wc_sessionPing":return await this.onSessionPingRequest(is,os);case"wc_sessionDelete":return await this.onSessionDeleteRequest(is,os);case"wc_sessionRequest":return await this.onSessionRequest({topic:is,payload:os,attestation:as,encryptedId:ds,transportType:us});case"wc_sessionEvent":return await this.onSessionEventRequest(is,os);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:is,payload:os,attestation:as,encryptedId:ds,transportType:us});default:return this.client.logger.info(`Unsupported request method ${hs}`)}},this.onRelayEventResponse=async rs=>{const{topic:is,payload:os,transportType:as}=rs,us=(await this.client.core.history.get(is,os.id)).request.method;switch(us){case"wc_sessionPropose":return this.onSessionProposeResponse(is,os,as);case"wc_sessionSettle":return this.onSessionSettleResponse(is,os);case"wc_sessionUpdate":return this.onSessionUpdateResponse(is,os);case"wc_sessionExtend":return this.onSessionExtendResponse(is,os);case"wc_sessionPing":return this.onSessionPingResponse(is,os);case"wc_sessionRequest":return this.onSessionRequestResponse(is,os);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(is,os);default:return this.client.logger.info(`Unsupported response method ${us}`)}},this.onRelayEventUnknownPayload=rs=>{const{topic:is}=rs,{message:os}=xe$1("MISSING_OR_INVALID",`Decoded payload on topic ${is} is not identifiable as a JSON-RPC request or a response.`);throw new Error(os)},this.shouldIgnorePairingRequest=rs=>{const{topic:is,requestMethod:os}=rs,as=this.expectedPairingMethodMap.get(is);return!as||as.includes(os)?!1:!!(as.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async rs=>{const{topic:is,payload:os,attestation:as,encryptedId:us}=rs,{params:ds,id:hs}=os;try{const ps=this.client.core.eventClient.getEvent({topic:is});this.isValidConnect(I({},os.params));const io=ds.expiryTimestamp||ws$1(v$1.wc_sessionPropose.req.ttl),fo=I({id:hs,pairingTopic:is,expiryTimestamp:io},ds);await this.setProposal(hs,fo);const mo=await this.getVerifyContext({attestationId:as,hash:Ou(JSON.stringify(os)),encryptedId:us,metadata:fo.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),ps==null||ps.setError(M.proposal_listener_not_found)),ps==null||ps.addTrace(z$1.emit_session_proposal),this.client.events.emit("session_proposal",{id:hs,params:fo,verifyContext:mo})}catch(ps){await this.sendError({id:hs,topic:is,error:ps,rpcOpts:v$1.wc_sessionPropose.autoReject}),this.client.logger.error(ps)}},this.onSessionProposeResponse=async(rs,is,os)=>{const{id:as}=is;if(isJsonRpcResult(is)){const{result:us}=is;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:us});const ds=this.client.proposal.get(as);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:ds});const hs=ds.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:hs});const ps=us.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:ps});const io=await this.client.core.crypto.generateSharedKey(hs,ps);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:io});const fo=await this.client.core.relayer.subscribe(io,{transportType:os});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:fo}),await this.client.core.pairing.activate({topic:rs})}else if(isJsonRpcError(is)){await this.client.proposal.delete(as,er$1("USER_DISCONNECTED"));const us=Ms$1("session_connect");if(this.events.listenerCount(us)===0)throw new Error(`emitting ${us} without any listeners, 954`);this.events.emit(Ms$1("session_connect"),{error:is.error})}},this.onSessionSettleRequest=async(rs,is)=>{const{id:os,params:as}=is;try{this.isValidSessionSettleRequest(as);const{relay:us,controller:ds,expiry:hs,namespaces:ps,sessionProperties:io,sessionConfig:fo}=is.params,mo=D(I(I({topic:rs,relay:us,expiry:hs,namespaces:ps,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:ds.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:ds.publicKey,metadata:ds.metadata}},io&&{sessionProperties:io}),fo&&{sessionConfig:fo}),{transportType:F$1.relay}),Ao=Ms$1("session_connect");if(this.events.listenerCount(Ao)===0)throw new Error(`emitting ${Ao} without any listeners 997`);this.events.emit(Ms$1("session_connect"),{session:mo}),await this.sendResult({id:is.id,topic:rs,result:!0,throwOnFailedPublish:!0})}catch(us){await this.sendError({id:os,topic:rs,error:us}),this.client.logger.error(us)}},this.onSessionSettleResponse=async(rs,is)=>{const{id:os}=is;isJsonRpcResult(is)?(await this.client.session.update(rs,{acknowledged:!0}),this.events.emit(Ms$1("session_approve",os),{})):isJsonRpcError(is)&&(await this.client.session.delete(rs,er$1("USER_DISCONNECTED")),this.events.emit(Ms$1("session_approve",os),{error:is.error}))},this.onSessionUpdateRequest=async(rs,is)=>{const{params:os,id:as}=is;try{const us=`${rs}_session_update`,ds=Rh.get(us);if(ds&&this.isRequestOutOfSync(ds,as)){this.client.logger.info(`Discarding out of sync request - ${as}`),this.sendError({id:as,topic:rs,error:er$1("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(I({topic:rs},os));try{Rh.set(us,as),await this.client.session.update(rs,{namespaces:os.namespaces}),await this.sendResult({id:as,topic:rs,result:!0,throwOnFailedPublish:!0})}catch(hs){throw Rh.delete(us),hs}this.client.events.emit("session_update",{id:as,topic:rs,params:os})}catch(us){await this.sendError({id:as,topic:rs,error:us}),this.client.logger.error(us)}},this.isRequestOutOfSync=(rs,is)=>parseInt(is.toString().slice(0,-3))<=parseInt(rs.toString().slice(0,-3)),this.onSessionUpdateResponse=(rs,is)=>{const{id:os}=is,as=Ms$1("session_update",os);if(this.events.listenerCount(as)===0)throw new Error(`emitting ${as} without any listeners`);isJsonRpcResult(is)?this.events.emit(Ms$1("session_update",os),{}):isJsonRpcError(is)&&this.events.emit(Ms$1("session_update",os),{error:is.error})},this.onSessionExtendRequest=async(rs,is)=>{const{id:os}=is;try{this.isValidExtend({topic:rs}),await this.setExpiry(rs,ws$1(z)),await this.sendResult({id:os,topic:rs,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:os,topic:rs})}catch(as){await this.sendError({id:os,topic:rs,error:as}),this.client.logger.error(as)}},this.onSessionExtendResponse=(rs,is)=>{const{id:os}=is,as=Ms$1("session_extend",os);if(this.events.listenerCount(as)===0)throw new Error(`emitting ${as} without any listeners`);isJsonRpcResult(is)?this.events.emit(Ms$1("session_extend",os),{}):isJsonRpcError(is)&&this.events.emit(Ms$1("session_extend",os),{error:is.error})},this.onSessionPingRequest=async(rs,is)=>{const{id:os}=is;try{this.isValidPing({topic:rs}),await this.sendResult({id:os,topic:rs,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:os,topic:rs})}catch(as){await this.sendError({id:os,topic:rs,error:as}),this.client.logger.error(as)}},this.onSessionPingResponse=(rs,is)=>{const{id:os}=is,as=Ms$1("session_ping",os);if(this.events.listenerCount(as)===0)throw new Error(`emitting ${as} without any listeners`);setTimeout(()=>{isJsonRpcResult(is)?this.events.emit(Ms$1("session_ping",os),{}):isJsonRpcError(is)&&this.events.emit(Ms$1("session_ping",os),{error:is.error})},500)},this.onSessionDeleteRequest=async(rs,is)=>{const{id:os}=is;try{this.isValidDisconnect({topic:rs,reason:is.params}),Promise.all([new Promise(as=>{this.client.core.relayer.once(w$1.publish,async()=>{as(await this.deleteSession({topic:rs,id:os}))})}),this.sendResult({id:os,topic:rs,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:rs,error:er$1("USER_DISCONNECTED")})]).catch(as=>this.client.logger.error(as))}catch(as){this.client.logger.error(as)}},this.onSessionRequest=async rs=>{var is,os,as;const{topic:us,payload:ds,attestation:hs,encryptedId:ps,transportType:io}=rs,{id:fo,params:mo}=ds;try{await this.isValidRequest(I({topic:us},mo));const Ao=this.client.session.get(us),$o=await this.getVerifyContext({attestationId:hs,hash:Ou(JSON.stringify(formatJsonRpcRequest("wc_sessionRequest",mo,fo))),encryptedId:ps,metadata:Ao.peer.metadata,transportType:io}),Lo={id:fo,topic:us,params:mo,verifyContext:$o};await this.setPendingSessionRequest(Lo),io===F$1.link_mode&&(is=Ao.peer.metadata.redirect)!=null&&is.universal&&this.client.core.addLinkModeSupportedApp((os=Ao.peer.metadata.redirect)==null?void 0:os.universal),(as=this.client.signConfig)!=null&&as.disableRequestQueue?this.emitSessionRequest(Lo):(this.addSessionRequestToSessionRequestQueue(Lo),this.processSessionRequestQueue())}catch(Ao){await this.sendError({id:fo,topic:us,error:Ao}),this.client.logger.error(Ao)}},this.onSessionRequestResponse=(rs,is)=>{const{id:os}=is,as=Ms$1("session_request",os);if(this.events.listenerCount(as)===0)throw new Error(`emitting ${as} without any listeners`);isJsonRpcResult(is)?this.events.emit(Ms$1("session_request",os),{result:is.result}):isJsonRpcError(is)&&this.events.emit(Ms$1("session_request",os),{error:is.error})},this.onSessionEventRequest=async(rs,is)=>{const{id:os,params:as}=is;try{const us=`${rs}_session_event_${as.event.name}`,ds=Rh.get(us);if(ds&&this.isRequestOutOfSync(ds,os)){this.client.logger.info(`Discarding out of sync request - ${os}`);return}this.isValidEmit(I({topic:rs},as)),this.client.events.emit("session_event",{id:os,topic:rs,params:as}),Rh.set(us,os)}catch(us){await this.sendError({id:os,topic:rs,error:us}),this.client.logger.error(us)}},this.onSessionAuthenticateResponse=(rs,is)=>{const{id:os}=is;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:rs,payload:is}),isJsonRpcResult(is)?this.events.emit(Ms$1("session_request",os),{result:is.result}):isJsonRpcError(is)&&this.events.emit(Ms$1("session_request",os),{error:is.error})},this.onSessionAuthenticateRequest=async rs=>{var is;const{topic:os,payload:as,attestation:us,encryptedId:ds,transportType:hs}=rs;try{const{requester:ps,authPayload:io,expiryTimestamp:fo}=as.params,mo=await this.getVerifyContext({attestationId:us,hash:Ou(JSON.stringify(as)),encryptedId:ds,metadata:ps.metadata,transportType:hs}),Ao={requester:ps,pairingTopic:os,id:as.id,authPayload:io,verifyContext:mo,expiryTimestamp:fo};await this.setAuthRequest(as.id,{request:Ao,pairingTopic:os,transportType:hs}),hs===F$1.link_mode&&(is=ps.metadata.redirect)!=null&&is.universal&&this.client.core.addLinkModeSupportedApp(ps.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:os,params:as.params,id:as.id,verifyContext:mo})}catch(ps){this.client.logger.error(ps);const io=as.params.requester.publicKey,fo=await this.client.core.crypto.generateKeyPair(),mo=this.getAppLinkIfEnabled(as.params.requester.metadata,hs),Ao={type:pr$2,receiverPublicKey:io,senderPublicKey:fo};await this.sendError({id:as.id,topic:os,error:ps,encodeOpts:Ao,rpcOpts:v$1.wc_sessionAuthenticate.autoReject,appLink:mo})}},this.addSessionRequestToSessionRequestQueue=rs=>{this.sessionRequestQueue.queue.push(rs)},this.cleanupAfterResponse=rs=>{this.deletePendingSessionRequest(rs.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=x.idle,this.processSessionRequestQueue()},cjs$4.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:rs,error:is})=>{const os=this.client.core.history.pending;os.length>0&&os.filter(as=>as.topic===rs&&as.request.method==="wc_sessionRequest").forEach(as=>{const us=as.request.id,ds=Ms$1("session_request",us);if(this.events.listenerCount(ds)===0)throw new Error(`emitting ${ds} without any listeners`);this.events.emit(Ms$1("session_request",as.request.id),{error:is})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===x.active){this.client.logger.info("session request queue is already active.");return}const rs=this.sessionRequestQueue.queue[0];if(!rs){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=x.active,this.emitSessionRequest(rs)}catch(is){this.client.logger.error(is)}},this.emitSessionRequest=rs=>{this.client.events.emit("session_request",rs)},this.onPairingCreated=rs=>{if(rs.methods&&this.expectedPairingMethodMap.set(rs.topic,rs.methods),rs.active)return;const is=this.client.proposal.getAll().find(os=>os.pairingTopic===rs.topic);is&&this.onSessionProposeRequest({topic:rs.topic,payload:formatJsonRpcRequest("wc_sessionPropose",{requiredNamespaces:is.requiredNamespaces,optionalNamespaces:is.optionalNamespaces,relays:is.relays,proposer:is.proposer,sessionProperties:is.sessionProperties},is.id)})},this.isValidConnect=async rs=>{if(!Ah(rs)){const{message:hs}=xe$1("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(rs)}`);throw new Error(hs)}const{pairingTopic:is,requiredNamespaces:os,optionalNamespaces:as,sessionProperties:us,relays:ds}=rs;if(Pe(is)||await this.isValidPairingTopic(is),!gh(ds)){const{message:hs}=xe$1("MISSING_OR_INVALID",`connect() relays: ${ds}`);throw new Error(hs)}!Pe(os)&&Xr$1(os)!==0&&this.validateNamespaces(os,"requiredNamespaces"),!Pe(as)&&Xr$1(as)!==0&&this.validateNamespaces(as,"optionalNamespaces"),Pe(us)||this.validateSessionProps(us,"sessionProperties")},this.validateNamespaces=(rs,is)=>{const os=vh(rs,"connect()",is);if(os)throw new Error(os.message)},this.isValidApprove=async rs=>{if(!Ah(rs))throw new Error(xe$1("MISSING_OR_INVALID",`approve() params: ${rs}`).message);const{id:is,namespaces:os,relayProtocol:as,sessionProperties:us}=rs;this.checkRecentlyDeleted(is),await this.isValidProposalId(is);const ds=this.client.proposal.get(is),hs=Oo(os,"approve()");if(hs)throw new Error(hs.message);const ps=To(ds.requiredNamespaces,os,"approve()");if(ps)throw new Error(ps.message);if(!Yt$1(as,!0)){const{message:io}=xe$1("MISSING_OR_INVALID",`approve() relayProtocol: ${as}`);throw new Error(io)}Pe(us)||this.validateSessionProps(us,"sessionProperties")},this.isValidReject=async rs=>{if(!Ah(rs)){const{message:as}=xe$1("MISSING_OR_INVALID",`reject() params: ${rs}`);throw new Error(as)}const{id:is,reason:os}=rs;if(this.checkRecentlyDeleted(is),await this.isValidProposalId(is),!bh(os)){const{message:as}=xe$1("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(os)}`);throw new Error(as)}},this.isValidSessionSettleRequest=rs=>{if(!Ah(rs)){const{message:ps}=xe$1("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${rs}`);throw new Error(ps)}const{relay:is,controller:os,namespaces:as,expiry:us}=rs;if(!Po(is)){const{message:ps}=xe$1("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(ps)}const ds=ph(os,"onSessionSettleRequest()");if(ds)throw new Error(ds.message);const hs=Oo(as,"onSessionSettleRequest()");if(hs)throw new Error(hs.message);if(xs$1(us)){const{message:ps}=xe$1("EXPIRED","onSessionSettleRequest()");throw new Error(ps)}},this.isValidUpdate=async rs=>{if(!Ah(rs)){const{message:hs}=xe$1("MISSING_OR_INVALID",`update() params: ${rs}`);throw new Error(hs)}const{topic:is,namespaces:os}=rs;this.checkRecentlyDeleted(is),await this.isValidSessionTopic(is);const as=this.client.session.get(is),us=Oo(os,"update()");if(us)throw new Error(us.message);const ds=To(as.requiredNamespaces,os,"update()");if(ds)throw new Error(ds.message)},this.isValidExtend=async rs=>{if(!Ah(rs)){const{message:os}=xe$1("MISSING_OR_INVALID",`extend() params: ${rs}`);throw new Error(os)}const{topic:is}=rs;this.checkRecentlyDeleted(is),await this.isValidSessionTopic(is)},this.isValidRequest=async rs=>{if(!Ah(rs)){const{message:hs}=xe$1("MISSING_OR_INVALID",`request() params: ${rs}`);throw new Error(hs)}const{topic:is,request:os,chainId:as,expiry:us}=rs;this.checkRecentlyDeleted(is),await this.isValidSessionTopic(is);const{namespaces:ds}=this.client.session.get(is);if(!Mh(ds,as)){const{message:hs}=xe$1("MISSING_OR_INVALID",`request() chainId: ${as}`);throw new Error(hs)}if(!yh(os)){const{message:hs}=xe$1("MISSING_OR_INVALID",`request() ${JSON.stringify(os)}`);throw new Error(hs)}if(!Eh(ds,as,os.method)){const{message:hs}=xe$1("MISSING_OR_INVALID",`request() method: ${os.method}`);throw new Error(hs)}if(us&&!_h(us,me)){const{message:hs}=xe$1("MISSING_OR_INVALID",`request() expiry: ${us}. Expiry must be a number (in seconds) between ${me.min} and ${me.max}`);throw new Error(hs)}},this.isValidRespond=async rs=>{var is;if(!Ah(rs)){const{message:us}=xe$1("MISSING_OR_INVALID",`respond() params: ${rs}`);throw new Error(us)}const{topic:os,response:as}=rs;try{await this.isValidSessionTopic(os)}catch(us){throw(is=rs==null?void 0:rs.response)!=null&&is.id&&this.cleanupAfterResponse(rs),us}if(!wh(as)){const{message:us}=xe$1("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(as)}`);throw new Error(us)}},this.isValidPing=async rs=>{if(!Ah(rs)){const{message:os}=xe$1("MISSING_OR_INVALID",`ping() params: ${rs}`);throw new Error(os)}const{topic:is}=rs;await this.isValidSessionOrPairingTopic(is)},this.isValidEmit=async rs=>{if(!Ah(rs)){const{message:ds}=xe$1("MISSING_OR_INVALID",`emit() params: ${rs}`);throw new Error(ds)}const{topic:is,event:os,chainId:as}=rs;await this.isValidSessionTopic(is);const{namespaces:us}=this.client.session.get(is);if(!Mh(us,as)){const{message:ds}=xe$1("MISSING_OR_INVALID",`emit() chainId: ${as}`);throw new Error(ds)}if(!xh(os)){const{message:ds}=xe$1("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(os)}`);throw new Error(ds)}if(!Sh(us,as,os.name)){const{message:ds}=xe$1("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(os)}`);throw new Error(ds)}},this.isValidDisconnect=async rs=>{if(!Ah(rs)){const{message:os}=xe$1("MISSING_OR_INVALID",`disconnect() params: ${rs}`);throw new Error(os)}const{topic:is}=rs;await this.isValidSessionOrPairingTopic(is)},this.isValidAuthenticate=rs=>{const{chains:is,uri:os,domain:as,nonce:us}=rs;if(!Array.isArray(is)||is.length===0)throw new Error("chains is required and must be a non-empty array");if(!Yt$1(os,!1))throw new Error("uri is required parameter");if(!Yt$1(as,!1))throw new Error("domain is required parameter");if(!Yt$1(us,!1))throw new Error("nonce is required parameter");if([...new Set(is.map(hs=>An(hs).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:ds}=An(is[0]);if(ds!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async rs=>{const{attestationId:is,hash:os,encryptedId:as,metadata:us,transportType:ds}=rs,hs={verified:{verifyUrl:us.verifyUrl||Z,validation:"UNKNOWN",origin:us.url||""}};try{if(ds===F$1.link_mode){const io=this.getAppLinkIfEnabled(us,ds);return hs.verified.validation=io&&new URL(io).origin===new URL(us.url).origin?"VALID":"INVALID",hs}const ps=await this.client.core.verify.resolve({attestationId:is,hash:os,encryptedId:as,verifyUrl:us.verifyUrl});ps&&(hs.verified.origin=ps.origin,hs.verified.isScam=ps.isScam,hs.verified.validation=ps.origin===new URL(us.url).origin?"VALID":"INVALID")}catch(ps){this.client.logger.warn(ps)}return this.client.logger.debug(`Verify context: ${JSON.stringify(hs)}`),hs},this.validateSessionProps=(rs,is)=>{Object.values(rs).forEach(os=>{if(!Yt$1(os,!1)){const{message:as}=xe$1("MISSING_OR_INVALID",`${is} must be in Record<string, string> format. Received: ${JSON.stringify(os)}`);throw new Error(as)}})},this.getPendingAuthRequest=rs=>{const is=this.client.auth.requests.get(rs);return typeof is=="object"?is:void 0},this.addToRecentlyDeleted=(rs,is)=>{if(this.recentlyDeletedMap.set(rs,is),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let os=0;const as=this.recentlyDeletedLimit/2;for(const us of this.recentlyDeletedMap.keys()){if(os++>=as)break;this.recentlyDeletedMap.delete(us)}}},this.checkRecentlyDeleted=rs=>{const is=this.recentlyDeletedMap.get(rs);if(is){const{message:os}=xe$1("MISSING_OR_INVALID",`Record was recently deleted - ${is}: ${rs}`);throw new Error(os)}},this.isLinkModeEnabled=(rs,is)=>{var os,as,us,ds,hs,ps,io,fo,mo;return!rs||is!==F$1.link_mode?!1:((as=(os=this.client.metadata)==null?void 0:os.redirect)==null?void 0:as.linkMode)===!0&&((ds=(us=this.client.metadata)==null?void 0:us.redirect)==null?void 0:ds.universal)!==void 0&&((ps=(hs=this.client.metadata)==null?void 0:hs.redirect)==null?void 0:ps.universal)!==""&&((io=rs==null?void 0:rs.redirect)==null?void 0:io.universal)!==void 0&&((fo=rs==null?void 0:rs.redirect)==null?void 0:fo.universal)!==""&&((mo=rs==null?void 0:rs.redirect)==null?void 0:mo.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(rs.redirect.universal)&&typeof(global$2==null?void 0:global$2.Linking)<"u"},this.getAppLinkIfEnabled=(rs,is)=>{var os;return this.isLinkModeEnabled(rs,is)?(os=rs==null?void 0:rs.redirect)==null?void 0:os.universal:void 0},this.handleLinkModeMessage=({url:rs})=>{if(!rs||!rs.includes("wc_ev")||!rs.includes("topic"))return;const is=Is$2(rs,"topic")||"",os=decodeURIComponent(Is$2(rs,"wc_ev")||""),as=this.client.session.keys.includes(is);as&&this.client.session.update(is,{transportType:F$1.link_mode}),this.client.core.dispatchEnvelope({topic:is,message:os,sessionExists:as})},this.registerLinkModeListeners=async()=>{var rs;if(_s$1()||rr$1()&&(rs=this.client.metadata.redirect)!=null&&rs.linkMode){const is=global$2==null?void 0:global$2.Linking;if(typeof is<"u"){is.addEventListener("url",this.handleLinkModeMessage,this.client.name);const os=await is.getInitialURL();os&&setTimeout(()=>{this.handleLinkModeMessage({url:os})},50)}}}}isInitialized(){if(!this.initialized){const{message:Mn}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Mn)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(w$1.message,Mn=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(Mn):this.onRelayMessage(Mn)})}async onRelayMessage(Mn){const{topic:rs,message:is,attestation:os,transportType:as}=Mn,{publicKey:us}=this.client.auth.authKeys.keys.includes(ae)?this.client.auth.authKeys.get(ae):{responseTopic:void 0,publicKey:void 0},ds=await this.client.core.crypto.decode(rs,is,{receiverPublicKey:us,encoding:as===F$1.link_mode?Iu:tn$1});try{isJsonRpcRequest(ds)?(this.client.core.history.set(rs,ds),this.onRelayEventRequest({topic:rs,payload:ds,attestation:os,transportType:as,encryptedId:Ou(is)})):isJsonRpcResponse(ds)?(await this.client.core.history.resolve(ds),await this.onRelayEventResponse({topic:rs,payload:ds,transportType:as}),this.client.core.history.delete(rs,ds.id)):this.onRelayEventUnknownPayload({topic:rs,payload:ds,transportType:as})}catch(hs){this.client.logger.error(hs)}}registerExpirerEvents(){this.client.core.expirer.on(R.expired,async Mn=>{const{topic:rs,id:is}=ys$1(Mn.target);if(is&&this.client.pendingRequest.keys.includes(is))return await this.deletePendingSessionRequest(is,xe$1("EXPIRED"),!0);if(is&&this.client.auth.requests.keys.includes(is))return await this.deletePendingAuthRequest(is,xe$1("EXPIRED"),!0);rs?this.client.session.keys.includes(rs)&&(await this.deleteSession({topic:rs,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:rs})):is&&(await this.deleteProposal(is,!0),this.client.events.emit("proposal_expire",{id:is}))})}registerPairingEvents(){this.client.core.pairing.events.on(q.create,Mn=>this.onPairingCreated(Mn)),this.client.core.pairing.events.on(q.delete,Mn=>{this.addToRecentlyDeleted(Mn.topic,"pairing")})}isValidPairingTopic(Mn){if(!Yt$1(Mn,!1)){const{message:rs}=xe$1("MISSING_OR_INVALID",`pairing topic should be a string: ${Mn}`);throw new Error(rs)}if(!this.client.core.pairing.pairings.keys.includes(Mn)){const{message:rs}=xe$1("NO_MATCHING_KEY",`pairing topic doesn't exist: ${Mn}`);throw new Error(rs)}if(xs$1(this.client.core.pairing.pairings.get(Mn).expiry)){const{message:rs}=xe$1("EXPIRED",`pairing topic: ${Mn}`);throw new Error(rs)}}async isValidSessionTopic(Mn){if(!Yt$1(Mn,!1)){const{message:rs}=xe$1("MISSING_OR_INVALID",`session topic should be a string: ${Mn}`);throw new Error(rs)}if(this.checkRecentlyDeleted(Mn),!this.client.session.keys.includes(Mn)){const{message:rs}=xe$1("NO_MATCHING_KEY",`session topic doesn't exist: ${Mn}`);throw new Error(rs)}if(xs$1(this.client.session.get(Mn).expiry)){await this.deleteSession({topic:Mn});const{message:rs}=xe$1("EXPIRED",`session topic: ${Mn}`);throw new Error(rs)}if(!this.client.core.crypto.keychain.has(Mn)){const{message:rs}=xe$1("MISSING_OR_INVALID",`session topic does not exist in keychain: ${Mn}`);throw await this.deleteSession({topic:Mn}),new Error(rs)}}async isValidSessionOrPairingTopic(Mn){if(this.checkRecentlyDeleted(Mn),this.client.session.keys.includes(Mn))await this.isValidSessionTopic(Mn);else if(this.client.core.pairing.pairings.keys.includes(Mn))this.isValidPairingTopic(Mn);else if(Yt$1(Mn,!1)){const{message:rs}=xe$1("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${Mn}`);throw new Error(rs)}else{const{message:rs}=xe$1("MISSING_OR_INVALID",`session or pairing topic should be a string: ${Mn}`);throw new Error(rs)}}async isValidProposalId(Mn){if(!mh(Mn)){const{message:rs}=xe$1("MISSING_OR_INVALID",`proposal id should be a number: ${Mn}`);throw new Error(rs)}if(!this.client.proposal.keys.includes(Mn)){const{message:rs}=xe$1("NO_MATCHING_KEY",`proposal id doesn't exist: ${Mn}`);throw new Error(rs)}if(xs$1(this.client.proposal.get(Mn).expiryTimestamp)){await this.deleteProposal(Mn);const{message:rs}=xe$1("EXPIRED",`proposal id: ${Mn}`);throw new Error(rs)}}}class Ss extends ai{constructor(Mn,rs){super(Mn,rs,st,ye),this.core=Mn,this.logger=rs}}class yt extends ai{constructor(Mn,rs){super(Mn,rs,rt,ye),this.core=Mn,this.logger=rs}}class Is extends ai{constructor(Mn,rs){super(Mn,rs,ot,ye,is=>is.id),this.core=Mn,this.logger=rs}}class fs extends ai{constructor(Mn,rs){super(Mn,rs,pt,oe,()=>ae),this.core=Mn,this.logger=rs}}class vs extends ai{constructor(Mn,rs){super(Mn,rs,ht,oe),this.core=Mn,this.logger=rs}}class qs extends ai{constructor(Mn,rs){super(Mn,rs,dt,oe,is=>is.id),this.core=Mn,this.logger=rs}}class Ts{constructor(Mn,rs){this.core=Mn,this.logger=rs,this.authKeys=new fs(this.core,this.logger),this.pairingTopics=new vs(this.core,this.logger),this.requests=new qs(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class _e extends S$1{constructor(Mn){super(Mn),this.protocol=be,this.version=Ce,this.name=we.name,this.events=new eventsExports.EventEmitter,this.on=(is,os)=>this.events.on(is,os),this.once=(is,os)=>this.events.once(is,os),this.off=(is,os)=>this.events.off(is,os),this.removeListener=(is,os)=>this.events.removeListener(is,os),this.removeAllListeners=is=>this.events.removeAllListeners(is),this.connect=async is=>{try{return await this.engine.connect(is)}catch(os){throw this.logger.error(os.message),os}},this.pair=async is=>{try{return await this.engine.pair(is)}catch(os){throw this.logger.error(os.message),os}},this.approve=async is=>{try{return await this.engine.approve(is)}catch(os){throw this.logger.error(os.message),os}},this.reject=async is=>{try{return await this.engine.reject(is)}catch(os){throw this.logger.error(os.message),os}},this.update=async is=>{try{return await this.engine.update(is)}catch(os){throw this.logger.error(os.message),os}},this.extend=async is=>{try{return await this.engine.extend(is)}catch(os){throw this.logger.error(os.message),os}},this.request=async is=>{try{return await this.engine.request(is)}catch(os){throw this.logger.error(os.message),os}},this.respond=async is=>{try{return await this.engine.respond(is)}catch(os){throw this.logger.error(os.message),os}},this.ping=async is=>{try{return await this.engine.ping(is)}catch(os){throw this.logger.error(os.message),os}},this.emit=async is=>{try{return await this.engine.emit(is)}catch(os){throw this.logger.error(os.message),os}},this.disconnect=async is=>{try{return await this.engine.disconnect(is)}catch(os){throw this.logger.error(os.message),os}},this.find=is=>{try{return this.engine.find(is)}catch(os){throw this.logger.error(os.message),os}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(is){throw this.logger.error(is.message),is}},this.authenticate=async(is,os)=>{try{return await this.engine.authenticate(is,os)}catch(as){throw this.logger.error(as.message),as}},this.formatAuthMessage=is=>{try{return this.engine.formatAuthMessage(is)}catch(os){throw this.logger.error(os.message),os}},this.approveSessionAuthenticate=async is=>{try{return await this.engine.approveSessionAuthenticate(is)}catch(os){throw this.logger.error(os.message),os}},this.rejectSessionAuthenticate=async is=>{try{return await this.engine.rejectSessionAuthenticate(is)}catch(os){throw this.logger.error(os.message),os}},this.name=(Mn==null?void 0:Mn.name)||we.name,this.metadata=(Mn==null?void 0:Mn.metadata)||fs$1(),this.signConfig=Mn==null?void 0:Mn.signConfig;const rs=typeof(Mn==null?void 0:Mn.logger)<"u"&&typeof(Mn==null?void 0:Mn.logger)!="string"?Mn.logger:Mg(k$2({level:(Mn==null?void 0:Mn.logger)||we.logger}));this.core=(Mn==null?void 0:Mn.core)||new On(Mn),this.logger=E$3(rs,this.name),this.session=new yt(this.core,this.logger),this.proposal=new Ss(this.core,this.logger),this.pendingRequest=new Is(this.core,this.logger),this.engine=new Rs(this),this.auth=new Ts(this.core,this.logger)}static async init(Mn){const rs=new _e(Mn);return await rs.initialize(),rs}get context(){return y$4(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(Mn){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(Mn.message),Mn}}}var browserPonyfill={exports:{}};(function(Fn,Mn){var rs=typeof self<"u"?self:commonjsGlobal,is=function(){function as(){this.fetch=!1,this.DOMException=rs.DOMException}return as.prototype=rs,new as}();(function(as){(function(us){var ds={searchParams:"URLSearchParams"in as,iterable:"Symbol"in as&&"iterator"in Symbol,blob:"FileReader"in as&&"Blob"in as&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in as,arrayBuffer:"ArrayBuffer"in as};function hs(jo){return jo&&DataView.prototype.isPrototypeOf(jo)}if(ds.arrayBuffer)var ps=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],io=ArrayBuffer.isView||function(jo){return jo&&ps.indexOf(Object.prototype.toString.call(jo))>-1};function fo(jo){if(typeof jo!="string"&&(jo=String(jo)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(jo))throw new TypeError("Invalid character in header field name");return jo.toLowerCase()}function mo(jo){return typeof jo!="string"&&(jo=String(jo)),jo}function Ao(jo){var Ho={next:function(){var Qo=jo.shift();return{done:Qo===void 0,value:Qo}}};return ds.iterable&&(Ho[Symbol.iterator]=function(){return Ho}),Ho}function $o(jo){this.map={},jo instanceof $o?jo.forEach(function(Ho,Qo){this.append(Qo,Ho)},this):Array.isArray(jo)?jo.forEach(function(Ho){this.append(Ho[0],Ho[1])},this):jo&&Object.getOwnPropertyNames(jo).forEach(function(Ho){this.append(Ho,jo[Ho])},this)}$o.prototype.append=function(jo,Ho){jo=fo(jo),Ho=mo(Ho);var Qo=this.map[jo];this.map[jo]=Qo?Qo+", "+Ho:Ho},$o.prototype.delete=function(jo){delete this.map[fo(jo)]},$o.prototype.get=function(jo){return jo=fo(jo),this.has(jo)?this.map[jo]:null},$o.prototype.has=function(jo){return this.map.hasOwnProperty(fo(jo))},$o.prototype.set=function(jo,Ho){this.map[fo(jo)]=mo(Ho)},$o.prototype.forEach=function(jo,Ho){for(var Qo in this.map)this.map.hasOwnProperty(Qo)&&jo.call(Ho,this.map[Qo],Qo,this)},$o.prototype.keys=function(){var jo=[];return this.forEach(function(Ho,Qo){jo.push(Qo)}),Ao(jo)},$o.prototype.values=function(){var jo=[];return this.forEach(function(Ho){jo.push(Ho)}),Ao(jo)},$o.prototype.entries=function(){var jo=[];return this.forEach(function(Ho,Qo){jo.push([Qo,Ho])}),Ao(jo)},ds.iterable&&($o.prototype[Symbol.iterator]=$o.prototype.entries);function Lo(jo){if(jo.bodyUsed)return Promise.reject(new TypeError("Already read"));jo.bodyUsed=!0}function Go(jo){return new Promise(function(Ho,Qo){jo.onload=function(){Ho(jo.result)},jo.onerror=function(){Qo(jo.error)}})}function Yo(jo){var Ho=new FileReader,Qo=Go(Ho);return Ho.readAsArrayBuffer(jo),Qo}function Wo(jo){var Ho=new FileReader,Qo=Go(Ho);return Ho.readAsText(jo),Qo}function Jo(jo){for(var Ho=new Uint8Array(jo),Qo=new Array(Ho.length),El=0;El<Ho.length;El++)Qo[El]=String.fromCharCode(Ho[El]);return Qo.join("")}function xl(jo){if(jo.slice)return jo.slice(0);var Ho=new Uint8Array(jo.byteLength);return Ho.set(new Uint8Array(jo)),Ho.buffer}function _l(){return this.bodyUsed=!1,this._initBody=function(jo){this._bodyInit=jo,jo?typeof jo=="string"?this._bodyText=jo:ds.blob&&Blob.prototype.isPrototypeOf(jo)?this._bodyBlob=jo:ds.formData&&FormData.prototype.isPrototypeOf(jo)?this._bodyFormData=jo:ds.searchParams&&URLSearchParams.prototype.isPrototypeOf(jo)?this._bodyText=jo.toString():ds.arrayBuffer&&ds.blob&&hs(jo)?(this._bodyArrayBuffer=xl(jo.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ds.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(jo)||io(jo))?this._bodyArrayBuffer=xl(jo):this._bodyText=jo=Object.prototype.toString.call(jo):this._bodyText="",this.headers.get("content-type")||(typeof jo=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):ds.searchParams&&URLSearchParams.prototype.isPrototypeOf(jo)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},ds.blob&&(this.blob=function(){var jo=Lo(this);if(jo)return jo;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(){return this._bodyArrayBuffer?Lo(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(Yo)}),this.text=function(){var jo=Lo(this);if(jo)return jo;if(this._bodyBlob)return Wo(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Jo(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},ds.formData&&(this.formData=function(){return this.text().then(Pl)}),this.json=function(){return this.text().then(JSON.parse)},this}var Tl=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Sl(jo){var Ho=jo.toUpperCase();return Tl.indexOf(Ho)>-1?Ho:jo}function $l(jo,Ho){Ho=Ho||{};var Qo=Ho.body;if(jo instanceof $l){if(jo.bodyUsed)throw new TypeError("Already read");this.url=jo.url,this.credentials=jo.credentials,Ho.headers||(this.headers=new $o(jo.headers)),this.method=jo.method,this.mode=jo.mode,this.signal=jo.signal,!Qo&&jo._bodyInit!=null&&(Qo=jo._bodyInit,jo.bodyUsed=!0)}else this.url=String(jo);if(this.credentials=Ho.credentials||this.credentials||"same-origin",(Ho.headers||!this.headers)&&(this.headers=new $o(Ho.headers)),this.method=Sl(Ho.method||this.method||"GET"),this.mode=Ho.mode||this.mode||null,this.signal=Ho.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Qo)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(Qo)}$l.prototype.clone=function(){return new $l(this,{body:this._bodyInit})};function Pl(jo){var Ho=new FormData;return jo.trim().split("&").forEach(function(Qo){if(Qo){var El=Qo.split("="),Xo=El.shift().replace(/\+/g," "),Al=El.join("=").replace(/\+/g," ");Ho.append(decodeURIComponent(Xo),decodeURIComponent(Al))}}),Ho}function Dl(jo){var Ho=new $o,Qo=jo.replace(/\r?\n[\t ]+/g," ");return Qo.split(/\r?\n/).forEach(function(El){var Xo=El.split(":"),Al=Xo.shift().trim();if(Al){var wl=Xo.join(":").trim();Ho.append(Al,wl)}}),Ho}_l.call($l.prototype);function Ol(jo,Ho){Ho||(Ho={}),this.type="default",this.status=Ho.status===void 0?200:Ho.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in Ho?Ho.statusText:"OK",this.headers=new $o(Ho.headers),this.url=Ho.url||"",this._initBody(jo)}_l.call(Ol.prototype),Ol.prototype.clone=function(){return new Ol(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new $o(this.headers),url:this.url})},Ol.error=function(){var jo=new Ol(null,{status:0,statusText:""});return jo.type="error",jo};var Rl=[301,302,303,307,308];Ol.redirect=function(jo,Ho){if(Rl.indexOf(Ho)===-1)throw new RangeError("Invalid status code");return new Ol(null,{status:Ho,headers:{location:jo}})},us.DOMException=as.DOMException;try{new us.DOMException}catch{us.DOMException=function(Ho,Qo){this.message=Ho,this.name=Qo;var El=Error(Ho);this.stack=El.stack},us.DOMException.prototype=Object.create(Error.prototype),us.DOMException.prototype.constructor=us.DOMException}function Vo(jo,Ho){return new Promise(function(Qo,El){var Xo=new $l(jo,Ho);if(Xo.signal&&Xo.signal.aborted)return El(new us.DOMException("Aborted","AbortError"));var Al=new XMLHttpRequest;function wl(){Al.abort()}Al.onload=function(){var yl={status:Al.status,statusText:Al.statusText,headers:Dl(Al.getAllResponseHeaders()||"")};yl.url="responseURL"in Al?Al.responseURL:yl.headers.get("X-Request-URL");var Il="response"in Al?Al.response:Al.responseText;Qo(new Ol(Il,yl))},Al.onerror=function(){El(new TypeError("Network request failed"))},Al.ontimeout=function(){El(new TypeError("Network request failed"))},Al.onabort=function(){El(new us.DOMException("Aborted","AbortError"))},Al.open(Xo.method,Xo.url,!0),Xo.credentials==="include"?Al.withCredentials=!0:Xo.credentials==="omit"&&(Al.withCredentials=!1),"responseType"in Al&&ds.blob&&(Al.responseType="blob"),Xo.headers.forEach(function(yl,Il){Al.setRequestHeader(Il,yl)}),Xo.signal&&(Xo.signal.addEventListener("abort",wl),Al.onreadystatechange=function(){Al.readyState===4&&Xo.signal.removeEventListener("abort",wl)}),Al.send(typeof Xo._bodyInit>"u"?null:Xo._bodyInit)})}return Vo.polyfill=!0,as.fetch||(as.fetch=Vo,as.Headers=$o,as.Request=$l,as.Response=Ol),us.Headers=$o,us.Request=$l,us.Response=Ol,us.fetch=Vo,Object.defineProperty(us,"__esModule",{value:!0}),us})({})})(is),is.fetch.ponyfill=!0,delete is.fetch.polyfill;var os=is;Mn=os.fetch,Mn.default=os.fetch,Mn.fetch=os.fetch,Mn.Headers=os.Headers,Mn.Request=os.Request,Mn.Response=os.Response,Fn.exports=Mn})(browserPonyfill,browserPonyfill.exports);var browserPonyfillExports=browserPonyfill.exports;const o$1=getDefaultExportFromCjs(browserPonyfillExports);var P=Object.defineProperty,w=Object.defineProperties,E=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,l=(Fn,Mn,rs)=>Mn in Fn?P(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,p=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))L.call(Mn,rs)&&l(Fn,rs,Mn[rs]);if(c)for(var rs of c(Mn))O.call(Mn,rs)&&l(Fn,rs,Mn[rs]);return Fn},v=(Fn,Mn)=>w(Fn,E(Mn));const j={Accept:"application/json","Content-Type":"application/json"},T="POST",d={headers:j,method:T},g=10;class f{constructor(Mn,rs=!1){if(this.url=Mn,this.disableProviderPing=rs,this.events=new eventsExports.EventEmitter,this.isAvailable=!1,this.registering=!1,!isHttpUrl(Mn))throw new Error(`Provided URL is not compatible with HTTP connection: ${Mn}`);this.url=Mn,this.disableProviderPing=rs}get connected(){return this.isAvailable}get connecting(){return this.registering}on(Mn,rs){this.events.on(Mn,rs)}once(Mn,rs){this.events.once(Mn,rs)}off(Mn,rs){this.events.off(Mn,rs)}removeListener(Mn,rs){this.events.removeListener(Mn,rs)}async open(Mn=this.url){await this.register(Mn)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(Mn){this.isAvailable||await this.register();try{const rs=safeJsonStringify(Mn),is=await(await o$1(this.url,v(p({},d),{body:rs}))).json();this.onPayload({data:is})}catch(rs){this.onError(Mn.id,rs)}}async register(Mn=this.url){if(!isHttpUrl(Mn))throw new Error(`Provided URL is not compatible with HTTP connection: ${Mn}`);if(this.registering){const rs=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=rs||this.events.listenerCount("open")>=rs)&&this.events.setMaxListeners(rs+1),new Promise((is,os)=>{this.events.once("register_error",as=>{this.resetMaxListeners(),os(as)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return os(new Error("HTTP connection is missing or invalid"));is()})})}this.url=Mn,this.registering=!0;try{if(!this.disableProviderPing){const rs=safeJsonStringify({id:1,jsonrpc:"2.0",method:"test",params:[]});await o$1(Mn,v(p({},d),{body:rs}))}this.onOpen()}catch(rs){const is=this.parseError(rs);throw this.events.emit("register_error",is),this.onClose(),is}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(Mn){if(typeof Mn.data>"u")return;const rs=typeof Mn.data=="string"?safeJsonParse(Mn.data):Mn.data;this.events.emit("payload",rs)}onError(Mn,rs){const is=this.parseError(rs),os=is.message||is.toString(),as=formatJsonRpcError(Mn,os);this.events.emit("payload",as)}parseError(Mn,rs=this.url){return parseConnectionError(Mn,rs,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>g&&this.events.setMaxListeners(g)}}const ya="error",Yg="wss://relay.walletconnect.org",Zg="wc",Xg="universal_provider",Sa=`${Zg}@2:${Xg}:`,Oa="https://rpc.walletconnect.org/v1/",ze="generic",Qg=`${Oa}bundler`,Tt={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var _n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global$2<"u"?global$2:typeof self<"u"?self:{},qi={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
*/(function(Fn,Mn){(function(){var rs,is="4.17.21",os=200,as="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",us="Expected a function",ds="Invalid `variable` option passed into `_.template`",hs="__lodash_hash_undefined__",ps=500,io="__lodash_placeholder__",fo=1,mo=2,Ao=4,$o=1,Lo=2,Go=1,Yo=2,Wo=4,Jo=8,xl=16,_l=32,Tl=64,Sl=128,$l=256,Pl=512,Dl=30,Ol="...",Rl=800,Vo=16,jo=1,Ho=2,Qo=3,El=1/0,Xo=9007199254740991,Al=17976931348623157e292,wl=NaN,yl=4294967295,Il=yl-1,Bl=yl>>>1,Gl=[["ary",Sl],["bind",Go],["bindKey",Yo],["curry",Jo],["curryRight",xl],["flip",Pl],["partial",_l],["partialRight",Tl],["rearg",$l]],Nl="[object Arguments]",zl="[object Array]",Vl="[object AsyncFunction]",Hl="[object Boolean]",Yl="[object Date]",Ll="[object DOMException]",Zl="[object Error]",Xl="[object Function]",wu="[object GeneratorFunction]",yu="[object Map]",rp="[object Number]",dp="[object Null]",up="[object Object]",wp="[object Promise]",vp="[object Proxy]",pp="[object RegExp]",cp="[object Set]",gp="[object String]",mp="[object Symbol]",fp="[object Undefined]",hp="[object WeakMap]",xp="[object WeakSet]",Kl="[object ArrayBuffer]",Fl="[object DataView]",Ul="[object Float32Array]",Jl="[object Float64Array]",fu="[object Int8Array]",_d="[object Int16Array]",tp="[object Int32Array]",yp="[object Uint8Array]",_p="[object Uint8ClampedArray]",Sp="[object Uint16Array]",Ap="[object Uint32Array]",Op=/\b__p \+= '';/g,Zp=/\b(__p \+=) '' \+/g,Qp=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xp=/&(?:amp|lt|gt|quot|#39);/g,h0=/[&<>"']/g,Wp=RegExp(Xp.source),Np=RegExp(h0.source),Rp=/<%-([\s\S]+?)%>/g,Pp=/<%([\s\S]+?)%>/g,Hp=/<%=([\s\S]+?)%>/g,kp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gp=/^\w*$/,Yp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mp=/[\\^$.*+?()[\]{}|]/g,Ip=RegExp(Mp.source),Dp=/^\s+/,Lp=/\s/,zp=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bp=/\{\n\/\* \[wrapped with (.+)\] \*/,qp=/,? & /,Vp=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,tm=/[()=,{}\[\]\/\s]/,g0=/\\(\\)?/g,rm=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Jp=/\w*$/,lm=/^[-+]0x[0-9a-f]+$/i,$m=/^0b[01]+$/i,km=/^\[object .+?Constructor\]$/,Cm=/^0o[0-7]+$/i,Am=/^(?:0|[1-9]\d*)$/,pm=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ym=/($^)/,u1=/['\n\r\u2028\u2029\\]/g,qm="\\ud800-\\udfff",Qm="\\u0300-\\u036f",o1="\\ufe20-\\ufe2f",e1="\\u20d0-\\u20ff",Zm=Qm+o1+e1,t1="\\u2700-\\u27bf",Bm="a-z\\xdf-\\xf6\\xf8-\\xff",Dm="\\xac\\xb1\\xd7\\xf7",Om="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",r1="\\u2000-\\u206f",g1=" \\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",b1="A-Z\\xc0-\\xd6\\xd8-\\xde",F1="\\ufe0e\\ufe0f",P1=Dm+Om+r1+g1,K1="['’]",w1="["+qm+"]",S2="["+P1+"]",n2="["+Zm+"]",i2="\\d+",p2="["+t1+"]",O2="["+Bm+"]",M2="[^"+qm+P1+i2+t1+Bm+b1+"]",s2="\\ud83c[\\udffb-\\udfff]",D2="(?:"+n2+"|"+s2+")",L2="[^"+qm+"]",q1="(?:\\ud83c[\\udde6-\\uddff]){2}",k1="[\\ud800-\\udbff][\\udc00-\\udfff]",E1="["+b1+"]",v1="\\u200d",$2="(?:"+O2+"|"+M2+")",a1="(?:"+E1+"|"+M2+")",Z1="(?:"+K1+"(?:d|ll|m|re|s|t|ve))?",Y1="(?:"+K1+"(?:D|LL|M|RE|S|T|VE))?",Q1=D2+"?",o2="["+F1+"]?",m2="(?:"+v1+"(?:"+[L2,q1,k1].join("|")+")"+o2+Q1+")*",Up="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",im="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mm=o2+Q1+m2,Wm="(?:"+[p2,q1,k1].join("|")+")"+mm,Pm="(?:"+[L2+n2+"?",n2,q1,k1,w1].join("|")+")",Kp=RegExp(K1,"g"),cm=RegExp(n2,"g"),Lm=RegExp(s2+"(?="+s2+")|"+Pm+mm,"g"),n1=RegExp([E1+"?"+O2+"+"+Z1+"(?="+[S2,E1,"$"].join("|")+")",a1+"+"+Y1+"(?="+[S2,E1+$2,"$"].join("|")+")",E1+"?"+$2+"+"+Z1,E1+"+"+Y1,im,Up,i2,Wm].join("|"),"g"),zm=RegExp("["+v1+qm+Zm+F1+"]"),g2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$v=["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"],ay=-1,jm={};jm[Ul]=jm[Jl]=jm[fu]=jm[_d]=jm[tp]=jm[yp]=jm[_p]=jm[Sp]=jm[Ap]=!0,jm[Nl]=jm[zl]=jm[Kl]=jm[Hl]=jm[Fl]=jm[Yl]=jm[Zl]=jm[Xl]=jm[yu]=jm[rp]=jm[up]=jm[pp]=jm[cp]=jm[gp]=jm[hp]=!1;var Vm={};Vm[Nl]=Vm[zl]=Vm[Kl]=Vm[Fl]=Vm[Hl]=Vm[Yl]=Vm[Ul]=Vm[Jl]=Vm[fu]=Vm[_d]=Vm[tp]=Vm[yu]=Vm[rp]=Vm[up]=Vm[pp]=Vm[cp]=Vm[gp]=Vm[mp]=Vm[yp]=Vm[_p]=Vm[Sp]=Vm[Ap]=!0,Vm[Zl]=Vm[Xl]=Vm[hp]=!1;var Au={À:"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",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"},sp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},jp={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},sm={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Hm=parseFloat,ym=parseInt,Jm=typeof _n=="object"&&_n&&_n.Object===Object&&_n,y1=typeof self=="object"&&self&&self.Object===Object&&self,Rm=Jm||y1||Function("return this")(),Gm=Mn&&!Mn.nodeType&&Mn,d1=Gm&&!0&&Fn&&!Fn.nodeType&&Fn,J1=d1&&d1.exports===Gm,x1=J1&&Jm.process,Xm=function(){try{var ap=d1&&d1.require&&d1.require("util").types;return ap||x1&&x1.binding&&x1.binding("util")}catch{}}(),B1=Xm&&Xm.isArrayBuffer,T2=Xm&&Xm.isDate,v2=Xm&&Xm.isMap,F2=Xm&&Xm.isRegExp,Iy=Xm&&Xm.isSet,qv=Xm&&Xm.isTypedArray;function I1(ap,Cp,bp){switch(bp.length){case 0:return ap.call(Cp);case 1:return ap.call(Cp,bp[0]);case 2:return ap.call(Cp,bp[0],bp[1]);case 3:return ap.call(Cp,bp[0],bp[1],bp[2])}return ap.apply(Cp,bp)}function i_(ap,Cp,bp,om){for(var vm=-1,Mm=ap==null?0:ap.length;++vm<Mm;){var C1=ap[vm];Cp(om,C1,bp(C1),ap)}return om}function y2(ap,Cp){for(var bp=-1,om=ap==null?0:ap.length;++bp<om&&Cp(ap[bp],bp,ap)!==!1;);return ap}function s_(ap,Cp){for(var bp=ap==null?0:ap.length;bp--&&Cp(ap[bp],bp,ap)!==!1;);return ap}function Hw(ap,Cp){for(var bp=-1,om=ap==null?0:ap.length;++bp<om;)if(!Cp(ap[bp],bp,ap))return!1;return!0}function Tv(ap,Cp){for(var bp=-1,om=ap==null?0:ap.length,vm=0,Mm=[];++bp<om;){var C1=ap[bp];Cp(C1,bp,ap)&&(Mm[vm++]=C1)}return Mm}function Zy(ap,Cp){var bp=ap==null?0:ap.length;return!!bp&&ly(ap,Cp,0)>-1}function Dx(ap,Cp,bp){for(var om=-1,vm=ap==null?0:ap.length;++om<vm;)if(bp(Cp,ap[om]))return!0;return!1}function i1(ap,Cp){for(var bp=-1,om=ap==null?0:ap.length,vm=Array(om);++bp<om;)vm[bp]=Cp(ap[bp],bp,ap);return vm}function Rv(ap,Cp){for(var bp=-1,om=Cp.length,vm=ap.length;++bp<om;)ap[vm+bp]=Cp[bp];return ap}function Lx(ap,Cp,bp,om){var vm=-1,Mm=ap==null?0:ap.length;for(om&&Mm&&(bp=ap[++vm]);++vm<Mm;)bp=Cp(bp,ap[vm],vm,ap);return bp}function o_(ap,Cp,bp,om){var vm=ap==null?0:ap.length;for(om&&vm&&(bp=ap[--vm]);vm--;)bp=Cp(bp,ap[vm],vm,ap);return bp}function Fx(ap,Cp){for(var bp=-1,om=ap==null?0:ap.length;++bp<om;)if(Cp(ap[bp],bp,ap))return!0;return!1}var a_=Bx("length");function l_(ap){return ap.split("")}function c_(ap){return ap.match(Vp)||[]}function Gw(ap,Cp,bp){var om;return bp(ap,function(vm,Mm,C1){if(Cp(vm,Mm,C1))return om=Mm,!1}),om}function Yy(ap,Cp,bp,om){for(var vm=ap.length,Mm=bp+(om?1:-1);om?Mm--:++Mm<vm;)if(Cp(ap[Mm],Mm,ap))return Mm;return-1}function ly(ap,Cp,bp){return Cp===Cp?w_(ap,Cp,bp):Yy(ap,Kw,bp)}function u_(ap,Cp,bp,om){for(var vm=bp-1,Mm=ap.length;++vm<Mm;)if(om(ap[vm],Cp))return vm;return-1}function Kw(ap){return ap!==ap}function qw(ap,Cp){var bp=ap==null?0:ap.length;return bp?Wx(ap,Cp)/bp:wl}function Bx(ap){return function(Cp){return Cp==null?rs:Cp[ap]}}function Ux(ap){return function(Cp){return ap==null?rs:ap[Cp]}}function Zw(ap,Cp,bp,om,vm){return vm(ap,function(Mm,C1,Km){bp=om?(om=!1,Mm):Cp(bp,Mm,C1,Km)}),bp}function d_(ap,Cp){var bp=ap.length;for(ap.sort(Cp);bp--;)ap[bp]=ap[bp].value;return ap}function Wx(ap,Cp){for(var bp,om=-1,vm=ap.length;++om<vm;){var Mm=Cp(ap[om]);Mm!==rs&&(bp=bp===rs?Mm:bp+Mm)}return bp}function Vx(ap,Cp){for(var bp=-1,om=Array(ap);++bp<ap;)om[bp]=Cp(bp);return om}function f_(ap,Cp){return i1(Cp,function(bp){return[bp,ap[bp]]})}function Yw(ap){return ap&&ap.slice(0,e3(ap)+1).replace(Dp,"")}function a2(ap){return function(Cp){return ap(Cp)}}function zx(ap,Cp){return i1(Cp,function(bp){return ap[bp]})}function Ny(ap,Cp){return ap.has(Cp)}function Qw(ap,Cp){for(var bp=-1,om=ap.length;++bp<om&&ly(Cp,ap[bp],0)>-1;);return bp}function Jw(ap,Cp){for(var bp=ap.length;bp--&&ly(Cp,ap[bp],0)>-1;);return bp}function h_(ap,Cp){for(var bp=ap.length,om=0;bp--;)ap[bp]===Cp&&++om;return om}var p_=Ux(Au),m_=Ux(sp);function g_(ap){return"\\"+sm[ap]}function v_(ap,Cp){return ap==null?rs:ap[Cp]}function cy(ap){return zm.test(ap)}function y_(ap){return g2.test(ap)}function x_(ap){for(var Cp,bp=[];!(Cp=ap.next()).done;)bp.push(Cp.value);return bp}function Hx(ap){var Cp=-1,bp=Array(ap.size);return ap.forEach(function(om,vm){bp[++Cp]=[vm,om]}),bp}function Xw(ap,Cp){return function(bp){return ap(Cp(bp))}}function Nv(ap,Cp){for(var bp=-1,om=ap.length,vm=0,Mm=[];++bp<om;){var C1=ap[bp];(C1===Cp||C1===io)&&(ap[bp]=io,Mm[vm++]=bp)}return Mm}function Qy(ap){var Cp=-1,bp=Array(ap.size);return ap.forEach(function(om){bp[++Cp]=om}),bp}function b_(ap){var Cp=-1,bp=Array(ap.size);return ap.forEach(function(om){bp[++Cp]=[om,om]}),bp}function w_(ap,Cp,bp){for(var om=bp-1,vm=ap.length;++om<vm;)if(ap[om]===Cp)return om;return-1}function E_(ap,Cp,bp){for(var om=bp+1;om--;)if(ap[om]===Cp)return om;return om}function uy(ap){return cy(ap)?C_(ap):a_(ap)}function R2(ap){return cy(ap)?A_(ap):l_(ap)}function e3(ap){for(var Cp=ap.length;Cp--&&Lp.test(ap.charAt(Cp)););return Cp}var __=Ux(jp);function C_(ap){for(var Cp=Lm.lastIndex=0;Lm.test(ap);)++Cp;return Cp}function A_(ap){return ap.match(Lm)||[]}function S_(ap){return ap.match(n1)||[]}var $_=function ap(Cp){Cp=Cp==null?Rm:dy.defaults(Rm.Object(),Cp,dy.pick(Rm,$v));var bp=Cp.Array,om=Cp.Date,vm=Cp.Error,Mm=Cp.Function,C1=Cp.Math,Km=Cp.Object,Gx=Cp.RegExp,T_=Cp.String,x2=Cp.TypeError,Jy=bp.prototype,R_=Mm.prototype,fy=Km.prototype,Xy=Cp["__core-js_shared__"],ex=R_.toString,Um=fy.hasOwnProperty,I_=0,t3=function(){var zo=/[^.]+$/.exec(Xy&&Xy.keys&&Xy.keys.IE_PROTO||"");return zo?"Symbol(src)_1."+zo:""}(),tx=fy.toString,N_=ex.call(Km),P_=Rm._,k_=Gx("^"+ex.call(Um).replace(Mp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rx=J1?Cp.Buffer:rs,kv=Cp.Symbol,nx=Cp.Uint8Array,r3=rx?rx.allocUnsafe:rs,ix=Xw(Km.getPrototypeOf,Km),n3=Km.create,i3=fy.propertyIsEnumerable,sx=Jy.splice,s3=kv?kv.isConcatSpreadable:rs,Py=kv?kv.iterator:rs,Zv=kv?kv.toStringTag:rs,ox=function(){try{var zo=ey(Km,"defineProperty");return zo({},"",{}),zo}catch{}}(),j_=Cp.clearTimeout!==Rm.clearTimeout&&Cp.clearTimeout,O_=om&&om.now!==Rm.Date.now&&om.now,M_=Cp.setTimeout!==Rm.setTimeout&&Cp.setTimeout,ax=C1.ceil,lx=C1.floor,Kx=Km.getOwnPropertySymbols,D_=rx?rx.isBuffer:rs,o3=Cp.isFinite,L_=Jy.join,F_=Xw(Km.keys,Km),A1=C1.max,O1=C1.min,B_=om.now,U_=Cp.parseInt,a3=C1.random,W_=Jy.reverse,qx=ey(Cp,"DataView"),ky=ey(Cp,"Map"),Zx=ey(Cp,"Promise"),hy=ey(Cp,"Set"),jy=ey(Cp,"WeakMap"),Oy=ey(Km,"create"),cx=jy&&new jy,py={},V_=ty(qx),z_=ty(ky),H_=ty(Zx),G_=ty(hy),K_=ty(jy),ux=kv?kv.prototype:rs,My=ux?ux.valueOf:rs,l3=ux?ux.toString:rs;function _c(zo){if(l1(zo)&&!xm(zo)&&!(zo instanceof Tm)){if(zo instanceof b2)return zo;if(Um.call(zo,"__wrapped__"))return cE(zo)}return new b2(zo)}var my=function(){function zo(){}return function(Cl){if(!s1(Cl))return{};if(n3)return n3(Cl);zo.prototype=Cl;var Ml=new zo;return zo.prototype=rs,Ml}}();function dx(){}function b2(zo,Cl){this.__wrapped__=zo,this.__actions__=[],this.__chain__=!!Cl,this.__index__=0,this.__values__=rs}_c.templateSettings={escape:Rp,evaluate:Pp,interpolate:Hp,variable:"",imports:{_:_c}},_c.prototype=dx.prototype,_c.prototype.constructor=_c,b2.prototype=my(dx.prototype),b2.prototype.constructor=b2;function Tm(zo){this.__wrapped__=zo,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=yl,this.__views__=[]}function q_(){var zo=new Tm(this.__wrapped__);return zo.__actions__=X1(this.__actions__),zo.__dir__=this.__dir__,zo.__filtered__=this.__filtered__,zo.__iteratees__=X1(this.__iteratees__),zo.__takeCount__=this.__takeCount__,zo.__views__=X1(this.__views__),zo}function Z_(){if(this.__filtered__){var zo=new Tm(this);zo.__dir__=-1,zo.__filtered__=!0}else zo=this.clone(),zo.__dir__*=-1;return zo}function Y_(){var zo=this.__wrapped__.value(),Cl=this.__dir__,Ml=xm(zo),Wl=Cl<0,Ql=Ml?zo.length:0,bu=lC(0,Ql,this.__views__),ep=bu.start,np=bu.end,lp=np-ep,$p=Wl?np:ep-1,Tp=this.__iteratees__,Fp=Tp.length,em=0,um=O1(lp,this.__takeCount__);if(!Ml||!Wl&&Ql==lp&&um==lp)return P3(zo,this.__actions__);var fm=[];e:for(;lp--&&em<um;){$p+=Cl;for(var wm=-1,hm=zo[$p];++wm<Fp;){var Sm=Tp[wm],Im=Sm.iteratee,u2=Sm.type,z1=Im(hm);if(u2==Ho)hm=z1;else if(!z1){if(u2==jo)continue e;break e}}fm[em++]=hm}return fm}Tm.prototype=my(dx.prototype),Tm.prototype.constructor=Tm;function Yv(zo){var Cl=-1,Ml=zo==null?0:zo.length;for(this.clear();++Cl<Ml;){var Wl=zo[Cl];this.set(Wl[0],Wl[1])}}function Q_(){this.__data__=Oy?Oy(null):{},this.size=0}function J_(zo){var Cl=this.has(zo)&&delete this.__data__[zo];return this.size-=Cl?1:0,Cl}function X_(zo){var Cl=this.__data__;if(Oy){var Ml=Cl[zo];return Ml===hs?rs:Ml}return Um.call(Cl,zo)?Cl[zo]:rs}function e5(zo){var Cl=this.__data__;return Oy?Cl[zo]!==rs:Um.call(Cl,zo)}function t5(zo,Cl){var Ml=this.__data__;return this.size+=this.has(zo)?0:1,Ml[zo]=Oy&&Cl===rs?hs:Cl,this}Yv.prototype.clear=Q_,Yv.prototype.delete=J_,Yv.prototype.get=X_,Yv.prototype.has=e5,Yv.prototype.set=t5;function G2(zo){var Cl=-1,Ml=zo==null?0:zo.length;for(this.clear();++Cl<Ml;){var Wl=zo[Cl];this.set(Wl[0],Wl[1])}}function r5(){this.__data__=[],this.size=0}function n5(zo){var Cl=this.__data__,Ml=fx(Cl,zo);if(Ml<0)return!1;var Wl=Cl.length-1;return Ml==Wl?Cl.pop():sx.call(Cl,Ml,1),--this.size,!0}function i5(zo){var Cl=this.__data__,Ml=fx(Cl,zo);return Ml<0?rs:Cl[Ml][1]}function s5(zo){return fx(this.__data__,zo)>-1}function o5(zo,Cl){var Ml=this.__data__,Wl=fx(Ml,zo);return Wl<0?(++this.size,Ml.push([zo,Cl])):Ml[Wl][1]=Cl,this}G2.prototype.clear=r5,G2.prototype.delete=n5,G2.prototype.get=i5,G2.prototype.has=s5,G2.prototype.set=o5;function K2(zo){var Cl=-1,Ml=zo==null?0:zo.length;for(this.clear();++Cl<Ml;){var Wl=zo[Cl];this.set(Wl[0],Wl[1])}}function a5(){this.size=0,this.__data__={hash:new Yv,map:new(ky||G2),string:new Yv}}function l5(zo){var Cl=Cx(this,zo).delete(zo);return this.size-=Cl?1:0,Cl}function c5(zo){return Cx(this,zo).get(zo)}function u5(zo){return Cx(this,zo).has(zo)}function d5(zo,Cl){var Ml=Cx(this,zo),Wl=Ml.size;return Ml.set(zo,Cl),this.size+=Ml.size==Wl?0:1,this}K2.prototype.clear=a5,K2.prototype.delete=l5,K2.prototype.get=c5,K2.prototype.has=u5,K2.prototype.set=d5;function Qv(zo){var Cl=-1,Ml=zo==null?0:zo.length;for(this.__data__=new K2;++Cl<Ml;)this.add(zo[Cl])}function f5(zo){return this.__data__.set(zo,hs),this}function h5(zo){return this.__data__.has(zo)}Qv.prototype.add=Qv.prototype.push=f5,Qv.prototype.has=h5;function I2(zo){var Cl=this.__data__=new G2(zo);this.size=Cl.size}function p5(){this.__data__=new G2,this.size=0}function m5(zo){var Cl=this.__data__,Ml=Cl.delete(zo);return this.size=Cl.size,Ml}function g5(zo){return this.__data__.get(zo)}function v5(zo){return this.__data__.has(zo)}function y5(zo,Cl){var Ml=this.__data__;if(Ml instanceof G2){var Wl=Ml.__data__;if(!ky||Wl.length<os-1)return Wl.push([zo,Cl]),this.size=++Ml.size,this;Ml=this.__data__=new K2(Wl)}return Ml.set(zo,Cl),this.size=Ml.size,this}I2.prototype.clear=p5,I2.prototype.delete=m5,I2.prototype.get=g5,I2.prototype.has=v5,I2.prototype.set=y5;function c3(zo,Cl){var Ml=xm(zo),Wl=!Ml&&ry(zo),Ql=!Ml&&!Wl&&Lv(zo),bu=!Ml&&!Wl&&!Ql&&xy(zo),ep=Ml||Wl||Ql||bu,np=ep?Vx(zo.length,T_):[],lp=np.length;for(var $p in zo)(Cl||Um.call(zo,$p))&&!(ep&&($p=="length"||Ql&&($p=="offset"||$p=="parent")||bu&&($p=="buffer"||$p=="byteLength"||$p=="byteOffset")||Q2($p,lp)))&&np.push($p);return np}function u3(zo){var Cl=zo.length;return Cl?zo[sw(0,Cl-1)]:rs}function x5(zo,Cl){return Ax(X1(zo),Jv(Cl,0,zo.length))}function b5(zo){return Ax(X1(zo))}function Yx(zo,Cl,Ml){(Ml!==rs&&!N2(zo[Cl],Ml)||Ml===rs&&!(Cl in zo))&&q2(zo,Cl,Ml)}function Dy(zo,Cl,Ml){var Wl=zo[Cl];(!(Um.call(zo,Cl)&&N2(Wl,Ml))||Ml===rs&&!(Cl in zo))&&q2(zo,Cl,Ml)}function fx(zo,Cl){for(var Ml=zo.length;Ml--;)if(N2(zo[Ml][0],Cl))return Ml;return-1}function w5(zo,Cl,Ml,Wl){return jv(zo,function(Ql,bu,ep){Cl(Wl,Ql,Ml(Ql),ep)}),Wl}function d3(zo,Cl){return zo&&U2(Cl,N1(Cl),zo)}function E5(zo,Cl){return zo&&U2(Cl,e2(Cl),zo)}function q2(zo,Cl,Ml){Cl=="__proto__"&&ox?ox(zo,Cl,{configurable:!0,enumerable:!0,value:Ml,writable:!0}):zo[Cl]=Ml}function Qx(zo,Cl){for(var Ml=-1,Wl=Cl.length,Ql=bp(Wl),bu=zo==null;++Ml<Wl;)Ql[Ml]=bu?rs:Iw(zo,Cl[Ml]);return Ql}function Jv(zo,Cl,Ml){return zo===zo&&(Ml!==rs&&(zo=zo<=Ml?zo:Ml),Cl!==rs&&(zo=zo>=Cl?zo:Cl)),zo}function w2(zo,Cl,Ml,Wl,Ql,bu){var ep,np=Cl&fo,lp=Cl&mo,$p=Cl&Ao;if(Ml&&(ep=Ql?Ml(zo,Wl,Ql,bu):Ml(zo)),ep!==rs)return ep;if(!s1(zo))return zo;var Tp=xm(zo);if(Tp){if(ep=uC(zo),!np)return X1(zo,ep)}else{var Fp=M1(zo),em=Fp==Xl||Fp==wu;if(Lv(zo))return O3(zo,np);if(Fp==up||Fp==Nl||em&&!Ql){if(ep=lp||em?{}:eE(zo),!np)return lp?X5(zo,E5(ep,zo)):J5(zo,d3(ep,zo))}else{if(!Vm[Fp])return Ql?zo:{};ep=dC(zo,Fp,np)}}bu||(bu=new I2);var um=bu.get(zo);if(um)return um;bu.set(zo,ep),RE(zo)?zo.forEach(function(hm){ep.add(w2(hm,Cl,Ml,hm,zo,bu))}):$E(zo)&&zo.forEach(function(hm,Sm){ep.set(Sm,w2(hm,Cl,Ml,Sm,zo,bu))});var fm=$p?lp?gw:mw:lp?e2:N1,wm=Tp?rs:fm(zo);return y2(wm||zo,function(hm,Sm){wm&&(Sm=hm,hm=zo[Sm]),Dy(ep,Sm,w2(hm,Cl,Ml,Sm,zo,bu))}),ep}function _5(zo){var Cl=N1(zo);return function(Ml){return f3(Ml,zo,Cl)}}function f3(zo,Cl,Ml){var Wl=Ml.length;if(zo==null)return!Wl;for(zo=Km(zo);Wl--;){var Ql=Ml[Wl],bu=Cl[Ql],ep=zo[Ql];if(ep===rs&&!(Ql in zo)||!bu(ep))return!1}return!0}function h3(zo,Cl,Ml){if(typeof zo!="function")throw new x2(us);return zy(function(){zo.apply(rs,Ml)},Cl)}function Ly(zo,Cl,Ml,Wl){var Ql=-1,bu=Zy,ep=!0,np=zo.length,lp=[],$p=Cl.length;if(!np)return lp;Ml&&(Cl=i1(Cl,a2(Ml))),Wl?(bu=Dx,ep=!1):Cl.length>=os&&(bu=Ny,ep=!1,Cl=new Qv(Cl));e:for(;++Ql<np;){var Tp=zo[Ql],Fp=Ml==null?Tp:Ml(Tp);if(Tp=Wl||Tp!==0?Tp:0,ep&&Fp===Fp){for(var em=$p;em--;)if(Cl[em]===Fp)continue e;lp.push(Tp)}else bu(Cl,Fp,Wl)||lp.push(Tp)}return lp}var jv=B3(B2),p3=B3(Xx,!0);function C5(zo,Cl){var Ml=!0;return jv(zo,function(Wl,Ql,bu){return Ml=!!Cl(Wl,Ql,bu),Ml}),Ml}function hx(zo,Cl,Ml){for(var Wl=-1,Ql=zo.length;++Wl<Ql;){var bu=zo[Wl],ep=Cl(bu);if(ep!=null&&(np===rs?ep===ep&&!c2(ep):Ml(ep,np)))var np=ep,lp=bu}return lp}function A5(zo,Cl,Ml,Wl){var Ql=zo.length;for(Ml=bm(Ml),Ml<0&&(Ml=-Ml>Ql?0:Ql+Ml),Wl=Wl===rs||Wl>Ql?Ql:bm(Wl),Wl<0&&(Wl+=Ql),Wl=Ml>Wl?0:NE(Wl);Ml<Wl;)zo[Ml++]=Cl;return zo}function m3(zo,Cl){var Ml=[];return jv(zo,function(Wl,Ql,bu){Cl(Wl,Ql,bu)&&Ml.push(Wl)}),Ml}function j1(zo,Cl,Ml,Wl,Ql){var bu=-1,ep=zo.length;for(Ml||(Ml=hC),Ql||(Ql=[]);++bu<ep;){var np=zo[bu];Cl>0&&Ml(np)?Cl>1?j1(np,Cl-1,Ml,Wl,Ql):Rv(Ql,np):Wl||(Ql[Ql.length]=np)}return Ql}var Jx=U3(),g3=U3(!0);function B2(zo,Cl){return zo&&Jx(zo,Cl,N1)}function Xx(zo,Cl){return zo&&g3(zo,Cl,N1)}function px(zo,Cl){return Tv(Cl,function(Ml){return J2(zo[Ml])})}function Xv(zo,Cl){Cl=Mv(Cl,zo);for(var Ml=0,Wl=Cl.length;zo!=null&&Ml<Wl;)zo=zo[W2(Cl[Ml++])];return Ml&&Ml==Wl?zo:rs}function v3(zo,Cl,Ml){var Wl=Cl(zo);return xm(zo)?Wl:Rv(Wl,Ml(zo))}function U1(zo){return zo==null?zo===rs?fp:dp:Zv&&Zv in Km(zo)?aC(zo):bC(zo)}function _b(zo,Cl){return zo>Cl}function S5(zo,Cl){return zo!=null&&Um.call(zo,Cl)}function $5(zo,Cl){return zo!=null&&Cl in Km(zo)}function T5(zo,Cl,Ml){return zo>=O1(Cl,Ml)&&zo<A1(Cl,Ml)}function ew(zo,Cl,Ml){for(var Wl=Ml?Dx:Zy,Ql=zo[0].length,bu=zo.length,ep=bu,np=bp(bu),lp=1/0,$p=[];ep--;){var Tp=zo[ep];ep&&Cl&&(Tp=i1(Tp,a2(Cl))),lp=O1(Tp.length,lp),np[ep]=!Ml&&(Cl||Ql>=120&&Tp.length>=120)?new Qv(ep&&Tp):rs}Tp=zo[0];var Fp=-1,em=np[0];e:for(;++Fp<Ql&&$p.length<lp;){var um=Tp[Fp],fm=Cl?Cl(um):um;if(um=Ml||um!==0?um:0,!(em?Ny(em,fm):Wl($p,fm,Ml))){for(ep=bu;--ep;){var wm=np[ep];if(!(wm?Ny(wm,fm):Wl(zo[ep],fm,Ml)))continue e}em&&em.push(fm),$p.push(um)}}return $p}function R5(zo,Cl,Ml,Wl){return B2(zo,function(Ql,bu,ep){Cl(Wl,Ml(Ql),bu,ep)}),Wl}function Fy(zo,Cl,Ml){Cl=Mv(Cl,zo),zo=iE(zo,Cl);var Wl=zo==null?zo:zo[W2(_2(Cl))];return Wl==null?rs:I1(Wl,zo,Ml)}function y3(zo){return l1(zo)&&U1(zo)==Nl}function I5(zo){return l1(zo)&&U1(zo)==Kl}function N5(zo){return l1(zo)&&U1(zo)==Yl}function By(zo,Cl,Ml,Wl,Ql){return zo===Cl?!0:zo==null||Cl==null||!l1(zo)&&!l1(Cl)?zo!==zo&&Cl!==Cl:P5(zo,Cl,Ml,Wl,By,Ql)}function P5(zo,Cl,Ml,Wl,Ql,bu){var ep=xm(zo),np=xm(Cl),lp=ep?zl:M1(zo),$p=np?zl:M1(Cl);lp=lp==Nl?up:lp,$p=$p==Nl?up:$p;var Tp=lp==up,Fp=$p==up,em=lp==$p;if(em&&Lv(zo)){if(!Lv(Cl))return!1;ep=!0,Tp=!1}if(em&&!Tp)return bu||(bu=new I2),ep||xy(zo)?Q3(zo,Cl,Ml,Wl,Ql,bu):sC(zo,Cl,lp,Ml,Wl,Ql,bu);if(!(Ml&$o)){var um=Tp&&Um.call(zo,"__wrapped__"),fm=Fp&&Um.call(Cl,"__wrapped__");if(um||fm){var wm=um?zo.value():zo,hm=fm?Cl.value():Cl;return bu||(bu=new I2),Ql(wm,hm,Ml,Wl,bu)}}return em?(bu||(bu=new I2),oC(zo,Cl,Ml,Wl,Ql,bu)):!1}function k5(zo){return l1(zo)&&M1(zo)==yu}function tw(zo,Cl,Ml,Wl){var Ql=Ml.length,bu=Ql,ep=!Wl;if(zo==null)return!bu;for(zo=Km(zo);Ql--;){var np=Ml[Ql];if(ep&&np[2]?np[1]!==zo[np[0]]:!(np[0]in zo))return!1}for(;++Ql<bu;){np=Ml[Ql];var lp=np[0],$p=zo[lp],Tp=np[1];if(ep&&np[2]){if($p===rs&&!(lp in zo))return!1}else{var Fp=new I2;if(Wl)var em=Wl($p,Tp,lp,zo,Cl,Fp);if(!(em===rs?By(Tp,$p,$o|Lo,Wl,Fp):em))return!1}}return!0}function x3(zo){if(!s1(zo)||mC(zo))return!1;var Cl=J2(zo)?k_:km;return Cl.test(ty(zo))}function j5(zo){return l1(zo)&&U1(zo)==pp}function O5(zo){return l1(zo)&&M1(zo)==cp}function M5(zo){return l1(zo)&&Nx(zo.length)&&!!jm[U1(zo)]}function b3(zo){return typeof zo=="function"?zo:zo==null?t2:typeof zo=="object"?xm(zo)?_3(zo[0],zo[1]):E3(zo):WE(zo)}function rw(zo){if(!Vy(zo))return F_(zo);var Cl=[];for(var Ml in Km(zo))Um.call(zo,Ml)&&Ml!="constructor"&&Cl.push(Ml);return Cl}function D5(zo){if(!s1(zo))return xC(zo);var Cl=Vy(zo),Ml=[];for(var Wl in zo)Wl=="constructor"&&(Cl||!Um.call(zo,Wl))||Ml.push(Wl);return Ml}function nw(zo,Cl){return zo<Cl}function w3(zo,Cl){var Ml=-1,Wl=_g(zo)?bp(zo.length):[];return jv(zo,function(Ql,bu,ep){Wl[++Ml]=Cl(Ql,bu,ep)}),Wl}function E3(zo){var Cl=yw(zo);return Cl.length==1&&Cl[0][2]?rE(Cl[0][0],Cl[0][1]):function(Ml){return Ml===zo||tw(Ml,zo,Cl)}}function _3(zo,Cl){return bw(zo)&&tE(Cl)?rE(W2(zo),Cl):function(Ml){var Wl=Iw(Ml,zo);return Wl===rs&&Wl===Cl?Nw(Ml,zo):By(Cl,Wl,$o|Lo)}}function mx(zo,Cl,Ml,Wl,Ql){zo!==Cl&&Jx(Cl,function(bu,ep){if(Ql||(Ql=new I2),s1(bu))L5(zo,Cl,ep,Ml,mx,Wl,Ql);else{var np=Wl?Wl(Ew(zo,ep),bu,ep+"",zo,Cl,Ql):rs;np===rs&&(np=bu),Yx(zo,ep,np)}},e2)}function L5(zo,Cl,Ml,Wl,Ql,bu,ep){var np=Ew(zo,Ml),lp=Ew(Cl,Ml),$p=ep.get(lp);if($p){Yx(zo,Ml,$p);return}var Tp=bu?bu(np,lp,Ml+"",zo,Cl,ep):rs,Fp=Tp===rs;if(Fp){var em=xm(lp),um=!em&&Lv(lp),fm=!em&&!um&&xy(lp);Tp=lp,em||um||fm?xm(np)?Tp=np:f1(np)?Tp=X1(np):um?(Fp=!1,Tp=O3(lp,!0)):fm?(Fp=!1,Tp=M3(lp,!0)):Tp=[]:Hy(lp)||ry(lp)?(Tp=np,ry(np)?Tp=PE(np):(!s1(np)||J2(np))&&(Tp=eE(lp))):Fp=!1}Fp&&(ep.set(lp,Tp),Ql(Tp,lp,Wl,bu,ep),ep.delete(lp)),Yx(zo,Ml,Tp)}function C3(zo,Cl){var Ml=zo.length;if(Ml)return Cl+=Cl<0?Ml:0,Q2(Cl,Ml)?zo[Cl]:rs}function A3(zo,Cl,Ml){Cl.length?Cl=i1(Cl,function(bu){return xm(bu)?function(ep){return Xv(ep,bu.length===1?bu[0]:bu)}:bu}):Cl=[t2];var Wl=-1;Cl=i1(Cl,a2(dm()));var Ql=w3(zo,function(bu,ep,np){var lp=i1(Cl,function($p){return $p(bu)});return{criteria:lp,index:++Wl,value:bu}});return d_(Ql,function(bu,ep){return Q5(bu,ep,Ml)})}function F5(zo,Cl){return S3(zo,Cl,function(Ml,Wl){return Nw(zo,Wl)})}function S3(zo,Cl,Ml){for(var Wl=-1,Ql=Cl.length,bu={};++Wl<Ql;){var ep=Cl[Wl],np=Xv(zo,ep);Ml(np,ep)&&Uy(bu,Mv(ep,zo),np)}return bu}function B5(zo){return function(Cl){return Xv(Cl,zo)}}function iw(zo,Cl,Ml,Wl){var Ql=Wl?u_:ly,bu=-1,ep=Cl.length,np=zo;for(zo===Cl&&(Cl=X1(Cl)),Ml&&(np=i1(zo,a2(Ml)));++bu<ep;)for(var lp=0,$p=Cl[bu],Tp=Ml?Ml($p):$p;(lp=Ql(np,Tp,lp,Wl))>-1;)np!==zo&&sx.call(np,lp,1),sx.call(zo,lp,1);return zo}function $3(zo,Cl){for(var Ml=zo?Cl.length:0,Wl=Ml-1;Ml--;){var Ql=Cl[Ml];if(Ml==Wl||Ql!==bu){var bu=Ql;Q2(Ql)?sx.call(zo,Ql,1):lw(zo,Ql)}}return zo}function sw(zo,Cl){return zo+lx(a3()*(Cl-zo+1))}function U5(zo,Cl,Ml,Wl){for(var Ql=-1,bu=A1(ax((Cl-zo)/(Ml||1)),0),ep=bp(bu);bu--;)ep[Wl?bu:++Ql]=zo,zo+=Ml;return ep}function ow(zo,Cl){var Ml="";if(!zo||Cl<1||Cl>Xo)return Ml;do Cl%2&&(Ml+=zo),Cl=lx(Cl/2),Cl&&(zo+=zo);while(Cl);return Ml}function Em(zo,Cl){return _w(nE(zo,Cl,t2),zo+"")}function W5(zo){return u3(by(zo))}function V5(zo,Cl){var Ml=by(zo);return Ax(Ml,Jv(Cl,0,Ml.length))}function Uy(zo,Cl,Ml,Wl){if(!s1(zo))return zo;Cl=Mv(Cl,zo);for(var Ql=-1,bu=Cl.length,ep=bu-1,np=zo;np!=null&&++Ql<bu;){var lp=W2(Cl[Ql]),$p=Ml;if(lp==="__proto__"||lp==="constructor"||lp==="prototype")return zo;if(Ql!=ep){var Tp=np[lp];$p=Wl?Wl(Tp,lp,np):rs,$p===rs&&($p=s1(Tp)?Tp:Q2(Cl[Ql+1])?[]:{})}Dy(np,lp,$p),np=np[lp]}return zo}var T3=cx?function(zo,Cl){return cx.set(zo,Cl),zo}:t2,z5=ox?function(zo,Cl){return ox(zo,"toString",{configurable:!0,enumerable:!1,value:kw(Cl),writable:!0})}:t2;function H5(zo){return Ax(by(zo))}function E2(zo,Cl,Ml){var Wl=-1,Ql=zo.length;Cl<0&&(Cl=-Cl>Ql?0:Ql+Cl),Ml=Ml>Ql?Ql:Ml,Ml<0&&(Ml+=Ql),Ql=Cl>Ml?0:Ml-Cl>>>0,Cl>>>=0;for(var bu=bp(Ql);++Wl<Ql;)bu[Wl]=zo[Wl+Cl];return bu}function G5(zo,Cl){var Ml;return jv(zo,function(Wl,Ql,bu){return Ml=Cl(Wl,Ql,bu),!Ml}),!!Ml}function gx(zo,Cl,Ml){var Wl=0,Ql=zo==null?Wl:zo.length;if(typeof Cl=="number"&&Cl===Cl&&Ql<=Bl){for(;Wl<Ql;){var bu=Wl+Ql>>>1,ep=zo[bu];ep!==null&&!c2(ep)&&(Ml?ep<=Cl:ep<Cl)?Wl=bu+1:Ql=bu}return Ql}return aw(zo,Cl,t2,Ml)}function aw(zo,Cl,Ml,Wl){var Ql=0,bu=zo==null?0:zo.length;if(bu===0)return 0;Cl=Ml(Cl);for(var ep=Cl!==Cl,np=Cl===null,lp=c2(Cl),$p=Cl===rs;Ql<bu;){var Tp=lx((Ql+bu)/2),Fp=Ml(zo[Tp]),em=Fp!==rs,um=Fp===null,fm=Fp===Fp,wm=c2(Fp);if(ep)var hm=Wl||fm;else $p?hm=fm&&(Wl||em):np?hm=fm&&em&&(Wl||!um):lp?hm=fm&&em&&!um&&(Wl||!wm):um||wm?hm=!1:hm=Wl?Fp<=Cl:Fp<Cl;hm?Ql=Tp+1:bu=Tp}return O1(bu,Il)}function R3(zo,Cl){for(var Ml=-1,Wl=zo.length,Ql=0,bu=[];++Ml<Wl;){var ep=zo[Ml],np=Cl?Cl(ep):ep;if(!Ml||!N2(np,lp)){var lp=np;bu[Ql++]=ep===0?0:ep}}return bu}function I3(zo){return typeof zo=="number"?zo:c2(zo)?wl:+zo}function l2(zo){if(typeof zo=="string")return zo;if(xm(zo))return i1(zo,l2)+"";if(c2(zo))return l3?l3.call(zo):"";var Cl=zo+"";return Cl=="0"&&1/zo==-El?"-0":Cl}function Ov(zo,Cl,Ml){var Wl=-1,Ql=Zy,bu=zo.length,ep=!0,np=[],lp=np;if(Ml)ep=!1,Ql=Dx;else if(bu>=os){var $p=Cl?null:nC(zo);if($p)return Qy($p);ep=!1,Ql=Ny,lp=new Qv}else lp=Cl?[]:np;e:for(;++Wl<bu;){var Tp=zo[Wl],Fp=Cl?Cl(Tp):Tp;if(Tp=Ml||Tp!==0?Tp:0,ep&&Fp===Fp){for(var em=lp.length;em--;)if(lp[em]===Fp)continue e;Cl&&lp.push(Fp),np.push(Tp)}else Ql(lp,Fp,Ml)||(lp!==np&&lp.push(Fp),np.push(Tp))}return np}function lw(zo,Cl){return Cl=Mv(Cl,zo),zo=iE(zo,Cl),zo==null||delete zo[W2(_2(Cl))]}function N3(zo,Cl,Ml,Wl){return Uy(zo,Cl,Ml(Xv(zo,Cl)),Wl)}function vx(zo,Cl,Ml,Wl){for(var Ql=zo.length,bu=Wl?Ql:-1;(Wl?bu--:++bu<Ql)&&Cl(zo[bu],bu,zo););return Ml?E2(zo,Wl?0:bu,Wl?bu+1:Ql):E2(zo,Wl?bu+1:0,Wl?Ql:bu)}function P3(zo,Cl){var Ml=zo;return Ml instanceof Tm&&(Ml=Ml.value()),Lx(Cl,function(Wl,Ql){return Ql.func.apply(Ql.thisArg,Rv([Wl],Ql.args))},Ml)}function cw(zo,Cl,Ml){var Wl=zo.length;if(Wl<2)return Wl?Ov(zo[0]):[];for(var Ql=-1,bu=bp(Wl);++Ql<Wl;)for(var ep=zo[Ql],np=-1;++np<Wl;)np!=Ql&&(bu[Ql]=Ly(bu[Ql]||ep,zo[np],Cl,Ml));return Ov(j1(bu,1),Cl,Ml)}function k3(zo,Cl,Ml){for(var Wl=-1,Ql=zo.length,bu=Cl.length,ep={};++Wl<Ql;){var np=Wl<bu?Cl[Wl]:rs;Ml(ep,zo[Wl],np)}return ep}function uw(zo){return f1(zo)?zo:[]}function dw(zo){return typeof zo=="function"?zo:t2}function Mv(zo,Cl){return xm(zo)?zo:bw(zo,Cl)?[zo]:lE(Fm(zo))}var K5=Em;function Dv(zo,Cl,Ml){var Wl=zo.length;return Ml=Ml===rs?Wl:Ml,!Cl&&Ml>=Wl?zo:E2(zo,Cl,Ml)}var j3=j_||function(zo){return Rm.clearTimeout(zo)};function O3(zo,Cl){if(Cl)return zo.slice();var Ml=zo.length,Wl=r3?r3(Ml):new zo.constructor(Ml);return zo.copy(Wl),Wl}function fw(zo){var Cl=new zo.constructor(zo.byteLength);return new nx(Cl).set(new nx(zo)),Cl}function q5(zo,Cl){var Ml=Cl?fw(zo.buffer):zo.buffer;return new zo.constructor(Ml,zo.byteOffset,zo.byteLength)}function Z5(zo){var Cl=new zo.constructor(zo.source,Jp.exec(zo));return Cl.lastIndex=zo.lastIndex,Cl}function Y5(zo){return My?Km(My.call(zo)):{}}function M3(zo,Cl){var Ml=Cl?fw(zo.buffer):zo.buffer;return new zo.constructor(Ml,zo.byteOffset,zo.length)}function D3(zo,Cl){if(zo!==Cl){var Ml=zo!==rs,Wl=zo===null,Ql=zo===zo,bu=c2(zo),ep=Cl!==rs,np=Cl===null,lp=Cl===Cl,$p=c2(Cl);if(!np&&!$p&&!bu&&zo>Cl||bu&&ep&&lp&&!np&&!$p||Wl&&ep&&lp||!Ml&&lp||!Ql)return 1;if(!Wl&&!bu&&!$p&&zo<Cl||$p&&Ml&&Ql&&!Wl&&!bu||np&&Ml&&Ql||!ep&&Ql||!lp)return-1}return 0}function Q5(zo,Cl,Ml){for(var Wl=-1,Ql=zo.criteria,bu=Cl.criteria,ep=Ql.length,np=Ml.length;++Wl<ep;){var lp=D3(Ql[Wl],bu[Wl]);if(lp){if(Wl>=np)return lp;var $p=Ml[Wl];return lp*($p=="desc"?-1:1)}}return zo.index-Cl.index}function L3(zo,Cl,Ml,Wl){for(var Ql=-1,bu=zo.length,ep=Ml.length,np=-1,lp=Cl.length,$p=A1(bu-ep,0),Tp=bp(lp+$p),Fp=!Wl;++np<lp;)Tp[np]=Cl[np];for(;++Ql<ep;)(Fp||Ql<bu)&&(Tp[Ml[Ql]]=zo[Ql]);for(;$p--;)Tp[np++]=zo[Ql++];return Tp}function F3(zo,Cl,Ml,Wl){for(var Ql=-1,bu=zo.length,ep=-1,np=Ml.length,lp=-1,$p=Cl.length,Tp=A1(bu-np,0),Fp=bp(Tp+$p),em=!Wl;++Ql<Tp;)Fp[Ql]=zo[Ql];for(var um=Ql;++lp<$p;)Fp[um+lp]=Cl[lp];for(;++ep<np;)(em||Ql<bu)&&(Fp[um+Ml[ep]]=zo[Ql++]);return Fp}function X1(zo,Cl){var Ml=-1,Wl=zo.length;for(Cl||(Cl=bp(Wl));++Ml<Wl;)Cl[Ml]=zo[Ml];return Cl}function U2(zo,Cl,Ml,Wl){var Ql=!Ml;Ml||(Ml={});for(var bu=-1,ep=Cl.length;++bu<ep;){var np=Cl[bu],lp=Wl?Wl(Ml[np],zo[np],np,Ml,zo):rs;lp===rs&&(lp=zo[np]),Ql?q2(Ml,np,lp):Dy(Ml,np,lp)}return Ml}function J5(zo,Cl){return U2(zo,xw(zo),Cl)}function X5(zo,Cl){return U2(zo,J3(zo),Cl)}function yx(zo,Cl){return function(Ml,Wl){var Ql=xm(Ml)?i_:w5,bu=Cl?Cl():{};return Ql(Ml,zo,dm(Wl,2),bu)}}function gy(zo){return Em(function(Cl,Ml){var Wl=-1,Ql=Ml.length,bu=Ql>1?Ml[Ql-1]:rs,ep=Ql>2?Ml[2]:rs;for(bu=zo.length>3&&typeof bu=="function"?(Ql--,bu):rs,ep&&W1(Ml[0],Ml[1],ep)&&(bu=Ql<3?rs:bu,Ql=1),Cl=Km(Cl);++Wl<Ql;){var np=Ml[Wl];np&&zo(Cl,np,Wl,bu)}return Cl})}function B3(zo,Cl){return function(Ml,Wl){if(Ml==null)return Ml;if(!_g(Ml))return zo(Ml,Wl);for(var Ql=Ml.length,bu=Cl?Ql:-1,ep=Km(Ml);(Cl?bu--:++bu<Ql)&&Wl(ep[bu],bu,ep)!==!1;);return Ml}}function U3(zo){return function(Cl,Ml,Wl){for(var Ql=-1,bu=Km(Cl),ep=Wl(Cl),np=ep.length;np--;){var lp=ep[zo?np:++Ql];if(Ml(bu[lp],lp,bu)===!1)break}return Cl}}function eC(zo,Cl,Ml){var Wl=Cl&Go,Ql=Wy(zo);function bu(){var ep=this&&this!==Rm&&this instanceof bu?Ql:zo;return ep.apply(Wl?Ml:this,arguments)}return bu}function W3(zo){return function(Cl){Cl=Fm(Cl);var Ml=cy(Cl)?R2(Cl):rs,Wl=Ml?Ml[0]:Cl.charAt(0),Ql=Ml?Dv(Ml,1).join(""):Cl.slice(1);return Wl[zo]()+Ql}}function vy(zo){return function(Cl){return Lx(BE(FE(Cl).replace(Kp,"")),zo,"")}}function Wy(zo){return function(){var Cl=arguments;switch(Cl.length){case 0:return new zo;case 1:return new zo(Cl[0]);case 2:return new zo(Cl[0],Cl[1]);case 3:return new zo(Cl[0],Cl[1],Cl[2]);case 4:return new zo(Cl[0],Cl[1],Cl[2],Cl[3]);case 5:return new zo(Cl[0],Cl[1],Cl[2],Cl[3],Cl[4]);case 6:return new zo(Cl[0],Cl[1],Cl[2],Cl[3],Cl[4],Cl[5]);case 7:return new zo(Cl[0],Cl[1],Cl[2],Cl[3],Cl[4],Cl[5],Cl[6])}var Ml=my(zo.prototype),Wl=zo.apply(Ml,Cl);return s1(Wl)?Wl:Ml}}function tC(zo,Cl,Ml){var Wl=Wy(zo);function Ql(){for(var bu=arguments.length,ep=bp(bu),np=bu,lp=yy(Ql);np--;)ep[np]=arguments[np];var $p=bu<3&&ep[0]!==lp&&ep[bu-1]!==lp?[]:Nv(ep,lp);if(bu-=$p.length,bu<Ml)return K3(zo,Cl,xx,Ql.placeholder,rs,ep,$p,rs,rs,Ml-bu);var Tp=this&&this!==Rm&&this instanceof Ql?Wl:zo;return I1(Tp,this,ep)}return Ql}function V3(zo){return function(Cl,Ml,Wl){var Ql=Km(Cl);if(!_g(Cl)){var bu=dm(Ml,3);Cl=N1(Cl),Ml=function(np){return bu(Ql[np],np,Ql)}}var ep=zo(Cl,Ml,Wl);return ep>-1?Ql[bu?Cl[ep]:ep]:rs}}function z3(zo){return Y2(function(Cl){var Ml=Cl.length,Wl=Ml,Ql=b2.prototype.thru;for(zo&&Cl.reverse();Wl--;){var bu=Cl[Wl];if(typeof bu!="function")throw new x2(us);if(Ql&&!ep&&_x(bu)=="wrapper")var ep=new b2([],!0)}for(Wl=ep?Wl:Ml;++Wl<Ml;){bu=Cl[Wl];var np=_x(bu),lp=np=="wrapper"?vw(bu):rs;lp&&ww(lp[0])&&lp[1]==(Sl|Jo|_l|$l)&&!lp[4].length&&lp[9]==1?ep=ep[_x(lp[0])].apply(ep,lp[3]):ep=bu.length==1&&ww(bu)?ep[np]():ep.thru(bu)}return function(){var $p=arguments,Tp=$p[0];if(ep&&$p.length==1&&xm(Tp))return ep.plant(Tp).value();for(var Fp=0,em=Ml?Cl[Fp].apply(this,$p):Tp;++Fp<Ml;)em=Cl[Fp].call(this,em);return em}})}function xx(zo,Cl,Ml,Wl,Ql,bu,ep,np,lp,$p){var Tp=Cl&Sl,Fp=Cl&Go,em=Cl&Yo,um=Cl&(Jo|xl),fm=Cl&Pl,wm=em?rs:Wy(zo);function hm(){for(var Sm=arguments.length,Im=bp(Sm),u2=Sm;u2--;)Im[u2]=arguments[u2];if(um)var z1=yy(hm),d2=h_(Im,z1);if(Wl&&(Im=L3(Im,Wl,Ql,um)),bu&&(Im=F3(Im,bu,ep,um)),Sm-=d2,um&&Sm<$p){var p1=Nv(Im,z1);return K3(zo,Cl,xx,hm.placeholder,Ml,Im,p1,np,lp,$p-Sm)}var P2=Fp?Ml:this,yv=em?P2[zo]:zo;return Sm=Im.length,np?Im=wC(Im,np):fm&&Sm>1&&Im.reverse(),Tp&&lp<Sm&&(Im.length=lp),this&&this!==Rm&&this instanceof hm&&(yv=wm||Wy(yv)),yv.apply(P2,Im)}return hm}function H3(zo,Cl){return function(Ml,Wl){return R5(Ml,zo,Cl(Wl),{})}}function bx(zo,Cl){return function(Ml,Wl){var Ql;if(Ml===rs&&Wl===rs)return Cl;if(Ml!==rs&&(Ql=Ml),Wl!==rs){if(Ql===rs)return Wl;typeof Ml=="string"||typeof Wl=="string"?(Ml=l2(Ml),Wl=l2(Wl)):(Ml=I3(Ml),Wl=I3(Wl)),Ql=zo(Ml,Wl)}return Ql}}function hw(zo){return Y2(function(Cl){return Cl=i1(Cl,a2(dm())),Em(function(Ml){var Wl=this;return zo(Cl,function(Ql){return I1(Ql,Wl,Ml)})})})}function wx(zo,Cl){Cl=Cl===rs?" ":l2(Cl);var Ml=Cl.length;if(Ml<2)return Ml?ow(Cl,zo):Cl;var Wl=ow(Cl,ax(zo/uy(Cl)));return cy(Cl)?Dv(R2(Wl),0,zo).join(""):Wl.slice(0,zo)}function rC(zo,Cl,Ml,Wl){var Ql=Cl&Go,bu=Wy(zo);function ep(){for(var np=-1,lp=arguments.length,$p=-1,Tp=Wl.length,Fp=bp(Tp+lp),em=this&&this!==Rm&&this instanceof ep?bu:zo;++$p<Tp;)Fp[$p]=Wl[$p];for(;lp--;)Fp[$p++]=arguments[++np];return I1(em,Ql?Ml:this,Fp)}return ep}function G3(zo){return function(Cl,Ml,Wl){return Wl&&typeof Wl!="number"&&W1(Cl,Ml,Wl)&&(Ml=Wl=rs),Cl=X2(Cl),Ml===rs?(Ml=Cl,Cl=0):Ml=X2(Ml),Wl=Wl===rs?Cl<Ml?1:-1:X2(Wl),U5(Cl,Ml,Wl,zo)}}function Ex(zo){return function(Cl,Ml){return typeof Cl=="string"&&typeof Ml=="string"||(Cl=C2(Cl),Ml=C2(Ml)),zo(Cl,Ml)}}function K3(zo,Cl,Ml,Wl,Ql,bu,ep,np,lp,$p){var Tp=Cl&Jo,Fp=Tp?ep:rs,em=Tp?rs:ep,um=Tp?bu:rs,fm=Tp?rs:bu;Cl|=Tp?_l:Tl,Cl&=~(Tp?Tl:_l),Cl&Wo||(Cl&=~(Go|Yo));var wm=[zo,Cl,Ql,um,Fp,fm,em,np,lp,$p],hm=Ml.apply(rs,wm);return ww(zo)&&sE(hm,wm),hm.placeholder=Wl,oE(hm,zo,Cl)}function pw(zo){var Cl=C1[zo];return function(Ml,Wl){if(Ml=C2(Ml),Wl=Wl==null?0:O1(bm(Wl),292),Wl&&o3(Ml)){var Ql=(Fm(Ml)+"e").split("e"),bu=Cl(Ql[0]+"e"+(+Ql[1]+Wl));return Ql=(Fm(bu)+"e").split("e"),+(Ql[0]+"e"+(+Ql[1]-Wl))}return Cl(Ml)}}var nC=hy&&1/Qy(new hy([,-0]))[1]==El?function(zo){return new hy(zo)}:Mw;function q3(zo){return function(Cl){var Ml=M1(Cl);return Ml==yu?Hx(Cl):Ml==cp?b_(Cl):f_(Cl,zo(Cl))}}function Z2(zo,Cl,Ml,Wl,Ql,bu,ep,np){var lp=Cl&Yo;if(!lp&&typeof zo!="function")throw new x2(us);var $p=Wl?Wl.length:0;if($p||(Cl&=~(_l|Tl),Wl=Ql=rs),ep=ep===rs?ep:A1(bm(ep),0),np=np===rs?np:bm(np),$p-=Ql?Ql.length:0,Cl&Tl){var Tp=Wl,Fp=Ql;Wl=Ql=rs}var em=lp?rs:vw(zo),um=[zo,Cl,Ml,Wl,Ql,Tp,Fp,bu,ep,np];if(em&&yC(um,em),zo=um[0],Cl=um[1],Ml=um[2],Wl=um[3],Ql=um[4],np=um[9]=um[9]===rs?lp?0:zo.length:A1(um[9]-$p,0),!np&&Cl&(Jo|xl)&&(Cl&=~(Jo|xl)),!Cl||Cl==Go)var fm=eC(zo,Cl,Ml);else Cl==Jo||Cl==xl?fm=tC(zo,Cl,np):(Cl==_l||Cl==(Go|_l))&&!Ql.length?fm=rC(zo,Cl,Ml,Wl):fm=xx.apply(rs,um);var wm=em?T3:sE;return oE(wm(fm,um),zo,Cl)}function Z3(zo,Cl,Ml,Wl){return zo===rs||N2(zo,fy[Ml])&&!Um.call(Wl,Ml)?Cl:zo}function Y3(zo,Cl,Ml,Wl,Ql,bu){return s1(zo)&&s1(Cl)&&(bu.set(Cl,zo),mx(zo,Cl,rs,Y3,bu),bu.delete(Cl)),zo}function iC(zo){return Hy(zo)?rs:zo}function Q3(zo,Cl,Ml,Wl,Ql,bu){var ep=Ml&$o,np=zo.length,lp=Cl.length;if(np!=lp&&!(ep&&lp>np))return!1;var $p=bu.get(zo),Tp=bu.get(Cl);if($p&&Tp)return $p==Cl&&Tp==zo;var Fp=-1,em=!0,um=Ml&Lo?new Qv:rs;for(bu.set(zo,Cl),bu.set(Cl,zo);++Fp<np;){var fm=zo[Fp],wm=Cl[Fp];if(Wl)var hm=ep?Wl(wm,fm,Fp,Cl,zo,bu):Wl(fm,wm,Fp,zo,Cl,bu);if(hm!==rs){if(hm)continue;em=!1;break}if(um){if(!Fx(Cl,function(Sm,Im){if(!Ny(um,Im)&&(fm===Sm||Ql(fm,Sm,Ml,Wl,bu)))return um.push(Im)})){em=!1;break}}else if(!(fm===wm||Ql(fm,wm,Ml,Wl,bu))){em=!1;break}}return bu.delete(zo),bu.delete(Cl),em}function sC(zo,Cl,Ml,Wl,Ql,bu,ep){switch(Ml){case Fl:if(zo.byteLength!=Cl.byteLength||zo.byteOffset!=Cl.byteOffset)return!1;zo=zo.buffer,Cl=Cl.buffer;case Kl:return!(zo.byteLength!=Cl.byteLength||!bu(new nx(zo),new nx(Cl)));case Hl:case Yl:case rp:return N2(+zo,+Cl);case Zl:return zo.name==Cl.name&&zo.message==Cl.message;case pp:case gp:return zo==Cl+"";case yu:var np=Hx;case cp:var lp=Wl&$o;if(np||(np=Qy),zo.size!=Cl.size&&!lp)return!1;var $p=ep.get(zo);if($p)return $p==Cl;Wl|=Lo,ep.set(zo,Cl);var Tp=Q3(np(zo),np(Cl),Wl,Ql,bu,ep);return ep.delete(zo),Tp;case mp:if(My)return My.call(zo)==My.call(Cl)}return!1}function oC(zo,Cl,Ml,Wl,Ql,bu){var ep=Ml&$o,np=mw(zo),lp=np.length,$p=mw(Cl),Tp=$p.length;if(lp!=Tp&&!ep)return!1;for(var Fp=lp;Fp--;){var em=np[Fp];if(!(ep?em in Cl:Um.call(Cl,em)))return!1}var um=bu.get(zo),fm=bu.get(Cl);if(um&&fm)return um==Cl&&fm==zo;var wm=!0;bu.set(zo,Cl),bu.set(Cl,zo);for(var hm=ep;++Fp<lp;){em=np[Fp];var Sm=zo[em],Im=Cl[em];if(Wl)var u2=ep?Wl(Im,Sm,em,Cl,zo,bu):Wl(Sm,Im,em,zo,Cl,bu);if(!(u2===rs?Sm===Im||Ql(Sm,Im,Ml,Wl,bu):u2)){wm=!1;break}hm||(hm=em=="constructor")}if(wm&&!hm){var z1=zo.constructor,d2=Cl.constructor;z1!=d2&&"constructor"in zo&&"constructor"in Cl&&!(typeof z1=="function"&&z1 instanceof z1&&typeof d2=="function"&&d2 instanceof d2)&&(wm=!1)}return bu.delete(zo),bu.delete(Cl),wm}function Y2(zo){return _w(nE(zo,rs,fE),zo+"")}function mw(zo){return v3(zo,N1,xw)}function gw(zo){return v3(zo,e2,J3)}var vw=cx?function(zo){return cx.get(zo)}:Mw;function _x(zo){for(var Cl=zo.name+"",Ml=py[Cl],Wl=Um.call(py,Cl)?Ml.length:0;Wl--;){var Ql=Ml[Wl],bu=Ql.func;if(bu==null||bu==zo)return Ql.name}return Cl}function yy(zo){var Cl=Um.call(_c,"placeholder")?_c:zo;return Cl.placeholder}function dm(){var zo=_c.iteratee||jw;return zo=zo===jw?b3:zo,arguments.length?zo(arguments[0],arguments[1]):zo}function Cx(zo,Cl){var Ml=zo.__data__;return pC(Cl)?Ml[typeof Cl=="string"?"string":"hash"]:Ml.map}function yw(zo){for(var Cl=N1(zo),Ml=Cl.length;Ml--;){var Wl=Cl[Ml],Ql=zo[Wl];Cl[Ml]=[Wl,Ql,tE(Ql)]}return Cl}function ey(zo,Cl){var Ml=v_(zo,Cl);return x3(Ml)?Ml:rs}function aC(zo){var Cl=Um.call(zo,Zv),Ml=zo[Zv];try{zo[Zv]=rs;var Wl=!0}catch{}var Ql=tx.call(zo);return Wl&&(Cl?zo[Zv]=Ml:delete zo[Zv]),Ql}var xw=Kx?function(zo){return zo==null?[]:(zo=Km(zo),Tv(Kx(zo),function(Cl){return i3.call(zo,Cl)}))}:Dw,J3=Kx?function(zo){for(var Cl=[];zo;)Rv(Cl,xw(zo)),zo=ix(zo);return Cl}:Dw,M1=U1;(qx&&M1(new qx(new ArrayBuffer(1)))!=Fl||ky&&M1(new ky)!=yu||Zx&&M1(Zx.resolve())!=wp||hy&&M1(new hy)!=cp||jy&&M1(new jy)!=hp)&&(M1=function(zo){var Cl=U1(zo),Ml=Cl==up?zo.constructor:rs,Wl=Ml?ty(Ml):"";if(Wl)switch(Wl){case V_:return Fl;case z_:return yu;case H_:return wp;case G_:return cp;case K_:return hp}return Cl});function lC(zo,Cl,Ml){for(var Wl=-1,Ql=Ml.length;++Wl<Ql;){var bu=Ml[Wl],ep=bu.size;switch(bu.type){case"drop":zo+=ep;break;case"dropRight":Cl-=ep;break;case"take":Cl=O1(Cl,zo+ep);break;case"takeRight":zo=A1(zo,Cl-ep);break}}return{start:zo,end:Cl}}function cC(zo){var Cl=zo.match(Bp);return Cl?Cl[1].split(qp):[]}function X3(zo,Cl,Ml){Cl=Mv(Cl,zo);for(var Wl=-1,Ql=Cl.length,bu=!1;++Wl<Ql;){var ep=W2(Cl[Wl]);if(!(bu=zo!=null&&Ml(zo,ep)))break;zo=zo[ep]}return bu||++Wl!=Ql?bu:(Ql=zo==null?0:zo.length,!!Ql&&Nx(Ql)&&Q2(ep,Ql)&&(xm(zo)||ry(zo)))}function uC(zo){var Cl=zo.length,Ml=new zo.constructor(Cl);return Cl&&typeof zo[0]=="string"&&Um.call(zo,"index")&&(Ml.index=zo.index,Ml.input=zo.input),Ml}function eE(zo){return typeof zo.constructor=="function"&&!Vy(zo)?my(ix(zo)):{}}function dC(zo,Cl,Ml){var Wl=zo.constructor;switch(Cl){case Kl:return fw(zo);case Hl:case Yl:return new Wl(+zo);case Fl:return q5(zo,Ml);case Ul:case Jl:case fu:case _d:case tp:case yp:case _p:case Sp:case Ap:return M3(zo,Ml);case yu:return new Wl;case rp:case gp:return new Wl(zo);case pp:return Z5(zo);case cp:return new Wl;case mp:return Y5(zo)}}function fC(zo,Cl){var Ml=Cl.length;if(!Ml)return zo;var Wl=Ml-1;return Cl[Wl]=(Ml>1?"& ":"")+Cl[Wl],Cl=Cl.join(Ml>2?", ":" "),zo.replace(zp,`{
/* [wrapped with `+Cl+`] */
`)}function hC(zo){return xm(zo)||ry(zo)||!!(s3&&zo&&zo[s3])}function Q2(zo,Cl){var Ml=typeof zo;return Cl=Cl??Xo,!!Cl&&(Ml=="number"||Ml!="symbol"&&Am.test(zo))&&zo>-1&&zo%1==0&&zo<Cl}function W1(zo,Cl,Ml){if(!s1(Ml))return!1;var Wl=typeof Cl;return(Wl=="number"?_g(Ml)&&Q2(Cl,Ml.length):Wl=="string"&&Cl in Ml)?N2(Ml[Cl],zo):!1}function bw(zo,Cl){if(xm(zo))return!1;var Ml=typeof zo;return Ml=="number"||Ml=="symbol"||Ml=="boolean"||zo==null||c2(zo)?!0:Gp.test(zo)||!kp.test(zo)||Cl!=null&&zo in Km(Cl)}function pC(zo){var Cl=typeof zo;return Cl=="string"||Cl=="number"||Cl=="symbol"||Cl=="boolean"?zo!=="__proto__":zo===null}function ww(zo){var Cl=_x(zo),Ml=_c[Cl];if(typeof Ml!="function"||!(Cl in Tm.prototype))return!1;if(zo===Ml)return!0;var Wl=vw(Ml);return!!Wl&&zo===Wl[0]}function mC(zo){return!!t3&&t3 in zo}var gC=Xy?J2:Lw;function Vy(zo){var Cl=zo&&zo.constructor,Ml=typeof Cl=="function"&&Cl.prototype||fy;return zo===Ml}function tE(zo){return zo===zo&&!s1(zo)}function rE(zo,Cl){return function(Ml){return Ml==null?!1:Ml[zo]===Cl&&(Cl!==rs||zo in Km(Ml))}}function vC(zo){var Cl=Rx(zo,function(Wl){return Ml.size===ps&&Ml.clear(),Wl}),Ml=Cl.cache;return Cl}function yC(zo,Cl){var Ml=zo[1],Wl=Cl[1],Ql=Ml|Wl,bu=Ql<(Go|Yo|Sl),ep=Wl==Sl&&Ml==Jo||Wl==Sl&&Ml==$l&&zo[7].length<=Cl[8]||Wl==(Sl|$l)&&Cl[7].length<=Cl[8]&&Ml==Jo;if(!(bu||ep))return zo;Wl&Go&&(zo[2]=Cl[2],Ql|=Ml&Go?0:Wo);var np=Cl[3];if(np){var lp=zo[3];zo[3]=lp?L3(lp,np,Cl[4]):np,zo[4]=lp?Nv(zo[3],io):Cl[4]}return np=Cl[5],np&&(lp=zo[5],zo[5]=lp?F3(lp,np,Cl[6]):np,zo[6]=lp?Nv(zo[5],io):Cl[6]),np=Cl[7],np&&(zo[7]=np),Wl&Sl&&(zo[8]=zo[8]==null?Cl[8]:O1(zo[8],Cl[8])),zo[9]==null&&(zo[9]=Cl[9]),zo[0]=Cl[0],zo[1]=Ql,zo}function xC(zo){var Cl=[];if(zo!=null)for(var Ml in Km(zo))Cl.push(Ml);return Cl}function bC(zo){return tx.call(zo)}function nE(zo,Cl,Ml){return Cl=A1(Cl===rs?zo.length-1:Cl,0),function(){for(var Wl=arguments,Ql=-1,bu=A1(Wl.length-Cl,0),ep=bp(bu);++Ql<bu;)ep[Ql]=Wl[Cl+Ql];Ql=-1;for(var np=bp(Cl+1);++Ql<Cl;)np[Ql]=Wl[Ql];return np[Cl]=Ml(ep),I1(zo,this,np)}}function iE(zo,Cl){return Cl.length<2?zo:Xv(zo,E2(Cl,0,-1))}function wC(zo,Cl){for(var Ml=zo.length,Wl=O1(Cl.length,Ml),Ql=X1(zo);Wl--;){var bu=Cl[Wl];zo[Wl]=Q2(bu,Ml)?Ql[bu]:rs}return zo}function Ew(zo,Cl){if(!(Cl==="constructor"&&typeof zo[Cl]=="function")&&Cl!="__proto__")return zo[Cl]}var sE=aE(T3),zy=M_||function(zo,Cl){return Rm.setTimeout(zo,Cl)},_w=aE(z5);function oE(zo,Cl,Ml){var Wl=Cl+"";return _w(zo,fC(Wl,_C(cC(Wl),Ml)))}function aE(zo){var Cl=0,Ml=0;return function(){var Wl=B_(),Ql=Vo-(Wl-Ml);if(Ml=Wl,Ql>0){if(++Cl>=Rl)return arguments[0]}else Cl=0;return zo.apply(rs,arguments)}}function Ax(zo,Cl){var Ml=-1,Wl=zo.length,Ql=Wl-1;for(Cl=Cl===rs?Wl:Cl;++Ml<Cl;){var bu=sw(Ml,Ql),ep=zo[bu];zo[bu]=zo[Ml],zo[Ml]=ep}return zo.length=Cl,zo}var lE=vC(function(zo){var Cl=[];return zo.charCodeAt(0)===46&&Cl.push(""),zo.replace(Yp,function(Ml,Wl,Ql,bu){Cl.push(Ql?bu.replace(g0,"$1"):Wl||Ml)}),Cl});function W2(zo){if(typeof zo=="string"||c2(zo))return zo;var Cl=zo+"";return Cl=="0"&&1/zo==-El?"-0":Cl}function ty(zo){if(zo!=null){try{return ex.call(zo)}catch{}try{return zo+""}catch{}}return""}function _C(zo,Cl){return y2(Gl,function(Ml){var Wl="_."+Ml[0];Cl&Ml[1]&&!Zy(zo,Wl)&&zo.push(Wl)}),zo.sort()}function cE(zo){if(zo instanceof Tm)return zo.clone();var Cl=new b2(zo.__wrapped__,zo.__chain__);return Cl.__actions__=X1(zo.__actions__),Cl.__index__=zo.__index__,Cl.__values__=zo.__values__,Cl}function CC(zo,Cl,Ml){(Ml?W1(zo,Cl,Ml):Cl===rs)?Cl=1:Cl=A1(bm(Cl),0);var Wl=zo==null?0:zo.length;if(!Wl||Cl<1)return[];for(var Ql=0,bu=0,ep=bp(ax(Wl/Cl));Ql<Wl;)ep[bu++]=E2(zo,Ql,Ql+=Cl);return ep}function AC(zo){for(var Cl=-1,Ml=zo==null?0:zo.length,Wl=0,Ql=[];++Cl<Ml;){var bu=zo[Cl];bu&&(Ql[Wl++]=bu)}return Ql}function SC(){var zo=arguments.length;if(!zo)return[];for(var Cl=bp(zo-1),Ml=arguments[0],Wl=zo;Wl--;)Cl[Wl-1]=arguments[Wl];return Rv(xm(Ml)?X1(Ml):[Ml],j1(Cl,1))}var $C=Em(function(zo,Cl){return f1(zo)?Ly(zo,j1(Cl,1,f1,!0)):[]}),TC=Em(function(zo,Cl){var Ml=_2(Cl);return f1(Ml)&&(Ml=rs),f1(zo)?Ly(zo,j1(Cl,1,f1,!0),dm(Ml,2)):[]}),RC=Em(function(zo,Cl){var Ml=_2(Cl);return f1(Ml)&&(Ml=rs),f1(zo)?Ly(zo,j1(Cl,1,f1,!0),rs,Ml):[]});function IC(zo,Cl,Ml){var Wl=zo==null?0:zo.length;return Wl?(Cl=Ml||Cl===rs?1:bm(Cl),E2(zo,Cl<0?0:Cl,Wl)):[]}function NC(zo,Cl,Ml){var Wl=zo==null?0:zo.length;return Wl?(Cl=Ml||Cl===rs?1:bm(Cl),Cl=Wl-Cl,E2(zo,0,Cl<0?0:Cl)):[]}function PC(zo,Cl){return zo&&zo.length?vx(zo,dm(Cl,3),!0,!0):[]}function kC(zo,Cl){return zo&&zo.length?vx(zo,dm(Cl,3),!0):[]}function jC(zo,Cl,Ml,Wl){var Ql=zo==null?0:zo.length;return Ql?(Ml&&typeof Ml!="number"&&W1(zo,Cl,Ml)&&(Ml=0,Wl=Ql),A5(zo,Cl,Ml,Wl)):[]}function uE(zo,Cl,Ml){var Wl=zo==null?0:zo.length;if(!Wl)return-1;var Ql=Ml==null?0:bm(Ml);return Ql<0&&(Ql=A1(Wl+Ql,0)),Yy(zo,dm(Cl,3),Ql)}function dE(zo,Cl,Ml){var Wl=zo==null?0:zo.length;if(!Wl)return-1;var Ql=Wl-1;return Ml!==rs&&(Ql=bm(Ml),Ql=Ml<0?A1(Wl+Ql,0):O1(Ql,Wl-1)),Yy(zo,dm(Cl,3),Ql,!0)}function fE(zo){var Cl=zo==null?0:zo.length;return Cl?j1(zo,1):[]}function OC(zo){var Cl=zo==null?0:zo.length;return Cl?j1(zo,El):[]}function MC(zo,Cl){var Ml=zo==null?0:zo.length;return Ml?(Cl=Cl===rs?1:bm(Cl),j1(zo,Cl)):[]}function DC(zo){for(var Cl=-1,Ml=zo==null?0:zo.length,Wl={};++Cl<Ml;){var Ql=zo[Cl];Wl[Ql[0]]=Ql[1]}return Wl}function hE(zo){return zo&&zo.length?zo[0]:rs}function LC(zo,Cl,Ml){var Wl=zo==null?0:zo.length;if(!Wl)return-1;var Ql=Ml==null?0:bm(Ml);return Ql<0&&(Ql=A1(Wl+Ql,0)),ly(zo,Cl,Ql)}function FC(zo){var Cl=zo==null?0:zo.length;return Cl?E2(zo,0,-1):[]}var BC=Em(function(zo){var Cl=i1(zo,uw);return Cl.length&&Cl[0]===zo[0]?ew(Cl):[]}),UC=Em(function(zo){var Cl=_2(zo),Ml=i1(zo,uw);return Cl===_2(Ml)?Cl=rs:Ml.pop(),Ml.length&&Ml[0]===zo[0]?ew(Ml,dm(Cl,2)):[]}),WC=Em(function(zo){var Cl=_2(zo),Ml=i1(zo,uw);return Cl=typeof Cl=="function"?Cl:rs,Cl&&Ml.pop(),Ml.length&&Ml[0]===zo[0]?ew(Ml,rs,Cl):[]});function VC(zo,Cl){return zo==null?"":L_.call(zo,Cl)}function _2(zo){var Cl=zo==null?0:zo.length;return Cl?zo[Cl-1]:rs}function zC(zo,Cl,Ml){var Wl=zo==null?0:zo.length;if(!Wl)return-1;var Ql=Wl;return Ml!==rs&&(Ql=bm(Ml),Ql=Ql<0?A1(Wl+Ql,0):O1(Ql,Wl-1)),Cl===Cl?E_(zo,Cl,Ql):Yy(zo,Kw,Ql,!0)}function HC(zo,Cl){return zo&&zo.length?C3(zo,bm(Cl)):rs}var GC=Em(pE);function pE(zo,Cl){return zo&&zo.length&&Cl&&Cl.length?iw(zo,Cl):zo}function KC(zo,Cl,Ml){return zo&&zo.length&&Cl&&Cl.length?iw(zo,Cl,dm(Ml,2)):zo}function qC(zo,Cl,Ml){return zo&&zo.length&&Cl&&Cl.length?iw(zo,Cl,rs,Ml):zo}var ZC=Y2(function(zo,Cl){var Ml=zo==null?0:zo.length,Wl=Qx(zo,Cl);return $3(zo,i1(Cl,function(Ql){return Q2(Ql,Ml)?+Ql:Ql}).sort(D3)),Wl});function YC(zo,Cl){var Ml=[];if(!(zo&&zo.length))return Ml;var Wl=-1,Ql=[],bu=zo.length;for(Cl=dm(Cl,3);++Wl<bu;){var ep=zo[Wl];Cl(ep,Wl,zo)&&(Ml.push(ep),Ql.push(Wl))}return $3(zo,Ql),Ml}function Cw(zo){return zo==null?zo:W_.call(zo)}function QC(zo,Cl,Ml){var Wl=zo==null?0:zo.length;return Wl?(Ml&&typeof Ml!="number"&&W1(zo,Cl,Ml)?(Cl=0,Ml=Wl):(Cl=Cl==null?0:bm(Cl),Ml=Ml===rs?Wl:bm(Ml)),E2(zo,Cl,Ml)):[]}function JC(zo,Cl){return gx(zo,Cl)}function XC(zo,Cl,Ml){return aw(zo,Cl,dm(Ml,2))}function e6(zo,Cl){var Ml=zo==null?0:zo.length;if(Ml){var Wl=gx(zo,Cl);if(Wl<Ml&&N2(zo[Wl],Cl))return Wl}return-1}function t6(zo,Cl){return gx(zo,Cl,!0)}function r6(zo,Cl,Ml){return aw(zo,Cl,dm(Ml,2),!0)}function n6(zo,Cl){var Ml=zo==null?0:zo.length;if(Ml){var Wl=gx(zo,Cl,!0)-1;if(N2(zo[Wl],Cl))return Wl}return-1}function i6(zo){return zo&&zo.length?R3(zo):[]}function s6(zo,Cl){return zo&&zo.length?R3(zo,dm(Cl,2)):[]}function o6(zo){var Cl=zo==null?0:zo.length;return Cl?E2(zo,1,Cl):[]}function a6(zo,Cl,Ml){return zo&&zo.length?(Cl=Ml||Cl===rs?1:bm(Cl),E2(zo,0,Cl<0?0:Cl)):[]}function l6(zo,Cl,Ml){var Wl=zo==null?0:zo.length;return Wl?(Cl=Ml||Cl===rs?1:bm(Cl),Cl=Wl-Cl,E2(zo,Cl<0?0:Cl,Wl)):[]}function c6(zo,Cl){return zo&&zo.length?vx(zo,dm(Cl,3),!1,!0):[]}function u6(zo,Cl){return zo&&zo.length?vx(zo,dm(Cl,3)):[]}var d6=Em(function(zo){return Ov(j1(zo,1,f1,!0))}),f6=Em(function(zo){var Cl=_2(zo);return f1(Cl)&&(Cl=rs),Ov(j1(zo,1,f1,!0),dm(Cl,2))}),h6=Em(function(zo){var Cl=_2(zo);return Cl=typeof Cl=="function"?Cl:rs,Ov(j1(zo,1,f1,!0),rs,Cl)});function p6(zo){return zo&&zo.length?Ov(zo):[]}function m6(zo,Cl){return zo&&zo.length?Ov(zo,dm(Cl,2)):[]}function g6(zo,Cl){return Cl=typeof Cl=="function"?Cl:rs,zo&&zo.length?Ov(zo,rs,Cl):[]}function Aw(zo){if(!(zo&&zo.length))return[];var Cl=0;return zo=Tv(zo,function(Ml){if(f1(Ml))return Cl=A1(Ml.length,Cl),!0}),Vx(Cl,function(Ml){return i1(zo,Bx(Ml))})}function mE(zo,Cl){if(!(zo&&zo.length))return[];var Ml=Aw(zo);return Cl==null?Ml:i1(Ml,function(Wl){return I1(Cl,rs,Wl)})}var v6=Em(function(zo,Cl){return f1(zo)?Ly(zo,Cl):[]}),y6=Em(function(zo){return cw(Tv(zo,f1))}),x6=Em(function(zo){var Cl=_2(zo);return f1(Cl)&&(Cl=rs),cw(Tv(zo,f1),dm(Cl,2))}),b6=Em(function(zo){var Cl=_2(zo);return Cl=typeof Cl=="function"?Cl:rs,cw(Tv(zo,f1),rs,Cl)}),w6=Em(Aw);function E6(zo,Cl){return k3(zo||[],Cl||[],Dy)}function _6(zo,Cl){return k3(zo||[],Cl||[],Uy)}var C6=Em(function(zo){var Cl=zo.length,Ml=Cl>1?zo[Cl-1]:rs;return Ml=typeof Ml=="function"?(zo.pop(),Ml):rs,mE(zo,Ml)});function gE(zo){var Cl=_c(zo);return Cl.__chain__=!0,Cl}function A6(zo,Cl){return Cl(zo),zo}function Sx(zo,Cl){return Cl(zo)}var S6=Y2(function(zo){var Cl=zo.length,Ml=Cl?zo[0]:0,Wl=this.__wrapped__,Ql=function(bu){return Qx(bu,zo)};return Cl>1||this.__actions__.length||!(Wl instanceof Tm)||!Q2(Ml)?this.thru(Ql):(Wl=Wl.slice(Ml,+Ml+(Cl?1:0)),Wl.__actions__.push({func:Sx,args:[Ql],thisArg:rs}),new b2(Wl,this.__chain__).thru(function(bu){return Cl&&!bu.length&&bu.push(rs),bu}))});function $6(){return gE(this)}function T6(){return new b2(this.value(),this.__chain__)}function R6(){this.__values__===rs&&(this.__values__=IE(this.value()));var zo=this.__index__>=this.__values__.length,Cl=zo?rs:this.__values__[this.__index__++];return{done:zo,value:Cl}}function I6(){return this}function N6(zo){for(var Cl,Ml=this;Ml instanceof dx;){var Wl=cE(Ml);Wl.__index__=0,Wl.__values__=rs,Cl?Ql.__wrapped__=Wl:Cl=Wl;var Ql=Wl;Ml=Ml.__wrapped__}return Ql.__wrapped__=zo,Cl}function P6(){var zo=this.__wrapped__;if(zo instanceof Tm){var Cl=zo;return this.__actions__.length&&(Cl=new Tm(this)),Cl=Cl.reverse(),Cl.__actions__.push({func:Sx,args:[Cw],thisArg:rs}),new b2(Cl,this.__chain__)}return this.thru(Cw)}function k6(){return P3(this.__wrapped__,this.__actions__)}var j6=yx(function(zo,Cl,Ml){Um.call(zo,Ml)?++zo[Ml]:q2(zo,Ml,1)});function O6(zo,Cl,Ml){var Wl=xm(zo)?Hw:C5;return Ml&&W1(zo,Cl,Ml)&&(Cl=rs),Wl(zo,dm(Cl,3))}function M6(zo,Cl){var Ml=xm(zo)?Tv:m3;return Ml(zo,dm(Cl,3))}var D6=V3(uE),L6=V3(dE);function F6(zo,Cl){return j1($x(zo,Cl),1)}function B6(zo,Cl){return j1($x(zo,Cl),El)}function U6(zo,Cl,Ml){return Ml=Ml===rs?1:bm(Ml),j1($x(zo,Cl),Ml)}function vE(zo,Cl){var Ml=xm(zo)?y2:jv;return Ml(zo,dm(Cl,3))}function yE(zo,Cl){var Ml=xm(zo)?s_:p3;return Ml(zo,dm(Cl,3))}var W6=yx(function(zo,Cl,Ml){Um.call(zo,Ml)?zo[Ml].push(Cl):q2(zo,Ml,[Cl])});function V6(zo,Cl,Ml,Wl){zo=_g(zo)?zo:by(zo),Ml=Ml&&!Wl?bm(Ml):0;var Ql=zo.length;return Ml<0&&(Ml=A1(Ql+Ml,0)),Px(zo)?Ml<=Ql&&zo.indexOf(Cl,Ml)>-1:!!Ql&&ly(zo,Cl,Ml)>-1}var z6=Em(function(zo,Cl,Ml){var Wl=-1,Ql=typeof Cl=="function",bu=_g(zo)?bp(zo.length):[];return jv(zo,function(ep){bu[++Wl]=Ql?I1(Cl,ep,Ml):Fy(ep,Cl,Ml)}),bu}),H6=yx(function(zo,Cl,Ml){q2(zo,Ml,Cl)});function $x(zo,Cl){var Ml=xm(zo)?i1:w3;return Ml(zo,dm(Cl,3))}function G6(zo,Cl,Ml,Wl){return zo==null?[]:(xm(Cl)||(Cl=Cl==null?[]:[Cl]),Ml=Wl?rs:Ml,xm(Ml)||(Ml=Ml==null?[]:[Ml]),A3(zo,Cl,Ml))}var K6=yx(function(zo,Cl,Ml){zo[Ml?0:1].push(Cl)},function(){return[[],[]]});function q6(zo,Cl,Ml){var Wl=xm(zo)?Lx:Zw,Ql=arguments.length<3;return Wl(zo,dm(Cl,4),Ml,Ql,jv)}function Z6(zo,Cl,Ml){var Wl=xm(zo)?o_:Zw,Ql=arguments.length<3;return Wl(zo,dm(Cl,4),Ml,Ql,p3)}function Y6(zo,Cl){var Ml=xm(zo)?Tv:m3;return Ml(zo,Ix(dm(Cl,3)))}function Q6(zo){var Cl=xm(zo)?u3:W5;return Cl(zo)}function J6(zo,Cl,Ml){(Ml?W1(zo,Cl,Ml):Cl===rs)?Cl=1:Cl=bm(Cl);var Wl=xm(zo)?x5:V5;return Wl(zo,Cl)}function X6(zo){var Cl=xm(zo)?b5:H5;return Cl(zo)}function e4(zo){if(zo==null)return 0;if(_g(zo))return Px(zo)?uy(zo):zo.length;var Cl=M1(zo);return Cl==yu||Cl==cp?zo.size:rw(zo).length}function t4(zo,Cl,Ml){var Wl=xm(zo)?Fx:G5;return Ml&&W1(zo,Cl,Ml)&&(Cl=rs),Wl(zo,dm(Cl,3))}var r4=Em(function(zo,Cl){if(zo==null)return[];var Ml=Cl.length;return Ml>1&&W1(zo,Cl[0],Cl[1])?Cl=[]:Ml>2&&W1(Cl[0],Cl[1],Cl[2])&&(Cl=[Cl[0]]),A3(zo,j1(Cl,1),[])}),Tx=O_||function(){return Rm.Date.now()};function n4(zo,Cl){if(typeof Cl!="function")throw new x2(us);return zo=bm(zo),function(){if(--zo<1)return Cl.apply(this,arguments)}}function xE(zo,Cl,Ml){return Cl=Ml?rs:Cl,Cl=zo&&Cl==null?zo.length:Cl,Z2(zo,Sl,rs,rs,rs,rs,Cl)}function bE(zo,Cl){var Ml;if(typeof Cl!="function")throw new x2(us);return zo=bm(zo),function(){return--zo>0&&(Ml=Cl.apply(this,arguments)),zo<=1&&(Cl=rs),Ml}}var Sw=Em(function(zo,Cl,Ml){var Wl=Go;if(Ml.length){var Ql=Nv(Ml,yy(Sw));Wl|=_l}return Z2(zo,Wl,Cl,Ml,Ql)}),wE=Em(function(zo,Cl,Ml){var Wl=Go|Yo;if(Ml.length){var Ql=Nv(Ml,yy(wE));Wl|=_l}return Z2(Cl,Wl,zo,Ml,Ql)});function EE(zo,Cl,Ml){Cl=Ml?rs:Cl;var Wl=Z2(zo,Jo,rs,rs,rs,rs,rs,Cl);return Wl.placeholder=EE.placeholder,Wl}function _E(zo,Cl,Ml){Cl=Ml?rs:Cl;var Wl=Z2(zo,xl,rs,rs,rs,rs,rs,Cl);return Wl.placeholder=_E.placeholder,Wl}function CE(zo,Cl,Ml){var Wl,Ql,bu,ep,np,lp,$p=0,Tp=!1,Fp=!1,em=!0;if(typeof zo!="function")throw new x2(us);Cl=C2(Cl)||0,s1(Ml)&&(Tp=!!Ml.leading,Fp="maxWait"in Ml,bu=Fp?A1(C2(Ml.maxWait)||0,Cl):bu,em="trailing"in Ml?!!Ml.trailing:em);function um(p1){var P2=Wl,yv=Ql;return Wl=Ql=rs,$p=p1,ep=zo.apply(yv,P2),ep}function fm(p1){return $p=p1,np=zy(Sm,Cl),Tp?um(p1):ep}function wm(p1){var P2=p1-lp,yv=p1-$p,VE=Cl-P2;return Fp?O1(VE,bu-yv):VE}function hm(p1){var P2=p1-lp,yv=p1-$p;return lp===rs||P2>=Cl||P2<0||Fp&&yv>=bu}function Sm(){var p1=Tx();if(hm(p1))return Im(p1);np=zy(Sm,wm(p1))}function Im(p1){return np=rs,em&&Wl?um(p1):(Wl=Ql=rs,ep)}function u2(){np!==rs&&j3(np),$p=0,Wl=lp=Ql=np=rs}function z1(){return np===rs?ep:Im(Tx())}function d2(){var p1=Tx(),P2=hm(p1);if(Wl=arguments,Ql=this,lp=p1,P2){if(np===rs)return fm(lp);if(Fp)return j3(np),np=zy(Sm,Cl),um(lp)}return np===rs&&(np=zy(Sm,Cl)),ep}return d2.cancel=u2,d2.flush=z1,d2}var i4=Em(function(zo,Cl){return h3(zo,1,Cl)}),s4=Em(function(zo,Cl,Ml){return h3(zo,C2(Cl)||0,Ml)});function o4(zo){return Z2(zo,Pl)}function Rx(zo,Cl){if(typeof zo!="function"||Cl!=null&&typeof Cl!="function")throw new x2(us);var Ml=function(){var Wl=arguments,Ql=Cl?Cl.apply(this,Wl):Wl[0],bu=Ml.cache;if(bu.has(Ql))return bu.get(Ql);var ep=zo.apply(this,Wl);return Ml.cache=bu.set(Ql,ep)||bu,ep};return Ml.cache=new(Rx.Cache||K2),Ml}Rx.Cache=K2;function Ix(zo){if(typeof zo!="function")throw new x2(us);return function(){var Cl=arguments;switch(Cl.length){case 0:return!zo.call(this);case 1:return!zo.call(this,Cl[0]);case 2:return!zo.call(this,Cl[0],Cl[1]);case 3:return!zo.call(this,Cl[0],Cl[1],Cl[2])}return!zo.apply(this,Cl)}}function a4(zo){return bE(2,zo)}var l4=K5(function(zo,Cl){Cl=Cl.length==1&&xm(Cl[0])?i1(Cl[0],a2(dm())):i1(j1(Cl,1),a2(dm()));var Ml=Cl.length;return Em(function(Wl){for(var Ql=-1,bu=O1(Wl.length,Ml);++Ql<bu;)Wl[Ql]=Cl[Ql].call(this,Wl[Ql]);return I1(zo,this,Wl)})}),$w=Em(function(zo,Cl){var Ml=Nv(Cl,yy($w));return Z2(zo,_l,rs,Cl,Ml)}),AE=Em(function(zo,Cl){var Ml=Nv(Cl,yy(AE));return Z2(zo,Tl,rs,Cl,Ml)}),c4=Y2(function(zo,Cl){return Z2(zo,$l,rs,rs,rs,Cl)});function u4(zo,Cl){if(typeof zo!="function")throw new x2(us);return Cl=Cl===rs?Cl:bm(Cl),Em(zo,Cl)}function d4(zo,Cl){if(typeof zo!="function")throw new x2(us);return Cl=Cl==null?0:A1(bm(Cl),0),Em(function(Ml){var Wl=Ml[Cl],Ql=Dv(Ml,0,Cl);return Wl&&Rv(Ql,Wl),I1(zo,this,Ql)})}function f4(zo,Cl,Ml){var Wl=!0,Ql=!0;if(typeof zo!="function")throw new x2(us);return s1(Ml)&&(Wl="leading"in Ml?!!Ml.leading:Wl,Ql="trailing"in Ml?!!Ml.trailing:Ql),CE(zo,Cl,{leading:Wl,maxWait:Cl,trailing:Ql})}function h4(zo){return xE(zo,1)}function p4(zo,Cl){return $w(dw(Cl),zo)}function m4(){if(!arguments.length)return[];var zo=arguments[0];return xm(zo)?zo:[zo]}function g4(zo){return w2(zo,Ao)}function v4(zo,Cl){return Cl=typeof Cl=="function"?Cl:rs,w2(zo,Ao,Cl)}function y4(zo){return w2(zo,fo|Ao)}function x4(zo,Cl){return Cl=typeof Cl=="function"?Cl:rs,w2(zo,fo|Ao,Cl)}function b4(zo,Cl){return Cl==null||f3(zo,Cl,N1(Cl))}function N2(zo,Cl){return zo===Cl||zo!==zo&&Cl!==Cl}var w4=Ex(_b),E4=Ex(function(zo,Cl){return zo>=Cl}),ry=y3(function(){return arguments}())?y3:function(zo){return l1(zo)&&Um.call(zo,"callee")&&!i3.call(zo,"callee")},xm=bp.isArray,_4=B1?a2(B1):I5;function _g(zo){return zo!=null&&Nx(zo.length)&&!J2(zo)}function f1(zo){return l1(zo)&&_g(zo)}function C4(zo){return zo===!0||zo===!1||l1(zo)&&U1(zo)==Hl}var Lv=D_||Lw,A4=T2?a2(T2):N5;function S4(zo){return l1(zo)&&zo.nodeType===1&&!Hy(zo)}function $4(zo){if(zo==null)return!0;if(_g(zo)&&(xm(zo)||typeof zo=="string"||typeof zo.splice=="function"||Lv(zo)||xy(zo)||ry(zo)))return!zo.length;var Cl=M1(zo);if(Cl==yu||Cl==cp)return!zo.size;if(Vy(zo))return!rw(zo).length;for(var Ml in zo)if(Um.call(zo,Ml))return!1;return!0}function T4(zo,Cl){return By(zo,Cl)}function R4(zo,Cl,Ml){Ml=typeof Ml=="function"?Ml:rs;var Wl=Ml?Ml(zo,Cl):rs;return Wl===rs?By(zo,Cl,rs,Ml):!!Wl}function Tw(zo){if(!l1(zo))return!1;var Cl=U1(zo);return Cl==Zl||Cl==Ll||typeof zo.message=="string"&&typeof zo.name=="string"&&!Hy(zo)}function I4(zo){return typeof zo=="number"&&o3(zo)}function J2(zo){if(!s1(zo))return!1;var Cl=U1(zo);return Cl==Xl||Cl==wu||Cl==Vl||Cl==vp}function SE(zo){return typeof zo=="number"&&zo==bm(zo)}function Nx(zo){return typeof zo=="number"&&zo>-1&&zo%1==0&&zo<=Xo}function s1(zo){var Cl=typeof zo;return zo!=null&&(Cl=="object"||Cl=="function")}function l1(zo){return zo!=null&&typeof zo=="object"}var $E=v2?a2(v2):k5;function N4(zo,Cl){return zo===Cl||tw(zo,Cl,yw(Cl))}function P4(zo,Cl,Ml){return Ml=typeof Ml=="function"?Ml:rs,tw(zo,Cl,yw(Cl),Ml)}function k4(zo){return TE(zo)&&zo!=+zo}function j4(zo){if(gC(zo))throw new vm(as);return x3(zo)}function O4(zo){return zo===null}function M4(zo){return zo==null}function TE(zo){return typeof zo=="number"||l1(zo)&&U1(zo)==rp}function Hy(zo){if(!l1(zo)||U1(zo)!=up)return!1;var Cl=ix(zo);if(Cl===null)return!0;var Ml=Um.call(Cl,"constructor")&&Cl.constructor;return typeof Ml=="function"&&Ml instanceof Ml&&ex.call(Ml)==N_}var Rw=F2?a2(F2):j5;function D4(zo){return SE(zo)&&zo>=-Xo&&zo<=Xo}var RE=Iy?a2(Iy):O5;function Px(zo){return typeof zo=="string"||!xm(zo)&&l1(zo)&&U1(zo)==gp}function c2(zo){return typeof zo=="symbol"||l1(zo)&&U1(zo)==mp}var xy=qv?a2(qv):M5;function L4(zo){return zo===rs}function F4(zo){return l1(zo)&&M1(zo)==hp}function B4(zo){return l1(zo)&&U1(zo)==xp}var U4=Ex(nw),W4=Ex(function(zo,Cl){return zo<=Cl});function IE(zo){if(!zo)return[];if(_g(zo))return Px(zo)?R2(zo):X1(zo);if(Py&&zo[Py])return x_(zo[Py]());var Cl=M1(zo),Ml=Cl==yu?Hx:Cl==cp?Qy:by;return Ml(zo)}function X2(zo){if(!zo)return zo===0?zo:0;if(zo=C2(zo),zo===El||zo===-El){var Cl=zo<0?-1:1;return Cl*Al}return zo===zo?zo:0}function bm(zo){var Cl=X2(zo),Ml=Cl%1;return Cl===Cl?Ml?Cl-Ml:Cl:0}function NE(zo){return zo?Jv(bm(zo),0,yl):0}function C2(zo){if(typeof zo=="number")return zo;if(c2(zo))return wl;if(s1(zo)){var Cl=typeof zo.valueOf=="function"?zo.valueOf():zo;zo=s1(Cl)?Cl+"":Cl}if(typeof zo!="string")return zo===0?zo:+zo;zo=Yw(zo);var Ml=$m.test(zo);return Ml||Cm.test(zo)?ym(zo.slice(2),Ml?2:8):lm.test(zo)?wl:+zo}function PE(zo){return U2(zo,e2(zo))}function V4(zo){return zo?Jv(bm(zo),-Xo,Xo):zo===0?zo:0}function Fm(zo){return zo==null?"":l2(zo)}var z4=gy(function(zo,Cl){if(Vy(Cl)||_g(Cl)){U2(Cl,N1(Cl),zo);return}for(var Ml in Cl)Um.call(Cl,Ml)&&Dy(zo,Ml,Cl[Ml])}),kE=gy(function(zo,Cl){U2(Cl,e2(Cl),zo)}),kx=gy(function(zo,Cl,Ml,Wl){U2(Cl,e2(Cl),zo,Wl)}),H4=gy(function(zo,Cl,Ml,Wl){U2(Cl,N1(Cl),zo,Wl)}),G4=Y2(Qx);function K4(zo,Cl){var Ml=my(zo);return Cl==null?Ml:d3(Ml,Cl)}var q4=Em(function(zo,Cl){zo=Km(zo);var Ml=-1,Wl=Cl.length,Ql=Wl>2?Cl[2]:rs;for(Ql&&W1(Cl[0],Cl[1],Ql)&&(Wl=1);++Ml<Wl;)for(var bu=Cl[Ml],ep=e2(bu),np=-1,lp=ep.length;++np<lp;){var $p=ep[np],Tp=zo[$p];(Tp===rs||N2(Tp,fy[$p])&&!Um.call(zo,$p))&&(zo[$p]=bu[$p])}return zo}),Z4=Em(function(zo){return zo.push(rs,Y3),I1(jE,rs,zo)});function Y4(zo,Cl){return Gw(zo,dm(Cl,3),B2)}function Q4(zo,Cl){return Gw(zo,dm(Cl,3),Xx)}function J4(zo,Cl){return zo==null?zo:Jx(zo,dm(Cl,3),e2)}function X4(zo,Cl){return zo==null?zo:g3(zo,dm(Cl,3),e2)}function eA(zo,Cl){return zo&&B2(zo,dm(Cl,3))}function tA(zo,Cl){return zo&&Xx(zo,dm(Cl,3))}function rA(zo){return zo==null?[]:px(zo,N1(zo))}function nA(zo){return zo==null?[]:px(zo,e2(zo))}function Iw(zo,Cl,Ml){var Wl=zo==null?rs:Xv(zo,Cl);return Wl===rs?Ml:Wl}function iA(zo,Cl){return zo!=null&&X3(zo,Cl,S5)}function Nw(zo,Cl){return zo!=null&&X3(zo,Cl,$5)}var sA=H3(function(zo,Cl,Ml){Cl!=null&&typeof Cl.toString!="function"&&(Cl=tx.call(Cl)),zo[Cl]=Ml},kw(t2)),oA=H3(function(zo,Cl,Ml){Cl!=null&&typeof Cl.toString!="function"&&(Cl=tx.call(Cl)),Um.call(zo,Cl)?zo[Cl].push(Ml):zo[Cl]=[Ml]},dm),aA=Em(Fy);function N1(zo){return _g(zo)?c3(zo):rw(zo)}function e2(zo){return _g(zo)?c3(zo,!0):D5(zo)}function lA(zo,Cl){var Ml={};return Cl=dm(Cl,3),B2(zo,function(Wl,Ql,bu){q2(Ml,Cl(Wl,Ql,bu),Wl)}),Ml}function cA(zo,Cl){var Ml={};return Cl=dm(Cl,3),B2(zo,function(Wl,Ql,bu){q2(Ml,Ql,Cl(Wl,Ql,bu))}),Ml}var uA=gy(function(zo,Cl,Ml){mx(zo,Cl,Ml)}),jE=gy(function(zo,Cl,Ml,Wl){mx(zo,Cl,Ml,Wl)}),dA=Y2(function(zo,Cl){var Ml={};if(zo==null)return Ml;var Wl=!1;Cl=i1(Cl,function(bu){return bu=Mv(bu,zo),Wl||(Wl=bu.length>1),bu}),U2(zo,gw(zo),Ml),Wl&&(Ml=w2(Ml,fo|mo|Ao,iC));for(var Ql=Cl.length;Ql--;)lw(Ml,Cl[Ql]);return Ml});function fA(zo,Cl){return OE(zo,Ix(dm(Cl)))}var hA=Y2(function(zo,Cl){return zo==null?{}:F5(zo,Cl)});function OE(zo,Cl){if(zo==null)return{};var Ml=i1(gw(zo),function(Wl){return[Wl]});return Cl=dm(Cl),S3(zo,Ml,function(Wl,Ql){return Cl(Wl,Ql[0])})}function pA(zo,Cl,Ml){Cl=Mv(Cl,zo);var Wl=-1,Ql=Cl.length;for(Ql||(Ql=1,zo=rs);++Wl<Ql;){var bu=zo==null?rs:zo[W2(Cl[Wl])];bu===rs&&(Wl=Ql,bu=Ml),zo=J2(bu)?bu.call(zo):bu}return zo}function mA(zo,Cl,Ml){return zo==null?zo:Uy(zo,Cl,Ml)}function gA(zo,Cl,Ml,Wl){return Wl=typeof Wl=="function"?Wl:rs,zo==null?zo:Uy(zo,Cl,Ml,Wl)}var ME=q3(N1),DE=q3(e2);function vA(zo,Cl,Ml){var Wl=xm(zo),Ql=Wl||Lv(zo)||xy(zo);if(Cl=dm(Cl,4),Ml==null){var bu=zo&&zo.constructor;Ql?Ml=Wl?new bu:[]:s1(zo)?Ml=J2(bu)?my(ix(zo)):{}:Ml={}}return(Ql?y2:B2)(zo,function(ep,np,lp){return Cl(Ml,ep,np,lp)}),Ml}function yA(zo,Cl){return zo==null?!0:lw(zo,Cl)}function xA(zo,Cl,Ml){return zo==null?zo:N3(zo,Cl,dw(Ml))}function bA(zo,Cl,Ml,Wl){return Wl=typeof Wl=="function"?Wl:rs,zo==null?zo:N3(zo,Cl,dw(Ml),Wl)}function by(zo){return zo==null?[]:zx(zo,N1(zo))}function wA(zo){return zo==null?[]:zx(zo,e2(zo))}function EA(zo,Cl,Ml){return Ml===rs&&(Ml=Cl,Cl=rs),Ml!==rs&&(Ml=C2(Ml),Ml=Ml===Ml?Ml:0),Cl!==rs&&(Cl=C2(Cl),Cl=Cl===Cl?Cl:0),Jv(C2(zo),Cl,Ml)}function _A(zo,Cl,Ml){return Cl=X2(Cl),Ml===rs?(Ml=Cl,Cl=0):Ml=X2(Ml),zo=C2(zo),T5(zo,Cl,Ml)}function CA(zo,Cl,Ml){if(Ml&&typeof Ml!="boolean"&&W1(zo,Cl,Ml)&&(Cl=Ml=rs),Ml===rs&&(typeof Cl=="boolean"?(Ml=Cl,Cl=rs):typeof zo=="boolean"&&(Ml=zo,zo=rs)),zo===rs&&Cl===rs?(zo=0,Cl=1):(zo=X2(zo),Cl===rs?(Cl=zo,zo=0):Cl=X2(Cl)),zo>Cl){var Wl=zo;zo=Cl,Cl=Wl}if(Ml||zo%1||Cl%1){var Ql=a3();return O1(zo+Ql*(Cl-zo+Hm("1e-"+((Ql+"").length-1))),Cl)}return sw(zo,Cl)}var AA=vy(function(zo,Cl,Ml){return Cl=Cl.toLowerCase(),zo+(Ml?LE(Cl):Cl)});function LE(zo){return Pw(Fm(zo).toLowerCase())}function FE(zo){return zo=Fm(zo),zo&&zo.replace(pm,p_).replace(cm,"")}function SA(zo,Cl,Ml){zo=Fm(zo),Cl=l2(Cl);var Wl=zo.length;Ml=Ml===rs?Wl:Jv(bm(Ml),0,Wl);var Ql=Ml;return Ml-=Cl.length,Ml>=0&&zo.slice(Ml,Ql)==Cl}function $A(zo){return zo=Fm(zo),zo&&Np.test(zo)?zo.replace(h0,m_):zo}function TA(zo){return zo=Fm(zo),zo&&Ip.test(zo)?zo.replace(Mp,"\\$&"):zo}var RA=vy(function(zo,Cl,Ml){return zo+(Ml?"-":"")+Cl.toLowerCase()}),IA=vy(function(zo,Cl,Ml){return zo+(Ml?" ":"")+Cl.toLowerCase()}),NA=W3("toLowerCase");function PA(zo,Cl,Ml){zo=Fm(zo),Cl=bm(Cl);var Wl=Cl?uy(zo):0;if(!Cl||Wl>=Cl)return zo;var Ql=(Cl-Wl)/2;return wx(lx(Ql),Ml)+zo+wx(ax(Ql),Ml)}function kA(zo,Cl,Ml){zo=Fm(zo),Cl=bm(Cl);var Wl=Cl?uy(zo):0;return Cl&&Wl<Cl?zo+wx(Cl-Wl,Ml):zo}function jA(zo,Cl,Ml){zo=Fm(zo),Cl=bm(Cl);var Wl=Cl?uy(zo):0;return Cl&&Wl<Cl?wx(Cl-Wl,Ml)+zo:zo}function OA(zo,Cl,Ml){return Ml||Cl==null?Cl=0:Cl&&(Cl=+Cl),U_(Fm(zo).replace(Dp,""),Cl||0)}function MA(zo,Cl,Ml){return(Ml?W1(zo,Cl,Ml):Cl===rs)?Cl=1:Cl=bm(Cl),ow(Fm(zo),Cl)}function DA(){var zo=arguments,Cl=Fm(zo[0]);return zo.length<3?Cl:Cl.replace(zo[1],zo[2])}var LA=vy(function(zo,Cl,Ml){return zo+(Ml?"_":"")+Cl.toLowerCase()});function FA(zo,Cl,Ml){return Ml&&typeof Ml!="number"&&W1(zo,Cl,Ml)&&(Cl=Ml=rs),Ml=Ml===rs?yl:Ml>>>0,Ml?(zo=Fm(zo),zo&&(typeof Cl=="string"||Cl!=null&&!Rw(Cl))&&(Cl=l2(Cl),!Cl&&cy(zo))?Dv(R2(zo),0,Ml):zo.split(Cl,Ml)):[]}var BA=vy(function(zo,Cl,Ml){return zo+(Ml?" ":"")+Pw(Cl)});function UA(zo,Cl,Ml){return zo=Fm(zo),Ml=Ml==null?0:Jv(bm(Ml),0,zo.length),Cl=l2(Cl),zo.slice(Ml,Ml+Cl.length)==Cl}function WA(zo,Cl,Ml){var Wl=_c.templateSettings;Ml&&W1(zo,Cl,Ml)&&(Cl=rs),zo=Fm(zo),Cl=kx({},Cl,Wl,Z3);var Ql=kx({},Cl.imports,Wl.imports,Z3),bu=N1(Ql),ep=zx(Ql,bu),np,lp,$p=0,Tp=Cl.interpolate||Ym,Fp="__p += '",em=Gx((Cl.escape||Ym).source+"|"+Tp.source+"|"+(Tp===Hp?rm:Ym).source+"|"+(Cl.evaluate||Ym).source+"|$","g"),um="//# sourceURL="+(Um.call(Cl,"sourceURL")?(Cl.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ay+"]")+`
`;zo.replace(em,function(hm,Sm,Im,u2,z1,d2){return Im||(Im=u2),Fp+=zo.slice($p,d2).replace(u1,g_),Sm&&(np=!0,Fp+=`' +
__e(`+Sm+`) +
'`),z1&&(lp=!0,Fp+=`';
`+z1+`;
__p += '`),Im&&(Fp+=`' +
((__t = (`+Im+`)) == null ? '' : __t) +
'`),$p=d2+hm.length,hm}),Fp+=`';
`;var fm=Um.call(Cl,"variable")&&Cl.variable;if(!fm)Fp=`with (obj) {
`+Fp+`
}
`;else if(tm.test(fm))throw new vm(ds);Fp=(lp?Fp.replace(Op,""):Fp).replace(Zp,"$1").replace(Qp,"$1;"),Fp="function("+(fm||"obj")+`) {
`+(fm?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(np?", __e = _.escape":"")+(lp?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Fp+`return __p
}`;var wm=UE(function(){return Mm(bu,um+"return "+Fp).apply(rs,ep)});if(wm.source=Fp,Tw(wm))throw wm;return wm}function VA(zo){return Fm(zo).toLowerCase()}function zA(zo){return Fm(zo).toUpperCase()}function HA(zo,Cl,Ml){if(zo=Fm(zo),zo&&(Ml||Cl===rs))return Yw(zo);if(!zo||!(Cl=l2(Cl)))return zo;var Wl=R2(zo),Ql=R2(Cl),bu=Qw(Wl,Ql),ep=Jw(Wl,Ql)+1;return Dv(Wl,bu,ep).join("")}function GA(zo,Cl,Ml){if(zo=Fm(zo),zo&&(Ml||Cl===rs))return zo.slice(0,e3(zo)+1);if(!zo||!(Cl=l2(Cl)))return zo;var Wl=R2(zo),Ql=Jw(Wl,R2(Cl))+1;return Dv(Wl,0,Ql).join("")}function KA(zo,Cl,Ml){if(zo=Fm(zo),zo&&(Ml||Cl===rs))return zo.replace(Dp,"");if(!zo||!(Cl=l2(Cl)))return zo;var Wl=R2(zo),Ql=Qw(Wl,R2(Cl));return Dv(Wl,Ql).join("")}function qA(zo,Cl){var Ml=Dl,Wl=Ol;if(s1(Cl)){var Ql="separator"in Cl?Cl.separator:Ql;Ml="length"in Cl?bm(Cl.length):Ml,Wl="omission"in Cl?l2(Cl.omission):Wl}zo=Fm(zo);var bu=zo.length;if(cy(zo)){var ep=R2(zo);bu=ep.length}if(Ml>=bu)return zo;var np=Ml-uy(Wl);if(np<1)return Wl;var lp=ep?Dv(ep,0,np).join(""):zo.slice(0,np);if(Ql===rs)return lp+Wl;if(ep&&(np+=lp.length-np),Rw(Ql)){if(zo.slice(np).search(Ql)){var $p,Tp=lp;for(Ql.global||(Ql=Gx(Ql.source,Fm(Jp.exec(Ql))+"g")),Ql.lastIndex=0;$p=Ql.exec(Tp);)var Fp=$p.index;lp=lp.slice(0,Fp===rs?np:Fp)}}else if(zo.indexOf(l2(Ql),np)!=np){var em=lp.lastIndexOf(Ql);em>-1&&(lp=lp.slice(0,em))}return lp+Wl}function ZA(zo){return zo=Fm(zo),zo&&Wp.test(zo)?zo.replace(Xp,__):zo}var YA=vy(function(zo,Cl,Ml){return zo+(Ml?" ":"")+Cl.toUpperCase()}),Pw=W3("toUpperCase");function BE(zo,Cl,Ml){return zo=Fm(zo),Cl=Ml?rs:Cl,Cl===rs?y_(zo)?S_(zo):c_(zo):zo.match(Cl)||[]}var UE=Em(function(zo,Cl){try{return I1(zo,rs,Cl)}catch(Ml){return Tw(Ml)?Ml:new vm(Ml)}}),QA=Y2(function(zo,Cl){return y2(Cl,function(Ml){Ml=W2(Ml),q2(zo,Ml,Sw(zo[Ml],zo))}),zo});function JA(zo){var Cl=zo==null?0:zo.length,Ml=dm();return zo=Cl?i1(zo,function(Wl){if(typeof Wl[1]!="function")throw new x2(us);return[Ml(Wl[0]),Wl[1]]}):[],Em(function(Wl){for(var Ql=-1;++Ql<Cl;){var bu=zo[Ql];if(I1(bu[0],this,Wl))return I1(bu[1],this,Wl)}})}function XA(zo){return _5(w2(zo,fo))}function kw(zo){return function(){return zo}}function eS(zo,Cl){return zo==null||zo!==zo?Cl:zo}var tS=z3(),rS=z3(!0);function t2(zo){return zo}function jw(zo){return b3(typeof zo=="function"?zo:w2(zo,fo))}function nS(zo){return E3(w2(zo,fo))}function iS(zo,Cl){return _3(zo,w2(Cl,fo))}var sS=Em(function(zo,Cl){return function(Ml){return Fy(Ml,zo,Cl)}}),oS=Em(function(zo,Cl){return function(Ml){return Fy(zo,Ml,Cl)}});function Ow(zo,Cl,Ml){var Wl=N1(Cl),Ql=px(Cl,Wl);Ml==null&&!(s1(Cl)&&(Ql.length||!Wl.length))&&(Ml=Cl,Cl=zo,zo=this,Ql=px(Cl,N1(Cl)));var bu=!(s1(Ml)&&"chain"in Ml)||!!Ml.chain,ep=J2(zo);return y2(Ql,function(np){var lp=Cl[np];zo[np]=lp,ep&&(zo.prototype[np]=function(){var $p=this.__chain__;if(bu||$p){var Tp=zo(this.__wrapped__),Fp=Tp.__actions__=X1(this.__actions__);return Fp.push({func:lp,args:arguments,thisArg:zo}),Tp.__chain__=$p,Tp}return lp.apply(zo,Rv([this.value()],arguments))})}),zo}function aS(){return Rm._===this&&(Rm._=P_),this}function Mw(){}function lS(zo){return zo=bm(zo),Em(function(Cl){return C3(Cl,zo)})}var cS=hw(i1),uS=hw(Hw),dS=hw(Fx);function WE(zo){return bw(zo)?Bx(W2(zo)):B5(zo)}function fS(zo){return function(Cl){return zo==null?rs:Xv(zo,Cl)}}var hS=G3(),pS=G3(!0);function Dw(){return[]}function Lw(){return!1}function mS(){return{}}function gS(){return""}function vS(){return!0}function yS(zo,Cl){if(zo=bm(zo),zo<1||zo>Xo)return[];var Ml=yl,Wl=O1(zo,yl);Cl=dm(Cl),zo-=yl;for(var Ql=Vx(Wl,Cl);++Ml<zo;)Cl(Ml);return Ql}function xS(zo){return xm(zo)?i1(zo,W2):c2(zo)?[zo]:X1(lE(Fm(zo)))}function bS(zo){var Cl=++I_;return Fm(zo)+Cl}var wS=bx(function(zo,Cl){return zo+Cl},0),ES=pw("ceil"),_S=bx(function(zo,Cl){return zo/Cl},1),CS=pw("floor");function AS(zo){return zo&&zo.length?hx(zo,t2,_b):rs}function SS(zo,Cl){return zo&&zo.length?hx(zo,dm(Cl,2),_b):rs}function $S(zo){return qw(zo,t2)}function TS(zo,Cl){return qw(zo,dm(Cl,2))}function RS(zo){return zo&&zo.length?hx(zo,t2,nw):rs}function IS(zo,Cl){return zo&&zo.length?hx(zo,dm(Cl,2),nw):rs}var NS=bx(function(zo,Cl){return zo*Cl},1),PS=pw("round"),kS=bx(function(zo,Cl){return zo-Cl},0);function jS(zo){return zo&&zo.length?Wx(zo,t2):0}function OS(zo,Cl){return zo&&zo.length?Wx(zo,dm(Cl,2)):0}return _c.after=n4,_c.ary=xE,_c.assign=z4,_c.assignIn=kE,_c.assignInWith=kx,_c.assignWith=H4,_c.at=G4,_c.before=bE,_c.bind=Sw,_c.bindAll=QA,_c.bindKey=wE,_c.castArray=m4,_c.chain=gE,_c.chunk=CC,_c.compact=AC,_c.concat=SC,_c.cond=JA,_c.conforms=XA,_c.constant=kw,_c.countBy=j6,_c.create=K4,_c.curry=EE,_c.curryRight=_E,_c.debounce=CE,_c.defaults=q4,_c.defaultsDeep=Z4,_c.defer=i4,_c.delay=s4,_c.difference=$C,_c.differenceBy=TC,_c.differenceWith=RC,_c.drop=IC,_c.dropRight=NC,_c.dropRightWhile=PC,_c.dropWhile=kC,_c.fill=jC,_c.filter=M6,_c.flatMap=F6,_c.flatMapDeep=B6,_c.flatMapDepth=U6,_c.flatten=fE,_c.flattenDeep=OC,_c.flattenDepth=MC,_c.flip=o4,_c.flow=tS,_c.flowRight=rS,_c.fromPairs=DC,_c.functions=rA,_c.functionsIn=nA,_c.groupBy=W6,_c.initial=FC,_c.intersection=BC,_c.intersectionBy=UC,_c.intersectionWith=WC,_c.invert=sA,_c.invertBy=oA,_c.invokeMap=z6,_c.iteratee=jw,_c.keyBy=H6,_c.keys=N1,_c.keysIn=e2,_c.map=$x,_c.mapKeys=lA,_c.mapValues=cA,_c.matches=nS,_c.matchesProperty=iS,_c.memoize=Rx,_c.merge=uA,_c.mergeWith=jE,_c.method=sS,_c.methodOf=oS,_c.mixin=Ow,_c.negate=Ix,_c.nthArg=lS,_c.omit=dA,_c.omitBy=fA,_c.once=a4,_c.orderBy=G6,_c.over=cS,_c.overArgs=l4,_c.overEvery=uS,_c.overSome=dS,_c.partial=$w,_c.partialRight=AE,_c.partition=K6,_c.pick=hA,_c.pickBy=OE,_c.property=WE,_c.propertyOf=fS,_c.pull=GC,_c.pullAll=pE,_c.pullAllBy=KC,_c.pullAllWith=qC,_c.pullAt=ZC,_c.range=hS,_c.rangeRight=pS,_c.rearg=c4,_c.reject=Y6,_c.remove=YC,_c.rest=u4,_c.reverse=Cw,_c.sampleSize=J6,_c.set=mA,_c.setWith=gA,_c.shuffle=X6,_c.slice=QC,_c.sortBy=r4,_c.sortedUniq=i6,_c.sortedUniqBy=s6,_c.split=FA,_c.spread=d4,_c.tail=o6,_c.take=a6,_c.takeRight=l6,_c.takeRightWhile=c6,_c.takeWhile=u6,_c.tap=A6,_c.throttle=f4,_c.thru=Sx,_c.toArray=IE,_c.toPairs=ME,_c.toPairsIn=DE,_c.toPath=xS,_c.toPlainObject=PE,_c.transform=vA,_c.unary=h4,_c.union=d6,_c.unionBy=f6,_c.unionWith=h6,_c.uniq=p6,_c.uniqBy=m6,_c.uniqWith=g6,_c.unset=yA,_c.unzip=Aw,_c.unzipWith=mE,_c.update=xA,_c.updateWith=bA,_c.values=by,_c.valuesIn=wA,_c.without=v6,_c.words=BE,_c.wrap=p4,_c.xor=y6,_c.xorBy=x6,_c.xorWith=b6,_c.zip=w6,_c.zipObject=E6,_c.zipObjectDeep=_6,_c.zipWith=C6,_c.entries=ME,_c.entriesIn=DE,_c.extend=kE,_c.extendWith=kx,Ow(_c,_c),_c.add=wS,_c.attempt=UE,_c.camelCase=AA,_c.capitalize=LE,_c.ceil=ES,_c.clamp=EA,_c.clone=g4,_c.cloneDeep=y4,_c.cloneDeepWith=x4,_c.cloneWith=v4,_c.conformsTo=b4,_c.deburr=FE,_c.defaultTo=eS,_c.divide=_S,_c.endsWith=SA,_c.eq=N2,_c.escape=$A,_c.escapeRegExp=TA,_c.every=O6,_c.find=D6,_c.findIndex=uE,_c.findKey=Y4,_c.findLast=L6,_c.findLastIndex=dE,_c.findLastKey=Q4,_c.floor=CS,_c.forEach=vE,_c.forEachRight=yE,_c.forIn=J4,_c.forInRight=X4,_c.forOwn=eA,_c.forOwnRight=tA,_c.get=Iw,_c.gt=w4,_c.gte=E4,_c.has=iA,_c.hasIn=Nw,_c.head=hE,_c.identity=t2,_c.includes=V6,_c.indexOf=LC,_c.inRange=_A,_c.invoke=aA,_c.isArguments=ry,_c.isArray=xm,_c.isArrayBuffer=_4,_c.isArrayLike=_g,_c.isArrayLikeObject=f1,_c.isBoolean=C4,_c.isBuffer=Lv,_c.isDate=A4,_c.isElement=S4,_c.isEmpty=$4,_c.isEqual=T4,_c.isEqualWith=R4,_c.isError=Tw,_c.isFinite=I4,_c.isFunction=J2,_c.isInteger=SE,_c.isLength=Nx,_c.isMap=$E,_c.isMatch=N4,_c.isMatchWith=P4,_c.isNaN=k4,_c.isNative=j4,_c.isNil=M4,_c.isNull=O4,_c.isNumber=TE,_c.isObject=s1,_c.isObjectLike=l1,_c.isPlainObject=Hy,_c.isRegExp=Rw,_c.isSafeInteger=D4,_c.isSet=RE,_c.isString=Px,_c.isSymbol=c2,_c.isTypedArray=xy,_c.isUndefined=L4,_c.isWeakMap=F4,_c.isWeakSet=B4,_c.join=VC,_c.kebabCase=RA,_c.last=_2,_c.lastIndexOf=zC,_c.lowerCase=IA,_c.lowerFirst=NA,_c.lt=U4,_c.lte=W4,_c.max=AS,_c.maxBy=SS,_c.mean=$S,_c.meanBy=TS,_c.min=RS,_c.minBy=IS,_c.stubArray=Dw,_c.stubFalse=Lw,_c.stubObject=mS,_c.stubString=gS,_c.stubTrue=vS,_c.multiply=NS,_c.nth=HC,_c.noConflict=aS,_c.noop=Mw,_c.now=Tx,_c.pad=PA,_c.padEnd=kA,_c.padStart=jA,_c.parseInt=OA,_c.random=CA,_c.reduce=q6,_c.reduceRight=Z6,_c.repeat=MA,_c.replace=DA,_c.result=pA,_c.round=PS,_c.runInContext=ap,_c.sample=Q6,_c.size=e4,_c.snakeCase=LA,_c.some=t4,_c.sortedIndex=JC,_c.sortedIndexBy=XC,_c.sortedIndexOf=e6,_c.sortedLastIndex=t6,_c.sortedLastIndexBy=r6,_c.sortedLastIndexOf=n6,_c.startCase=BA,_c.startsWith=UA,_c.subtract=kS,_c.sum=jS,_c.sumBy=OS,_c.template=WA,_c.times=yS,_c.toFinite=X2,_c.toInteger=bm,_c.toLength=NE,_c.toLower=VA,_c.toNumber=C2,_c.toSafeInteger=V4,_c.toString=Fm,_c.toUpper=zA,_c.trim=HA,_c.trimEnd=GA,_c.trimStart=KA,_c.truncate=qA,_c.unescape=ZA,_c.uniqueId=bS,_c.upperCase=YA,_c.upperFirst=Pw,_c.each=vE,_c.eachRight=yE,_c.first=hE,Ow(_c,function(){var zo={};return B2(_c,function(Cl,Ml){Um.call(_c.prototype,Ml)||(zo[Ml]=Cl)}),zo}(),{chain:!1}),_c.VERSION=is,y2(["bind","bindKey","curry","curryRight","partial","partialRight"],function(zo){_c[zo].placeholder=_c}),y2(["drop","take"],function(zo,Cl){Tm.prototype[zo]=function(Ml){Ml=Ml===rs?1:A1(bm(Ml),0);var Wl=this.__filtered__&&!Cl?new Tm(this):this.clone();return Wl.__filtered__?Wl.__takeCount__=O1(Ml,Wl.__takeCount__):Wl.__views__.push({size:O1(Ml,yl),type:zo+(Wl.__dir__<0?"Right":"")}),Wl},Tm.prototype[zo+"Right"]=function(Ml){return this.reverse()[zo](Ml).reverse()}}),y2(["filter","map","takeWhile"],function(zo,Cl){var Ml=Cl+1,Wl=Ml==jo||Ml==Qo;Tm.prototype[zo]=function(Ql){var bu=this.clone();return bu.__iteratees__.push({iteratee:dm(Ql,3),type:Ml}),bu.__filtered__=bu.__filtered__||Wl,bu}}),y2(["head","last"],function(zo,Cl){var Ml="take"+(Cl?"Right":"");Tm.prototype[zo]=function(){return this[Ml](1).value()[0]}}),y2(["initial","tail"],function(zo,Cl){var Ml="drop"+(Cl?"":"Right");Tm.prototype[zo]=function(){return this.__filtered__?new Tm(this):this[Ml](1)}}),Tm.prototype.compact=function(){return this.filter(t2)},Tm.prototype.find=function(zo){return this.filter(zo).head()},Tm.prototype.findLast=function(zo){return this.reverse().find(zo)},Tm.prototype.invokeMap=Em(function(zo,Cl){return typeof zo=="function"?new Tm(this):this.map(function(Ml){return Fy(Ml,zo,Cl)})}),Tm.prototype.reject=function(zo){return this.filter(Ix(dm(zo)))},Tm.prototype.slice=function(zo,Cl){zo=bm(zo);var Ml=this;return Ml.__filtered__&&(zo>0||Cl<0)?new Tm(Ml):(zo<0?Ml=Ml.takeRight(-zo):zo&&(Ml=Ml.drop(zo)),Cl!==rs&&(Cl=bm(Cl),Ml=Cl<0?Ml.dropRight(-Cl):Ml.take(Cl-zo)),Ml)},Tm.prototype.takeRightWhile=function(zo){return this.reverse().takeWhile(zo).reverse()},Tm.prototype.toArray=function(){return this.take(yl)},B2(Tm.prototype,function(zo,Cl){var Ml=/^(?:filter|find|map|reject)|While$/.test(Cl),Wl=/^(?:head|last)$/.test(Cl),Ql=_c[Wl?"take"+(Cl=="last"?"Right":""):Cl],bu=Wl||/^find/.test(Cl);Ql&&(_c.prototype[Cl]=function(){var ep=this.__wrapped__,np=Wl?[1]:arguments,lp=ep instanceof Tm,$p=np[0],Tp=lp||xm(ep),Fp=function(Sm){var Im=Ql.apply(_c,Rv([Sm],np));return Wl&&em?Im[0]:Im};Tp&&Ml&&typeof $p=="function"&&$p.length!=1&&(lp=Tp=!1);var em=this.__chain__,um=!!this.__actions__.length,fm=bu&&!em,wm=lp&&!um;if(!bu&&Tp){ep=wm?ep:new Tm(this);var hm=zo.apply(ep,np);return hm.__actions__.push({func:Sx,args:[Fp],thisArg:rs}),new b2(hm,em)}return fm&&wm?zo.apply(this,np):(hm=this.thru(Fp),fm?Wl?hm.value()[0]:hm.value():hm)})}),y2(["pop","push","shift","sort","splice","unshift"],function(zo){var Cl=Jy[zo],Ml=/^(?:push|sort|unshift)$/.test(zo)?"tap":"thru",Wl=/^(?:pop|shift)$/.test(zo);_c.prototype[zo]=function(){var Ql=arguments;if(Wl&&!this.__chain__){var bu=this.value();return Cl.apply(xm(bu)?bu:[],Ql)}return this[Ml](function(ep){return Cl.apply(xm(ep)?ep:[],Ql)})}}),B2(Tm.prototype,function(zo,Cl){var Ml=_c[Cl];if(Ml){var Wl=Ml.name+"";Um.call(py,Wl)||(py[Wl]=[]),py[Wl].push({name:Cl,func:Ml})}}),py[xx(rs,Yo).name]=[{name:"wrapper",func:rs}],Tm.prototype.clone=q_,Tm.prototype.reverse=Z_,Tm.prototype.value=Y_,_c.prototype.at=S6,_c.prototype.chain=$6,_c.prototype.commit=T6,_c.prototype.next=R6,_c.prototype.plant=N6,_c.prototype.reverse=P6,_c.prototype.toJSON=_c.prototype.valueOf=_c.prototype.value=k6,_c.prototype.first=_c.prototype.head,Py&&(_c.prototype[Py]=I6),_c},dy=$_();d1?((d1.exports=dy)._=dy,Gm._=dy):Rm._=dy}).call(_n)})(qi,qi.exports);var Vg=Object.defineProperty,kg=Object.defineProperties,jg=Object.getOwnPropertyDescriptors,Ra=Object.getOwnPropertySymbols,tv=Object.prototype.hasOwnProperty,ev=Object.prototype.propertyIsEnumerable,ba=(Fn,Mn,rs)=>Mn in Fn?Vg(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,lr=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))tv.call(Mn,rs)&&ba(Fn,rs,Mn[rs]);if(Ra)for(var rs of Ra(Mn))ev.call(Mn,rs)&&ba(Fn,rs,Mn[rs]);return Fn},nv=(Fn,Mn)=>kg(Fn,jg(Mn));function Lt(Fn,Mn,rs){var is;const os=An(Fn);return((is=Mn.rpcMap)==null?void 0:is[os.reference])||`${Oa}?chainId=${os.namespace}:${os.reference}&projectId=${rs}`}function Ae(Fn){return Fn.includes(":")?Fn.split(":")[1]:Fn}function Ta(Fn){return Fn.map(Mn=>`${Mn.split(":")[0]}:${Mn.split(":")[1]}`)}function rv(Fn,Mn){const rs=Object.keys(Mn.namespaces).filter(os=>os.includes(Fn));if(!rs.length)return[];const is=[];return rs.forEach(os=>{const as=Mn.namespaces[os].accounts;is.push(...as)}),is}function Fi(Fn={},Mn={}){const rs=La(Fn),is=La(Mn);return qi.exports.merge(rs,is)}function La(Fn){var Mn,rs,is,os;const as={};if(!Xr$1(Fn))return as;for(const[us,ds]of Object.entries(Fn)){const hs=on$1(us)?[us]:ds.chains,ps=ds.methods||[],io=ds.events||[],fo=ds.rpcMap||{},mo=xo(us);as[mo]=nv(lr(lr({},as[mo]),ds),{chains:me$1(hs,(Mn=as[mo])==null?void 0:Mn.chains),methods:me$1(ps,(rs=as[mo])==null?void 0:rs.methods),events:me$1(io,(is=as[mo])==null?void 0:is.events),rpcMap:lr(lr({},fo),(os=as[mo])==null?void 0:os.rpcMap)})}return as}function iv(Fn){return Fn.includes(":")?Fn.split(":")[2]:Fn}function Ha(Fn){const Mn={};for(const[rs,is]of Object.entries(Fn)){const os=is.methods||[],as=is.events||[],us=is.accounts||[],ds=on$1(rs)?[rs]:is.chains?is.chains:Ta(is.accounts);Mn[rs]={chains:ds,methods:os,events:as,accounts:us}}return Mn}function Wi(Fn){return typeof Fn=="number"?Fn:Fn.includes("0x")?parseInt(Fn,16):(Fn=Fn.includes(":")?Fn.split(":")[1]:Fn,isNaN(Number(Fn))?Fn:Number(Fn))}const Da={},F=Fn=>Da[Fn],Mi=(Fn,Mn)=>{Da[Fn]=Mn};class sv{constructor(Mn){this.name="polkadot",this.namespace=Mn.namespace,this.events=F("events"),this.client=F("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(Mn){this.namespace=Object.assign(this.namespace,Mn)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const Mn=this.namespace.chains[0];if(!Mn)throw new Error("ChainId not found");return Mn.split(":")[1]}request(Mn){return this.namespace.methods.includes(Mn.request.method)?this.client.request(Mn):this.getHttpProvider().request(Mn.request)}setDefaultChain(Mn,rs){this.httpProviders[Mn]||this.setHttpProvider(Mn,rs),this.chainId=Mn,this.events.emit(Tt.DEFAULT_CHAIN_CHANGED,`${this.name}:${Mn}`)}getAccounts(){const Mn=this.namespace.accounts;return Mn?Mn.filter(rs=>rs.split(":")[1]===this.chainId.toString()).map(rs=>rs.split(":")[2])||[]:[]}createHttpProviders(){const Mn={};return this.namespace.chains.forEach(rs=>{var is;const os=Ae(rs);Mn[os]=this.createHttpProvider(os,(is=this.namespace.rpcMap)==null?void 0:is[rs])}),Mn}getHttpProvider(){const Mn=`${this.name}:${this.chainId}`,rs=this.httpProviders[Mn];if(typeof rs>"u")throw new Error(`JSON-RPC provider for ${Mn} not found`);return rs}setHttpProvider(Mn,rs){const is=this.createHttpProvider(Mn,rs);is&&(this.httpProviders[Mn]=is)}createHttpProvider(Mn,rs){const is=rs||Lt(Mn,this.namespace,this.client.core.projectId);if(!is)throw new Error(`No RPC url provided for chainId: ${Mn}`);return new o$2(new f(is,F("disableProviderPing")))}}var uv=Object.defineProperty,av=Object.defineProperties,ov=Object.getOwnPropertyDescriptors,Na=Object.getOwnPropertySymbols,cv=Object.prototype.hasOwnProperty,fv=Object.prototype.propertyIsEnumerable,$a=(Fn,Mn,rs)=>Mn in Fn?uv(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,Ua=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))cv.call(Mn,rs)&&$a(Fn,rs,Mn[rs]);if(Na)for(var rs of Na(Mn))fv.call(Mn,rs)&&$a(Fn,rs,Mn[rs]);return Fn},qa=(Fn,Mn)=>av(Fn,ov(Mn));class hv{constructor(Mn){this.name="eip155",this.namespace=Mn.namespace,this.events=F("events"),this.client=F("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(Mn){switch(Mn.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(Mn);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(Mn);case"wallet_getCallsStatus":return await this.getCallStatus(Mn)}return this.namespace.methods.includes(Mn.request.method)?await this.client.request(Mn):this.getHttpProvider().request(Mn.request)}updateNamespace(Mn){this.namespace=Object.assign(this.namespace,Mn)}setDefaultChain(Mn,rs){this.httpProviders[Mn]||this.setHttpProvider(parseInt(Mn),rs),this.chainId=parseInt(Mn),this.events.emit(Tt.DEFAULT_CHAIN_CHANGED,`${this.name}:${Mn}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const Mn=this.namespace.chains[0];if(!Mn)throw new Error("ChainId not found");return Mn.split(":")[1]}createHttpProvider(Mn,rs){const is=rs||Lt(`${this.name}:${Mn}`,this.namespace,this.client.core.projectId);if(!is)throw new Error(`No RPC url provided for chainId: ${Mn}`);return new o$2(new f(is,F("disableProviderPing")))}setHttpProvider(Mn,rs){const is=this.createHttpProvider(Mn,rs);is&&(this.httpProviders[Mn]=is)}createHttpProviders(){const Mn={};return this.namespace.chains.forEach(rs=>{var is;const os=parseInt(Ae(rs));Mn[os]=this.createHttpProvider(os,(is=this.namespace.rpcMap)==null?void 0:is[rs])}),Mn}getAccounts(){const Mn=this.namespace.accounts;return Mn?[...new Set(Mn.filter(rs=>rs.split(":")[1]===this.chainId.toString()).map(rs=>rs.split(":")[2]))]:[]}getHttpProvider(){const Mn=this.chainId,rs=this.httpProviders[Mn];if(typeof rs>"u")throw new Error(`JSON-RPC provider for ${Mn} not found`);return rs}async handleSwitchChain(Mn){var rs,is;let os=Mn.request.params?(rs=Mn.request.params[0])==null?void 0:rs.chainId:"0x0";os=os.startsWith("0x")?os:`0x${os}`;const as=parseInt(os,16);if(this.isChainApproved(as))this.setDefaultChain(`${as}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:Mn.topic,request:{method:Mn.request.method,params:[{chainId:os}]},chainId:(is=this.namespace.chains)==null?void 0:is[0]}),this.setDefaultChain(`${as}`);else throw new Error(`Failed to switch to chain 'eip155:${as}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(Mn){return this.namespace.chains.includes(`${this.name}:${Mn}`)}async getCapabilities(Mn){var rs,is,os;const as=(is=(rs=Mn.request)==null?void 0:rs.params)==null?void 0:is[0];if(!as)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const us=this.client.session.get(Mn.topic),ds=((os=us==null?void 0:us.sessionProperties)==null?void 0:os.capabilities)||{};if(ds!=null&&ds[as])return ds==null?void 0:ds[as];const hs=await this.client.request(Mn);try{await this.client.session.update(Mn.topic,{sessionProperties:qa(Ua({},us.sessionProperties||{}),{capabilities:qa(Ua({},ds||{}),{[as]:hs})})})}catch(ps){console.warn("Failed to update session with capabilities",ps)}return hs}async getCallStatus(Mn){var rs,is;const os=this.client.session.get(Mn.topic),as=(rs=os.sessionProperties)==null?void 0:rs.bundler_name;if(as){const ds=this.getBundlerUrl(Mn.chainId,as);try{return await this.getUserOperationReceipt(ds,Mn)}catch(hs){console.warn("Failed to fetch call status from bundler",hs,ds)}}const us=(is=os.sessionProperties)==null?void 0:is.bundler_url;if(us)try{return await this.getUserOperationReceipt(us,Mn)}catch(ds){console.warn("Failed to fetch call status from custom bundler",ds,us)}if(this.namespace.methods.includes(Mn.request.method))return await this.client.request(Mn);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(Mn,rs){var is;const os=new URL(Mn),as=await fetch(os,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(formatJsonRpcRequest("eth_getUserOperationReceipt",[(is=rs.request.params)==null?void 0:is[0]]))});if(!as.ok)throw new Error(`Failed to fetch user operation receipt - ${as.status}`);return await as.json()}getBundlerUrl(Mn,rs){return`${Qg}?projectId=${this.client.core.projectId}&chainId=${Mn}&bundler=${rs}`}}class lv{constructor(Mn){this.name="solana",this.namespace=Mn.namespace,this.events=F("events"),this.client=F("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(Mn){this.namespace=Object.assign(this.namespace,Mn)}requestAccounts(){return this.getAccounts()}request(Mn){return this.namespace.methods.includes(Mn.request.method)?this.client.request(Mn):this.getHttpProvider().request(Mn.request)}setDefaultChain(Mn,rs){this.httpProviders[Mn]||this.setHttpProvider(Mn,rs),this.chainId=Mn,this.events.emit(Tt.DEFAULT_CHAIN_CHANGED,`${this.name}:${Mn}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const Mn=this.namespace.chains[0];if(!Mn)throw new Error("ChainId not found");return Mn.split(":")[1]}getAccounts(){const Mn=this.namespace.accounts;return Mn?[...new Set(Mn.filter(rs=>rs.split(":")[1]===this.chainId.toString()).map(rs=>rs.split(":")[2]))]:[]}createHttpProviders(){const Mn={};return this.namespace.chains.forEach(rs=>{var is;const os=Ae(rs);Mn[os]=this.createHttpProvider(os,(is=this.namespace.rpcMap)==null?void 0:is[rs])}),Mn}getHttpProvider(){const Mn=`${this.name}:${this.chainId}`,rs=this.httpProviders[Mn];if(typeof rs>"u")throw new Error(`JSON-RPC provider for ${Mn} not found`);return rs}setHttpProvider(Mn,rs){const is=this.createHttpProvider(Mn,rs);is&&(this.httpProviders[Mn]=is)}createHttpProvider(Mn,rs){const is=rs||Lt(Mn,this.namespace,this.client.core.projectId);if(!is)throw new Error(`No RPC url provided for chainId: ${Mn}`);return new o$2(new f(is,F("disableProviderPing")))}}class pv{constructor(Mn){this.name="cosmos",this.namespace=Mn.namespace,this.events=F("events"),this.client=F("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(Mn){this.namespace=Object.assign(this.namespace,Mn)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const Mn=this.namespace.chains[0];if(!Mn)throw new Error("ChainId not found");return Mn.split(":")[1]}request(Mn){return this.namespace.methods.includes(Mn.request.method)?this.client.request(Mn):this.getHttpProvider().request(Mn.request)}setDefaultChain(Mn,rs){this.httpProviders[Mn]||this.setHttpProvider(Mn,rs),this.chainId=Mn,this.events.emit(Tt.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const Mn=this.namespace.accounts;return Mn?[...new Set(Mn.filter(rs=>rs.split(":")[1]===this.chainId.toString()).map(rs=>rs.split(":")[2]))]:[]}createHttpProviders(){const Mn={};return this.namespace.chains.forEach(rs=>{var is;const os=Ae(rs);Mn[os]=this.createHttpProvider(os,(is=this.namespace.rpcMap)==null?void 0:is[rs])}),Mn}getHttpProvider(){const Mn=`${this.name}:${this.chainId}`,rs=this.httpProviders[Mn];if(typeof rs>"u")throw new Error(`JSON-RPC provider for ${Mn} not found`);return rs}setHttpProvider(Mn,rs){const is=this.createHttpProvider(Mn,rs);is&&(this.httpProviders[Mn]=is)}createHttpProvider(Mn,rs){const is=rs||Lt(Mn,this.namespace,this.client.core.projectId);if(!is)throw new Error(`No RPC url provided for chainId: ${Mn}`);return new o$2(new f(is,F("disableProviderPing")))}}class dv{constructor(Mn){this.name="algorand",this.namespace=Mn.namespace,this.events=F("events"),this.client=F("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(Mn){this.namespace=Object.assign(this.namespace,Mn)}requestAccounts(){return this.getAccounts()}request(Mn){return this.namespace.methods.includes(Mn.request.method)?this.client.request(Mn):this.getHttpProvider().request(Mn.request)}setDefaultChain(Mn,rs){if(!this.httpProviders[Mn]){const is=rs||Lt(`${this.name}:${Mn}`,this.namespace,this.client.core.projectId);if(!is)throw new Error(`No RPC url provided for chainId: ${Mn}`);this.setHttpProvider(Mn,is)}this.chainId=Mn,this.events.emit(Tt.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const Mn=this.namespace.chains[0];if(!Mn)throw new Error("ChainId not found");return Mn.split(":")[1]}getAccounts(){const Mn=this.namespace.accounts;return Mn?[...new Set(Mn.filter(rs=>rs.split(":")[1]===this.chainId.toString()).map(rs=>rs.split(":")[2]))]:[]}createHttpProviders(){const Mn={};return this.namespace.chains.forEach(rs=>{var is;Mn[rs]=this.createHttpProvider(rs,(is=this.namespace.rpcMap)==null?void 0:is[rs])}),Mn}getHttpProvider(){const Mn=`${this.name}:${this.chainId}`,rs=this.httpProviders[Mn];if(typeof rs>"u")throw new Error(`JSON-RPC provider for ${Mn} not found`);return rs}setHttpProvider(Mn,rs){const is=this.createHttpProvider(Mn,rs);is&&(this.httpProviders[Mn]=is)}createHttpProvider(Mn,rs){const is=rs||Lt(Mn,this.namespace,this.client.core.projectId);return typeof is>"u"?void 0:new o$2(new f(is,F("disableProviderPing")))}}class gv{constructor(Mn){this.name="cip34",this.namespace=Mn.namespace,this.events=F("events"),this.client=F("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(Mn){this.namespace=Object.assign(this.namespace,Mn)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const Mn=this.namespace.chains[0];if(!Mn)throw new Error("ChainId not found");return Mn.split(":")[1]}request(Mn){return this.namespace.methods.includes(Mn.request.method)?this.client.request(Mn):this.getHttpProvider().request(Mn.request)}setDefaultChain(Mn,rs){this.httpProviders[Mn]||this.setHttpProvider(Mn,rs),this.chainId=Mn,this.events.emit(Tt.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const Mn=this.namespace.accounts;return Mn?[...new Set(Mn.filter(rs=>rs.split(":")[1]===this.chainId.toString()).map(rs=>rs.split(":")[2]))]:[]}createHttpProviders(){const Mn={};return this.namespace.chains.forEach(rs=>{const is=this.getCardanoRPCUrl(rs),os=Ae(rs);Mn[os]=this.createHttpProvider(os,is)}),Mn}getHttpProvider(){const Mn=`${this.name}:${this.chainId}`,rs=this.httpProviders[Mn];if(typeof rs>"u")throw new Error(`JSON-RPC provider for ${Mn} not found`);return rs}getCardanoRPCUrl(Mn){const rs=this.namespace.rpcMap;if(rs)return rs[Mn]}setHttpProvider(Mn,rs){const is=this.createHttpProvider(Mn,rs);is&&(this.httpProviders[Mn]=is)}createHttpProvider(Mn,rs){const is=rs||this.getCardanoRPCUrl(Mn);if(!is)throw new Error(`No RPC url provided for chainId: ${Mn}`);return new o$2(new f(is,F("disableProviderPing")))}}class vv{constructor(Mn){this.name="elrond",this.namespace=Mn.namespace,this.events=F("events"),this.client=F("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(Mn){this.namespace=Object.assign(this.namespace,Mn)}requestAccounts(){return this.getAccounts()}request(Mn){return this.namespace.methods.includes(Mn.request.method)?this.client.request(Mn):this.getHttpProvider().request(Mn.request)}setDefaultChain(Mn,rs){this.httpProviders[Mn]||this.setHttpProvider(Mn,rs),this.chainId=Mn,this.events.emit(Tt.DEFAULT_CHAIN_CHANGED,`${this.name}:${Mn}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const Mn=this.namespace.chains[0];if(!Mn)throw new Error("ChainId not found");return Mn.split(":")[1]}getAccounts(){const Mn=this.namespace.accounts;return Mn?[...new Set(Mn.filter(rs=>rs.split(":")[1]===this.chainId.toString()).map(rs=>rs.split(":")[2]))]:[]}createHttpProviders(){const Mn={};return this.namespace.chains.forEach(rs=>{var is;const os=Ae(rs);Mn[os]=this.createHttpProvider(os,(is=this.namespace.rpcMap)==null?void 0:is[rs])}),Mn}getHttpProvider(){const Mn=`${this.name}:${this.chainId}`,rs=this.httpProviders[Mn];if(typeof rs>"u")throw new Error(`JSON-RPC provider for ${Mn} not found`);return rs}setHttpProvider(Mn,rs){const is=this.createHttpProvider(Mn,rs);is&&(this.httpProviders[Mn]=is)}createHttpProvider(Mn,rs){const is=rs||Lt(Mn,this.namespace,this.client.core.projectId);if(!is)throw new Error(`No RPC url provided for chainId: ${Mn}`);return new o$2(new f(is,F("disableProviderPing")))}}class _v{constructor(Mn){this.name="multiversx",this.namespace=Mn.namespace,this.events=F("events"),this.client=F("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(Mn){this.namespace=Object.assign(this.namespace,Mn)}requestAccounts(){return this.getAccounts()}request(Mn){return this.namespace.methods.includes(Mn.request.method)?this.client.request(Mn):this.getHttpProvider().request(Mn.request)}setDefaultChain(Mn,rs){this.httpProviders[Mn]||this.setHttpProvider(Mn,rs),this.chainId=Mn,this.events.emit(Tt.DEFAULT_CHAIN_CHANGED,`${this.name}:${Mn}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const Mn=this.namespace.chains[0];if(!Mn)throw new Error("ChainId not found");return Mn.split(":")[1]}getAccounts(){const Mn=this.namespace.accounts;return Mn?[...new Set(Mn.filter(rs=>rs.split(":")[1]===this.chainId.toString()).map(rs=>rs.split(":")[2]))]:[]}createHttpProviders(){const Mn={};return this.namespace.chains.forEach(rs=>{var is;const os=Ae(rs);Mn[os]=this.createHttpProvider(os,(is=this.namespace.rpcMap)==null?void 0:is[rs])}),Mn}getHttpProvider(){const Mn=`${this.name}:${this.chainId}`,rs=this.httpProviders[Mn];if(typeof rs>"u")throw new Error(`JSON-RPC provider for ${Mn} not found`);return rs}setHttpProvider(Mn,rs){const is=this.createHttpProvider(Mn,rs);is&&(this.httpProviders[Mn]=is)}createHttpProvider(Mn,rs){const is=rs||Lt(Mn,this.namespace,this.client.core.projectId);if(!is)throw new Error(`No RPC url provided for chainId: ${Mn}`);return new o$2(new f(is,F("disableProviderPing")))}}class mv{constructor(Mn){this.name="near",this.namespace=Mn.namespace,this.events=F("events"),this.client=F("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(Mn){this.namespace=Object.assign(this.namespace,Mn)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const Mn=this.namespace.chains[0];if(!Mn)throw new Error("ChainId not found");return Mn.split(":")[1]}request(Mn){return this.namespace.methods.includes(Mn.request.method)?this.client.request(Mn):this.getHttpProvider().request(Mn.request)}setDefaultChain(Mn,rs){if(this.chainId=Mn,!this.httpProviders[Mn]){const is=rs||Lt(`${this.name}:${Mn}`,this.namespace);if(!is)throw new Error(`No RPC url provided for chainId: ${Mn}`);this.setHttpProvider(Mn,is)}this.events.emit(Tt.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const Mn=this.namespace.accounts;return Mn?Mn.filter(rs=>rs.split(":")[1]===this.chainId.toString()).map(rs=>rs.split(":")[2])||[]:[]}createHttpProviders(){const Mn={};return this.namespace.chains.forEach(rs=>{var is;Mn[rs]=this.createHttpProvider(rs,(is=this.namespace.rpcMap)==null?void 0:is[rs])}),Mn}getHttpProvider(){const Mn=`${this.name}:${this.chainId}`,rs=this.httpProviders[Mn];if(typeof rs>"u")throw new Error(`JSON-RPC provider for ${Mn} not found`);return rs}setHttpProvider(Mn,rs){const is=this.createHttpProvider(Mn,rs);is&&(this.httpProviders[Mn]=is)}createHttpProvider(Mn,rs){const is=rs||Lt(Mn,this.namespace);return typeof is>"u"?void 0:new o$2(new f(is,F("disableProviderPing")))}}class wv{constructor(Mn){this.name=ze,this.namespace=Mn.namespace,this.events=F("events"),this.client=F("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(Mn){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(Mn.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(Mn.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(Mn.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(Mn.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(Mn){return this.namespace.methods.includes(Mn.request.method)?this.client.request(Mn):this.getHttpProvider(Mn.chainId).request(Mn.request)}setDefaultChain(Mn,rs){this.httpProviders[Mn]||this.setHttpProvider(Mn,rs),this.chainId=Mn,this.events.emit(Tt.DEFAULT_CHAIN_CHANGED,`${this.name}:${Mn}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const Mn=this.namespace.chains[0];if(!Mn)throw new Error("ChainId not found");return Mn.split(":")[1]}getAccounts(){const Mn=this.namespace.accounts;return Mn?[...new Set(Mn.filter(rs=>rs.split(":")[1]===this.chainId.toString()).map(rs=>rs.split(":")[2]))]:[]}createHttpProviders(){var Mn,rs;const is={};return(rs=(Mn=this.namespace)==null?void 0:Mn.accounts)==null||rs.forEach(os=>{const as=An(os);is[`${as.namespace}:${as.reference}`]=this.createHttpProvider(os)}),is}getHttpProvider(Mn){const rs=this.httpProviders[Mn];if(typeof rs>"u")throw new Error(`JSON-RPC provider for ${Mn} not found`);return rs}setHttpProvider(Mn,rs){const is=this.createHttpProvider(Mn,rs);is&&(this.httpProviders[Mn]=is)}createHttpProvider(Mn,rs){const is=rs||Lt(Mn,this.namespace,this.client.core.projectId);if(!is)throw new Error(`No RPC url provided for chainId: ${Mn}`);return new o$2(new f(is,F("disableProviderPing")))}}var Pv=Object.defineProperty,Cv=Object.defineProperties,Av=Object.getOwnPropertyDescriptors,Fa=Object.getOwnPropertySymbols,Iv=Object.prototype.hasOwnProperty,xv=Object.prototype.propertyIsEnumerable,Wa=(Fn,Mn,rs)=>Mn in Fn?Pv(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,pr=(Fn,Mn)=>{for(var rs in Mn||(Mn={}))Iv.call(Mn,rs)&&Wa(Fn,rs,Mn[rs]);if(Fa)for(var rs of Fa(Mn))xv.call(Mn,rs)&&Wa(Fn,rs,Mn[rs]);return Fn},Bi=(Fn,Mn)=>Cv(Fn,Av(Mn));class dr{constructor(Mn){this.events=new Jg,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=Mn,this.logger=typeof(Mn==null?void 0:Mn.logger)<"u"&&typeof(Mn==null?void 0:Mn.logger)!="string"?Mn.logger:Mg(k$2({level:(Mn==null?void 0:Mn.logger)||ya})),this.disableProviderPing=(Mn==null?void 0:Mn.disableProviderPing)||!1}static async init(Mn){const rs=new dr(Mn);return await rs.initialize(),rs}async request(Mn,rs,is){const[os,as]=this.validateChain(rs);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(os).request({request:pr({},Mn),chainId:`${os}:${as}`,topic:this.session.topic,expiry:is})}sendAsync(Mn,rs,is,os){const as=new Date().getTime();this.request(Mn,is,os).then(us=>rs(null,formatJsonRpcResult(as,us))).catch(us=>rs(us,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var Mn;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(Mn=this.session)==null?void 0:Mn.topic,reason:er$1("USER_DISCONNECTED")}),await this.cleanup()}async connect(Mn){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(Mn),await this.cleanupPendingPairings(),!Mn.skipPairing)return await this.pair(Mn.pairingTopic)}async authenticate(Mn,rs){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(Mn),await this.cleanupPendingPairings();const{uri:is,response:os}=await this.client.authenticate(Mn,rs);is&&(this.uri=is,this.events.emit("display_uri",is));const as=await os();if(this.session=as.session,this.session){const us=Ha(this.session.namespaces);this.namespaces=Fi(this.namespaces,us),this.persist("namespaces",this.namespaces),this.onConnect()}return as}on(Mn,rs){this.events.on(Mn,rs)}once(Mn,rs){this.events.once(Mn,rs)}removeListener(Mn,rs){this.events.removeListener(Mn,rs)}off(Mn,rs){this.events.off(Mn,rs)}get isWalletConnect(){return!0}async pair(Mn){this.shouldAbortPairingAttempt=!1;let rs=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(rs>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:is,approval:os}=await this.client.connect({pairingTopic:Mn,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});is&&(this.uri=is,this.events.emit("display_uri",is)),await os().then(as=>{this.session=as;const us=Ha(as.namespaces);this.namespaces=Fi(this.namespaces,us),this.persist("namespaces",this.namespaces)}).catch(as=>{if(as.message!==it)throw as;rs++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(Mn,rs){try{if(!this.session)return;const[is,os]=this.validateChain(Mn),as=this.getProvider(is);as.name===ze?as.setDefaultChain(`${is}:${os}`,rs):as.setDefaultChain(os,rs)}catch(is){if(!/Please call connect/.test(is.message))throw is}}async cleanupPendingPairings(Mn={}){this.logger.info("Cleaning up inactive pairings...");const rs=this.client.pairing.getAll();if(Nr$1(rs)){for(const is of rs)Mn.deletePairings?this.client.core.expirer.set(is.topic,0):await this.client.core.relayer.subscriber.unsubscribe(is.topic);this.logger.info(`Inactive pairings cleared: ${rs.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const Mn=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[Mn]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await _e.init({core:this.providerOpts.core,logger:this.providerOpts.logger||ya,relayUrl:this.providerOpts.relayUrl||Yg,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const Mn=[...new Set(Object.keys(this.session.namespaces).map(rs=>xo(rs)))];Mi("client",this.client),Mi("events",this.events),Mi("disableProviderPing",this.disableProviderPing),Mn.forEach(rs=>{if(!this.session)return;const is=rv(rs,this.session),os=Ta(is),as=Fi(this.namespaces,this.optionalNamespaces),us=Bi(pr({},as[rs]),{accounts:is,chains:os});switch(rs){case"eip155":this.rpcProviders[rs]=new hv({namespace:us});break;case"algorand":this.rpcProviders[rs]=new dv({namespace:us});break;case"solana":this.rpcProviders[rs]=new lv({namespace:us});break;case"cosmos":this.rpcProviders[rs]=new pv({namespace:us});break;case"polkadot":this.rpcProviders[rs]=new sv({namespace:us});break;case"cip34":this.rpcProviders[rs]=new gv({namespace:us});break;case"elrond":this.rpcProviders[rs]=new vv({namespace:us});break;case"multiversx":this.rpcProviders[rs]=new _v({namespace:us});break;case"near":this.rpcProviders[rs]=new mv({namespace:us});break;default:this.rpcProviders[ze]?this.rpcProviders[ze].updateNamespace(us):this.rpcProviders[ze]=new wv({namespace:us})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",Mn=>{this.events.emit("session_ping",Mn)}),this.client.on("session_event",Mn=>{const{params:rs}=Mn,{event:is}=rs;if(is.name==="accountsChanged"){const os=is.data;os&&Nr$1(os)&&this.events.emit("accountsChanged",os.map(iv))}else if(is.name==="chainChanged"){const os=rs.chainId,as=rs.event.data,us=xo(os),ds=Wi(os)!==Wi(as)?`${us}:${Wi(as)}`:os;this.onChainChanged(ds)}else this.events.emit(is.name,is.data);this.events.emit("session_event",Mn)}),this.client.on("session_update",({topic:Mn,params:rs})=>{var is;const{namespaces:os}=rs,as=(is=this.client)==null?void 0:is.session.get(Mn);this.session=Bi(pr({},as),{namespaces:os}),this.onSessionUpdate(),this.events.emit("session_update",{topic:Mn,params:rs})}),this.client.on("session_delete",async Mn=>{await this.cleanup(),this.events.emit("session_delete",Mn),this.events.emit("disconnect",Bi(pr({},er$1("USER_DISCONNECTED")),{data:Mn.topic}))}),this.on(Tt.DEFAULT_CHAIN_CHANGED,Mn=>{this.onChainChanged(Mn,!0)})}getProvider(Mn){return this.rpcProviders[Mn]||this.rpcProviders[ze]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(Mn=>{var rs;this.getProvider(Mn).updateNamespace((rs=this.session)==null?void 0:rs.namespaces[Mn])})}setNamespaces(Mn){const{namespaces:rs,optionalNamespaces:is,sessionProperties:os}=Mn;rs&&Object.keys(rs).length&&(this.namespaces=rs),is&&Object.keys(is).length&&(this.optionalNamespaces=is),this.sessionProperties=os,this.persist("namespaces",rs),this.persist("optionalNamespaces",is)}validateChain(Mn){const[rs,is]=(Mn==null?void 0:Mn.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[rs,is];if(rs&&!Object.keys(this.namespaces||{}).map(us=>xo(us)).includes(rs))throw new Error(`Namespace '${rs}' is not configured. Please call connect() first with namespace config.`);if(rs&&is)return[rs,is];const os=xo(Object.keys(this.namespaces)[0]),as=this.rpcProviders[os].getDefaultChain();return[os,as]}async requestAccounts(){const[Mn]=this.validateChain();return await this.getProvider(Mn).requestAccounts()}onChainChanged(Mn,rs=!1){if(!this.namespaces)return;const[is,os]=this.validateChain(Mn);os&&(rs||this.getProvider(is).setDefaultChain(os),this.namespaces[is]?this.namespaces[is].defaultChain=os:this.namespaces[`${is}:${os}`]?this.namespaces[`${is}:${os}`].defaultChain=os:this.namespaces[`${is}:${os}`]={defaultChain:os},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",os))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(Mn,rs){this.client.core.storage.setItem(`${Sa}/${Mn}`,rs)}async getFromStore(Mn){return await this.client.core.storage.getItem(`${Sa}/${Mn}`)}}const WcHelpersUtil={getMethodsByChainNamespace(Fn){switch(Fn){case"solana":return["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"];case"eip155":return["personal_sign","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendRawTransaction","eth_sendTransaction","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus","wallet_getCallsStatus","wallet_grantPermissions","wallet_revokePermissions","wallet_switchEthereumChain"];default:return[]}},createNamespaces(Fn){return Fn.reduce((Mn,rs)=>{const{id:is,chainNamespace:os,rpcUrls:as}=rs,us=as.default.http[0],ds=this.getMethodsByChainNamespace(os);Mn[os]||(Mn[os]={methods:ds,events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}});const hs=`${os}:${is}`,ps=Mn[os];return ps.chains.push(hs),ps!=null&&ps.rpcMap&&us&&(ps.rpcMap[is]=us),Mn},{})},getChainsFromNamespaces(Fn={}){return Object.values(Fn).flatMap(Mn=>{const rs=Mn.chains||[],is=Mn.accounts.map(os=>{const[as,us]=os.split(":");return`${as}:${us}`});return Array.from(new Set([...rs,...is]))})}},state=proxy({providers:{eip155:void 0,solana:void 0,polkadot:void 0},providerIds:{eip155:void 0,solana:void 0,polkadot:void 0}}),ProviderUtil={state,subscribeKey(Fn,Mn){return subscribeKey(state,Fn,Mn)},subscribeProviders(Fn){return subscribe(state.providers,()=>Fn(state.providers))},setProvider(Fn,Mn){Mn&&(state.providers[Fn]=ref(Mn))},getProvider(Fn){return state.providers[Fn]},setProviderId(Fn,Mn){Mn&&(state.providerIds[Fn]=Mn)},getProviderId(Fn){return state.providerIds[Fn]},reset(){state.providers={eip155:void 0,solana:void 0,polkadot:void 0},state.providerIds={eip155:void 0,solana:void 0,polkadot:void 0}},resetChain(Fn){state.providers[Fn]=void 0,state.providerIds[Fn]=void 0}},OPTIONAL_METHODS$1=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions"];class UniversalAdapterClient{constructor(Mn){this.appKit=void 0,this.isUniversalAdapterClient=!0,this.options=void 0,this.adapterType="universal",this.reportErrors=!0;const{siweConfig:rs,metadata:is}=Mn;this.caipNetworks=Mn.networks,this.chainNamespace=ConstantsUtil$3.CHAIN.EVM,this.metadata=is,this.networkControllerClient={switchCaipNetwork:os=>{os&&this.switchNetwork(os)},getApprovedCaipNetworksData:async()=>{var us;const os=await this.getWalletConnectProvider();if(!os)return Promise.resolve({supportsAllNetworks:!1,approvedCaipNetworkIds:[]});const as=WcHelpersUtil.getChainsFromNamespaces((us=os.session)==null?void 0:us.namespaces);return Promise.resolve({supportsAllNetworks:!1,approvedCaipNetworkIds:as})}},this.connectionControllerClient={connectWalletConnect:async os=>{var us,ds,hs,ps,io,fo,mo,Ao,$o,Lo,Go;const as=await this.getWalletConnectProvider();if(!as)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");if(as.on("display_uri",Yo=>{os(Yo)}),ChainController.state.activeChain&&((hs=(ds=(us=ChainController.state)==null?void 0:us.chains)==null?void 0:ds.get(ChainController.state.activeChain))==null?void 0:hs.adapterType)==="wagmi"){const Yo=ChainController.state.chains.get(ChainController.state.activeChain);await((io=(ps=Yo==null?void 0:Yo.connectionControllerClient)==null?void 0:ps.connectWalletConnect)==null?void 0:io.call(ps,os)),this.setWalletConnectProvider()}else{const Yo=await((fo=rs==null?void 0:rs.getMessageParams)==null?void 0:fo.call(rs)),Wo=(mo=rs==null?void 0:rs.options)==null?void 0:mo.enabled,Jo=typeof(as==null?void 0:as.authenticate)=="function",xl=Yo&&Object.keys(Yo||{}).length>0;if(rs&&Wo&&Yo&&Jo&&xl&&ChainController.state.activeChain===ConstantsUtil$3.CHAIN.EVM){const{SIWEController:_l,getDidChainId:Tl,getDidAddress:Sl}=await __vitePreload(async()=>{const{SIWEController:Ol,getDidChainId:Rl,getDidAddress:Vo}=await import("./index-Bt9bEBgv.js");return{SIWEController:Ol,getDidChainId:Rl,getDidAddress:Vo}},[]),$l=(Ao=this.caipNetworks)==null?void 0:Ao.filter(Ol=>Ol.chainNamespace===ConstantsUtil$3.CHAIN.EVM).map(Ol=>Ol.caipNetworkId);Yo.chains=($o=this.caipNetworks)==null?void 0:$o.filter(Ol=>Ol.chainNamespace===ConstantsUtil$3.CHAIN.EVM).map(Ol=>Ol.id);const Pl=await as.authenticate({nonce:await((Lo=rs==null?void 0:rs.getNonce)==null?void 0:Lo.call(rs)),methods:[...OPTIONAL_METHODS$1],...Yo,chains:$l}),Dl=(Go=Pl==null?void 0:Pl.auths)==null?void 0:Go[0];if(Dl){const{p:Ol,s:Rl}=Dl,Vo=Tl(Ol.iss),jo=Sl(Ol.iss);jo&&Vo&&_l.setSession({address:jo,chainId:parseInt(Vo,10)});try{const Ho=as.client.formatAuthMessage({request:Ol,iss:Ol.iss});await _l.verifyMessage({message:Ho,signature:Rl.s,cacao:Dl})}catch(Ho){throw console.error("Error verifying message",Ho),await as.disconnect().catch(console.error),await _l.signOut().catch(console.error),Ho}}}else{const _l=WcHelpersUtil.createNamespaces(this.caipNetworks);await as.connect({optionalNamespaces:_l})}this.setWalletConnectProvider()}},disconnect:async()=>{var os,as,us,ds;if(SafeLocalStorage.removeItem(SafeLocalStorageKeys.WALLET_ID),(os=rs==null?void 0:rs.options)!=null&&os.signOutOnDisconnect){const{SIWEController:hs}=await __vitePreload(async()=>{const{SIWEController:ps}=await import("./index-Bt9bEBgv.js");return{SIWEController:ps}},[]);await hs.signOut()}await((as=this.walletConnectProvider)==null?void 0:as.disconnect()),(us=this.appKit)==null||us.resetAccount(ConstantsUtil$3.CHAIN.EVM),(ds=this.appKit)==null||ds.resetAccount(ConstantsUtil$3.CHAIN.SOLANA)},signMessage:async os=>{const as=await this.getWalletConnectProvider(),us=ChainController.state.activeCaipAddress,ds=CoreHelperUtil.getPlainAddress(us);if(!as)throw new Error("connectionControllerClient:signMessage - provider is undefined");return await as.request({method:"personal_sign",params:[os,ds]})},estimateGas:async()=>await Promise.resolve(BigInt(0)),getEnsAvatar:async os=>await Promise.resolve(os),getEnsAddress:async os=>await Promise.resolve(os),writeContract:async()=>await Promise.resolve("0x"),getCapabilities:async os=>{var ds,hs;const as=await this.getWalletConnectProvider();if(!as)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");const us=(hs=(ds=as.session)==null?void 0:ds.sessionProperties)==null?void 0:hs.capabilities;if(us){const io=this.parseWalletCapabilities(us)[os];if(io)return io}return await as.request({method:"wallet_getCapabilities",params:[os]})},grantPermissions:async os=>{const as=await this.getWalletConnectProvider();if(!as)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return as.request({method:"wallet_grantPermissions",params:os})},revokePermissions:async os=>{const as=await this.getWalletConnectProvider();if(!as)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return as.request({method:"wallet_revokePermissions",params:[os]})},sendTransaction:async()=>await Promise.resolve("0x"),parseUnits:()=>BigInt(0),formatUnits:()=>""}}construct(Mn,rs){this.appKit=Mn,this.options=rs,this.createProvider(),this.syncRequestedNetworks(this.caipNetworks),this.syncConnectors()}switchNetwork(Mn){Mn&&this.walletConnectProvider&&this.walletConnectProvider.setDefaultChain(Mn.caipNetworkId)}async disconnect(){var Mn,rs;this.walletConnectProvider&&(await this.walletConnectProvider.disconnect(),(Mn=this.appKit)==null||Mn.resetAccount(ConstantsUtil$3.CHAIN.EVM),(rs=this.appKit)==null||rs.resetAccount(ConstantsUtil$3.CHAIN.SOLANA))}async getWalletConnectProvider(){if(!this.walletConnectProvider)try{await this.createProvider()}catch{throw new Error("EthereumAdapter:getWalletConnectProvider - Cannot create provider")}return this.walletConnectProvider}createProvider(){var Mn,rs;return!this.walletConnectProviderInitPromise&&typeof window<"u"&&((Mn=this.options)!=null&&Mn.projectId)&&(this.walletConnectProviderInitPromise=this.initWalletConnectProvider((rs=this.options)==null?void 0:rs.projectId)),this.walletConnectProviderInitPromise}async initWalletConnectProvider(Mn){const rs=LoggerUtil.createLogger((os,...as)=>{if(os.message.includes(ErrorUtil.UniversalProviderErrors.UNAUTHORIZED_DOMAIN_NOT_ALLOWED)){this.reportErrors&&(AlertController.open(ErrorUtil.ALERT_ERRORS.INVALID_APP_CONFIGURATION,"error"),this.reportErrors=!1);return}console.error(...as)}),is={projectId:Mn,metadata:{name:this.metadata?this.metadata.name:"",description:this.metadata?this.metadata.description:"",url:this.metadata?this.metadata.url:"",icons:this.metadata?this.metadata.icons:[""]},logger:rs};this.walletConnectProvider=await dr.init(is),await this.checkActiveWalletConnectProvider()}syncRequestedNetworks(Mn){[...new Set(Mn.map(is=>is.chainNamespace))].filter(is=>!!is).forEach(is=>{var os;(os=this.appKit)==null||os.setRequestedCaipNetworks(Mn.filter(as=>as.chainNamespace===is),is)})}async checkActiveWalletConnectProvider(){const Mn=await this.getWalletConnectProvider(),rs=SafeLocalStorage.getItem(SafeLocalStorageKeys.WALLET_ID);Mn&&rs===ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID&&this.setWalletConnectProvider()}setWalletConnectProvider(){var rs,is;SafeLocalStorage.setItem(SafeLocalStorageKeys.WALLET_ID,ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID);const Mn=(is=(rs=this.walletConnectProvider)==null?void 0:rs.session)==null?void 0:is.namespaces;if(Mn){Object.keys(Mn).reverse().forEach(ds=>{var ps,io,fo;const hs=(ps=Mn==null?void 0:Mn[ds])==null?void 0:ps.accounts[0];ProviderUtil.setProvider(ds,this.walletConnectProvider),ProviderUtil.setProviderId(ds,"walletConnect"),(io=this.appKit)==null||io.setApprovedCaipNetworksData(ds),hs&&((fo=this.appKit)==null||fo.setCaipAddress(hs,ds))});const as=StorageUtil.getStoredActiveCaipNetwork(),us=ChainController.state.activeCaipNetwork;try{as?ChainController.setActiveCaipNetwork(as):(!us||!ChainController.getAllApprovedCaipNetworkIds().includes(us.caipNetworkId))&&this.setDefaultNetwork(Mn)}catch(ds){console.warn(">>> Error setting active caip network",ds)}}this.syncAccount(),this.watchWalletConnect()}setDefaultNetwork(Mn){var is;const rs=(is=this.caipNetworks[0])==null?void 0:is.chainNamespace;if(rs){const os=Mn==null?void 0:Mn[rs];if(os!=null&&os.chains){const as=os.chains[0];if(as){const us=ChainController.getRequestedCaipNetworks(rs);if(us){const ds=us.find(hs=>hs.caipNetworkId===as);ds&&ChainController.setActiveCaipNetwork(ds)}}}}}async watchWalletConnect(){var us;const Mn=await this.getWalletConnectProvider(),rs=((us=Mn==null?void 0:Mn.session)==null?void 0:us.namespaces)||{};function is(){Object.keys(rs).forEach(ds=>{AccountController.resetAccount(ds)}),ConnectionController.resetWcConnection(),SafeLocalStorage.removeItem(SafeLocalStorageKeys.WALLET_ID),Mn==null||Mn.removeListener("disconnect",is),Mn==null||Mn.removeListener("accountsChanged",os)}const os=ds=>{ds.length>0&&this.syncAccount()},as=ds=>{var io,fo,mo;const hs=this.caipNetworks.find(Ao=>Ao.id==ds),ps=(io=this.appKit)==null?void 0:io.getCaipNetwork();if(!hs){const Ao=((fo=this.appKit)==null?void 0:fo.getActiveChainNamespace())||ConstantsUtil$3.CHAIN.EVM;ChainController.setActiveCaipNetwork({id:ds,caipNetworkId:`${Ao}:${ds}`,name:"Unknown Network",chainNamespace:Ao,nativeCurrency:{name:"",decimals:0,symbol:""},rpcUrls:{default:{http:[]}}});return}(!ps||(ps==null?void 0:ps.id)!==(hs==null?void 0:hs.id))&&((mo=this.appKit)==null||mo.setCaipNetwork(hs))};Mn&&(Mn.on("disconnect",is),Mn.on("accountsChanged",os),Mn.on("chainChanged",as))}getProviderData(){var os,as,us,ds;const Mn=((as=(os=this.walletConnectProvider)==null?void 0:os.session)==null?void 0:as.namespaces)||{},rs=((us=this.appKit)==null?void 0:us.getIsConnectedState())||!1,is=((ds=this.appKit)==null?void 0:ds.getPreferredAccountType())||"";return{provider:this.walletConnectProvider,namespaces:Mn,namespaceKeys:Mn?Object.keys(Mn):[],isConnected:rs,preferredAccountType:is}}syncAccount(){var as,us,ds,hs;const{namespaceKeys:Mn,namespaces:rs}=this.getProviderData(),is=(as=this.appKit)==null?void 0:as.getPreferredAccountType();((us=this.appKit)==null?void 0:us.getIsConnectedState())||!1?Mn.forEach(async ps=>{var Ao,$o,Lo,Go,Yo;const io=ps,fo=(Ao=rs==null?void 0:rs[ps])==null?void 0:Ao.accounts[0];(($o=this.appKit)==null?void 0:$o.getCaipAddress(io))||((Lo=this.appKit)==null||Lo.setPreferredAccountType(is,io),(Go=this.appKit)==null||Go.setCaipAddress(fo,io),this.syncConnectedWalletInfo(),await Promise.all([(Yo=this.appKit)==null?void 0:Yo.setApprovedCaipNetworksData(io)])),this.syncAccounts()}):((ds=this.appKit)==null||ds.resetWcConnection(),(hs=this.appKit)==null||hs.resetNetwork(this.chainNamespace),this.syncAccounts(!0))}syncAccounts(Mn=!1){const{namespaces:rs}=this.getProviderData();Object.keys(rs).forEach(os=>{var us,ds,hs,ps;const as=(ds=(us=rs==null?void 0:rs[os])==null?void 0:us.accounts)==null?void 0:ds.map(io=>{const[,,fo]=io.split(":");return fo}).filter((io,fo,mo)=>mo.indexOf(io)===fo);Mn&&((hs=this.appKit)==null||hs.setAllAccounts([],os)),as&&((ps=this.appKit)==null||ps.setAllAccounts(as.map(io=>({address:io,type:"eoa"})),os))})}syncConnectedWalletInfo(){var os,as;const Mn=SafeLocalStorage.getItem(SafeLocalStorageKeys.WALLET_ID),rs=((as=(os=this.walletConnectProvider)==null?void 0:os.session)==null?void 0:as.namespaces)||{};Object.keys(rs).forEach(us=>{var ds,hs,ps,io,fo;(ds=this.walletConnectProvider)!=null&&ds.session?(ps=this.appKit)==null||ps.setConnectedWalletInfo({...this.walletConnectProvider.session.peer.metadata,name:this.walletConnectProvider.session.peer.metadata.name,icon:(hs=this.walletConnectProvider.session.peer.metadata.icons)==null?void 0:hs[0]},us):Mn&&((io=this.appKit)==null||io.setConnectedWalletInfo({name:Mn},ConstantsUtil$3.CHAIN.EVM),(fo=this.appKit)==null||fo.setConnectedWalletInfo({name:Mn},ConstantsUtil$3.CHAIN.SOLANA))})}syncConnectors(){var rs;const Mn=[];Mn.push({id:ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID,explorerId:PresetsUtil.ConnectorExplorerIds[ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID],imageId:PresetsUtil.ConnectorImageIds[ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID],name:PresetsUtil.ConnectorNamesMap[ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID],type:"WALLET_CONNECT",chain:this.chainNamespace}),(rs=this.appKit)==null||rs.setConnectors(Mn)}parseWalletCapabilities(Mn){try{return JSON.parse(Mn)}catch{throw new Error("Error parsing wallet capabilities")}}}let isInitialized=!1;class AppKit{constructor(Mn){var rs;this.initPromise=void 0,this.setStatus=(is,os)=>{AccountController.setStatus(is,os)},this.getIsConnectedState=()=>!!ChainController.state.activeCaipAddress,this.setAllAccounts=(is,os)=>{AccountController.setAllAccounts(is,os),OptionsController.setHasMultipleAddresses((is==null?void 0:is.length)>1)},this.addAddressLabel=(is,os,as)=>{AccountController.addAddressLabel(is,os,as)},this.removeAddressLabel=(is,os)=>{AccountController.removeAddressLabel(is,os)},this.getCaipAddress=is=>ChainController.state.activeChain===is||!is?ChainController.state.activeCaipAddress:ChainController.getAccountProp("caipAddress",is),this.getAddress=is=>ChainController.state.activeChain===is||!is?AccountController.state.address:ChainController.getAccountProp("address",is),this.getProvider=()=>AccountController.state.provider,this.getPreferredAccountType=()=>AccountController.state.preferredAccountType,this.setCaipAddress=(is,os)=>{AccountController.setCaipAddress(is,os)},this.setProvider=(is,os)=>{AccountController.setProvider(is,os)},this.setBalance=(is,os,as)=>{AccountController.setBalance(is,os,as)},this.setProfileName=(is,os)=>{AccountController.setProfileName(is,os)},this.setProfileImage=(is,os)=>{AccountController.setProfileImage(is,os)},this.resetAccount=is=>{AccountController.resetAccount(is)},this.setCaipNetwork=is=>{ChainController.setActiveCaipNetwork(is)},this.getCaipNetwork=is=>{var os;return is?(os=ChainController.getRequestedCaipNetworks(is).filter(as=>as.chainNamespace===is))==null?void 0:os[0]:ChainController.state.activeCaipNetwork},this.getCaipNetworkId=()=>{const is=this.getCaipNetwork();if(is)return is.id},this.getCaipNetworks=is=>ChainController.getRequestedCaipNetworks(is),this.getActiveChainNamespace=()=>ChainController.state.activeChain,this.setRequestedCaipNetworks=(is,os)=>{ChainController.setRequestedCaipNetworks(is,os)},this.getApprovedCaipNetworkIds=()=>ChainController.getAllApprovedCaipNetworkIds(),this.setApprovedCaipNetworksData=is=>ChainController.setApprovedCaipNetworksData(is),this.resetNetwork=is=>{ChainController.resetNetwork(is)},this.setConnectors=is=>{const os=[...ConnectorController.getConnectors(),...is];ConnectorController.setConnectors(os)},this.addConnector=is=>{ConnectorController.addConnector(is)},this.getConnectors=()=>ConnectorController.getConnectors(),this.resetWcConnection=()=>{ConnectionController.resetWcConnection()},this.fetchIdentity=is=>BlockchainApiController.fetchIdentity(is),this.setAddressExplorerUrl=(is,os)=>{AccountController.setAddressExplorerUrl(is,os)},this.setSmartAccountDeployed=(is,os)=>{AccountController.setSmartAccountDeployed(is,os)},this.setConnectedWalletInfo=(is,os)=>{AccountController.setConnectedWalletInfo(is,os)},this.setSmartAccountEnabledNetworks=(is,os)=>{ChainController.setSmartAccountEnabledNetworks(is,os)},this.setPreferredAccountType=(is,os)=>{AccountController.setPreferredAccountType(is,os)},this.getReownName=is=>EnsController.getNamesForAddress(is),this.resolveReownName=async is=>{var us;const os=await EnsController.resolveName(is);return((us=(Object.values(os==null?void 0:os.addresses)||[])[0])==null?void 0:us.address)||!1},this.setEIP6963Enabled=is=>{OptionsController.setEIP6963Enabled(is)},this.setClientId=is=>{BlockchainApiController.setClientId(is)},this.getConnectorImage=is=>AssetUtil.getConnectorImage(is),this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.adapter=(rs=Mn.adapters)==null?void 0:rs[0],this.caipNetworks=this.extendCaipNetworks(Mn),this.defaultCaipNetwork=this.extendDefaultCaipNetwork(Mn),this.initControllers(Mn),this.initOrContinue(),this.version=Mn.sdkVersion}static getInstance(){return this.instance}async open(Mn){await this.initOrContinue(),ModalController.open(Mn)}async close(){await this.initOrContinue(),ModalController.close()}setLoading(Mn){ModalController.setLoading(Mn)}getError(){return""}getChainId(){var Mn;return(Mn=ChainController.state.activeCaipNetwork)==null?void 0:Mn.id}switchNetwork(Mn){return ChainController.switchActiveNetwork(Mn)}getWalletProvider(){return ChainController.state.activeChain?ProviderUtil.state.providers[ChainController.state.activeChain]:null}getWalletProviderType(){return ChainController.state.activeChain?ProviderUtil.state.providerIds[ChainController.state.activeChain]:null}subscribeProvider(){return null}getThemeMode(){return ThemeController.state.themeMode}getThemeVariables(){return ThemeController.state.themeVariables}setThemeMode(Mn){ThemeController.setThemeMode(Mn),setColorTheme(ThemeController.state.themeMode)}setThemeVariables(Mn){ThemeController.setThemeVariables(Mn),setThemeVariables(ThemeController.state.themeVariables)}subscribeTheme(Mn){return ThemeController.subscribe(Mn)}getWalletInfo(){return AccountController.state.connectedWalletInfo}subscribeWalletInfo(Mn){return AccountController.subscribeKey("connectedWalletInfo",Mn)}subscribeShouldUpdateToAddress(Mn){AccountController.subscribeKey("shouldUpdateToAddress",Mn)}subscribeCaipNetworkChange(Mn){ChainController.subscribeKey("activeCaipNetwork",Mn)}getState(){return PublicStateController.state}subscribeState(Mn){return PublicStateController.subscribe(Mn)}showErrorMessage(Mn){SnackController.showError(Mn)}showSuccessMessage(Mn){SnackController.showSuccess(Mn)}getEvent(){return{...EventsController.state}}subscribeEvents(Mn){return EventsController.subscribe(Mn)}replace(Mn){RouterController.replace(Mn)}redirect(Mn){RouterController.push(Mn)}popTransactionStack(Mn){RouterController.popTransactionStack(Mn)}isOpen(){return ModalController.state.open}isTransactionStackEmpty(){return RouterController.state.transactionStack.length===0}isTransactionShouldReplaceView(){var Mn;return(Mn=RouterController.state.transactionStack[RouterController.state.transactionStack.length-1])==null?void 0:Mn.replace}async initControllers(Mn){var is;if(OptionsController.setDebug(Mn.debug),OptionsController.setProjectId(Mn.projectId),OptionsController.setSdkVersion(Mn.sdkVersion),!Mn.projectId){AlertController.open(ErrorUtil.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}if(this.adapters=Mn.adapters,this.setMetadata(Mn),this.initializeUniversalAdapter(Mn),this.initializeAdapters(Mn),this.setDefaultNetwork(),OptionsController.setAllWallets(Mn.allWallets),OptionsController.setIncludeWalletIds(Mn.includeWalletIds),OptionsController.setExcludeWalletIds(Mn.excludeWalletIds),Mn.excludeWalletIds&&ApiController.searchWalletByIds({ids:Mn.excludeWalletIds}),OptionsController.setFeaturedWalletIds(Mn.featuredWalletIds),OptionsController.setTokens(Mn.tokens),OptionsController.setTermsConditionsUrl(Mn.termsConditionsUrl),OptionsController.setPrivacyPolicyUrl(Mn.privacyPolicyUrl),OptionsController.setCustomWallets(Mn.customWallets),OptionsController.setFeatures(Mn.features),OptionsController.setEnableWalletConnect(Mn.enableWalletConnect!==!1),OptionsController.setEnableWallets(Mn.enableWallets!==!1),Mn.metadata&&OptionsController.setMetadata(Mn.metadata),Mn.themeMode&&ThemeController.setThemeMode(Mn.themeMode),Mn.themeVariables&&ThemeController.setThemeVariables(Mn.themeVariables),Mn.disableAppend&&OptionsController.setDisableAppend(!!Mn.disableAppend),((is=Mn.adapters)==null?void 0:is.find(os=>os.chainNamespace===ConstantsUtil$3.CHAIN.EVM))&&Mn.siweConfig){const{SIWEController:os}=await __vitePreload(async()=>{const{SIWEController:as}=await import("./index-Bt9bEBgv.js");return{SIWEController:as}},[]);os.setSIWEClient(Mn.siweConfig)}}setMetadata(Mn){var rs,is,os;typeof window>"u"||typeof document>"u"||(Mn.metadata={name:((rs=document.getElementsByTagName("title")[0])==null?void 0:rs.textContent)||"",description:((is=document.querySelector('meta[property="og:description"]'))==null?void 0:is.content)||"",url:window.location.origin,icons:[((os=document.querySelector('link[rel~="icon"]'))==null?void 0:os.href)||""]})}extendCaipNetworks(Mn){return CaipNetworksUtil.extendCaipNetworks(Mn.networks,{customNetworkImageUrls:Mn.chainImages,projectId:Mn.projectId})}extendDefaultCaipNetwork(Mn){const rs=Mn.networks.find(os=>{var as;return os.id===((as=Mn.defaultNetwork)==null?void 0:as.id)});return rs?CaipNetworksUtil.extendCaipNetwork(rs,{customNetworkImageUrls:Mn.chainImages,projectId:Mn.projectId}):void 0}initializeUniversalAdapter(Mn){var is,os;const rs={...Mn,networks:this.caipNetworks,defaultNetwork:this.defaultCaipNetwork};this.universalAdapter=new UniversalAdapterClient(rs),ChainController.initializeUniversalAdapter(this.universalAdapter,Mn.adapters||[]),(os=(is=this.universalAdapter).construct)==null||os.call(is,this,rs)}initializeAdapters(Mn){var is;const rs={...Mn,networks:this.caipNetworks,defaultNetwork:this.defaultCaipNetwork};ChainController.initialize(Mn.adapters||[]),(is=Mn.adapters)==null||is.forEach(os=>{var as;(as=os.construct)==null||as.call(os,this,rs)})}setDefaultNetwork(){const Mn=SafeLocalStorage.getItem(SafeLocalStorageKeys.ACTIVE_CAIP_NETWORK_ID),is=(Mn?this.caipNetworks.find(os=>os.caipNetworkId===Mn):void 0)||this.defaultCaipNetwork||this.caipNetworks[0];ChainController.setActiveCaipNetwork(is)}async initOrContinue(){return!this.initPromise&&!isInitialized&&CoreHelperUtil.isClient()&&(isInitialized=!0,this.initPromise=new Promise(async Mn=>{await Promise.all([__vitePreload(()=>import("./index-DYsEC-qm.js"),[]),__vitePreload(()=>import("./w3m-modal-_REIw8Av.js"),[])]);const rs=document.createElement("w3m-modal");OptionsController.state.disableAppend||document.body.insertAdjacentElement("beforeend",rs),Mn()})),this.initPromise}}let modal$1;function getAppKit(Fn){Fn&&(modal$1=Fn)}function useAppKit(){if(!modal$1)throw new Error('Please call "createAppKit" before using "useAppKit" hook');async function Fn(rs){await(modal$1==null?void 0:modal$1.open(rs))}async function Mn(){await(modal$1==null?void 0:modal$1.close())}return{open:Fn,close:Mn}}const PACKAGE_VERSION="1.1.6";var __decorate$1G=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAccountButton=class extends h$3{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.caipAddress=ChainController.state.activeCaipAddress,this.balanceVal=AccountController.state.balance,this.balanceSymbol=AccountController.state.balanceSymbol,this.profileName=AccountController.state.profileName,this.profileImage=AccountController.state.profileImage,this.network=ChainController.state.activeCaipNetwork,this.networkImage=this.network?AssetUtil.getNetworkImage(this.network):void 0,this.isSupported=!0,this.unsubscribe.push(AssetController.subscribeNetworkImages(()=>{var Mn,rs;this.networkImage=(rs=(Mn=this.network)==null?void 0:Mn.assets)!=null&&rs.imageId?AssetUtil.getNetworkImage(this.network):void 0}),ChainController.subscribeKey("activeCaipAddress",Mn=>this.caipAddress=Mn),AccountController.subscribeKey("balance",Mn=>this.balanceVal=Mn),AccountController.subscribeKey("balanceSymbol",Mn=>this.balanceSymbol=Mn),AccountController.subscribeKey("profileName",Mn=>this.profileName=Mn),AccountController.subscribeKey("profileImage",Mn=>this.profileImage=Mn),ChainController.subscribeKey("activeCaipNetwork",Mn=>{var rs;this.network=Mn,this.networkImage=(rs=Mn==null?void 0:Mn.assets)!=null&&rs.imageId?AssetUtil.getNetworkImage(Mn):void 0,this.isSupported=Mn!=null&&Mn.chainNamespace?ChainController.checkIfSupportedNetwork(Mn==null?void 0:Mn.chainNamespace):!0}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){if(!ChainController.state.activeChain)return null;const Mn=this.balance==="show";return ke`
      <wui-account-button
        .disabled=${!!this.disabled}
        .isUnsupportedChain=${!this.isSupported}
        address=${to$2(CoreHelperUtil.getPlainAddress(this.caipAddress))}
        profileName=${to$2(this.profileName)}
        networkSrc=${to$2(this.networkImage)}
        avatarSrc=${to$2(this.profileImage)}
        balance=${Mn?CoreHelperUtil.formatBalance(this.balanceVal,this.balanceSymbol):""}
        @click=${this.onClick.bind(this)}
        data-testid="account-button"
        .charsStart=${this.charsStart}
        .charsEnd=${this.charsEnd}
      >
      </wui-account-button>
    `}onClick(){this.isSupported?ModalController.open():ModalController.open({view:"UnsupportedChain"})}};__decorate$1G([n$4({type:Boolean})],W3mAccountButton.prototype,"disabled",void 0);__decorate$1G([n$4()],W3mAccountButton.prototype,"balance",void 0);__decorate$1G([n$4()],W3mAccountButton.prototype,"charsStart",void 0);__decorate$1G([n$4()],W3mAccountButton.prototype,"charsEnd",void 0);__decorate$1G([r$5()],W3mAccountButton.prototype,"caipAddress",void 0);__decorate$1G([r$5()],W3mAccountButton.prototype,"balanceVal",void 0);__decorate$1G([r$5()],W3mAccountButton.prototype,"balanceSymbol",void 0);__decorate$1G([r$5()],W3mAccountButton.prototype,"profileName",void 0);__decorate$1G([r$5()],W3mAccountButton.prototype,"profileImage",void 0);__decorate$1G([r$5()],W3mAccountButton.prototype,"network",void 0);__decorate$1G([r$5()],W3mAccountButton.prototype,"networkImage",void 0);__decorate$1G([r$5()],W3mAccountButton.prototype,"isSupported",void 0);W3mAccountButton=__decorate$1G([customElement("w3m-account-button")],W3mAccountButton);const styles$15=i$4`
  :host {
    display: block;
    width: max-content;
  }
`;var __decorate$1F=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mButton=class extends h$3{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.caipAddress=ChainController.state.activeCaipAddress,this.isLoading=ModalController.state.loading}firstUpdated(){this.unsubscribe.push(ChainController.subscribeKey("activeCaipAddress",Mn=>this.caipAddress=Mn),ModalController.subscribeKey("loading",Mn=>this.isLoading=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return this.caipAddress&&!this.isLoading?ke`
          <w3m-account-button
            .disabled=${!!this.disabled}
            balance=${to$2(this.balance)}
            .charsStart=${to$2(this.charsStart)}
            .charsEnd=${to$2(this.charsEnd)}
          >
          </w3m-account-button>
        `:ke`
          <w3m-connect-button
            size=${to$2(this.size)}
            label=${to$2(this.label)}
            loadingLabel=${to$2(this.loadingLabel)}
          ></w3m-connect-button>
        `}};W3mButton.styles=styles$15;__decorate$1F([n$4({type:Boolean})],W3mButton.prototype,"disabled",void 0);__decorate$1F([n$4()],W3mButton.prototype,"balance",void 0);__decorate$1F([n$4()],W3mButton.prototype,"size",void 0);__decorate$1F([n$4()],W3mButton.prototype,"label",void 0);__decorate$1F([n$4()],W3mButton.prototype,"loadingLabel",void 0);__decorate$1F([n$4()],W3mButton.prototype,"charsStart",void 0);__decorate$1F([n$4()],W3mButton.prototype,"charsEnd",void 0);__decorate$1F([r$5()],W3mButton.prototype,"caipAddress",void 0);__decorate$1F([r$5()],W3mButton.prototype,"isLoading",void 0);W3mButton=__decorate$1F([customElement("w3m-button")],W3mButton);var __decorate$1E=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectButton=class extends h$3{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=ModalController.state.open,this.loading=ModalController.state.loading,this.unsubscribe.push(ModalController.subscribe(Mn=>{this.open=Mn.open,this.loading=Mn.loading}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const Mn=this.loading||this.open;return ke`
      <wui-connect-button
        size=${to$2(this.size)}
        .loading=${Mn}
        @click=${this.onClick.bind(this)}
        data-testid="connect-button"
      >
        ${Mn?this.loadingLabel:this.label}
      </wui-connect-button>
    `}onClick(){this.open?ModalController.close():this.loading||ModalController.open()}};__decorate$1E([n$4()],W3mConnectButton.prototype,"size",void 0);__decorate$1E([n$4()],W3mConnectButton.prototype,"label",void 0);__decorate$1E([n$4()],W3mConnectButton.prototype,"loadingLabel",void 0);__decorate$1E([r$5()],W3mConnectButton.prototype,"open",void 0);__decorate$1E([r$5()],W3mConnectButton.prototype,"loading",void 0);W3mConnectButton=__decorate$1E([customElement("w3m-connect-button")],W3mConnectButton);const styles$14=i$4`
  :host {
    display: block;
    width: max-content;
  }
`;var __decorate$1D=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mNetworkButton=class extends h$3{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=ChainController.state.activeCaipNetwork,this.networkImage=this.network?AssetUtil.getNetworkImage(this.network):void 0,this.caipAddress=ChainController.state.activeCaipAddress,this.loading=ModalController.state.loading,this.isSupported=!0,this.unsubscribe.push(AssetController.subscribeNetworkImages(()=>{var Mn,rs;this.networkImage=(rs=(Mn=this.network)==null?void 0:Mn.assets)!=null&&rs.imageId?AssetUtil.getNetworkImage(this.network):void 0}),ChainController.subscribeKey("activeCaipAddress",Mn=>{this.caipAddress=Mn}),ChainController.subscribeKey("activeCaipNetwork",Mn=>{var rs;this.network=Mn,this.networkImage=(rs=Mn==null?void 0:Mn.assets)!=null&&rs.imageId?AssetUtil.getNetworkImage(Mn):void 0,this.isSupported=Mn!=null&&Mn.chainNamespace?ChainController.checkIfSupportedNetwork(Mn.chainNamespace):!0}),ModalController.subscribeKey("loading",Mn=>this.loading=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const Mn=this.network?ChainController.checkIfSupportedNetwork(this.network.chainNamespace):!0;return ke`
      <wui-network-button
        data-testid="wui-network-button"
        .disabled=${!!(this.disabled||this.loading)}
        .isUnsupportedChain=${!Mn}
        imageSrc=${to$2(this.networkImage)}
        @click=${this.onClick.bind(this)}
      >
        ${this.getLabel()}
        <slot></slot>
      </wui-network-button>
    `}getLabel(){return this.network?this.isSupported?this.network.name:"Switch Network":this.label?this.label:this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(EventsController.sendEvent({type:"track",event:"CLICK_NETWORKS"}),ModalController.open({view:"Networks"}))}};W3mNetworkButton.styles=styles$14;__decorate$1D([n$4({type:Boolean})],W3mNetworkButton.prototype,"disabled",void 0);__decorate$1D([n$4({type:String})],W3mNetworkButton.prototype,"label",void 0);__decorate$1D([r$5()],W3mNetworkButton.prototype,"network",void 0);__decorate$1D([r$5()],W3mNetworkButton.prototype,"networkImage",void 0);__decorate$1D([r$5()],W3mNetworkButton.prototype,"caipAddress",void 0);__decorate$1D([r$5()],W3mNetworkButton.prototype,"loading",void 0);__decorate$1D([r$5()],W3mNetworkButton.prototype,"isSupported",void 0);W3mNetworkButton=__decorate$1D([customElement("w3m-network-button")],W3mNetworkButton);const styles$13=i$4`
  :host {
    --prev-height: 0px;
    --new-height: 0px;
    display: block;
  }

  div.w3m-router-container {
    transform: translateY(0);
    opacity: 1;
  }

  div.w3m-router-container[view-direction='prev'] {
    animation:
      slide-left-out 150ms forwards ease,
      slide-left-in 150ms forwards ease;
    animation-delay: 0ms, 200ms;
  }

  div.w3m-router-container[view-direction='next'] {
    animation:
      slide-right-out 150ms forwards ease,
      slide-right-in 150ms forwards ease;
    animation-delay: 0ms, 200ms;
  }

  @keyframes slide-left-out {
    from {
      transform: translateX(0px);
      opacity: 1;
    }
    to {
      transform: translateX(10px);
      opacity: 0;
    }
  }

  @keyframes slide-left-in {
    from {
      transform: translateX(-10px);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }

  @keyframes slide-right-out {
    from {
      transform: translateX(0px);
      opacity: 1;
    }
    to {
      transform: translateX(-10px);
      opacity: 0;
    }
  }

  @keyframes slide-right-in {
    from {
      transform: translateX(10px);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
`;var define_process_env_default={};const ConstantsUtil={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}],SECURE_SITE_ORIGIN:define_process_env_default.NEXT_PUBLIC_SECURE_SITE_ORIGIN||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150}};var __decorate$1C=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mRouter=class extends h$3{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=RouterController.state.view,this.viewDirection="",this.unsubscribe.push(RouterController.subscribeKey("view",Mn=>this.onViewChange(Mn)))}firstUpdated(){this.resizeObserver=new ResizeObserver(([Mn])=>{const rs=`${Mn==null?void 0:Mn.contentRect.height}px`;this.prevHeight!=="0px"&&(this.style.setProperty("--prev-height",this.prevHeight),this.style.setProperty("--new-height",rs),this.style.animation="w3m-view-height 150ms forwards ease",this.style.height="auto"),setTimeout(()=>{this.prevHeight=rs,this.style.animation="unset"},ConstantsUtil.ANIMATION_DURATIONS.ModalHeight)}),this.resizeObserver.observe(this.getWrapper())}disconnectedCallback(){var Mn;(Mn=this.resizeObserver)==null||Mn.unobserve(this.getWrapper()),this.unsubscribe.forEach(rs=>rs())}render(){return ke`<div class="w3m-router-container" view-direction="${this.viewDirection}">
      ${this.viewTemplate()}
    </div>`}viewTemplate(){switch(this.view){case"AccountSettings":return ke`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return ke`<w3m-account-view></w3m-account-view>`;case"AllWallets":return ke`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return ke`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return ke`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return ke`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":return ke`<w3m-connect-view></w3m-connect-view>`;case"Create":return ke`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return ke`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingExternal":return ke`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return ke`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return ke`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return ke`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return ke`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"Downloads":return ke`<w3m-downloads-view></w3m-downloads-view>`;case"EmailVerifyOtp":return ke`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return ke`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return ke`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return ke`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return ke`<w3m-network-switch-view></w3m-network-switch-view>`;case"Profile":return ke`<w3m-profile-view></w3m-profile-view>`;case"SelectAddresses":return ke`<w3m-select-addresses-view></w3m-select-addresses-view>`;case"SwitchAddress":return ke`<w3m-switch-address-view></w3m-switch-address-view>`;case"Transactions":return ke`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return ke`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampActivity":return ke`<w3m-onramp-activity-view></w3m-onramp-activity-view>`;case"OnRampTokenSelect":return ke`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return ke`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return ke`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpgradeToSmartAccount":return ke`<w3m-upgrade-to-smart-account-view></w3m-upgrade-to-smart-account-view>`;case"UpdateEmailWallet":return ke`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return ke`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return ke`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return ke`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return ke`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return ke`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return ke`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return ke`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return ke`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return ke`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WhatIsABuy":return ke`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return ke`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return ke`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return ke`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return ke`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return ke`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return ke`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return ke`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return ke`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return ke`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return ke`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return ke`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;default:return ke`<w3m-connect-view></w3m-connect-view>`}}onViewChange(Mn){TooltipController.hide();let rs=ConstantsUtil.VIEW_DIRECTION.Next;const{history:is}=RouterController.state;is.length<this.prevHistoryLength&&(rs=ConstantsUtil.VIEW_DIRECTION.Prev),this.prevHistoryLength=is.length,this.viewDirection=rs,setTimeout(()=>{this.view=Mn},ConstantsUtil.ANIMATION_DURATIONS.ViewTransition)}getWrapper(){var Mn;return(Mn=this.shadowRoot)==null?void 0:Mn.querySelector("div")}};W3mRouter.styles=styles$13;__decorate$1C([r$5()],W3mRouter.prototype,"view",void 0);__decorate$1C([r$5()],W3mRouter.prototype,"viewDirection",void 0);W3mRouter=__decorate$1C([customElement("w3m-router")],W3mRouter);const styles$12=i$4`
  :host > wui-flex {
    width: 100%;
    max-width: 360px;
  }

  :host > wui-flex > wui-flex {
    border-radius: var(--wui-border-radius-l);
    width: 100%;
  }

  .amounts-container {
    width: 100%;
  }
`;var __decorate$1B=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const PAYMENT_CURRENCY_SYMBOLS={USD:"$",EUR:"€",GBP:"£"},BUY_PRESET_AMOUNTS=[100,250,500,1e3];let W3mOnrampWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.caipAddress=ChainController.state.activeCaipAddress,this.loading=ModalController.state.loading,this.paymentCurrency=OnRampController.state.paymentCurrency,this.paymentAmount=OnRampController.state.paymentAmount,this.purchaseAmount=OnRampController.state.purchaseAmount,this.quoteLoading=OnRampController.state.quotesLoading,this.unsubscribe.push(ChainController.subscribeKey("activeCaipAddress",Mn=>this.caipAddress=Mn),ModalController.subscribeKey("loading",Mn=>{this.loading=Mn}),OnRampController.subscribe(Mn=>{this.paymentCurrency=Mn.paymentCurrency,this.paymentAmount=Mn.paymentAmount,this.purchaseAmount=Mn.purchaseAmount,this.quoteLoading=Mn.quotesLoading}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return ke`
      <wui-flex flexDirection="column" justifyContent="center" alignItems="center">
        <wui-flex flexDirection="column" alignItems="center" gap="xs">
          <w3m-onramp-input
            type="Fiat"
            @inputChange=${this.onPaymentAmountChange.bind(this)}
            .value=${this.paymentAmount||0}
          ></w3m-onramp-input>
          <w3m-onramp-input
            type="Token"
            .value=${this.purchaseAmount||0}
            .loading=${this.quoteLoading}
          ></w3m-onramp-input>
          <wui-flex justifyContent="space-evenly" class="amounts-container" gap="xs">
            ${BUY_PRESET_AMOUNTS.map(Mn=>{var rs;return ke`<wui-button
                  variant=${this.paymentAmount===Mn?"accent":"neutral"}
                  size="md"
                  textVariant="paragraph-600"
                  fullWidth
                  @click=${()=>this.selectPresetAmount(Mn)}
                  >${`${PAYMENT_CURRENCY_SYMBOLS[((rs=this.paymentCurrency)==null?void 0:rs.id)||"USD"]} ${Mn}`}</wui-button
                >`})}
          </wui-flex>
          ${this.templateButton()}
        </wui-flex>
      </wui-flex>
    `}templateButton(){return this.caipAddress?ke`<wui-button
          @click=${this.getQuotes.bind(this)}
          variant="main"
          fullWidth
          size="lg"
          borderRadius="xs"
        >
          Get quotes
        </wui-button>`:ke`<wui-button
          @click=${this.openModal.bind(this)}
          variant="accent"
          fullWidth
          size="lg"
          borderRadius="xs"
        >
          Connect wallet
        </wui-button>`}getQuotes(){this.loading||ModalController.open({view:"OnRampProviders"})}openModal(){ModalController.open({view:"Connect"})}async onPaymentAmountChange(Mn){OnRampController.setPaymentAmount(Number(Mn.detail)),await OnRampController.getQuote()}async selectPresetAmount(Mn){OnRampController.setPaymentAmount(Mn),await OnRampController.getQuote()}};W3mOnrampWidget.styles=styles$12;__decorate$1B([n$4({type:Boolean})],W3mOnrampWidget.prototype,"disabled",void 0);__decorate$1B([r$5()],W3mOnrampWidget.prototype,"caipAddress",void 0);__decorate$1B([r$5()],W3mOnrampWidget.prototype,"loading",void 0);__decorate$1B([r$5()],W3mOnrampWidget.prototype,"paymentCurrency",void 0);__decorate$1B([r$5()],W3mOnrampWidget.prototype,"paymentAmount",void 0);__decorate$1B([r$5()],W3mOnrampWidget.prototype,"purchaseAmount",void 0);__decorate$1B([r$5()],W3mOnrampWidget.prototype,"quoteLoading",void 0);W3mOnrampWidget=__decorate$1B([customElement("w3m-onramp-widget")],W3mOnrampWidget);var __decorate$1A=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAccountSettingsView=class extends h$3{constructor(){super(),this.usubscribe=[],this.networkImages=AssetController.state.networkImages,this.address=AccountController.state.address,this.profileImage=AccountController.state.profileImage,this.profileName=AccountController.state.profileName,this.network=ChainController.state.activeCaipNetwork,this.preferredAccountType=AccountController.state.preferredAccountType,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.usubscribe.push(AccountController.subscribe(Mn=>{Mn.address?(this.address=Mn.address,this.profileImage=Mn.profileImage,this.profileName=Mn.profileName,this.preferredAccountType=Mn.preferredAccountType):ModalController.close()}),AccountController.subscribeKey("preferredAccountType",Mn=>this.preferredAccountType=Mn),ChainController.subscribeKey("activeCaipNetwork",Mn=>{Mn!=null&&Mn.id&&(this.network=Mn)}))}disconnectedCallback(){this.usubscribe.forEach(Mn=>Mn())}render(){var rs,is,os;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const Mn=this.networkImages[((is=(rs=this.network)==null?void 0:rs.assets)==null?void 0:is.imageId)??""];return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        gap="l"
        .padding=${["0","xl","m","xl"]}
      >
        <wui-avatar
          alt=${this.address}
          address=${this.address}
          imageSrc=${to$2(this.profileImage)}
          size="2lg"
        ></wui-avatar>
        <wui-flex flexDirection="column" alignItems="center">
          <wui-flex gap="3xs" alignItems="center" justifyContent="center">
            <wui-text variant="title-6-600" color="fg-100" data-testid="account-settings-address">
              ${UiHelperUtil.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
            </wui-text>
            <wui-icon-link
              size="md"
              icon="copy"
              iconColor="fg-200"
              @click=${this.onCopyAddress}
            ></wui-icon-link>
          </wui-flex>
        </wui-flex>
      </wui-flex>
      <wui-flex flexDirection="column" gap="m">
        <wui-flex flexDirection="column" gap="xs" .padding=${["0","l","m","l"]}>
          ${this.authCardTemplate()}
          <w3m-account-auth-button></w3m-account-auth-button>
          <wui-list-item
            .variant=${Mn?"image":"icon"}
            iconVariant="overlay"
            icon="networkPlaceholder"
            imageSrc=${to$2(Mn)}
            ?chevron=${this.isAllowedNetworkSwitch()}
            @click=${this.onNetworks.bind(this)}
            data-testid="account-switch-network-button"
          >
            <wui-text variant="paragraph-500" color="fg-100">
              ${((os=this.network)==null?void 0:os.name)??"Unknown"}
            </wui-text>
          </wui-list-item>
          ${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()}
          <wui-list-item
            variant="icon"
            iconVariant="overlay"
            icon="disconnect"
            ?chevron=${!1}
            .loading=${this.disconnecting}
            @click=${this.onDisconnect.bind(this)}
            data-testid="disconnect-button"
          >
            <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text>
          </wui-list-item>
        </wui-flex>
      </wui-flex>
    `}chooseNameButtonTemplate(){const Mn=StorageUtil.getConnectedConnector(),rs=ConnectorController.getAuthConnector();return!ChainController.checkIfNamesSupported()||!rs||Mn!=="AUTH"||this.profileName?null:ke`
      <wui-list-item
        variant="icon"
        iconVariant="overlay"
        icon="id"
        iconSize="sm"
        ?chevron=${!0}
        @click=${this.onChooseName.bind(this)}
        data-testid="account-choose-name-button"
      >
        <wui-text variant="paragraph-500" color="fg-100">Choose account name </wui-text>
      </wui-list-item>
    `}authCardTemplate(){const Mn=StorageUtil.getConnectedConnector(),rs=ConnectorController.getAuthConnector(),{origin:is}=location;return!rs||Mn!=="AUTH"||is.includes(ConstantsUtil$2.SECURE_SITE)?null:ke`
      <wui-notice-card
        @click=${this.onGoToUpgradeView.bind(this)}
        label="Upgrade your wallet"
        description="Transition to a self-custodial wallet"
        icon="wallet"
        data-testid="w3m-wallet-upgrade-card"
      ></wui-notice-card>
    `}isAllowedNetworkSwitch(){const Mn=ChainController.getAllRequestedCaipNetworks(),rs=Mn?Mn.length>1:!1,is=Mn==null?void 0:Mn.find(({id:os})=>{var as;return os===((as=this.network)==null?void 0:as.id)});return rs||!is}onCopyAddress(){try{this.address&&(CoreHelperUtil.copyToClopboard(this.address),SnackController.showSuccess("Address copied"))}catch{SnackController.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){const Mn=ChainController.checkIfSmartAccountEnabled(),rs=StorageUtil.getConnectedConnector();return!ConnectorController.getAuthConnector()||rs!=="AUTH"||!Mn?null:(this.switched||(this.text=this.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account"),ke`
      <wui-list-item
        variant="icon"
        iconVariant="overlay"
        icon="swapHorizontalBold"
        iconSize="sm"
        ?chevron=${!0}
        ?loading=${this.loading}
        @click=${this.changePreferredAccountType.bind(this)}
        data-testid="account-toggle-preferred-account-type"
      >
        <wui-text variant="paragraph-500" color="fg-100">${this.text}</wui-text>
      </wui-list-item>
    `)}onChooseName(){RouterController.push("ChooseAccountName")}async changePreferredAccountType(){const Mn=ChainController.checkIfSmartAccountEnabled(),rs=this.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT||!Mn?W3mFrameRpcConstants.ACCOUNT_TYPES.EOA:W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT;ConnectorController.getAuthConnector()&&(this.loading=!0,await ConnectionController.setPreferredAccountType(rs),this.text=rs===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account",this.switched=!0,SendController.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&RouterController.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await ConnectionController.disconnect(),EventsController.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),ModalController.close()}catch{EventsController.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),SnackController.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){EventsController.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),RouterController.push("UpgradeEmailWallet")}};__decorate$1A([r$5()],W3mAccountSettingsView.prototype,"address",void 0);__decorate$1A([r$5()],W3mAccountSettingsView.prototype,"profileImage",void 0);__decorate$1A([r$5()],W3mAccountSettingsView.prototype,"profileName",void 0);__decorate$1A([r$5()],W3mAccountSettingsView.prototype,"network",void 0);__decorate$1A([r$5()],W3mAccountSettingsView.prototype,"preferredAccountType",void 0);__decorate$1A([r$5()],W3mAccountSettingsView.prototype,"disconnecting",void 0);__decorate$1A([r$5()],W3mAccountSettingsView.prototype,"loading",void 0);__decorate$1A([r$5()],W3mAccountSettingsView.prototype,"switched",void 0);__decorate$1A([r$5()],W3mAccountSettingsView.prototype,"text",void 0);W3mAccountSettingsView=__decorate$1A([customElement("w3m-account-settings-view")],W3mAccountSettingsView);var __decorate$1z=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAccountView=class extends h$3{render(){const Mn=StorageUtil.getConnectedConnector(),rs=ConnectorController.getAuthConnector();return ke`
      ${rs&&Mn==="AUTH"?this.walletFeaturesTemplate():this.defaultTemplate()}
    `}walletFeaturesTemplate(){return ke`<w3m-account-wallet-features-widget></w3m-account-wallet-features-widget>`}defaultTemplate(){return ke`<w3m-account-default-widget></w3m-account-default-widget>`}};W3mAccountView=__decorate$1z([customElement("w3m-account-view")],W3mAccountView);var __decorate$1y=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAllWalletsView=class extends h$3{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=CoreHelperUtil.debounce(Mn=>{this.search=Mn})}render(){const Mn=this.search.length>=2;return ke`
      <wui-flex .padding=${["0","s","s","s"]} gap="s">
        <wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
        ${this.qrButtonTemplate()}
      </wui-flex>
      ${Mn?ke`<w3m-all-wallets-search query=${this.search}></w3m-all-wallets-search>`:ke`<w3m-all-wallets-list></w3m-all-wallets-list>`}
    `}onInputChange(Mn){this.onDebouncedSearch(Mn.detail)}qrButtonTemplate(){return CoreHelperUtil.isMobile()?ke`
        <wui-icon-box
          size="lg"
          iconSize="xl"
          iconColor="accent-100"
          backgroundColor="accent-100"
          icon="qrCode"
          background="transparent"
          border
          borderColor="wui-accent-glass-010"
          @click=${this.onWalletConnectQr.bind(this)}
        ></wui-icon-box>
      `:null}onWalletConnectQr(){RouterController.push("ConnectingWalletConnect")}};__decorate$1y([r$5()],W3mAllWalletsView.prototype,"search",void 0);W3mAllWalletsView=__decorate$1y([customElement("w3m-all-wallets-view")],W3mAllWalletsView);const styles$11=i$4`
  @keyframes shake {
    0% {
      transform: translateX(0);
    }
    25% {
      transform: translateX(3px);
    }
    50% {
      transform: translateX(-3px);
    }
    75% {
      transform: translateX(3px);
    }
    100% {
      transform: translateX(0);
    }
  }

  wui-flex:first-child:not(:only-child) {
    position: relative;
  }

  wui-loading-thumbnail {
    position: absolute;
  }

  wui-visual {
    width: var(--wui-wallet-image-size-lg);
    height: var(--wui-wallet-image-size-lg);
    border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
    position: relative;
    overflow: hidden;
  }

  wui-visual::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
  }

  wui-icon-box {
    position: absolute;
    right: calc(var(--wui-spacing-3xs) * -1);
    bottom: calc(var(--wui-spacing-3xs) * -1);
    opacity: 0;
    transform: scale(0.5);
    transition:
      opacity var(--wui-ease-out-power-2) var(--wui-duration-lg),
      transform var(--wui-ease-out-power-2) var(--wui-duration-lg);
    will-change: opacity, transform;
  }

  wui-text[align='center'] {
    width: 100%;
    padding: 0px var(--wui-spacing-l);
  }

  [data-error='true'] wui-icon-box {
    opacity: 1;
    transform: scale(1);
  }

  [data-error='true'] > wui-flex:first-child {
    animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  }

  [data-retry='false'] wui-link {
    display: none;
  }

  [data-retry='true'] wui-link {
    display: block;
    opacity: 1;
  }

  wui-link {
    padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
  }
`;var __decorate$1x=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mBuyInProgressView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=OnRampController.state.selectedProvider,this.uri=ConnectionController.state.wcUri,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.error=!1,this.startTime=null,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(OnRampController.subscribeKey("selectedProvider",Mn=>{this.selectedOnRampProvider=Mn})),this.watchTransactions()}disconnectedCallback(){this.intervalId&&clearInterval(this.intervalId)}render(){var is,os;let Mn="Continue in external window";this.error?Mn="Buy failed":this.selectedOnRampProvider&&(Mn=`Buy in ${(is=this.selectedOnRampProvider)==null?void 0:is.label}`);const rs=this.error?"Buy can be declined from your side or due to and error on the provider app":"We’ll notify you once your Buy is processed";return ke`
      <wui-flex
        data-error=${to$2(this.error)}
        data-retry=${this.showRetry}
        flexDirection="column"
        alignItems="center"
        .padding=${["3xl","xl","xl","xl"]}
        gap="xl"
      >
        <wui-flex justifyContent="center" alignItems="center">
          <wui-visual
            name=${to$2((os=this.selectedOnRampProvider)==null?void 0:os.name)}
            size="lg"
            class="provider-image"
          >
          </wui-visual>

          ${this.error?null:this.loaderTemplate()}

          <wui-icon-box
            backgroundColor="error-100"
            background="opaque"
            iconColor="error-100"
            icon="close"
            size="sm"
            border
            borderColor="wui-color-bg-125"
          ></wui-icon-box>
        </wui-flex>

        <wui-flex flexDirection="column" alignItems="center" gap="xs">
          <wui-text variant="paragraph-500" color=${this.error?"error-100":"fg-100"}>
            ${Mn}
          </wui-text>
          <wui-text align="center" variant="small-500" color="fg-200">${rs}</wui-text>
        </wui-flex>

        ${this.error?this.tryAgainTemplate():null}
      </wui-flex>

      <wui-flex .padding=${["0","xl","xl","xl"]} justifyContent="center">
        <wui-link @click=${this.onCopyUri} color="fg-200">
          <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
          Copy link
        </wui-link>
      </wui-flex>
    `}watchTransactions(){if(this.selectedOnRampProvider)switch(this.selectedOnRampProvider.name){case"coinbase":this.startTime=Date.now(),this.initializeCoinbaseTransactions();break}}async initializeCoinbaseTransactions(){await this.watchCoinbaseTransactions(),this.intervalId=setInterval(()=>this.watchCoinbaseTransactions(),4e3)}async watchCoinbaseTransactions(){try{const Mn=AccountController.state.address,rs=OptionsController.state.projectId;if(!Mn)throw new Error("No address found");(await BlockchainApiController.fetchTransactions({account:Mn,onramp:"coinbase",projectId:rs})).data.filter(as=>new Date(as.metadata.minedAt)>new Date(this.startTime)||as.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length?(clearInterval(this.intervalId),RouterController.replace("OnRampActivity")):this.startTime&&Date.now()-this.startTime>=18e4&&(clearInterval(this.intervalId),this.error=!0)}catch(Mn){SnackController.showError(Mn)}}onTryAgain(){this.selectedOnRampProvider&&(this.error=!1,CoreHelperUtil.openHref(this.selectedOnRampProvider.url,"popupWindow","width=600,height=800,scrollbars=yes"))}tryAgainTemplate(){var Mn;return(Mn=this.selectedOnRampProvider)!=null&&Mn.url?ke`<wui-button size="md" variant="accent" @click=${this.onTryAgain.bind(this)}>
      <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
      Try again
    </wui-button>`:null}loaderTemplate(){const Mn=ThemeController.state.themeVariables["--w3m-border-radius-master"],rs=Mn?parseInt(Mn.replace("px",""),10):4;return ke`<wui-loading-thumbnail radius=${rs*9}></wui-loading-thumbnail>`}onCopyUri(){var Mn;if(!((Mn=this.selectedOnRampProvider)!=null&&Mn.url)){SnackController.showError("No link found"),RouterController.goBack();return}try{CoreHelperUtil.copyToClopboard(this.selectedOnRampProvider.url),SnackController.showSuccess("Link copied")}catch{SnackController.showError("Failed to copy")}}};W3mBuyInProgressView.styles=styles$11;__decorate$1x([r$5()],W3mBuyInProgressView.prototype,"intervalId",void 0);__decorate$1x([r$5()],W3mBuyInProgressView.prototype,"selectedOnRampProvider",void 0);__decorate$1x([r$5()],W3mBuyInProgressView.prototype,"uri",void 0);__decorate$1x([r$5()],W3mBuyInProgressView.prototype,"ready",void 0);__decorate$1x([r$5()],W3mBuyInProgressView.prototype,"showRetry",void 0);__decorate$1x([r$5()],W3mBuyInProgressView.prototype,"buffering",void 0);__decorate$1x([r$5()],W3mBuyInProgressView.prototype,"error",void 0);__decorate$1x([r$5()],W3mBuyInProgressView.prototype,"startTime",void 0);__decorate$1x([n$4({type:Boolean})],W3mBuyInProgressView.prototype,"isMobile",void 0);__decorate$1x([n$4()],W3mBuyInProgressView.prototype,"onRetry",void 0);W3mBuyInProgressView=__decorate$1x([customElement("w3m-buy-in-progress-view")],W3mBuyInProgressView);const styles$10=i$4`
  :host > wui-flex {
    max-height: clamp(360px, 540px, 80vh);
    scrollbar-width: none;
    overflow-y: scroll;
    overflow-x: hidden;
  }

  :host > wui-flex::-webkit-scrollbar {
    display: none;
  }

  .all-wallets {
    flex-flow: column;
  }
`;var __decorate$1w=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.authConnector=this.connectors.find(Mn=>Mn.type==="AUTH"),this.features=OptionsController.state.features,this.walletGuide="get-started",this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>{this.connectors=Mn,this.authConnector=this.connectors.find(rs=>rs.type==="AUTH")}),OptionsController.subscribeKey("features",Mn=>this.features=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){var as;const Mn=(as=this.features)==null?void 0:as.socials,rs=OptionsController.state.enableWallets,os=Mn&&Mn.length||this.authConnector;return ke`
      <wui-flex
        flexDirection="column"
        .padding=${os&&rs&&this.walletGuide==="get-started"?["3xs","s","0","s"]:["3xs","s","s","s"]}
      >
        <w3m-email-login-widget walletGuide=${this.walletGuide}></w3m-email-login-widget>
        <w3m-social-login-widget></w3m-social-login-widget>
        ${this.walletListTemplate()}
      </wui-flex>
      ${this.guideTemplate()}
      <w3m-legal-footer></w3m-legal-footer>
    `}walletListTemplate(){var os,as;const Mn=(os=this.features)==null?void 0:os.socials,rs=(as=this.features)==null?void 0:as.emailShowWallets;return!OptionsController.state.enableWallets||(CoreHelperUtil.isTelegram()&&CoreHelperUtil.isIos()&&ConnectionController.connectWalletConnect().catch(us=>({})),this.walletGuide==="explore")?null:this.authConnector&&Mn?this.authConnector&&rs?ke`
          <wui-flex flexDirection="column" gap="xs" .margin=${["xs","0","0","0"]}>
            <w3m-connector-list></w3m-connector-list>
            <wui-flex class="all-wallets">
              <w3m-all-wallets-widget></w3m-all-wallets-widget>
            </wui-flex>
          </wui-flex>
        `:ke`<wui-list-button
        @click=${this.onContinueWalletClick.bind(this)}
        text="Continue with a wallet"
      ></wui-list-button>`:ke`<w3m-wallet-login-list></w3m-wallet-login-list>`}guideTemplate(){var os;const Mn=(os=this.features)==null?void 0:os.socials,rs=OptionsController.state.enableWallets,is=Mn&&Mn.length;return!this.authConnector&&!is||!rs?null:this.walletGuide==="explore"?ke`
        <wui-flex flexDirection="column" .padding=${["0","0","xl","0"]}>
          <w3m-wallet-guide walletGuide=${this.walletGuide}></w3m-wallet-guide>
        </wui-flex>
      `:ke`
      <wui-flex flexDirection="column" .padding=${["xl","0","xl","0"]}>
        <w3m-wallet-guide walletGuide=${this.walletGuide}></w3m-wallet-guide>
      </wui-flex>
    `}onContinueWalletClick(){RouterController.push("ConnectWallets")}};W3mConnectView.styles=styles$10;__decorate$1w([r$5()],W3mConnectView.prototype,"connectors",void 0);__decorate$1w([r$5()],W3mConnectView.prototype,"authConnector",void 0);__decorate$1w([r$5()],W3mConnectView.prototype,"features",void 0);__decorate$1w([n$4()],W3mConnectView.prototype,"walletGuide",void 0);W3mConnectView=__decorate$1w([customElement("w3m-connect-view")],W3mConnectView);const styles$$=i$4`
  @keyframes shake {
    0% {
      transform: translateX(0);
    }
    25% {
      transform: translateX(3px);
    }
    50% {
      transform: translateX(-3px);
    }
    75% {
      transform: translateX(3px);
    }
    100% {
      transform: translateX(0);
    }
  }

  wui-flex:first-child:not(:only-child) {
    position: relative;
  }

  wui-loading-thumbnail {
    position: absolute;
  }

  wui-icon-box {
    position: absolute;
    right: calc(var(--wui-spacing-3xs) * -1);
    bottom: calc(var(--wui-spacing-3xs) * -1);
    opacity: 0;
    transform: scale(0.5);
    transition-property: opacity, transform;
    transition-duration: var(--wui-duration-lg);
    transition-timing-function: var(--wui-ease-out-power-2);
    will-change: opacity, transform;
  }

  wui-text[align='center'] {
    width: 100%;
    padding: 0px var(--wui-spacing-l);
  }

  [data-error='true'] wui-icon-box {
    opacity: 1;
    transform: scale(1);
  }

  [data-error='true'] > wui-flex:first-child {
    animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  }

  [data-retry='false'] wui-link {
    display: none;
  }

  [data-retry='true'] wui-link {
    display: block;
    opacity: 1;
  }
`;var __decorate$1v=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};class W3mConnectingWidget extends h$3{constructor(){var Mn,rs,is,os,as;super(),this.wallet=(Mn=RouterController.state.data)==null?void 0:Mn.wallet,this.connector=(rs=RouterController.state.data)==null?void 0:rs.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=AssetUtil.getWalletImage(this.wallet)??AssetUtil.getConnectorImage(this.connector),this.name=((is=this.wallet)==null?void 0:is.name)??((os=this.connector)==null?void 0:os.name)??"Wallet",this.isRetrying=!1,this.uri=ConnectionController.state.wcUri,this.error=ConnectionController.state.wcError,this.ready=!1,this.showRetry=!1,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.buffering=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(ConnectionController.subscribeKey("wcUri",us=>{var ds;this.uri=us,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(ds=this.onConnect)==null||ds.call(this))}),ConnectionController.subscribeKey("wcError",us=>this.error=us),ConnectionController.subscribeKey("buffering",us=>this.buffering=us)),CoreHelperUtil.isTelegram()&&CoreHelperUtil.isIos()&&ConnectionController.state.wcUri&&((as=this.onConnect)==null||as.call(this))}firstUpdated(){var Mn;(Mn=this.onAutoConnect)==null||Mn.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn()),clearTimeout(this.timeout)}render(){var is;(is=this.onRender)==null||is.call(this),this.onShowRetry();const Mn=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let rs=`Continue in ${this.name}`;return this.buffering&&(rs="Connecting..."),this.error&&(rs="Connection declined"),ke`
      <wui-flex
        data-error=${to$2(this.error)}
        data-retry=${this.showRetry}
        flexDirection="column"
        alignItems="center"
        .padding=${["3xl","xl","xl","xl"]}
        gap="xl"
      >
        <wui-flex justifyContent="center" alignItems="center">
          <wui-wallet-image size="lg" imageSrc=${to$2(this.imageSrc)}></wui-wallet-image>

          ${this.error?null:this.loaderTemplate()}

          <wui-icon-box
            backgroundColor="error-100"
            background="opaque"
            iconColor="error-100"
            icon="close"
            size="sm"
            border
            borderColor="wui-color-bg-125"
          ></wui-icon-box>
        </wui-flex>

        <wui-flex flexDirection="column" alignItems="center" gap="xs">
          <wui-text variant="paragraph-500" color=${this.error?"error-100":"fg-100"}>
            ${rs}
          </wui-text>
          <wui-text align="center" variant="small-500" color="fg-200">${Mn}</wui-text>
        </wui-flex>

        ${this.secondaryBtnLabel?ke`
              <wui-button
                variant="accent"
                size="md"
                ?disabled=${this.isRetrying||!this.error&&this.buffering}
                @click=${this.onTryAgain.bind(this)}
                data-testid="w3m-connecting-widget-secondary-button"
              >
                <wui-icon color="inherit" slot="iconLeft" name=${this.secondaryBtnIcon}></wui-icon>
                ${this.secondaryBtnLabel}
              </wui-button>
            `:null}
      </wui-flex>

      ${this.isWalletConnect?ke`
            <wui-flex .padding=${["0","xl","xl","xl"]} justifyContent="center">
              <wui-link @click=${this.onCopyUri} color="fg-200" data-testid="wui-link-copy">
                <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
                Copy link
              </wui-link>
            </wui-flex>
          `:null}

      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
    `}onShowRetry(){var Mn;if(this.error&&!this.showRetry){this.showRetry=!0;const rs=(Mn=this.shadowRoot)==null?void 0:Mn.querySelector("wui-button");rs==null||rs.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var Mn,rs;this.buffering||(ConnectionController.setWcError(!1),this.onRetry?(this.isRetrying=!0,(Mn=this.onRetry)==null||Mn.call(this)):(rs=this.onConnect)==null||rs.call(this))}loaderTemplate(){const Mn=ThemeController.state.themeVariables["--w3m-border-radius-master"],rs=Mn?parseInt(Mn.replace("px",""),10):4;return ke`<wui-loading-thumbnail radius=${rs*9}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(CoreHelperUtil.copyToClopboard(this.uri),SnackController.showSuccess("Link copied"))}catch{SnackController.showError("Failed to copy")}}}W3mConnectingWidget.styles=styles$$;__decorate$1v([r$5()],W3mConnectingWidget.prototype,"isRetrying",void 0);__decorate$1v([r$5()],W3mConnectingWidget.prototype,"uri",void 0);__decorate$1v([r$5()],W3mConnectingWidget.prototype,"error",void 0);__decorate$1v([r$5()],W3mConnectingWidget.prototype,"ready",void 0);__decorate$1v([r$5()],W3mConnectingWidget.prototype,"showRetry",void 0);__decorate$1v([r$5()],W3mConnectingWidget.prototype,"secondaryBtnLabel",void 0);__decorate$1v([r$5()],W3mConnectingWidget.prototype,"secondaryLabel",void 0);__decorate$1v([r$5()],W3mConnectingWidget.prototype,"buffering",void 0);__decorate$1v([n$4({type:Boolean})],W3mConnectingWidget.prototype,"isMobile",void 0);__decorate$1v([n$4()],W3mConnectingWidget.prototype,"onRetry",void 0);var __decorate$1u=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingExternalView=class extends W3mConnectingWidget{constructor(){if(super(),this.externalViewUnsubscribe=[],!this.connector)throw new Error("w3m-connecting-view: No connector provided");EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(ChainController.subscribeKey("activeCaipAddress",Mn=>{Mn&&ModalController.close()}))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(Mn=>Mn())}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.id!==ConstantsUtil$1.COINBASE_SDK_CONNECTOR_ID||!this.error)&&(await ConnectionController.connectExternal(this.connector,this.connector.chain),EventsController.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}catch(Mn){EventsController.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(Mn==null?void 0:Mn.message)??"Unknown"}}),this.error=!0}}};W3mConnectingExternalView=__decorate$1u([customElement("w3m-connecting-external-view")],W3mConnectingExternalView);const styles$_=i$4`
  wui-flex,
  wui-list-wallet {
    width: 100%;
  }
`;var __decorate$1t=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingMultiChainView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.activeConnector=ChainController.state.activeConnector,this.unsubscribe.push(ChainController.subscribeKey("activeConnector",Mn=>this.activeConnector=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){var Mn;return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        .padding=${["m","xl","xl","xl"]}
        gap="xl"
      >
        <wui-flex justifyContent="center" alignItems="center">
          <wui-wallet-image
            size="lg"
            imageSrc=${to$2(AssetUtil.getConnectorImage(this.activeConnector))}
          ></wui-wallet-image>
        </wui-flex>
        <wui-flex
          flexDirection="column"
          alignItems="center"
          gap="xs"
          .padding=${["0","s","0","s"]}
        >
          <wui-text variant="paragraph-500" color="fg-100">
            Select Chain for ${(Mn=this.activeConnector)==null?void 0:Mn.name}
          </wui-text>
          <wui-text align="center" variant="small-500" color="fg-200"
            >Select which chain to connect to your multi chain wallet</wui-text
          >
        </wui-flex>
        <wui-flex
          flexGrow="1"
          flexDirection="column"
          alignItems="center"
          gap="xs"
          .padding=${["xs","0","xs","0"]}
        >
          ${this.networksTemplate()}
        </wui-flex>
      </wui-flex>
    `}networksTemplate(){var Mn,rs;return(rs=(Mn=this.activeConnector)==null?void 0:Mn.connectors)==null?void 0:rs.map(is=>is.name?ke`
            <wui-list-wallet
              imageSrc=${to$2(AssetUtil.getChainImage(is.chain))}
              name=${ConstantsUtil$3.CHAIN_NAME_MAP[is.chain]}
              @click=${()=>this.onConnector(is)}
            ></wui-list-wallet>
          `:null)}onConnector(Mn){var is,os;const rs=(os=(is=this.activeConnector)==null?void 0:is.connectors)==null?void 0:os.find(as=>as.chain===Mn.chain);if(!rs){SnackController.showError("Failed to find connector");return}rs.id==="walletConnect"?CoreHelperUtil.isMobile()?RouterController.push("AllWallets"):RouterController.push("ConnectingWalletConnect"):RouterController.push("ConnectingExternal",{connector:rs})}};W3mConnectingMultiChainView.styles=styles$_;__decorate$1t([r$5()],W3mConnectingMultiChainView.prototype,"activeConnector",void 0);W3mConnectingMultiChainView=__decorate$1t([customElement("w3m-connecting-multi-chain-view")],W3mConnectingMultiChainView);var __decorate$1s=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingWcView=class extends h$3{constructor(){var Mn;super(),this.interval=void 0,this.lastRetry=Date.now(),this.wallet=(Mn=RouterController.state.data)==null?void 0:Mn.wallet,this.platform=void 0,this.platforms=[],this.isSiweEnabled=OptionsController.state.isSiweEnabled,this.determinePlatforms(),this.initializeConnection(),this.interval=setInterval(this.initializeConnection.bind(this),ConstantsUtil$2.TEN_SEC_MS)}disconnectedCallback(){clearTimeout(this.interval)}render(){return this.wallet?ke`
      ${this.headerTemplate()}
      <div>${this.platformTemplate()}</div>
    `:ke`<w3m-connecting-wc-qrcode></w3m-connecting-wc-qrcode>`}async initializeConnection(Mn=!1){if(this.platform!=="browser")try{const{wcPairingExpiry:rs,status:is}=ConnectionController.state;(Mn||CoreHelperUtil.isPairingExpired(rs)||is==="connecting")&&(await ConnectionController.connectWalletConnect(),this.finalizeConnection(),StorageUtil.getConnectedConnector()==="AUTH"&&OptionsController.state.hasMultipleAddresses?RouterController.push("SelectAddresses"):this.isSiweEnabled||ModalController.close())}catch(rs){EventsController.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(rs==null?void 0:rs.message)??"Unknown"}}),ConnectionController.setWcError(!0),CoreHelperUtil.isAllowedRetry(this.lastRetry)&&(SnackController.showError("Declined"),this.lastRetry=Date.now(),this.initializeConnection(!0))}}finalizeConnection(){var is;const{wcLinking:Mn,recentWallet:rs}=ConnectionController.state;Mn&&StorageUtil.setWalletConnectDeepLink(Mn),rs&&StorageUtil.setAppKitRecent(rs),EventsController.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:Mn?"mobile":"qrcode",name:((is=this.wallet)==null?void 0:is.name)||"Unknown"}})}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:Mn,desktop_link:rs,webapp_link:is,injected:os,rdns:as,name:us}=this.wallet,ds=os==null?void 0:os.map(({injected_id:Lo})=>Lo).filter(Boolean),hs=[...as?[as]:ds??[],us],ps=OptionsController.state.isUniversalProvider?!1:hs.length,io=Mn,fo=is,mo=ConnectionController.checkInstalled(hs),Ao=ps&&mo,$o=rs&&!CoreHelperUtil.isMobile();Ao&&this.platforms.push("browser"),io&&this.platforms.push(CoreHelperUtil.isMobile()?"mobile":"qrcode"),fo&&this.platforms.push("web"),$o&&this.platforms.push("desktop"),!Ao&&ps&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return ke`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return ke`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return ke`
          <w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
          </w3m-connecting-wc-desktop>
        `;case"mobile":return ke`
          <w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
          </w3m-connecting-wc-mobile>
        `;case"qrcode":return ke`<w3m-connecting-wc-qrcode></w3m-connecting-wc-qrcode>`;default:return ke`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?ke`
      <w3m-connecting-header
        .platforms=${this.platforms}
        .onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
      >
      </w3m-connecting-header>
    `:null}async onSelectPlatform(Mn){var is;const rs=(is=this.shadowRoot)==null?void 0:is.querySelector("div");rs&&(await rs.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=Mn,rs.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};__decorate$1s([r$5()],W3mConnectingWcView.prototype,"platform",void 0);__decorate$1s([r$5()],W3mConnectingWcView.prototype,"platforms",void 0);__decorate$1s([r$5()],W3mConnectingWcView.prototype,"isSiweEnabled",void 0);W3mConnectingWcView=__decorate$1s([customElement("w3m-connecting-wc-view")],W3mConnectingWcView);const styles$Z=i$4`
  .continue-button-container {
    width: 100%;
  }
`;var __decorate$1r=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mChooseAccountNameView=class extends h$3{constructor(){super(...arguments),this.loading=!1}render(){return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        gap="xxl"
        .padding=${["0","0","l","0"]}
      >
        ${this.onboardingTemplate()} ${this.buttonsTemplate()}
        <wui-link
          @click=${()=>{CoreHelperUtil.openHref(NavigationUtil.URLS.FAQ,"_blank")}}
        >
          Learn more about names
          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
        </wui-link>
      </wui-flex>
    `}onboardingTemplate(){return ke` <wui-flex
      flexDirection="column"
      gap="xxl"
      alignItems="center"
      .padding=${["0","xxl","0","xxl"]}
    >
      <wui-flex gap="s" alignItems="center" justifyContent="center">
        <wui-icon-box
          icon="id"
          size="xl"
          iconSize="xxl"
          iconColor="fg-200"
          backgroundColor="fg-200"
        ></wui-icon-box>
      </wui-flex>
      <wui-flex flexDirection="column" alignItems="center" gap="s">
        <wui-text align="center" variant="medium-600" color="fg-100">
          Choose your account name
        </wui-text>
        <wui-text align="center" variant="paragraph-400" color="fg-100">
          Finally say goodbye to 0x addresses, name your account to make it easier to exchange
          assets
        </wui-text>
      </wui-flex>
    </wui-flex>`}buttonsTemplate(){return ke`<wui-flex
      .padding=${["0","2l","0","2l"]}
      gap="s"
      class="continue-button-container"
    >
      <wui-button
        fullWidth
        .loading=${this.loading}
        size="lg"
        borderRadius="xs"
        @click=${this.handleContinue.bind(this)}
        >Choose name
      </wui-button>
    </wui-flex>`}handleContinue(){RouterController.push("RegisterAccountName"),EventsController.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}})}};W3mChooseAccountNameView.styles=styles$Z;__decorate$1r([r$5()],W3mChooseAccountNameView.prototype,"loading",void 0);W3mChooseAccountNameView=__decorate$1r([customElement("w3m-choose-account-name-view")],W3mChooseAccountNameView);var __decorate$1q=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mDownloadsView=class extends h$3{constructor(){var Mn;super(...arguments),this.wallet=(Mn=RouterController.state.data)==null?void 0:Mn.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return ke`
      <wui-flex gap="xs" flexDirection="column" .padding=${["s","s","l","s"]}>
        ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
        ${this.homepageTemplate()}
      </wui-flex>
    `}chromeTemplate(){var Mn;return(Mn=this.wallet)!=null&&Mn.chrome_store?ke`<wui-list-item
      variant="icon"
      icon="chromeStore"
      iconVariant="square"
      @click=${this.onChromeStore.bind(this)}
      chevron
    >
      <wui-text variant="paragraph-500" color="fg-100">Chrome Extension</wui-text>
    </wui-list-item>`:null}iosTemplate(){var Mn;return(Mn=this.wallet)!=null&&Mn.app_store?ke`<wui-list-item
      variant="icon"
      icon="appStore"
      iconVariant="square"
      @click=${this.onAppStore.bind(this)}
      chevron
    >
      <wui-text variant="paragraph-500" color="fg-100">iOS App</wui-text>
    </wui-list-item>`:null}androidTemplate(){var Mn;return(Mn=this.wallet)!=null&&Mn.play_store?ke`<wui-list-item
      variant="icon"
      icon="playStore"
      iconVariant="square"
      @click=${this.onPlayStore.bind(this)}
      chevron
    >
      <wui-text variant="paragraph-500" color="fg-100">Android App</wui-text>
    </wui-list-item>`:null}homepageTemplate(){var Mn;return(Mn=this.wallet)!=null&&Mn.homepage?ke`
      <wui-list-item
        variant="icon"
        icon="browser"
        iconVariant="square-blue"
        @click=${this.onHomePage.bind(this)}
        chevron
      >
        <wui-text variant="paragraph-500" color="fg-100">Website</wui-text>
      </wui-list-item>
    `:null}onChromeStore(){var Mn;(Mn=this.wallet)!=null&&Mn.chrome_store&&CoreHelperUtil.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var Mn;(Mn=this.wallet)!=null&&Mn.app_store&&CoreHelperUtil.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var Mn;(Mn=this.wallet)!=null&&Mn.play_store&&CoreHelperUtil.openHref(this.wallet.play_store,"_blank")}onHomePage(){var Mn;(Mn=this.wallet)!=null&&Mn.homepage&&CoreHelperUtil.openHref(this.wallet.homepage,"_blank")}};W3mDownloadsView=__decorate$1q([customElement("w3m-downloads-view")],W3mDownloadsView);var __decorate$1p=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const EXPLORER="https://walletconnect.com/explorer";let W3mGetWalletView=class extends h$3{render(){return ke`
      <wui-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
        ${this.recommendedWalletsTemplate()}
        <wui-list-wallet
          name="Explore all"
          showAllWallets
          walletIcon="allWallets"
          icon="externalLink"
          @click=${()=>{CoreHelperUtil.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}}
        ></wui-list-wallet>
      </wui-flex>
    `}recommendedWalletsTemplate(){const{recommended:Mn,featured:rs}=ApiController.state,{customWallets:is}=OptionsController.state;return[...rs,...is??[],...Mn].slice(0,4).map(as=>ke`
        <wui-list-wallet
          name=${as.name??"Unknown"}
          tagVariant="main"
          imageSrc=${to$2(AssetUtil.getWalletImage(as))}
          @click=${()=>{CoreHelperUtil.openHref(as.homepage??EXPLORER,"_blank")}}
        ></wui-list-wallet>
      `)}};W3mGetWalletView=__decorate$1p([customElement("w3m-get-wallet-view")],W3mGetWalletView);const styles$Y=i$4`
  wui-flex {
    width: 100%;
  }

  .suggestion {
    background: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xs);
  }

  .suggestion:hover {
    background-color: var(--wui-color-gray-glass-005);
    cursor: pointer;
  }

  .suggested-name {
    max-width: 75%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  form {
    width: 100%;
  }

  wui-icon-link {
    position: absolute;
    right: 20px;
    transform: translateY(11px);
  }
`;var __decorate$1o=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mRegisterAccountNameView=class extends h$3{constructor(){super(),this.formRef=ii$1(),this.usubscribe=[],this.name="",this.error="",this.loading=EnsController.state.loading,this.suggestions=EnsController.state.suggestions,this.registered=!1,this.profileName=AccountController.state.profileName,this.onDebouncedNameInputChange=CoreHelperUtil.debounce(Mn=>{EnsController.validateName(Mn)?(this.error="",this.name=Mn,EnsController.getSuggestions(Mn),EnsController.isNameRegistered(Mn).then(rs=>{this.registered=rs})):Mn.length<4?this.error="Name must be at least 4 characters long":this.error="Can only contain letters, numbers and - characters"}),this.usubscribe.push(EnsController.subscribe(Mn=>{this.suggestions=Mn.suggestions,this.loading=Mn.loading}),AccountController.subscribeKey("profileName",Mn=>{this.profileName=Mn,Mn&&(this.error="You already own a name")}))}firstUpdated(){var Mn;(Mn=this.formRef.value)==null||Mn.addEventListener("keydown",this.onEnterKey.bind(this))}disconnectedCallback(){var Mn;super.disconnectedCallback(),this.usubscribe.forEach(rs=>rs()),(Mn=this.formRef.value)==null||Mn.removeEventListener("keydown",this.onEnterKey.bind(this))}render(){return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        gap="m"
        .padding=${["0","s","m","s"]}
      >
        <form ${Kt$2(this.formRef)} @submit=${this.onSubmitName.bind(this)}>
          <wui-ens-input
            @inputChange=${this.onNameInputChange.bind(this)}
            .errorMessage=${this.error}
            .value=${this.name}
          >
          </wui-ens-input>
          ${this.submitButtonTemplate()}
          <input type="submit" hidden />
        </form>
        ${this.templateSuggestions()}
      </wui-flex>
    `}submitButtonTemplate(){return this.isAllowedToSubmit()?ke`
          <wui-icon-link
            size="sm"
            icon="chevronRight"
            iconcolor="accent-100"
            @click=${this.onSubmitName.bind(this)}
          >
          </wui-icon-link>
        `:null}onSelectSuggestion(Mn){return()=>{this.name=Mn,this.registered=!1,this.requestUpdate()}}onNameInputChange(Mn){this.onDebouncedNameInputChange(Mn.detail)}nameSuggestionTagTemplate(){return this.loading?ke`<wui-loading-spinner size="lg" color="fg-100"></wui-loading-spinner>`:this.registered?ke`<wui-tag variant="shade" size="lg">Registered</wui-tag>`:ke`<wui-tag variant="success" size="lg">Available</wui-tag>`}templateSuggestions(){if(!this.name||this.name.length<4||this.error)return null;const Mn=this.registered?this.suggestions.filter(rs=>rs.name!==this.name):[];return ke`<wui-flex flexDirection="column" gap="xxs" alignItems="center">
      <wui-flex
        data-testid="account-name-suggestion"
        .padding=${["m","m","m","m"]}
        justifyContent="space-between"
        class="suggestion"
        @click=${this.onSubmitName.bind(this)}
      >
        <wui-text color="fg-100" variant="paragraph-400" class="suggested-name">
          ${this.name}</wui-text
        >${this.nameSuggestionTagTemplate()}
      </wui-flex>
      ${Mn.map(rs=>this.availableNameTemplate(rs.name))}
    </wui-flex>`}availableNameTemplate(Mn){return ke` <wui-flex
      data-testid="account-name-suggestion"
      .padding=${["m","m","m","m"]}
      justifyContent="space-between"
      class="suggestion"
      @click=${this.onSelectSuggestion(Mn)}
    >
      <wui-text color="fg-100" variant="paragraph-400" class="suggested-name">
        ${Mn}
      </wui-text>
      <wui-tag variant="success" size="lg">Available</wui-tag>
    </wui-flex>`}isAllowedToSubmit(){return!this.loading&&!this.registered&&!this.error&&!this.profileName&&EnsController.validateName(this.name)}async onSubmitName(){try{if(!this.isAllowedToSubmit())return;const Mn=`${this.name}${ConstantsUtil$3.WC_NAME_SUFFIX}`;EventsController.sendEvent({type:"track",event:"REGISTER_NAME_INITIATED",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:Mn}}),await EnsController.registerName(Mn),EventsController.sendEvent({type:"track",event:"REGISTER_NAME_SUCCESS",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:Mn}})}catch(Mn){SnackController.showError(Mn.message),EventsController.sendEvent({type:"track",event:"REGISTER_NAME_ERROR",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:`${this.name}${ConstantsUtil$3.WC_NAME_SUFFIX}`,error:(Mn==null?void 0:Mn.message)||"Unknown error"}})}}onEnterKey(Mn){Mn.key==="Enter"&&this.isAllowedToSubmit()&&this.onSubmitName()}};W3mRegisterAccountNameView.styles=styles$Y;__decorate$1o([n$4()],W3mRegisterAccountNameView.prototype,"errorMessage",void 0);__decorate$1o([r$5()],W3mRegisterAccountNameView.prototype,"name",void 0);__decorate$1o([r$5()],W3mRegisterAccountNameView.prototype,"error",void 0);__decorate$1o([r$5()],W3mRegisterAccountNameView.prototype,"loading",void 0);__decorate$1o([r$5()],W3mRegisterAccountNameView.prototype,"suggestions",void 0);__decorate$1o([r$5()],W3mRegisterAccountNameView.prototype,"registered",void 0);__decorate$1o([r$5()],W3mRegisterAccountNameView.prototype,"profileName",void 0);W3mRegisterAccountNameView=__decorate$1o([customElement("w3m-register-account-name-view")],W3mRegisterAccountNameView);const styles$X=i$4`
  .continue-button-container {
    width: 100%;
  }
`;var __decorate$1n=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mRegisterAccountNameSuccess=class extends h$3{render(){return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        gap="xxl"
        .padding=${["0","0","l","0"]}
      >
        ${this.onboardingTemplate()} ${this.buttonsTemplate()}
        <wui-link
          @click=${()=>{CoreHelperUtil.openHref(NavigationUtil.URLS.FAQ,"_blank")}}
        >
          Learn more
          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
        </wui-link>
      </wui-flex>
    `}onboardingTemplate(){return ke` <wui-flex
      flexDirection="column"
      gap="xxl"
      alignItems="center"
      .padding=${["0","xxl","0","xxl"]}
    >
      <wui-flex gap="s" alignItems="center" justifyContent="center">
        <wui-icon-box
          size="xl"
          iconcolor="success-100"
          backgroundcolor="success-100"
          icon="checkmark"
          background="opaque"
        ></wui-icon-box>
      </wui-flex>
      <wui-flex flexDirection="column" alignItems="center" gap="s">
        <wui-text align="center" variant="medium-600" color="fg-100">
          Account name chosen successfully
        </wui-text>
        <wui-text align="center" variant="paragraph-400" color="fg-100">
          You can now fund your account and trade crypto
        </wui-text>
      </wui-flex>
    </wui-flex>`}buttonsTemplate(){return ke`<wui-flex
      .padding=${["0","2l","0","2l"]}
      gap="s"
      class="continue-button-container"
    >
      <wui-button fullWidth size="lg" borderRadius="xs" @click=${this.redirectToAccount.bind(this)}
        >Let's Go!
      </wui-button>
    </wui-flex>`}redirectToAccount(){RouterController.replace("Account")}};W3mRegisterAccountNameSuccess.styles=styles$X;W3mRegisterAccountNameSuccess=__decorate$1n([customElement("w3m-register-account-name-success-view")],W3mRegisterAccountNameSuccess);const styles$W=i$4`
  @keyframes shake {
    0% {
      transform: translateX(0);
    }
    25% {
      transform: translateX(3px);
    }
    50% {
      transform: translateX(-3px);
    }
    75% {
      transform: translateX(3px);
    }
    100% {
      transform: translateX(0);
    }
  }

  wui-flex:first-child:not(:only-child) {
    position: relative;
  }

  wui-loading-hexagon {
    position: absolute;
  }

  wui-icon-box {
    position: absolute;
    right: 4px;
    bottom: 0;
    opacity: 0;
    transform: scale(0.5);
    z-index: 1;
  }

  wui-button {
    display: none;
  }

  [data-error='true'] wui-icon-box {
    opacity: 1;
    transform: scale(1);
  }

  [data-error='true'] > wui-flex:first-child {
    animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  }

  wui-button[data-retry='true'] {
    display: block;
    opacity: 1;
  }
`;var __decorate$1m=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mNetworkSwitchView=class extends h$3{constructor(){var Mn;super(),this.network=(Mn=RouterController.state.data)==null?void 0:Mn.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const Mn=this.getLabel(),rs=this.getSubLabel();return ke`
      <wui-flex
        data-error=${this.error}
        flexDirection="column"
        alignItems="center"
        .padding=${["3xl","xl","3xl","xl"]}
        gap="xl"
      >
        <wui-flex justifyContent="center" alignItems="center">
          <wui-network-image
            size="lg"
            imageSrc=${to$2(AssetUtil.getNetworkImage(this.network))}
          ></wui-network-image>

          ${this.error?null:ke`<wui-loading-hexagon></wui-loading-hexagon>`}

          <wui-icon-box
            backgroundColor="error-100"
            background="opaque"
            iconColor="error-100"
            icon="close"
            size="sm"
            ?border=${!0}
            borderColor="wui-color-bg-125"
          ></wui-icon-box>
        </wui-flex>

        <wui-flex flexDirection="column" alignItems="center" gap="xs">
          <wui-text align="center" variant="paragraph-500" color="fg-100">${Mn}</wui-text>
          <wui-text align="center" variant="small-500" color="fg-200">${rs}</wui-text>
        </wui-flex>

        <wui-button
          data-retry=${this.showRetry}
          variant="accent"
          size="md"
          .disabled=${!this.error}
          @click=${this.onSwitchNetwork.bind(this)}
        >
          <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
          Try again
        </wui-button>
      </wui-flex>
    `}getSubLabel(){const Mn=StorageUtil.getConnectedConnector();return ConnectorController.getAuthConnector()&&Mn==="AUTH"?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var is;const Mn=StorageUtil.getConnectedConnector();return ConnectorController.getAuthConnector()&&Mn==="AUTH"?`Switching to ${((is=this.network)==null?void 0:is.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var Mn;if(this.error&&!this.showRetry){this.showRetry=!0;const rs=(Mn=this.shadowRoot)==null?void 0:Mn.querySelector("wui-button");rs==null||rs.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,this.network&&await ChainController.switchActiveNetwork(this.network)}catch{this.error=!0}}};W3mNetworkSwitchView.styles=styles$W;__decorate$1m([r$5()],W3mNetworkSwitchView.prototype,"showRetry",void 0);__decorate$1m([r$5()],W3mNetworkSwitchView.prototype,"error",void 0);W3mNetworkSwitchView=__decorate$1m([customElement("w3m-network-switch-view")],W3mNetworkSwitchView);const styles$V=i$4`
  .container {
    max-height: 360px;
    overflow: auto;
  }

  .container::-webkit-scrollbar {
    display: none;
  }
`;var __decorate$1l=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mNetworksView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.network=ChainController.state.activeCaipNetwork,this.requestedCaipNetworks=ChainController.getAllRequestedCaipNetworks(),this.search="",this.onDebouncedSearch=CoreHelperUtil.debounce(Mn=>{this.search=Mn},100),this.unsubscribe.push(ChainController.subscribeKey("activeCaipNetwork",Mn=>this.network=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return ke`
      ${this.templateSearchInput()}
      <wui-flex
        class="container"
        .padding=${["0","s","s","s"]}
        flexDirection="column"
        gap="xs"
      >
        ${this.networksTemplate()}
      </wui-flex>

      <wui-separator></wui-separator>

      <wui-flex padding="s" flexDirection="column" gap="m" alignItems="center">
        <wui-text variant="small-400" color="fg-300" align="center">
          Your connected wallet may not support some of the networks available for this dApp
        </wui-text>
        <wui-link @click=${this.onNetworkHelp.bind(this)}>
          <wui-icon size="xs" color="accent-100" slot="iconLeft" name="helpCircle"></wui-icon>
          What is a network
        </wui-link>
      </wui-flex>
    `}templateSearchInput(){return ke`
      <wui-flex gap="xs" .padding=${["0","s","s","s"]}>
        <wui-input-text
          @inputChange=${this.onInputChange.bind(this)}
          class="network-search-input"
          size="md"
          placeholder="Search network"
          icon="search"
        ></wui-input-text>
      </wui-flex>
    `}onInputChange(Mn){this.onDebouncedSearch(Mn.detail)}onNetworkHelp(){EventsController.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),RouterController.push("WhatIsANetwork")}networksTemplate(){var os;const Mn=ChainController.getAllRequestedCaipNetworks(),rs=ChainController.getAllApprovedCaipNetworkIds(),is=CoreHelperUtil.sortRequestedNetworks(rs,Mn);return this.search?this.filteredNetworks=is==null?void 0:is.filter(as=>{var us;return(us=as==null?void 0:as.name)==null?void 0:us.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=is,(os=this.filteredNetworks)==null?void 0:os.map(as=>{var us;return ke`
        <wui-list-network
          .selected=${((us=this.network)==null?void 0:us.id)===as.id}
          imageSrc=${to$2(AssetUtil.getNetworkImage(as))}
          type="network"
          name=${as.name??as.id}
          @click=${()=>this.onSwitchNetwork(as)}
          .disabled=${this.getNetworkDisabled(as)}
          data-testid=${`w3m-network-switch-${as.name??as.id}`}
        ></wui-list-network>
      `})}getNetworkDisabled(Mn){const rs=Mn.chainNamespace,is=AccountController.getCaipAddress(rs),os=ChainController.getAllApprovedCaipNetworkIds(),as=ChainController.getNetworkProp("supportsAllNetworks",rs)!==!1,us=StorageUtil.getConnectedConnector(),ds=ConnectorController.getAuthConnector();return!is||as||us==="AUTH"&&ds?!1:!(os!=null&&os.includes(Mn.caipNetworkId))}onSwitchNetwork(Mn){var hs;const rs=RouterController.state.data;if(Mn.id===((hs=this.network)==null?void 0:hs.id))return;const os=Mn.chainNamespace!==ChainController.state.activeChain,as=ChainController.getAccountProp("caipAddress",Mn.chainNamespace),us=AccountController.state.caipAddress,ds=StorageUtil.getConnectedConnector()==="AUTH";os&&us&&!as&&!ds?RouterController.push("SwitchActiveChain",{switchToChain:Mn.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:Mn}):RouterController.push("SwitchNetwork",{...rs,network:Mn})}};W3mNetworksView.styles=styles$V;__decorate$1l([r$5()],W3mNetworksView.prototype,"network",void 0);__decorate$1l([r$5()],W3mNetworksView.prototype,"requestedCaipNetworks",void 0);__decorate$1l([r$5()],W3mNetworksView.prototype,"filteredNetworks",void 0);__decorate$1l([r$5()],W3mNetworksView.prototype,"search",void 0);W3mNetworksView=__decorate$1l([customElement("w3m-networks-view")],W3mNetworksView);const styles$U=i$4`
  :host > wui-flex {
    height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    padding: var(--wui-spacing-m);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  :host > wui-flex::-webkit-scrollbar {
    display: none;
  }

  :host > wui-flex > wui-flex {
    width: 100%;
  }

  wui-transaction-list-item-loader {
    width: 100%;
  }
`;var __decorate$1k=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const LOADING_ITEM_COUNT$1=7;let W3mOnRampActivityView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=OnRampController.state.selectedProvider,this.loading=!1,this.coinbaseTransactions=TransactionsController.state.coinbaseTransactions,this.tokenImages=AssetController.state.tokenImages,this.unsubscribe.push(OnRampController.subscribeKey("selectedProvider",Mn=>{this.selectedOnRampProvider=Mn}),AssetController.subscribeKey("tokenImages",Mn=>this.tokenImages=Mn),()=>{clearTimeout(this.refetchTimeout)},TransactionsController.subscribe(Mn=>{this.coinbaseTransactions={...Mn.coinbaseTransactions}})),TransactionsController.clearCursor(),this.fetchTransactions()}render(){return ke`
      <wui-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
        ${this.loading?this.templateLoading():this.templateTransactionsByYear()}
      </wui-flex>
    `}templateTransactions(Mn){return Mn==null?void 0:Mn.map(rs=>{var ds,hs,ps;const is=DateUtil.formatDate((ds=rs==null?void 0:rs.metadata)==null?void 0:ds.minedAt),os=rs.transfers[0],as=os==null?void 0:os.fungible_info;if(!as)return null;const us=((hs=as==null?void 0:as.icon)==null?void 0:hs.url)||((ps=this.tokenImages)==null?void 0:ps[as.symbol||""]);return ke`
        <w3m-onramp-activity-item
          label="Bought"
          .completed=${rs.metadata.status==="ONRAMP_TRANSACTION_STATUS_SUCCESS"}
          .inProgress=${rs.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS"}
          .failed=${rs.metadata.status==="ONRAMP_TRANSACTION_STATUS_FAILED"}
          purchaseCurrency=${to$2(as.symbol)}
          purchaseValue=${os.quantity.numeric}
          date=${is}
          icon=${to$2(us)}
          symbol=${to$2(as.symbol)}
        ></w3m-onramp-activity-item>
      `})}templateTransactionsByYear(){return Object.keys(this.coinbaseTransactions).sort().reverse().map(rs=>{const is=parseInt(rs,10);return new Array(12).fill(null).map((as,us)=>us).reverse().map(as=>{var hs;const us=TransactionUtil.getTransactionGroupTitle(is,as),ds=(hs=this.coinbaseTransactions[is])==null?void 0:hs[as];return ds?ke`
          <wui-flex flexDirection="column">
            <wui-flex
              alignItems="center"
              flexDirection="row"
              .padding=${["xs","s","s","s"]}
            >
              <wui-text variant="paragraph-500" color="fg-200">${us}</wui-text>
            </wui-flex>
            <wui-flex flexDirection="column" gap="xs">
              ${this.templateTransactions(ds)}
            </wui-flex>
          </wui-flex>
        `:null})})}async fetchTransactions(){await this.fetchCoinbaseTransactions()}async fetchCoinbaseTransactions(){const Mn=AccountController.state.address,rs=OptionsController.state.projectId;if(!Mn)throw new Error("No address found");if(!rs)throw new Error("No projectId found");this.loading=!0,await TransactionsController.fetchTransactions(Mn,"coinbase"),this.loading=!1,this.refetchLoadingTransactions()}refetchLoadingTransactions(){var os;const Mn=new Date;if((((os=this.coinbaseTransactions[Mn.getFullYear()])==null?void 0:os[Mn.getMonth()])||[]).filter(as=>as.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length===0){clearTimeout(this.refetchTimeout);return}this.refetchTimeout=setTimeout(async()=>{const as=AccountController.state.address;await TransactionsController.fetchTransactions(as,"coinbase"),this.refetchLoadingTransactions()},3e3)}templateLoading(){return Array(LOADING_ITEM_COUNT$1).fill(ke` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map(Mn=>Mn)}};W3mOnRampActivityView.styles=styles$U;__decorate$1k([r$5()],W3mOnRampActivityView.prototype,"selectedOnRampProvider",void 0);__decorate$1k([r$5()],W3mOnRampActivityView.prototype,"loading",void 0);__decorate$1k([r$5()],W3mOnRampActivityView.prototype,"coinbaseTransactions",void 0);__decorate$1k([r$5()],W3mOnRampActivityView.prototype,"tokenImages",void 0);W3mOnRampActivityView=__decorate$1k([customElement("w3m-onramp-activity-view")],W3mOnRampActivityView);const styles$T=i$4`
  :host > wui-grid {
    max-height: 360px;
    overflow: auto;
  }

  wui-grid::-webkit-scrollbar {
    display: none;
  }
`;var __decorate$1j=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mOnrampFiatSelectView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=OnRampController.state.paymentCurrency,this.currencies=OnRampController.state.paymentCurrencies,this.currencyImages=AssetController.state.currencyImages,this.unsubscribe.push(OnRampController.subscribe(Mn=>{this.selectedCurrency=Mn.paymentCurrency,this.currencies=Mn.paymentCurrencies}),AssetController.subscribeKey("currencyImages",Mn=>this.currencyImages=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return ke`
      <wui-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
        ${this.currenciesTemplate()}
      </wui-flex>
      <w3m-legal-footer></w3m-legal-footer>
    `}currenciesTemplate(){return this.currencies.map(Mn=>{var rs;return ke`
        <wui-list-item
          imageSrc=${to$2((rs=this.currencyImages)==null?void 0:rs[Mn.id])}
          @click=${()=>this.selectCurrency(Mn)}
          variant="image"
        >
          <wui-text variant="paragraph-500" color="fg-100">${Mn.id}</wui-text>
        </wui-list-item>
      `})}selectCurrency(Mn){Mn&&(OnRampController.setPaymentCurrency(Mn),ModalController.close())}};W3mOnrampFiatSelectView.styles=styles$T;__decorate$1j([r$5()],W3mOnrampFiatSelectView.prototype,"selectedCurrency",void 0);__decorate$1j([r$5()],W3mOnrampFiatSelectView.prototype,"currencies",void 0);__decorate$1j([r$5()],W3mOnrampFiatSelectView.prototype,"currencyImages",void 0);W3mOnrampFiatSelectView=__decorate$1j([customElement("w3m-onramp-fiat-select-view")],W3mOnrampFiatSelectView);var __decorate$1i=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mOnRampProvidersView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.providers=OnRampController.state.providers,this.unsubscribe.push(OnRampController.subscribeKey("providers",Mn=>{this.providers=Mn}))}firstUpdated(){const Mn=this.providers.map(async rs=>rs.name==="coinbase"?await this.getCoinbaseOnRampURL():Promise.resolve(rs==null?void 0:rs.url));Promise.all(Mn).then(rs=>{this.providers=this.providers.map((is,os)=>({...is,url:rs[os]||""}))})}render(){return ke`
      <wui-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
        ${this.onRampProvidersTemplate()}
      </wui-flex>
      <w3m-onramp-providers-footer></w3m-onramp-providers-footer>
    `}onRampProvidersTemplate(){return this.providers.filter(Mn=>Mn.supportedChains.includes(ChainController.state.activeChain??"eip155")).map(Mn=>ke`
          <w3m-onramp-provider-item
            label=${Mn.label}
            name=${Mn.name}
            feeRange=${Mn.feeRange}
            @click=${()=>{this.onClickProvider(Mn)}}
            ?disabled=${!Mn.url}
          ></w3m-onramp-provider-item>
        `)}onClickProvider(Mn){OnRampController.setSelectedProvider(Mn),RouterController.push("BuyInProgress"),CoreHelperUtil.openHref(Mn.url,"popupWindow","width=600,height=800,scrollbars=yes"),EventsController.sendEvent({type:"track",event:"SELECT_BUY_PROVIDER",properties:{provider:Mn.name,isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}})}async getCoinbaseOnRampURL(){const Mn=AccountController.state.address,rs=ChainController.state.activeCaipNetwork;if(!Mn)throw new Error("No address found");if(!(rs!=null&&rs.name))throw new Error("No network found");const is=ConstantsUtil$2.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[rs.name]??ConstantsUtil$2.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,os=OnRampController.state.purchaseCurrency,as=os?[os.symbol]:OnRampController.state.purchaseCurrencies.map(us=>us.symbol);return await BlockchainApiController.generateOnRampURL({defaultNetwork:is,destinationWallets:[{address:Mn,blockchains:ConstantsUtil$2.WC_COINBASE_PAY_SDK_CHAINS,assets:as}],partnerUserId:Mn,purchaseAmount:OnRampController.state.purchaseAmount})}};__decorate$1i([r$5()],W3mOnRampProvidersView.prototype,"providers",void 0);W3mOnRampProvidersView=__decorate$1i([customElement("w3m-onramp-providers-view")],W3mOnRampProvidersView);const styles$S=i$4`
  :host > wui-grid {
    max-height: 360px;
    overflow: auto;
  }

  wui-grid::-webkit-scrollbar {
    display: none;
  }
`;var __decorate$1h=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mOnrampTokensView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=OnRampController.state.purchaseCurrencies,this.tokens=OnRampController.state.purchaseCurrencies,this.tokenImages=AssetController.state.tokenImages,this.unsubscribe.push(OnRampController.subscribe(Mn=>{this.selectedCurrency=Mn.purchaseCurrencies,this.tokens=Mn.purchaseCurrencies}),AssetController.subscribeKey("tokenImages",Mn=>this.tokenImages=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return ke`
      <wui-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
        ${this.currenciesTemplate()}
      </wui-flex>
      <w3m-legal-footer></w3m-legal-footer>
    `}currenciesTemplate(){return this.tokens.map(Mn=>{var rs;return ke`
        <wui-list-item
          imageSrc=${to$2((rs=this.tokenImages)==null?void 0:rs[Mn.symbol])}
          @click=${()=>this.selectToken(Mn)}
          variant="image"
        >
          <wui-flex gap="3xs" alignItems="center">
            <wui-text variant="paragraph-500" color="fg-100">${Mn.name}</wui-text>
            <wui-text variant="small-400" color="fg-200">${Mn.symbol}</wui-text>
          </wui-flex>
        </wui-list-item>
      `})}selectToken(Mn){Mn&&(OnRampController.setPurchaseCurrency(Mn),ModalController.close())}};W3mOnrampTokensView.styles=styles$S;__decorate$1h([r$5()],W3mOnrampTokensView.prototype,"selectedCurrency",void 0);__decorate$1h([r$5()],W3mOnrampTokensView.prototype,"tokens",void 0);__decorate$1h([r$5()],W3mOnrampTokensView.prototype,"tokenImages",void 0);W3mOnrampTokensView=__decorate$1h([customElement("w3m-onramp-token-select-view")],W3mOnrampTokensView);const styles$R=i$4`
  :host > wui-flex:first-child {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }

  :host > wui-flex:first-child::-webkit-scrollbar {
    display: none;
  }

  wui-loading-hexagon {
    position: absolute;
  }

  .action-button {
    width: 100%;
    border-radius: var(--wui-border-radius-xs);
  }

  .action-button:disabled {
    border-color: 1px solid var(--wui-color-gray-glass-005);
  }

  .swap-inputs-container {
    position: relative;
  }

  .replace-tokens-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    gap: var(--wui-spacing-1xs);
    border-radius: var(--wui-border-radius-xs);
    background-color: var(--wui-color-modal-bg-base);
    padding: var(--wui-spacing-xxs);
  }

  .replace-tokens-button-container > button {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    width: 40px;
    padding: var(--wui-spacing-xs);
    border: none;
    border-radius: var(--wui-border-radius-xxs);
    background: var(--wui-color-gray-glass-002);
    transition: background-color var(--wui-duration-md) var(--wui-ease-out-power-1);
    will-change: background-color;
    z-index: 20;
  }

  .replace-tokens-button-container > button:hover {
    background: var(--wui-color-gray-glass-005);
  }

  .details-container > wui-flex {
    background: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xxs);
    width: 100%;
  }

  .details-container > wui-flex > button {
    border: none;
    background: none;
    padding: var(--wui-spacing-s);
    border-radius: var(--wui-border-radius-xxs);
    transition: background 0.2s linear;
  }

  .details-container > wui-flex > button:hover {
    background: var(--wui-color-gray-glass-002);
  }

  .details-content-container {
    padding: var(--wui-spacing-1xs);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .details-content-container > wui-flex {
    width: 100%;
  }

  .details-row {
    width: 100%;
    padding: var(--wui-spacing-s) var(--wui-spacing-xl);
    border-radius: var(--wui-border-radius-xxs);
    background: var(--wui-color-gray-glass-002);
  }
`;var __decorate$1g=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mSwapView=class extends h$3{constructor(){var Mn;super(),this.unsubscribe=[],this.detailsOpen=!1,this.caipNetworkId=(Mn=ChainController.state.activeCaipNetwork)==null?void 0:Mn.caipNetworkId,this.initialized=SwapController.state.initialized,this.loadingQuote=SwapController.state.loadingQuote,this.loadingPrices=SwapController.state.loadingPrices,this.loadingTransaction=SwapController.state.loadingTransaction,this.sourceToken=SwapController.state.sourceToken,this.sourceTokenAmount=SwapController.state.sourceTokenAmount,this.sourceTokenPriceInUSD=SwapController.state.sourceTokenPriceInUSD,this.toToken=SwapController.state.toToken,this.toTokenAmount=SwapController.state.toTokenAmount,this.toTokenPriceInUSD=SwapController.state.toTokenPriceInUSD,this.inputError=SwapController.state.inputError,this.gasPriceInUSD=SwapController.state.gasPriceInUSD,this.fetchError=SwapController.state.fetchError,this.onDebouncedGetSwapCalldata=CoreHelperUtil.debounce(async()=>{await SwapController.swapTokens()},200),ChainController.subscribeKey("activeCaipNetwork",rs=>{this.caipNetworkId!==(rs==null?void 0:rs.caipNetworkId)&&(this.caipNetworkId=rs==null?void 0:rs.caipNetworkId,SwapController.resetState(),SwapController.initializeState())}),this.unsubscribe.push(ModalController.subscribeKey("open",rs=>{rs||SwapController.resetState()}),RouterController.subscribeKey("view",rs=>{rs.includes("Swap")||SwapController.resetValues()}),SwapController.subscribe(rs=>{this.initialized=rs.initialized,this.loadingQuote=rs.loadingQuote,this.loadingPrices=rs.loadingPrices,this.loadingTransaction=rs.loadingTransaction,this.sourceToken=rs.sourceToken,this.sourceTokenAmount=rs.sourceTokenAmount,this.sourceTokenPriceInUSD=rs.sourceTokenPriceInUSD,this.toToken=rs.toToken,this.toTokenAmount=rs.toTokenAmount,this.toTokenPriceInUSD=rs.toTokenPriceInUSD,this.inputError=rs.inputError,this.gasPriceInUSD=rs.gasPriceInUSD,this.fetchError=rs.fetchError}))}firstUpdated(){SwapController.initializeState(),this.watchTokensAndValues()}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn==null?void 0:Mn()),clearInterval(this.interval)}render(){return ke`
      <wui-flex flexDirection="column" .padding=${["0","l","l","l"]} gap="s">
        ${this.initialized?this.templateSwap():this.templateLoading()}
      </wui-flex>
    `}watchTokensAndValues(){this.interval=setInterval(()=>{SwapController.getNetworkTokenPrice(),SwapController.getMyTokensWithBalance(),SwapController.swapTokens()},1e4)}templateSwap(){return ke`
      <wui-flex flexDirection="column" gap="s">
        <wui-flex flexDirection="column" alignItems="center" gap="xs" class="swap-inputs-container">
          ${this.templateTokenInput("sourceToken",this.sourceToken)}
          ${this.templateTokenInput("toToken",this.toToken)} ${this.templateReplaceTokensButton()}
        </wui-flex>
        ${this.templateDetails()} ${this.templateActionButton()}
      </wui-flex>
    `}actionButtonLabel(){return this.fetchError?"Swap":!this.sourceToken||!this.toToken?"Select token":this.sourceTokenAmount?this.inputError?this.inputError:"Review swap":"Enter amount"}templateReplaceTokensButton(){return ke`
      <wui-flex class="replace-tokens-button-container">
        <button @click=${this.onSwitchTokens.bind(this)}>
          <wui-icon name="recycleHorizontal" color="fg-250" size="lg"></wui-icon>
        </button>
      </wui-flex>
    `}templateLoading(){return ke`
      <wui-flex flexDirection="column" gap="l">
        <wui-flex flexDirection="column" alignItems="center" gap="xs" class="swap-inputs-container">
          <w3m-swap-input-skeleton target="sourceToken"></w3m-swap-input-skeleton>
          <w3m-swap-input-skeleton target="toToken"></w3m-swap-input-skeleton>
          ${this.templateReplaceTokensButton()}
        </wui-flex>
        ${this.templateActionButton()}
      </wui-flex>
    `}templateTokenInput(Mn,rs){var ds,hs;const is=(ds=SwapController.state.myTokensWithBalance)==null?void 0:ds.find(ps=>(ps==null?void 0:ps.address)===(rs==null?void 0:rs.address)),os=Mn==="toToken"?this.toTokenAmount:this.sourceTokenAmount,as=Mn==="toToken"?this.toTokenPriceInUSD:this.sourceTokenPriceInUSD;let us=parseFloat(os)*as;return Mn==="toToken"&&(us-=this.gasPriceInUSD||0),ke`<w3m-swap-input
      .value=${Mn==="toToken"?this.toTokenAmount:this.sourceTokenAmount}
      ?disabled=${this.loadingQuote&&Mn==="toToken"}
      .onSetAmount=${this.handleChangeAmount.bind(this)}
      target=${Mn}
      .token=${rs}
      .balance=${(hs=is==null?void 0:is.quantity)==null?void 0:hs.numeric}
      .price=${is==null?void 0:is.price}
      .marketValue=${us}
      .onSetMaxValue=${this.onSetMaxValue.bind(this)}
    ></w3m-swap-input>`}onSetMaxValue(Mn,rs){const is=Mn==="sourceToken"?this.sourceToken:this.toToken,os=(is==null?void 0:is.address)===ChainController.getActiveNetworkTokenAddress();let as="0";if(!rs){as="0",this.handleChangeAmount(Mn,as);return}if(!this.gasPriceInUSD){as=rs,this.handleChangeAmount(Mn,as);return}const us=NumberUtil.bigNumber(this.gasPriceInUSD.toFixed(5)).dividedBy(this.sourceTokenPriceInUSD),ds=os?NumberUtil.bigNumber(rs).minus(us):NumberUtil.bigNumber(rs);this.handleChangeAmount(Mn,ds.isGreaterThan(0)?ds.toFixed(20):"0")}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:ke`<w3m-swap-details .detailsOpen=${this.detailsOpen}></w3m-swap-details>`}handleChangeAmount(Mn,rs){SwapController.clearError(),Mn==="sourceToken"?SwapController.setSourceTokenAmount(rs):SwapController.setToTokenAmount(rs),this.onDebouncedGetSwapCalldata()}templateActionButton(){const Mn=!this.toToken||!this.sourceToken,rs=!this.sourceTokenAmount,is=this.loadingQuote||this.loadingPrices||this.loadingTransaction,os=is||Mn||rs||this.inputError;return ke` <wui-flex gap="xs">
      <wui-button
        data-testid="swap-action-button"
        class="action-button"
        fullWidth
        size="lg"
        borderRadius="xs"
        variant=${Mn?"neutral":"main"}
        .loading=${is}
        .disabled=${os}
        @click=${this.onSwapPreview.bind(this)}
      >
        ${this.actionButtonLabel()}
      </wui-button>
    </wui-flex>`}onSwitchTokens(){SwapController.switchTokens()}onSwapPreview(){var Mn,rs;if(this.fetchError){SwapController.swapTokens();return}EventsController.sendEvent({type:"track",event:"INITIATE_SWAP",properties:{network:this.caipNetworkId||"",swapFromToken:((Mn=this.sourceToken)==null?void 0:Mn.symbol)||"",swapToToken:((rs=this.toToken)==null?void 0:rs.symbol)||"",swapFromAmount:this.sourceTokenAmount||"",swapToAmount:this.toTokenAmount||"",isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("SwapPreview")}};W3mSwapView.styles=styles$R;__decorate$1g([r$5()],W3mSwapView.prototype,"interval",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"detailsOpen",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"caipNetworkId",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"initialized",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"loadingQuote",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"loadingPrices",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"loadingTransaction",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"sourceToken",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"sourceTokenAmount",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"sourceTokenPriceInUSD",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"toToken",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"toTokenAmount",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"toTokenPriceInUSD",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"inputError",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"gasPriceInUSD",void 0);__decorate$1g([r$5()],W3mSwapView.prototype,"fetchError",void 0);W3mSwapView=__decorate$1g([customElement("w3m-swap-view")],W3mSwapView);const styles$Q=i$4`
  @keyframes shake {
    0% {
      transform: translateX(0);
    }
    25% {
      transform: translateX(3px);
    }
    50% {
      transform: translateX(-3px);
    }
    75% {
      transform: translateX(3px);
    }
    100% {
      transform: translateX(0);
    }
  }

  wui-flex:first-child:not(:only-child) {
    position: relative;
  }

  wui-loading-thumbnail {
    position: absolute;
  }

  wui-visual {
    width: var(--wui-wallet-image-size-lg);
    height: var(--wui-wallet-image-size-lg);
    border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
    position: relative;
    overflow: hidden;
  }

  wui-visual::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
  }

  wui-icon-box {
    position: absolute;
    right: calc(var(--wui-spacing-3xs) * -1);
    bottom: calc(var(--wui-spacing-3xs) * -1);
    opacity: 0;
    transform: scale(0.5);
    transition:
      opacity var(--wui-ease-out-power-2) var(--wui-duration-lg),
      transform var(--wui-ease-out-power-2) var(--wui-duration-lg);
    will-change: opacity, transform;
  }

  wui-text[align='center'] {
    width: 100%;
    padding: 0px var(--wui-spacing-l);
  }

  [data-error='true'] wui-icon-box {
    opacity: 1;
    transform: scale(1);
  }

  [data-error='true'] > wui-flex:first-child {
    animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  }

  [data-retry='false'] wui-link {
    display: none;
  }

  [data-retry='true'] wui-link {
    display: block;
    opacity: 1;
  }

  wui-link {
    padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
  }

  .capitalize {
    text-transform: capitalize;
  }
`;var __decorate$1f=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mSwitchActiveChainView=class extends h$3{constructor(){var Mn,rs,is,os;super(...arguments),this.unsubscribe=[],this.switchToChain=(Mn=RouterController.state.data)==null?void 0:Mn.switchToChain,this.navigateTo=(rs=RouterController.state.data)==null?void 0:rs.navigateTo,this.navigateWithReplace=(is=RouterController.state.data)==null?void 0:is.navigateWithReplace,this.caipNetwork=(os=RouterController.state.data)==null?void 0:os.network,this.activeChain=ChainController.state.activeChain}firstUpdated(){this.unsubscribe.push(ChainController.subscribeKey("activeChain",Mn=>this.activeChain=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const Mn=this.switchToChain?ConstantsUtil$3.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const rs=this.switchToChain==="eip155"?"Ethereum":this.switchToChain;return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        .padding=${["3xl","xl","xl","xl"]}
        gap="xl"
      >
        <wui-flex justifyContent="center" flexDirection="column" alignItems="center" gap="xl">
          <wui-visual
            name=${this.switchToChain==="eip155"?"eth":this.switchToChain}
          ></wui-visual>
          <wui-text
            data-testid=${`w3m-switch-active-chain-to-${rs}`}
            variant="paragraph-500"
            color="fg-100"
            align="center"
            >Switch to <span class="capitalize">${rs}</span></wui-text
          >
          <wui-text variant="small-400" color="fg-200" align="center">
            Connected wallet doesn't support connecting to ${Mn} chain. You
            need to connect with a different wallet.
          </wui-text>
          <wui-button size="md" @click=${this.switchActiveChain.bind(this)}>Switch</wui-button>
        </wui-flex>
      </wui-flex>
    `}async switchActiveChain(){this.switchToChain&&(this.caipNetwork?await ChainController.switchActiveNetwork(this.caipNetwork):ChainController.setActiveNamespace(this.switchToChain),ModalController.close(),ModalController.open({view:"Connect"}))}};W3mSwitchActiveChainView.styles=styles$Q;__decorate$1f([n$4()],W3mSwitchActiveChainView.prototype,"activeChain",void 0);W3mSwitchActiveChainView=__decorate$1f([customElement("w3m-switch-active-chain-view")],W3mSwitchActiveChainView);const styles$P=i$4`
  :host > wui-flex:first-child {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }

  :host > wui-flex:first-child::-webkit-scrollbar {
    display: none;
  }

  .preview-container,
  .details-container {
    width: 100%;
  }

  .token-image {
    width: 24px;
    height: 24px;
    box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
    border-radius: 12px;
  }

  wui-loading-hexagon {
    position: absolute;
  }

  .token-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--wui-spacing-xxs);
    padding: var(--wui-spacing-xs);
    height: 40px;
    border: none;
    border-radius: 80px;
    background: var(--wui-color-gray-glass-002);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
    cursor: pointer;
    transition: background 0.2s linear;
  }

  .token-item:hover {
    background: var(--wui-color-gray-glass-005);
  }

  .preview-token-details-container {
    width: 100%;
  }

  .details-row {
    width: 100%;
    padding: var(--wui-spacing-s) var(--wui-spacing-xl);
    border-radius: var(--wui-border-radius-xxs);
    background: var(--wui-color-gray-glass-002);
  }

  .action-buttons-container {
    width: 100%;
    gap: var(--wui-spacing-xs);
  }

  .action-buttons-container > button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    height: 48px;
    border-radius: var(--wui-border-radius-xs);
    border: none;
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
  }

  .action-buttons-container > button:disabled {
    opacity: 0.8;
    cursor: not-allowed;
  }

  .action-button > wui-loading-spinner {
    display: inline-block;
  }

  .cancel-button:hover,
  .action-button:hover {
    cursor: pointer;
  }

  .action-buttons-container > wui-button.cancel-button {
    flex: 2;
  }

  .action-buttons-container > wui-button.action-button {
    flex: 4;
  }

  .action-buttons-container > button.action-button > wui-text {
    color: white;
  }

  .details-container > wui-flex {
    background: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xxs);
    width: 100%;
  }

  .details-container > wui-flex > button {
    border: none;
    background: none;
    padding: var(--wui-spacing-s);
    border-radius: var(--wui-border-radius-xxs);
    transition: background 0.2s linear;
  }

  .details-container > wui-flex > button:hover {
    background: var(--wui-color-gray-glass-002);
  }

  .details-content-container {
    padding: var(--wui-spacing-1xs);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .details-content-container > wui-flex {
    width: 100%;
  }

  .details-row {
    width: 100%;
    padding: var(--wui-spacing-s) var(--wui-spacing-xl);
    border-radius: var(--wui-border-radius-xxs);
    background: var(--wui-color-gray-glass-002);
  }
`;var __decorate$1e=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mSwapPreviewView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.detailsOpen=!0,this.approvalTransaction=SwapController.state.approvalTransaction,this.swapTransaction=SwapController.state.swapTransaction,this.sourceToken=SwapController.state.sourceToken,this.sourceTokenAmount=SwapController.state.sourceTokenAmount??"",this.sourceTokenPriceInUSD=SwapController.state.sourceTokenPriceInUSD,this.toToken=SwapController.state.toToken,this.toTokenAmount=SwapController.state.toTokenAmount??"",this.toTokenPriceInUSD=SwapController.state.toTokenPriceInUSD,this.caipNetwork=ChainController.state.activeCaipNetwork,this.balanceSymbol=AccountController.state.balanceSymbol,this.gasPriceInUSD=SwapController.state.gasPriceInUSD,this.inputError=SwapController.state.inputError,this.loadingQuote=SwapController.state.loadingQuote,this.loadingApprovalTransaction=SwapController.state.loadingApprovalTransaction,this.loadingBuildTransaction=SwapController.state.loadingBuildTransaction,this.loadingTransaction=SwapController.state.loadingTransaction,this.unsubscribe.push(AccountController.subscribeKey("balanceSymbol",Mn=>{this.balanceSymbol!==Mn&&RouterController.goBack()}),ChainController.subscribeKey("activeCaipNetwork",Mn=>{this.caipNetwork!==Mn&&(this.caipNetwork=Mn)}),SwapController.subscribe(Mn=>{this.approvalTransaction=Mn.approvalTransaction,this.swapTransaction=Mn.swapTransaction,this.sourceToken=Mn.sourceToken,this.gasPriceInUSD=Mn.gasPriceInUSD,this.toToken=Mn.toToken,this.gasPriceInUSD=Mn.gasPriceInUSD,this.toTokenPriceInUSD=Mn.toTokenPriceInUSD,this.sourceTokenAmount=Mn.sourceTokenAmount??"",this.toTokenAmount=Mn.toTokenAmount??"",this.inputError=Mn.inputError,Mn.inputError&&RouterController.goBack(),this.loadingQuote=Mn.loadingQuote,this.loadingApprovalTransaction=Mn.loadingApprovalTransaction,this.loadingBuildTransaction=Mn.loadingBuildTransaction,this.loadingTransaction=Mn.loadingTransaction}))}firstUpdated(){SwapController.getTransaction(),this.refreshTransaction()}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn==null?void 0:Mn()),clearInterval(this.interval)}render(){return ke`
      <wui-flex flexDirection="column" .padding=${["0","l","l","l"]} gap="s">
        ${this.templateSwap()}
      </wui-flex>
    `}refreshTransaction(){this.interval=setInterval(()=>{SwapController.getApprovalLoadingState()||SwapController.getTransaction()},1e4)}templateSwap(){var hs,ps,io,fo;const Mn=`${UiHelperUtil.formatNumberToLocalString(parseFloat(this.sourceTokenAmount))} ${(hs=this.sourceToken)==null?void 0:hs.symbol}`,rs=`${UiHelperUtil.formatNumberToLocalString(parseFloat(this.toTokenAmount))} ${(ps=this.toToken)==null?void 0:ps.symbol}`,is=parseFloat(this.sourceTokenAmount)*this.sourceTokenPriceInUSD,os=parseFloat(this.toTokenAmount)*this.toTokenPriceInUSD-(this.gasPriceInUSD||0),as=UiHelperUtil.formatNumberToLocalString(is),us=UiHelperUtil.formatNumberToLocalString(os),ds=this.loadingQuote||this.loadingBuildTransaction||this.loadingTransaction||this.loadingApprovalTransaction;return ke`
      <wui-flex flexDirection="column" alignItems="center" gap="l">
        <wui-flex class="preview-container" flexDirection="column" alignItems="flex-start" gap="l">
          <wui-flex
            class="preview-token-details-container"
            alignItems="center"
            justifyContent="space-between"
            gap="l"
          >
            <wui-flex flexDirection="column" alignItems="flex-start" gap="4xs">
              <wui-text variant="small-400" color="fg-150">Send</wui-text>
              <wui-text variant="paragraph-400" color="fg-100">$${as}</wui-text>
            </wui-flex>
            <wui-token-button
              flexDirection="row-reverse"
              text=${Mn}
              imageSrc=${(io=this.sourceToken)==null?void 0:io.logoUri}
            >
            </wui-token-button>
          </wui-flex>
          <wui-icon name="recycleHorizontal" color="fg-200" size="md"></wui-icon>
          <wui-flex
            class="preview-token-details-container"
            alignItems="center"
            justifyContent="space-between"
            gap="l"
          >
            <wui-flex flexDirection="column" alignItems="flex-start" gap="4xs">
              <wui-text variant="small-400" color="fg-150">Receive</wui-text>
              <wui-text variant="paragraph-400" color="fg-100">$${us}</wui-text>
            </wui-flex>
            <wui-token-button
              flexDirection="row-reverse"
              text=${rs}
              imageSrc=${(fo=this.toToken)==null?void 0:fo.logoUri}
            >
            </wui-token-button>
          </wui-flex>
        </wui-flex>

        ${this.templateDetails()}

        <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="xs">
          <wui-icon size="sm" color="fg-200" name="infoCircle"></wui-icon>
          <wui-text variant="small-400" color="fg-200">Review transaction carefully</wui-text>
        </wui-flex>

        <wui-flex
          class="action-buttons-container"
          flexDirection="row"
          alignItems="center"
          justifyContent="space-between"
          gap="xs"
        >
          <wui-button
            class="cancel-button"
            fullWidth
            size="lg"
            borderRadius="xs"
            variant="neutral"
            @click=${this.onCancelTransaction.bind(this)}
          >
            <wui-text variant="paragraph-600" color="fg-200">Cancel</wui-text>
          </wui-button>
          <wui-button
            class="action-button"
            fullWidth
            size="lg"
            borderRadius="xs"
            variant="main"
            ?loading=${ds}
            ?disabled=${ds}
            @click=${this.onSendTransaction.bind(this)}
          >
            <wui-text variant="paragraph-600" color="inverse-100">
              ${this.actionButtonLabel()}
            </wui-text>
          </wui-button>
        </wui-flex>
      </wui-flex>
    `}templateDetails(){return!this.sourceToken||!this.toToken||this.inputError?null:ke`<w3m-swap-details .detailsOpen=${this.detailsOpen}></w3m-swap-details>`}actionButtonLabel(){return this.loadingApprovalTransaction?"Approving...":this.approvalTransaction?"Approve":"Swap"}onCancelTransaction(){RouterController.goBack()}onSendTransaction(){this.approvalTransaction?SwapController.sendTransactionForApproval(this.approvalTransaction):SwapController.sendTransactionForSwap(this.swapTransaction)}};W3mSwapPreviewView.styles=styles$P;__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"interval",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"detailsOpen",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"approvalTransaction",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"swapTransaction",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"sourceToken",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"sourceTokenAmount",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"sourceTokenPriceInUSD",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"toToken",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"toTokenAmount",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"toTokenPriceInUSD",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"caipNetwork",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"balanceSymbol",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"gasPriceInUSD",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"inputError",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"loadingQuote",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"loadingApprovalTransaction",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"loadingBuildTransaction",void 0);__decorate$1e([r$5()],W3mSwapPreviewView.prototype,"loadingTransaction",void 0);W3mSwapPreviewView=__decorate$1e([customElement("w3m-swap-preview-view")],W3mSwapPreviewView);const styles$O=i$4`
  :host {
    --tokens-scroll--top-opacity: 0;
    --tokens-scroll--bottom-opacity: 1;
    --suggested-tokens-scroll--left-opacity: 0;
    --suggested-tokens-scroll--right-opacity: 1;
  }

  :host > wui-flex:first-child {
    overflow-y: hidden;
    overflow-x: hidden;
    scrollbar-width: none;
    scrollbar-height: none;
  }

  :host > wui-flex:first-child::-webkit-scrollbar {
    display: none;
  }

  wui-loading-hexagon {
    position: absolute;
  }

  .suggested-tokens-container {
    overflow-x: auto;
    mask-image: linear-gradient(
      to right,
      rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 0px,
      rgba(200, 200, 200, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 1px,
      black 50px,
      black 90px,
      black calc(100% - 90px),
      black calc(100% - 50px),
      rgba(155, 155, 155, calc(1 - var(--suggested-tokens-scroll--right-opacity))) calc(100% - 1px),
      rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--right-opacity))) 100%
    );
  }

  .suggested-tokens-container::-webkit-scrollbar {
    display: none;
  }

  .tokens-container {
    border-top: 1px solid var(--wui-color-gray-glass-005);
    height: 100%;
    max-height: 390px;
  }

  .tokens {
    width: 100%;
    overflow-y: auto;
    mask-image: linear-gradient(
      to bottom,
      rgba(0, 0, 0, calc(1 - var(--tokens-scroll--top-opacity))) 0px,
      rgba(200, 200, 200, calc(1 - var(--tokens-scroll--top-opacity))) 1px,
      black 50px,
      black 90px,
      black calc(100% - 90px),
      black calc(100% - 50px),
      rgba(155, 155, 155, calc(1 - var(--tokens-scroll--bottom-opacity))) calc(100% - 1px),
      rgba(0, 0, 0, calc(1 - var(--tokens-scroll--bottom-opacity))) 100%
    );
  }

  .network-search-input,
  .select-network-button {
    height: 40px;
  }

  .select-network-button {
    border: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--wui-spacing-xs);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
    background-color: transparent;
    border-radius: var(--wui-border-radius-xxs);
    padding: var(--wui-spacing-xs);
    align-items: center;
    transition: background-color 0.2s linear;
  }

  .select-network-button:hover {
    background-color: var(--wui-color-gray-glass-002);
  }

  .select-network-button > wui-image {
    width: 26px;
    height: 26px;
    border-radius: var(--wui-border-radius-xs);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
  }
`;var __decorate$1d=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mSwapSelectTokenView=class extends h$3{constructor(){var Mn;super(),this.unsubscribe=[],this.targetToken=(Mn=RouterController.state.data)==null?void 0:Mn.target,this.sourceToken=SwapController.state.sourceToken,this.sourceTokenAmount=SwapController.state.sourceTokenAmount,this.toToken=SwapController.state.toToken,this.myTokensWithBalance=SwapController.state.myTokensWithBalance,this.popularTokens=SwapController.state.popularTokens,this.searchValue="",this.unsubscribe.push(SwapController.subscribe(rs=>{this.sourceToken=rs.sourceToken,this.toToken=rs.toToken,this.myTokensWithBalance=rs.myTokensWithBalance}))}updated(){var is,os;const Mn=(is=this.renderRoot)==null?void 0:is.querySelector(".suggested-tokens-container");Mn==null||Mn.addEventListener("scroll",this.handleSuggestedTokensScroll.bind(this));const rs=(os=this.renderRoot)==null?void 0:os.querySelector(".tokens");rs==null||rs.addEventListener("scroll",this.handleTokenListScroll.bind(this))}disconnectedCallback(){var is,os;super.disconnectedCallback();const Mn=(is=this.renderRoot)==null?void 0:is.querySelector(".suggested-tokens-container"),rs=(os=this.renderRoot)==null?void 0:os.querySelector(".tokens");Mn==null||Mn.removeEventListener("scroll",this.handleSuggestedTokensScroll.bind(this)),rs==null||rs.removeEventListener("scroll",this.handleTokenListScroll.bind(this)),clearInterval(this.interval)}render(){return ke`
      <wui-flex flexDirection="column" gap="s">
        ${this.templateSearchInput()} ${this.templateSuggestedTokens()} ${this.templateTokens()}
      </wui-flex>
    `}onSelectToken(Mn){this.targetToken==="sourceToken"?SwapController.setSourceToken(Mn):(SwapController.setToToken(Mn),this.sourceToken&&this.sourceTokenAmount&&SwapController.swapTokens()),RouterController.goBack()}templateSearchInput(){return ke`
      <wui-flex .padding=${["3xs","s","0","s"]} gap="xs">
        <wui-input-text
          data-testid="swap-select-token-search-input"
          class="network-search-input"
          size="sm"
          placeholder="Search token"
          icon="search"
          .value=${this.searchValue}
          @inputChange=${this.onSearchInputChange.bind(this)}
        ></wui-input-text>
      </wui-flex>
    `}templateTokens(){const Mn=this.myTokensWithBalance?Object.values(this.myTokensWithBalance):[],rs=this.popularTokens?this.popularTokens:[],is=this.filterTokensWithText(Mn,this.searchValue),os=this.filterTokensWithText(rs,this.searchValue);return ke`
      <wui-flex class="tokens-container">
        <wui-flex class="tokens" .padding=${["0","s","s","s"]} flexDirection="column">
          ${(is==null?void 0:is.length)>0?ke`
                <wui-flex justifyContent="flex-start" padding="s">
                  <wui-text variant="paragraph-500" color="fg-200">Your tokens</wui-text>
                </wui-flex>
                ${is.map(as=>{var ds,hs,ps;const us=as.symbol===((ds=this.sourceToken)==null?void 0:ds.symbol)||as.symbol===((hs=this.toToken)==null?void 0:hs.symbol);return ke`
                    <wui-token-list-item
                      data-testid="swap-select-token-item-${as.symbol}"
                      name=${as.name}
                      ?disabled=${us}
                      symbol=${as.symbol}
                      price=${as==null?void 0:as.price}
                      amount=${(ps=as==null?void 0:as.quantity)==null?void 0:ps.numeric}
                      imageSrc=${as.logoUri}
                      @click=${()=>{us||this.onSelectToken(as)}}
                    >
                    </wui-token-list-item>
                  `})}
              `:null}

          <wui-flex justifyContent="flex-start" padding="s">
            <wui-text variant="paragraph-500" color="fg-200">Tokens</wui-text>
          </wui-flex>
          ${(os==null?void 0:os.length)>0?os.map(as=>ke`
                  <wui-token-list-item
                    data-testid="swap-select-token-item-${as.symbol}"
                    name=${as.name}
                    symbol=${as.symbol}
                    imageSrc=${as.logoUri}
                    @click=${()=>this.onSelectToken(as)}
                  >
                  </wui-token-list-item>
                `):null}
        </wui-flex>
      </wui-flex>
    `}templateSuggestedTokens(){const Mn=SwapController.state.suggestedTokens?SwapController.state.suggestedTokens.slice(0,8):null;return Mn?ke`
      <wui-flex class="suggested-tokens-container" .padding=${["0","s","0","s"]} gap="xs">
        ${Mn.map(rs=>ke`
            <wui-token-button
              text=${rs.symbol}
              imageSrc=${rs.logoUri}
              @click=${()=>this.onSelectToken(rs)}
            >
            </wui-token-button>
          `)}
      </wui-flex>
    `:null}onSearchInputChange(Mn){this.searchValue=Mn.detail}handleSuggestedTokensScroll(){var rs;const Mn=(rs=this.renderRoot)==null?void 0:rs.querySelector(".suggested-tokens-container");Mn&&(Mn.style.setProperty("--suggested-tokens-scroll--left-opacity",MathUtil.interpolate([0,100],[0,1],Mn.scrollLeft).toString()),Mn.style.setProperty("--suggested-tokens-scroll--right-opacity",MathUtil.interpolate([0,100],[0,1],Mn.scrollWidth-Mn.scrollLeft-Mn.offsetWidth).toString()))}handleTokenListScroll(){var rs;const Mn=(rs=this.renderRoot)==null?void 0:rs.querySelector(".tokens");Mn&&(Mn.style.setProperty("--tokens-scroll--top-opacity",MathUtil.interpolate([0,100],[0,1],Mn.scrollTop).toString()),Mn.style.setProperty("--tokens-scroll--bottom-opacity",MathUtil.interpolate([0,100],[0,1],Mn.scrollHeight-Mn.scrollTop-Mn.offsetHeight).toString()))}filterTokensWithText(Mn,rs){return Mn.filter(is=>`${is.symbol} ${is.name} ${is.address}`.toLowerCase().includes(rs.toLowerCase()))}};W3mSwapSelectTokenView.styles=styles$O;__decorate$1d([r$5()],W3mSwapSelectTokenView.prototype,"interval",void 0);__decorate$1d([r$5()],W3mSwapSelectTokenView.prototype,"targetToken",void 0);__decorate$1d([r$5()],W3mSwapSelectTokenView.prototype,"sourceToken",void 0);__decorate$1d([r$5()],W3mSwapSelectTokenView.prototype,"sourceTokenAmount",void 0);__decorate$1d([r$5()],W3mSwapSelectTokenView.prototype,"toToken",void 0);__decorate$1d([r$5()],W3mSwapSelectTokenView.prototype,"myTokensWithBalance",void 0);__decorate$1d([r$5()],W3mSwapSelectTokenView.prototype,"popularTokens",void 0);__decorate$1d([r$5()],W3mSwapSelectTokenView.prototype,"searchValue",void 0);W3mSwapSelectTokenView=__decorate$1d([customElement("w3m-swap-select-token-view")],W3mSwapSelectTokenView);const styles$N=i$4`
  :host > wui-flex:first-child {
    height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }

  :host > wui-flex:first-child::-webkit-scrollbar {
    display: none;
  }
`;var __decorate$1c=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mTransactionsView=class extends h$3{render(){return ke`
      <wui-flex flexDirection="column" .padding=${["0","m","m","m"]} gap="s">
        <w3m-activity-list page="activity"></w3m-activity-list>
      </wui-flex>
    `}};W3mTransactionsView.styles=styles$N;W3mTransactionsView=__decorate$1c([customElement("w3m-transactions-view")],W3mTransactionsView);var __decorate$1b=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const data$1=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let W3mWhatIsANetworkView=class extends h$3{render(){return ke`
      <wui-flex
        flexDirection="column"
        .padding=${["xxl","xl","xl","xl"]}
        alignItems="center"
        gap="xl"
      >
        <w3m-help-widget .data=${data$1}></w3m-help-widget>
        <wui-button
          variant="main"
          size="md"
          @click=${()=>{CoreHelperUtil.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}}
        >
          Learn more
          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
        </wui-button>
      </wui-flex>
    `}};W3mWhatIsANetworkView=__decorate$1b([customElement("w3m-what-is-a-network-view")],W3mWhatIsANetworkView);var __decorate$1a=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const data=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let W3mWhatIsAWalletView=class extends h$3{render(){return ke`
      <wui-flex
        flexDirection="column"
        .padding=${["xxl","xl","xl","xl"]}
        alignItems="center"
        gap="xl"
      >
        <w3m-help-widget .data=${data}></w3m-help-widget>
        <wui-button variant="main" size="md" @click=${this.onGetWallet.bind(this)}>
          <wui-icon color="inherit" slot="iconLeft" name="wallet"></wui-icon>
          Get a wallet
        </wui-button>
      </wui-flex>
    `}onGetWallet(){EventsController.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),RouterController.push("GetWallet")}};W3mWhatIsAWalletView=__decorate$1a([customElement("w3m-what-is-a-wallet-view")],W3mWhatIsAWalletView);var __decorate$19=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mWhatIsABuyView=class extends h$3{render(){return ke`
      <wui-flex
        flexDirection="column"
        .padding=${["xxl","3xl","xl","3xl"]}
        alignItems="center"
        gap="xl"
      >
        <wui-visual name="onrampCard"></wui-visual>
        <wui-flex flexDirection="column" gap="xs" alignItems="center">
          <wui-text align="center" variant="paragraph-500" color="fg-100">
            Quickly and easily buy digital assets!
          </wui-text>
          <wui-text align="center" variant="small-400" color="fg-200">
            Simply select your preferred onramp provider and add digital assets to your account
            using your credit card or bank transfer
          </wui-text>
        </wui-flex>
        <wui-button @click=${RouterController.goBack}>
          <wui-icon size="sm" color="inherit" name="add" slot="iconLeft"></wui-icon>
          Buy
        </wui-button>
      </wui-flex>
    `}};W3mWhatIsABuyView=__decorate$19([customElement("w3m-what-is-a-buy-view")],W3mWhatIsABuyView);const styles$M=i$4`
  wui-loading-spinner {
    margin: 9px auto;
  }

  .email-display,
  .email-display wui-text {
    max-width: 100%;
  }
`;var __decorate$18=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const OTP_LENGTH=6;let W3mEmailOtpWidget=class extends h$3{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){var Mn;super(),this.loading=!1,this.timeoutTimeLeft=W3mFrameHelpers.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=(Mn=RouterController.state.data)==null?void 0:Mn.email,this.authConnector=ConnectorController.getAuthConnector()}render(){if(!this.email)throw new Error("w3m-email-otp-widget: No email provided");const Mn=!!this.timeoutTimeLeft,rs=this.getFooterLabels(Mn);return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        .padding=${["l","0","l","0"]}
        gap="l"
      >
        <wui-flex
          class="email-display"
          flexDirection="column"
          alignItems="center"
          .padding=${["0","xl","0","xl"]}
        >
          <wui-text variant="paragraph-400" color="fg-100" align="center">
            Enter the code we sent to
          </wui-text>
          <wui-text variant="paragraph-500" color="fg-100" lineClamp="1" align="center">
            ${this.email}
          </wui-text>
        </wui-flex>

        <wui-text variant="small-400" color="fg-200">The code expires in 20 minutes</wui-text>

        ${this.loading?ke`<wui-loading-spinner size="xl" color="accent-100"></wui-loading-spinner>`:ke` <wui-flex flexDirection="column" alignItems="center" gap="xs">
              <wui-otp
                dissabled
                length="6"
                @inputChange=${this.onOtpInputChange.bind(this)}
                .otp=${this.otp}
              ></wui-otp>
              ${this.error?ke`
                    <wui-text variant="small-400" align="center" color="error-100">
                      ${this.error}. Try Again
                    </wui-text>
                  `:null}
            </wui-flex>`}

        <wui-flex alignItems="center" gap="xs">
          <wui-text variant="small-400" color="fg-200">${rs.title}</wui-text>
          <wui-link @click=${this.onResendCode.bind(this)} .disabled=${Mn}>
            ${rs.action}
          </wui-link>
        </wui-flex>
      </wui-flex>
    `}startOTPTimeout(){this.timeoutTimeLeft=W3mFrameHelpers.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval(()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=W3mFrameHelpers.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)},1e3)}async onOtpInputChange(Mn){var rs;try{this.loading||(this.otp=Mn.detail,this.authConnector&&this.otp.length===OTP_LENGTH&&(this.loading=!0,await((rs=this.onOtpSubmit)==null?void 0:rs.call(this,this.otp))))}catch(is){this.error=CoreHelperUtil.parseError(is),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){if(this.error="",this.otp="",!ConnectorController.getAuthConnector()||!this.email)throw new Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),SnackController.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(Mn){SnackController.showError(Mn)}finally{this.loading=!1}}getFooterLabels(Mn){return this.onStartOver?{title:"Something wrong?",action:`Try again ${Mn?`in ${this.timeoutTimeLeft}s`:""}`}:{title:"Didn't receive it?",action:`Resend ${Mn?`in ${this.timeoutTimeLeft}s`:"Code"}`}}};W3mEmailOtpWidget.styles=styles$M;__decorate$18([r$5()],W3mEmailOtpWidget.prototype,"loading",void 0);__decorate$18([r$5()],W3mEmailOtpWidget.prototype,"timeoutTimeLeft",void 0);__decorate$18([r$5()],W3mEmailOtpWidget.prototype,"error",void 0);W3mEmailOtpWidget=__decorate$18([customElement("w3m-email-otp-widget")],W3mEmailOtpWidget);var __decorate$17=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mEmailVerifyOtpView=class extends W3mEmailOtpWidget{constructor(){super(),this.unsubscribe=[],this.smartAccountDeployed=AccountController.state.smartAccountDeployed,this.onOtpSubmit=async Mn=>{try{if(this.authConnector){const rs=ChainController.checkIfSmartAccountEnabled();if(await this.authConnector.provider.connectOtp({otp:Mn}),EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),ChainController.state.activeChain)await ConnectionController.connectExternal(this.authConnector,ChainController.state.activeChain);else throw new Error("Active chain is not set on ChainControll");EventsController.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"email",name:this.authConnector.name||"Unknown"}}),AccountController.state.allAccounts.length>1?RouterController.push("SelectAddresses"):rs&&!this.smartAccountDeployed?RouterController.push("UpgradeToSmartAccount"):OptionsController.state.isSiweEnabled||ModalController.close()}}catch(rs){throw EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),rs}},this.onOtpResend=async Mn=>{this.authConnector&&(await this.authConnector.provider.connectEmail({email:Mn}),EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))},this.unsubscribe.push(AccountController.subscribeKey("smartAccountDeployed",Mn=>{this.smartAccountDeployed=Mn}))}};__decorate$17([r$5()],W3mEmailVerifyOtpView.prototype,"smartAccountDeployed",void 0);W3mEmailVerifyOtpView=__decorate$17([customElement("w3m-email-verify-otp-view")],W3mEmailVerifyOtpView);const styles$L=i$4`
  wui-icon-box {
    height: var(--wui-icon-box-size-xl);
    width: var(--wui-icon-box-size-xl);
  }
`;var __decorate$16=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mEmailVerifyDeviceView=class extends h$3{constructor(){var Mn;super(),this.email=(Mn=RouterController.state.data)==null?void 0:Mn.email,this.authConnector=ConnectorController.getAuthConnector(),this.loading=!1,this.listenForDeviceApproval()}render(){if(!this.email)throw new Error("w3m-email-verify-device-view: No email provided");if(!this.authConnector)throw new Error("w3m-email-verify-device-view: No auth connector provided");return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        .padding=${["xxl","s","xxl","s"]}
        gap="l"
      >
        <wui-icon-box
          size="xl"
          iconcolor="accent-100"
          backgroundcolor="accent-100"
          icon="verify"
          background="opaque"
        ></wui-icon-box>

        <wui-flex flexDirection="column" alignItems="center" gap="s">
          <wui-flex flexDirection="column" alignItems="center">
            <wui-text variant="paragraph-400" color="fg-100">
              Approve the login link we sent to
            </wui-text>
            <wui-text variant="paragraph-400" color="fg-100"><b>${this.email}</b></wui-text>
          </wui-flex>

          <wui-text variant="small-400" color="fg-200" align="center">
            The code expires in 20 minutes
          </wui-text>

          <wui-flex alignItems="center" id="w3m-resend-section" gap="xs">
            <wui-text variant="small-400" color="fg-100" align="center">
              Didn't receive it?
            </wui-text>
            <wui-link @click=${this.onResendCode.bind(this)} .disabled=${this.loading}>
              Resend email
            </wui-link>
          </wui-flex>
        </wui-flex>
      </wui-flex>
    `}async listenForDeviceApproval(){if(this.authConnector)try{await this.authConnector.provider.connectDevice(),EventsController.sendEvent({type:"track",event:"DEVICE_REGISTERED_FOR_EMAIL"}),EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),RouterController.replace("EmailVerifyOtp",{email:this.email})}catch{RouterController.goBack()}}async onResendCode(){try{if(!this.loading){if(!this.authConnector||!this.email)throw new Error("w3m-email-login-widget: Unable to resend email");this.loading=!0,await this.authConnector.provider.connectEmail({email:this.email}),this.listenForDeviceApproval(),SnackController.showSuccess("Code email resent")}}catch(Mn){SnackController.showError(Mn)}finally{this.loading=!1}}};W3mEmailVerifyDeviceView.styles=styles$L;__decorate$16([r$5()],W3mEmailVerifyDeviceView.prototype,"loading",void 0);W3mEmailVerifyDeviceView=__decorate$16([customElement("w3m-email-verify-device-view")],W3mEmailVerifyDeviceView);const styles$K=i$4`
  div {
    width: 100%;
  }

  [data-ready='false'] {
    transform: scale(1.05);
  }

  @media (max-width: 430px) {
    [data-ready='false'] {
      transform: translateY(-50px);
    }
  }
`;var __decorate$15=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const PAGE_HEIGHT=600,PAGE_WIDTH=360,HEADER_HEIGHT=64;let W3mApproveTransactionView=class extends h$3{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(ModalController.subscribeKey("open",Mn=>{Mn||(this.onHideIframe(),RouterController.popTransactionStack())}),ModalController.subscribeKey("shake",Mn=>{Mn?this.iframe.style.animation="w3m-shake 500ms var(--wui-ease-out-power-2)":this.iframe.style.animation="none"}))}disconnectedCallback(){var Mn;this.onHideIframe(),this.unsubscribe.forEach(rs=>rs()),(Mn=this.bodyObserver)==null||Mn.unobserve(window.document.body)}async firstUpdated(){var rs;await this.syncTheme(),this.iframe.style.display="block";const Mn=(rs=this==null?void 0:this.renderRoot)==null?void 0:rs.querySelector("div");this.bodyObserver=new ResizeObserver(is=>{var us,ds;const os=(us=is==null?void 0:is[0])==null?void 0:us.contentBoxSize,as=(ds=os==null?void 0:os[0])==null?void 0:ds.inlineSize;this.iframe.style.height=`${PAGE_HEIGHT}px`,Mn.style.height=`${PAGE_HEIGHT}px`,as&&as<=430?(this.iframe.style.width="100%",this.iframe.style.left="0px",this.iframe.style.bottom="0px",this.iframe.style.top="unset"):(this.iframe.style.width=`${PAGE_WIDTH}px`,this.iframe.style.left=`calc(50% - ${PAGE_WIDTH/2}px)`,this.iframe.style.top=`calc(50% - ${PAGE_HEIGHT/2}px + ${HEADER_HEIGHT/2}px)`,this.iframe.style.bottom="unset"),this.ready=!0,this.onShowIframe()}),this.bodyObserver.observe(window.document.body)}render(){return ke`<div data-ready=${this.ready} id="w3m-frame-container"></div>`}onShowIframe(){const Mn=window.innerWidth<=430;this.iframe.style.animation=Mn?"w3m-iframe-zoom-in-mobile 200ms var(--wui-ease-out-power-2)":"w3m-iframe-zoom-in 200ms var(--wui-ease-out-power-2)"}onHideIframe(){this.iframe.style.display="none",this.iframe.style.animation="w3m-iframe-fade-out 200ms var(--wui-ease-out-power-2)"}async syncTheme(){const Mn=ConnectorController.getAuthConnector();if(Mn){const rs=ThemeController.getSnapshot().themeMode,is=ThemeController.getSnapshot().themeVariables;await Mn.provider.syncTheme({themeVariables:is,w3mThemeVariables:getW3mThemeVariables(is,rs)})}}};W3mApproveTransactionView.styles=styles$K;__decorate$15([r$5()],W3mApproveTransactionView.prototype,"ready",void 0);W3mApproveTransactionView=__decorate$15([customElement("w3m-approve-transaction-view")],W3mApproveTransactionView);var __decorate$14=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mUpgradeWalletView=class extends h$3{render(){return ke`
      <wui-flex flexDirection="column" alignItems="center" gap="xl" padding="xl">
        <wui-text variant="paragraph-400" color="fg-100">Follow the instructions on</wui-text>
        <wui-chip
          icon="externalLink"
          variant="fill"
          href=${ConstantsUtil$2.SECURE_SITE_DASHBOARD}
          imageSrc=${ConstantsUtil$2.SECURE_SITE_FAVICON}
          data-testid="w3m-secure-website-button"
        >
        </wui-chip>
        <wui-text variant="small-400" color="fg-200">
          You will have to reconnect for security reasons
        </wui-text>
      </wui-flex>
    `}};W3mUpgradeWalletView=__decorate$14([customElement("w3m-upgrade-wallet-view")],W3mUpgradeWalletView);var __decorate$13=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mUpgradeToSmartAccountView=class extends h$3{constructor(){super(...arguments),this.authConnector=ConnectorController.getAuthConnector(),this.loading=!1,this.setPreferSmartAccount=async()=>{if(this.authConnector)try{this.loading=!0,await ConnectionController.setPreferredAccountType(W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT),this.loading=!1,RouterController.push("Account")}catch{SnackController.showError("Error upgrading to smart account")}}}render(){return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        gap="xxl"
        .padding=${["0","0","l","0"]}
      >
        ${this.onboardingTemplate()} ${this.buttonsTemplate()}
        <wui-link
          @click=${()=>{CoreHelperUtil.openHref(NavigationUtil.URLS.FAQ,"_blank")}}
        >
          Learn more
          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
        </wui-link>
      </wui-flex>
    `}onboardingTemplate(){return ke` <wui-flex
      flexDirection="column"
      gap="xxl"
      alignItems="center"
      .padding=${["0","xxl","0","xxl"]}
    >
      <wui-flex gap="s" alignItems="center" justifyContent="center">
        <wui-visual name="google"></wui-visual>
        <wui-visual name="pencil"></wui-visual>
        <wui-visual name="lightbulb"></wui-visual>
      </wui-flex>
      <wui-flex flexDirection="column" alignItems="center" gap="s">
        <wui-text align="center" variant="medium-600" color="fg-100">
          Discover Smart Accounts
        </wui-text>
        <wui-text align="center" variant="paragraph-400" color="fg-100">
          Access advanced features such as username, social login, improved security and a smoother
          user experience!
        </wui-text>
      </wui-flex>
    </wui-flex>`}buttonsTemplate(){return ke`<wui-flex .padding=${["0","2l","0","2l"]} gap="s">
      <wui-button
        variant="accent"
        @click=${this.redirectToAccount.bind(this)}
        size="lg"
        borderRadius="xs"
      >
        Do it later
      </wui-button>
      <wui-button
        .loading=${this.loading}
        size="lg"
        borderRadius="xs"
        @click=${this.setPreferSmartAccount.bind(this)}
        >Continue
      </wui-button>
    </wui-flex>`}redirectToAccount(){RouterController.push("Account")}};__decorate$13([r$5()],W3mUpgradeToSmartAccountView.prototype,"authConnector",void 0);__decorate$13([r$5()],W3mUpgradeToSmartAccountView.prototype,"loading",void 0);W3mUpgradeToSmartAccountView=__decorate$13([customElement("w3m-upgrade-to-smart-account-view")],W3mUpgradeToSmartAccountView);const styles$J=i$4`
  wui-email-input {
    width: 100%;
  }

  form {
    width: 100%;
    display: block;
    position: relative;
  }
`;var __decorate$12=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mUpdateEmailWalletView=class extends h$3{constructor(){var Mn;super(...arguments),this.formRef=ii$1(),this.initialEmail=((Mn=RouterController.state.data)==null?void 0:Mn.email)??"",this.email="",this.loading=!1}firstUpdated(){var Mn;(Mn=this.formRef.value)==null||Mn.addEventListener("keydown",rs=>{rs.key==="Enter"&&this.onSubmitEmail(rs)})}render(){const Mn=!this.loading&&this.email.length>3&&this.email!==this.initialEmail;return ke`
      <wui-flex flexDirection="column" padding="m" gap="m">
        <form ${Kt$2(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
          <wui-email-input
            value=${this.initialEmail}
            .disabled=${this.loading}
            @inputChange=${this.onEmailInputChange.bind(this)}
          >
          </wui-email-input>
          <input type="submit" hidden />
        </form>

        <wui-flex gap="s">
          <wui-button size="md" variant="neutral" fullWidth @click=${RouterController.goBack}>
            Cancel
          </wui-button>

          <wui-button
            size="md"
            variant="main"
            fullWidth
            @click=${this.onSubmitEmail.bind(this)}
            .disabled=${!Mn}
            .loading=${this.loading}
          >
            Save
          </wui-button>
        </wui-flex>
      </wui-flex>
    `}onEmailInputChange(Mn){this.email=Mn.detail}async onSubmitEmail(Mn){try{if(this.loading)return;this.loading=!0,Mn.preventDefault();const rs=ConnectorController.getAuthConnector();if(!rs)throw new Error("w3m-update-email-wallet: Auth connector not found");const is=await rs.provider.updateEmail({email:this.email});EventsController.sendEvent({type:"track",event:"EMAIL_EDIT"}),is.action==="VERIFY_SECONDARY_OTP"?RouterController.push("UpdateEmailSecondaryOtp",{email:this.initialEmail,newEmail:this.email}):RouterController.push("UpdateEmailPrimaryOtp",{email:this.initialEmail,newEmail:this.email})}catch(rs){SnackController.showError(rs),this.loading=!1}}};W3mUpdateEmailWalletView.styles=styles$J;__decorate$12([r$5()],W3mUpdateEmailWalletView.prototype,"email",void 0);__decorate$12([r$5()],W3mUpdateEmailWalletView.prototype,"loading",void 0);W3mUpdateEmailWalletView=__decorate$12([customElement("w3m-update-email-wallet-view")],W3mUpdateEmailWalletView);var __decorate$11=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mUpdateEmailPrimaryOtpView=class extends W3mEmailOtpWidget{constructor(){var Mn;super(),this.email=(Mn=RouterController.state.data)==null?void 0:Mn.email,this.onOtpSubmit=async rs=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailPrimaryOtp({otp:rs}),EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),RouterController.replace("UpdateEmailSecondaryOtp",RouterController.state.data))}catch(is){throw EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),is}},this.onStartOver=()=>{RouterController.replace("UpdateEmailWallet",RouterController.state.data)}}};W3mUpdateEmailPrimaryOtpView=__decorate$11([customElement("w3m-update-email-primary-otp-view")],W3mUpdateEmailPrimaryOtpView);var __decorate$10=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mUpdateEmailSecondaryOtpView=class extends W3mEmailOtpWidget{constructor(){var Mn;super(),this.email=(Mn=RouterController.state.data)==null?void 0:Mn.newEmail,this.onOtpSubmit=async rs=>{try{this.authConnector&&(await this.authConnector.provider.updateEmailSecondaryOtp({otp:rs}),EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),RouterController.reset("Account"))}catch(is){throw EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),is}},this.onStartOver=()=>{RouterController.replace("UpdateEmailWallet",RouterController.state.data)}}};W3mUpdateEmailSecondaryOtpView=__decorate$10([customElement("w3m-update-email-secondary-otp-view")],W3mUpdateEmailSecondaryOtpView);const styles$I=i$4`
  :host > wui-flex {
    max-height: clamp(360px, 540px, 80vh);
    overflow: scroll;
    scrollbar-width: none;
  }

  :host > wui-flex::-webkit-scrollbar {
    display: none;
  }
`;var __decorate$$=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mUnsupportedChainView=class extends h$3{constructor(){var Mn;super(...arguments),this.swapUnsupportedChain=(Mn=RouterController.state.data)==null?void 0:Mn.swapUnsupportedChain,this.disconecting=!1}render(){return ke`
      <wui-flex class="container" flexDirection="column" gap="0">
        <wui-flex
          class="container"
          flexDirection="column"
          .padding=${["m","xl","xs","xl"]}
          alignItems="center"
          gap="xl"
        >
          ${this.descriptionTemplate()}
        </wui-flex>

        <wui-flex flexDirection="column" padding="s" gap="xs">
          ${this.networksTemplate()}
        </wui-flex>

        <wui-separator text="or"></wui-separator>
        <wui-flex flexDirection="column" padding="s" gap="xs">
          <wui-list-item
            variant="icon"
            iconVariant="overlay"
            icon="disconnect"
            ?chevron=${!1}
            .loading=${this.disconecting}
            @click=${this.onDisconnect.bind(this)}
            data-testid="disconnect-button"
          >
            <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text>
          </wui-list-item>
        </wui-flex>
      </wui-flex>
    `}descriptionTemplate(){return this.swapUnsupportedChain?ke`
        <wui-text variant="small-400" color="fg-200" align="center">
          The swap feature doesn’t support your current network. Switch to an available option to
          continue.
        </wui-text>
      `:ke`
      <wui-text variant="small-400" color="fg-200" align="center">
        This app doesn’t support your current network. Switch to an available option to continue.
      </wui-text>
    `}networksTemplate(){const Mn=ChainController.getAllRequestedCaipNetworks(),rs=ChainController.getAllApprovedCaipNetworkIds(),is=CoreHelperUtil.sortRequestedNetworks(rs,Mn);return(this.swapUnsupportedChain?is.filter(as=>ConstantsUtil$2.SWAP_SUPPORTED_NETWORKS.includes(as.caipNetworkId)):is).map(as=>ke`
        <wui-list-network
          imageSrc=${to$2(AssetUtil.getNetworkImage(as))}
          name=${as.name??"Unknown"}
          @click=${()=>this.onSwitchNetwork(as)}
        >
        </wui-list-network>
      `)}async onDisconnect(){try{this.disconecting=!0,await ConnectionController.disconnect(),EventsController.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),ModalController.close()}catch{EventsController.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),SnackController.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(Mn){const rs=AccountController.state.caipAddress,is=ChainController.getAllApprovedCaipNetworkIds(),os=ChainController.getNetworkProp("supportsAllNetworks",Mn.chainNamespace),as=ChainController.state.activeCaipNetwork,us=RouterController.state.data;rs&&(as==null?void 0:as.caipNetworkId)!==Mn.caipNetworkId?is!=null&&is.includes(Mn.caipNetworkId)?await ChainController.switchActiveNetwork(Mn):os&&RouterController.push("SwitchNetwork",{...us,network:Mn}):rs||(ChainController.setActiveCaipNetwork(Mn),RouterController.push("Connect"))}};W3mUnsupportedChainView.styles=styles$I;__decorate$$([r$5()],W3mUnsupportedChainView.prototype,"disconecting",void 0);W3mUnsupportedChainView=__decorate$$([customElement("w3m-unsupported-chain-view")],W3mUnsupportedChainView);const styles$H=i$4`
  wui-compatible-network {
    margin-top: var(--wui-spacing-l);
  }
`;var __decorate$_=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mWalletReceiveView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.address=AccountController.state.address,this.profileName=AccountController.state.profileName,this.network=ChainController.state.activeCaipNetwork,this.preferredAccountType=AccountController.state.preferredAccountType,this.unsubscribe.push(AccountController.subscribe(Mn=>{Mn.address?(this.address=Mn.address,this.profileName=Mn.profileName,this.preferredAccountType=Mn.preferredAccountType):SnackController.showError("Account not found")}),ChainController.subscribeKey("activeCaipNetwork",Mn=>{Mn!=null&&Mn.id&&(this.network=Mn)}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const Mn=AssetUtil.getNetworkImage(this.network);return ke` <wui-flex
      flexDirection="column"
      .padding=${["0","l","l","l"]}
      alignItems="center"
    >
      <wui-chip-button
        data-testid="receive-address-copy-button"
        @click=${this.onCopyClick.bind(this)}
        text=${UiHelperUtil.getTruncateString({string:this.profileName||this.address||"",charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
        icon="copy"
        size="sm"
        imageSrc=${Mn||""}
        variant="gray"
      ></wui-chip-button>
      <wui-flex
        flexDirection="column"
        .padding=${["l","0","0","0"]}
        alignItems="center"
        gap="s"
      >
        <wui-qr-code
          size=${232}
          theme=${ThemeController.state.themeMode}
          uri=${this.address}
          ?arenaClear=${!0}
          data-testid="wui-qr-code"
        ></wui-qr-code>
        <wui-text variant="paragraph-500" color="fg-100" align="center">
          Copy your address or scan this QR code
        </wui-text>
      </wui-flex>
      ${this.networkTemplate()}
    </wui-flex>`}networkTemplate(){var us;const Mn=ChainController.getAllRequestedCaipNetworks(),rs=ChainController.checkIfSmartAccountEnabled(),is=ChainController.state.activeCaipNetwork;if(this.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT&&rs)return is?ke`<wui-compatible-network
        @click=${this.onReceiveClick.bind(this)}
        text="Only receive assets on this network"
        .networkImages=${[AssetUtil.getNetworkImage(is)??""]}
      ></wui-compatible-network>`:null;const as=((us=Mn==null?void 0:Mn.filter(ds=>{var hs;return(hs=ds==null?void 0:ds.assets)==null?void 0:hs.imageId}))==null?void 0:us.slice(0,5)).map(AssetUtil.getNetworkImage).filter(Boolean);return ke`<wui-compatible-network
      @click=${this.onReceiveClick.bind(this)}
      text="Only receive assets on these networks"
      .networkImages=${as}
    ></wui-compatible-network>`}onReceiveClick(){RouterController.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(CoreHelperUtil.copyToClopboard(this.address),SnackController.showSuccess("Address copied"))}catch{SnackController.showError("Failed to copy")}}};W3mWalletReceiveView.styles=styles$H;__decorate$_([r$5()],W3mWalletReceiveView.prototype,"address",void 0);__decorate$_([r$5()],W3mWalletReceiveView.prototype,"profileName",void 0);__decorate$_([r$5()],W3mWalletReceiveView.prototype,"network",void 0);__decorate$_([r$5()],W3mWalletReceiveView.prototype,"preferredAccountType",void 0);W3mWalletReceiveView=__decorate$_([customElement("w3m-wallet-receive-view")],W3mWalletReceiveView);const styles$G=i$4`
  :host > wui-flex {
    max-height: clamp(360px, 540px, 80vh);
    overflow: scroll;
    scrollbar-width: none;
  }

  :host > wui-flex::-webkit-scrollbar {
    display: none;
  }
`;var __decorate$Z=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mWalletCompatibleNetworksView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.preferredAccountType=AccountController.state.preferredAccountType,this.unsubscribe.push(AccountController.subscribeKey("preferredAccountType",Mn=>{this.preferredAccountType=Mn}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return ke` <wui-flex
      flexDirection="column"
      .padding=${["xs","s","m","s"]}
      gap="xs"
    >
      <wui-banner
        icon="warningCircle"
        text="You can only receive assets on these networks"
      ></wui-banner>
      ${this.networkTemplate()}
    </wui-flex>`}networkTemplate(){const Mn=ChainController.getAllRequestedCaipNetworks(),rs=ChainController.getAllApprovedCaipNetworkIds(),is=ChainController.state.activeCaipNetwork,os=ChainController.checkIfSmartAccountEnabled();let as=CoreHelperUtil.sortRequestedNetworks(rs,Mn);if(os&&this.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT){if(!is)return null;as=[is]}return as.map(us=>ke`
        <wui-list-network
          imageSrc=${to$2(AssetUtil.getNetworkImage(us))}
          name=${us.name??"Unknown"}
          ?transparent=${!0}
        >
        </wui-list-network>
      `)}};W3mWalletCompatibleNetworksView.styles=styles$G;__decorate$Z([r$5()],W3mWalletCompatibleNetworksView.prototype,"preferredAccountType",void 0);W3mWalletCompatibleNetworksView=__decorate$Z([customElement("w3m-wallet-compatible-networks-view")],W3mWalletCompatibleNetworksView);const styles$F=i$4`
  :host {
    display: block;
  }

  wui-flex {
    position: relative;
  }

  wui-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--wui-border-radius-xs) !important;
    border: 5px solid var(--wui-color-bg-125);
    background: var(--wui-color-bg-175);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
  }

  wui-button {
    --local-border-radius: var(--wui-border-radius-xs) !important;
  }

  .inputContainer {
    height: fit-content;
  }
`;var __decorate$Y=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mWalletSendView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.token=SendController.state.token,this.sendTokenAmount=SendController.state.sendTokenAmount,this.receiverAddress=SendController.state.receiverAddress,this.receiverProfileName=SendController.state.receiverProfileName,this.loading=SendController.state.loading,this.gasPriceInUSD=SendController.state.gasPriceInUSD,this.gasPrice=SendController.state.gasPrice,this.message="Preview Send",this.fetchNetworkPrice(),this.unsubscribe.push(SendController.subscribe(Mn=>{this.token=Mn.token,this.sendTokenAmount=Mn.sendTokenAmount,this.receiverAddress=Mn.receiverAddress,this.gasPriceInUSD=Mn.gasPriceInUSD,this.receiverProfileName=Mn.receiverProfileName,this.loading=Mn.loading}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return this.getMessage(),ke` <wui-flex flexDirection="column" .padding=${["0","l","l","l"]}>
      <wui-flex class="inputContainer" gap="xs" flexDirection="column">
        <w3m-input-token
          .token=${this.token}
          .sendTokenAmount=${this.sendTokenAmount}
          .gasPriceInUSD=${this.gasPriceInUSD}
          .gasPrice=${this.gasPrice}
        ></w3m-input-token>
        <wui-icon-box
          size="inherit"
          backgroundColor="fg-300"
          iconSize="lg"
          iconColor="fg-250"
          background="opaque"
          icon="arrowBottom"
        ></wui-icon-box>
        <w3m-input-address
          .value=${this.receiverProfileName?this.receiverProfileName:this.receiverAddress}
        ></w3m-input-address>
      </wui-flex>
      <wui-flex .margin=${["l","0","0","0"]}>
        <wui-button
          @click=${this.onButtonClick.bind(this)}
          ?disabled=${!this.message.startsWith("Preview Send")}
          size="lg"
          variant="main"
          ?loading=${this.loading}
          fullWidth
        >
          ${this.message}
        </wui-button>
      </wui-flex>
    </wui-flex>`}async fetchNetworkPrice(){await SwapController.getNetworkTokenPrice();const Mn=await SwapController.getInitialGasPrice();Mn!=null&&Mn.gasPrice&&(Mn!=null&&Mn.gasPriceInUSD)&&(SendController.setGasPrice(Mn.gasPrice),SendController.setGasPriceInUsd(Mn.gasPriceInUSD))}onButtonClick(){RouterController.push("WalletSendPreview")}getMessage(){var Mn;this.message="Preview Send",this.receiverAddress&&!CoreHelperUtil.isAddress(this.receiverAddress,ChainController.state.activeChain)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.sendTokenAmount&&((Mn=this.token)!=null&&Mn.price)&&(this.sendTokenAmount*this.token.price||(this.message="Incorrect Value")),this.token||(this.message="Select Token")}};W3mWalletSendView.styles=styles$F;__decorate$Y([r$5()],W3mWalletSendView.prototype,"token",void 0);__decorate$Y([r$5()],W3mWalletSendView.prototype,"sendTokenAmount",void 0);__decorate$Y([r$5()],W3mWalletSendView.prototype,"receiverAddress",void 0);__decorate$Y([r$5()],W3mWalletSendView.prototype,"receiverProfileName",void 0);__decorate$Y([r$5()],W3mWalletSendView.prototype,"loading",void 0);__decorate$Y([r$5()],W3mWalletSendView.prototype,"gasPriceInUSD",void 0);__decorate$Y([r$5()],W3mWalletSendView.prototype,"gasPrice",void 0);__decorate$Y([r$5()],W3mWalletSendView.prototype,"message",void 0);W3mWalletSendView=__decorate$Y([customElement("w3m-wallet-send-view")],W3mWalletSendView);const styles$E=i$4`
  .contentContainer {
    height: 440px;
    overflow: scroll;
    scrollbar-width: none;
  }

  .contentContainer::-webkit-scrollbar {
    display: none;
  }

  wui-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--wui-border-radius-xxs);
  }
`;var __decorate$X=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mSendSelectTokenView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.tokenBalance=AccountController.state.tokenBalance,this.search="",this.onDebouncedSearch=CoreHelperUtil.debounce(Mn=>{this.search=Mn}),this.unsubscribe.push(AccountController.subscribe(Mn=>{this.tokenBalance=Mn.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return ke`
      <wui-flex flexDirection="column">
        ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
      </wui-flex>
    `}templateSearchInput(){return ke`
      <wui-flex gap="xs" padding="s">
        <wui-input-text
          @inputChange=${this.onInputChange.bind(this)}
          class="network-search-input"
          size="sm"
          placeholder="Search token"
          icon="search"
        ></wui-input-text>
      </wui-flex>
    `}templateTokens(){var Mn,rs;return this.tokens=(Mn=this.tokenBalance)==null?void 0:Mn.filter(is=>{var os;return is.chainId===((os=ChainController.state.activeCaipNetwork)==null?void 0:os.caipNetworkId)}),this.search?this.filteredTokens=(rs=this.tokenBalance)==null?void 0:rs.filter(is=>is.name.toLowerCase().includes(this.search.toLowerCase())):this.filteredTokens=this.tokens,ke`
      <wui-flex
        class="contentContainer"
        flexDirection="column"
        .padding=${["0","s","0","s"]}
      >
        <wui-flex justifyContent="flex-start" .padding=${["m","s","s","s"]}>
          <wui-text variant="paragraph-500" color="fg-200">Your tokens</wui-text>
        </wui-flex>
        <wui-flex flexDirection="column" gap="xs">
          ${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(is=>ke`<wui-list-token
                    @click=${this.handleTokenClick.bind(this,is)}
                    ?clickable=${!0}
                    tokenName=${is.name}
                    tokenImageUrl=${is.iconUrl}
                    tokenAmount=${is.quantity.numeric}
                    tokenValue=${is.value}
                    tokenCurrency=${is.symbol}
                  ></wui-list-token>`):ke`<wui-flex
                .padding=${["4xl","0","0","0"]}
                alignItems="center"
                flexDirection="column"
                gap="l"
              >
                <wui-icon-box
                  icon="coinPlaceholder"
                  size="inherit"
                  iconColor="fg-200"
                  backgroundColor="fg-200"
                  iconSize="lg"
                ></wui-icon-box>
                <wui-flex
                  class="textContent"
                  gap="xs"
                  flexDirection="column"
                  justifyContent="center"
                  flexDirection="column"
                >
                  <wui-text variant="paragraph-500" align="center" color="fg-100"
                    >No tokens found</wui-text
                  >
                  <wui-text variant="small-400" align="center" color="fg-200"
                    >Your tokens will appear here</wui-text
                  >
                </wui-flex>
                <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
              </wui-flex>`}
        </wui-flex>
      </wui-flex>
    `}onBuyClick(){RouterController.push("OnRampProviders")}onInputChange(Mn){this.onDebouncedSearch(Mn.detail)}handleTokenClick(Mn){SendController.setToken(Mn),SendController.setTokenAmount(void 0),RouterController.goBack()}};W3mSendSelectTokenView.styles=styles$E;__decorate$X([r$5()],W3mSendSelectTokenView.prototype,"tokenBalance",void 0);__decorate$X([r$5()],W3mSendSelectTokenView.prototype,"tokens",void 0);__decorate$X([r$5()],W3mSendSelectTokenView.prototype,"filteredTokens",void 0);__decorate$X([r$5()],W3mSendSelectTokenView.prototype,"search",void 0);W3mSendSelectTokenView=__decorate$X([customElement("w3m-wallet-send-select-token-view")],W3mSendSelectTokenView);const styles$D=i$4`
  wui-avatar,
  wui-image {
    display: ruby;
    width: 32px;
    height: 32px;
    border-radius: var(--wui-border-radius-3xl);
  }

  .sendButton {
    width: 70%;
    --local-width: 100% !important;
    --local-border-radius: var(--wui-border-radius-xs) !important;
  }

  .cancelButton {
    width: 30%;
    --local-width: 100% !important;
    --local-border-radius: var(--wui-border-radius-xs) !important;
  }
`;var __decorate$W=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mWalletSendPreviewView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.token=SendController.state.token,this.sendTokenAmount=SendController.state.sendTokenAmount,this.receiverAddress=SendController.state.receiverAddress,this.receiverProfileName=SendController.state.receiverProfileName,this.receiverProfileImageUrl=SendController.state.receiverProfileImageUrl,this.gasPriceInUSD=SendController.state.gasPriceInUSD,this.caipNetwork=ChainController.state.activeCaipNetwork,this.unsubscribe.push(SendController.subscribe(Mn=>{this.token=Mn.token,this.sendTokenAmount=Mn.sendTokenAmount,this.receiverAddress=Mn.receiverAddress,this.gasPriceInUSD=Mn.gasPriceInUSD,this.receiverProfileName=Mn.receiverProfileName,this.receiverProfileImageUrl=Mn.receiverProfileImageUrl}),ChainController.subscribeKey("activeCaipNetwork",Mn=>this.caipNetwork=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){var Mn,rs;return ke` <wui-flex flexDirection="column" .padding=${["0","l","l","l"]}>
      <wui-flex gap="xs" flexDirection="column" .padding=${["0","xs","0","xs"]}>
        <wui-flex alignItems="center" justifyContent="space-between">
          <wui-flex flexDirection="column" gap="4xs">
            <wui-text variant="small-400" color="fg-150">Send</wui-text>
            ${this.sendValueTemplate()}
          </wui-flex>
          <wui-preview-item
            text="${this.sendTokenAmount?UiHelperUtil.roundNumber(this.sendTokenAmount,6,5):"unknown"} ${(Mn=this.token)==null?void 0:Mn.symbol}"
            .imageSrc=${(rs=this.token)==null?void 0:rs.iconUrl}
          ></wui-preview-item>
        </wui-flex>
        <wui-flex>
          <wui-icon color="fg-200" size="md" name="arrowBottom"></wui-icon>
        </wui-flex>
        <wui-flex alignItems="center" justifyContent="space-between">
          <wui-text variant="small-400" color="fg-150">To</wui-text>
          <wui-preview-item
            text="${this.receiverProfileName?UiHelperUtil.getTruncateString({string:this.receiverProfileName,charsStart:20,charsEnd:0,truncate:"end"}):UiHelperUtil.getTruncateString({string:this.receiverAddress?this.receiverAddress:"",charsStart:4,charsEnd:4,truncate:"middle"})}"
            address=${this.receiverAddress??""}
            .imageSrc=${this.receiverProfileImageUrl??void 0}
            .isAddress=${!0}
          ></wui-preview-item>
        </wui-flex>
      </wui-flex>
      <wui-flex flexDirection="column" .padding=${["xxl","0","0","0"]}>
        <w3m-wallet-send-details
          .caipNetwork=${this.caipNetwork}
          .receiverAddress=${this.receiverAddress}
          .networkFee=${this.gasPriceInUSD}
        ></w3m-wallet-send-details>
        <wui-flex justifyContent="center" gap="xxs" .padding=${["s","0","0","0"]}>
          <wui-icon size="sm" color="fg-200" name="warningCircle"></wui-icon>
          <wui-text variant="small-400" color="fg-200">Review transaction carefully</wui-text>
        </wui-flex>
        <wui-flex justifyContent="center" gap="s" .padding=${["l","0","0","0"]}>
          <wui-button
            class="cancelButton"
            @click=${this.onCancelClick.bind(this)}
            size="lg"
            variant="neutral"
          >
            Cancel
          </wui-button>
          <wui-button
            class="sendButton"
            @click=${this.onSendClick.bind(this)}
            size="lg"
            variant="main"
          >
            Send
          </wui-button>
        </wui-flex>
      </wui-flex></wui-flex
    >`}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const rs=this.token.price*this.sendTokenAmount;return ke`<wui-text variant="paragraph-400" color="fg-100"
        >$${rs.toFixed(2)}</wui-text
      >`}return null}onSendClick(){SendController.sendToken()}onCancelClick(){RouterController.goBack()}};W3mWalletSendPreviewView.styles=styles$D;__decorate$W([r$5()],W3mWalletSendPreviewView.prototype,"token",void 0);__decorate$W([r$5()],W3mWalletSendPreviewView.prototype,"sendTokenAmount",void 0);__decorate$W([r$5()],W3mWalletSendPreviewView.prototype,"receiverAddress",void 0);__decorate$W([r$5()],W3mWalletSendPreviewView.prototype,"receiverProfileName",void 0);__decorate$W([r$5()],W3mWalletSendPreviewView.prototype,"receiverProfileImageUrl",void 0);__decorate$W([r$5()],W3mWalletSendPreviewView.prototype,"gasPriceInUSD",void 0);__decorate$W([r$5()],W3mWalletSendPreviewView.prototype,"caipNetwork",void 0);W3mWalletSendPreviewView=__decorate$W([customElement("w3m-wallet-send-preview-view")],W3mWalletSendPreviewView);const styles$C=i$4`
  wui-flex {
    max-height: clamp(360px, 540px, 80vh);
    overflow: scroll;
    scrollbar-width: none;
  }
  wui-flex::-webkit-scrollbar {
    display: none;
  }
`;var __decorate$V=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectWalletsView=class extends h$3{render(){return ke`
      <wui-flex flexDirection="column" padding="s" gap="xs">
        <w3m-wallet-login-list></w3m-wallet-login-list>
      </wui-flex>
      <w3m-legal-footer></w3m-legal-footer>
    `}};W3mConnectWalletsView.styles=styles$C;W3mConnectWalletsView=__decorate$V([customElement("w3m-connect-wallets-view")],W3mConnectWalletsView);const styles$B=i$4`
  wui-flex {
    max-height: clamp(360px, 540px, 80vh);
    overflow: scroll;
    scrollbar-width: none;
  }
  wui-flex::-webkit-scrollbar {
    display: none;
  }
`;var __decorate$U=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectSocialsView=class extends h$3{render(){return ke`
      <wui-flex flexDirection="column" padding="s" gap="xs">
        <w3m-social-login-list></w3m-social-login-list>
      </wui-flex>
      <w3m-legal-footer></w3m-legal-footer>
    `}};W3mConnectSocialsView.styles=styles$B;W3mConnectSocialsView=__decorate$U([customElement("w3m-connect-socials-view")],W3mConnectSocialsView);const styles$A=i$4`
  wui-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--wui-border-radius-m);
  }
  @keyframes shake {
    0% {
      transform: translateX(0);
    }
    25% {
      transform: translateX(3px);
    }
    50% {
      transform: translateX(-3px);
    }
    75% {
      transform: translateX(3px);
    }
    100% {
      transform: translateX(0);
    }
  }
  wui-flex:first-child:not(:only-child) {
    position: relative;
  }
  wui-loading-thumbnail {
    position: absolute;
  }
  wui-icon-box {
    position: absolute;
    right: calc(var(--wui-spacing-3xs) * -1);
    bottom: calc(var(--wui-spacing-3xs) * -1);
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
  }
  wui-text[align='center'] {
    width: 100%;
    padding: 0px var(--wui-spacing-l);
  }
  [data-error='true'] wui-icon-box {
    opacity: 1;
    transform: scale(1);
  }
  [data-error='true'] > wui-flex:first-child {
    animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  }
  .capitalize {
    text-transform: capitalize;
  }
`;var __decorate$T=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingSocialView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.socialProvider=AccountController.state.socialProvider,this.socialWindow=AccountController.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.authConnector=ConnectorController.getAuthConnector(),this.handleSocialConnection=async Mn=>{var rs;if((rs=Mn.data)!=null&&rs.resultUri)if(Mn.origin===ConstantsUtil.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),AccountController.setSocialWindow(void 0,ChainController.state.activeChain)),this.connecting=!0,this.updateMessage();const is=Mn.data.resultUri;await this.authConnector.provider.connectSocial(is),this.socialProvider&&(StorageUtil.setConnectedSocialProvider(this.socialProvider),await ConnectionController.connectExternal(this.authConnector,this.authConnector.chain),EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}))}}catch{this.error=!0,this.updateMessage(),this.socialProvider&&EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}}else RouterController.goBack(),SnackController.showError("Untrusted Origin"),this.socialProvider&&EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})},this.unsubscribe.push(AccountController.subscribe(Mn=>{Mn.socialProvider&&(this.socialProvider=Mn.socialProvider),Mn.socialWindow&&(this.socialWindow=Mn.socialWindow),Mn.address&&ModalController.state.open&&ModalController.close()})),this.authConnector&&this.connectSocial()}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn()),window.removeEventListener("message",this.handleSocialConnection,!1)}render(){return ke`
      <wui-flex
        data-error=${to$2(this.error)}
        flexDirection="column"
        alignItems="center"
        .padding=${["3xl","xl","xl","xl"]}
        gap="xl"
      >
        <wui-flex justifyContent="center" alignItems="center">
          <wui-logo logo=${to$2(this.socialProvider)}></wui-logo>
          ${this.error?null:this.loaderTemplate()}
          <wui-icon-box
            backgroundColor="error-100"
            background="opaque"
            iconColor="error-100"
            icon="close"
            size="sm"
            border
            borderColor="wui-color-bg-125"
          ></wui-icon-box>
        </wui-flex>
        <wui-flex flexDirection="column" alignItems="center" gap="xs">
          <wui-text align="center" variant="paragraph-500" color="fg-100"
            >Log in with
            <span class="capitalize">${this.socialProvider??"Social"}</span></wui-text
          >
          <wui-text align="center" variant="small-400" color=${this.error?"error-100":"fg-200"}
            >${this.message}</wui-text
          ></wui-flex
        >
      </wui-flex>
    `}loaderTemplate(){const Mn=ThemeController.state.themeVariables["--w3m-border-radius-master"],rs=Mn?parseInt(Mn.replace("px",""),10):4;return ke`<wui-loading-thumbnail radius=${rs*9}></wui-loading-thumbnail>`}connectSocial(){const Mn=setInterval(()=>{var rs;(rs=this.socialWindow)!=null&&rs.closed&&(!this.connecting&&RouterController.state.view==="ConnectingSocial"&&RouterController.goBack(),clearInterval(Mn))},1e3);window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};W3mConnectingSocialView.styles=styles$A;__decorate$T([r$5()],W3mConnectingSocialView.prototype,"socialProvider",void 0);__decorate$T([r$5()],W3mConnectingSocialView.prototype,"socialWindow",void 0);__decorate$T([r$5()],W3mConnectingSocialView.prototype,"error",void 0);__decorate$T([r$5()],W3mConnectingSocialView.prototype,"connecting",void 0);__decorate$T([r$5()],W3mConnectingSocialView.prototype,"message",void 0);W3mConnectingSocialView=__decorate$T([customElement("w3m-connecting-social-view")],W3mConnectingSocialView);const styles$z=i$4`
  wui-flex {
    width: 100%;
  }

  wui-icon-link {
    margin-right: calc(var(--wui-icon-box-size-md) * -1);
  }

  .account-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .account-links wui-flex {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: red;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 10px;
    flex: 1 0 0;

    border-radius: var(--XS, 16px);
    border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
    background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
    transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: background-color;
  }

  .account-links wui-flex:hover {
    background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
  }

  .account-links wui-flex wui-icon {
    width: var(--S, 20px);
    height: var(--S, 20px);
  }

  .account-links wui-flex wui-icon svg path {
    stroke: #47a1ff;
  }

  .account-settings-button {
    padding: calc(var(--wui-spacing-m) - 1px) var(--wui-spacing-2l);
    height: 40px;
    border-radius: var(--wui-border-radius-xxs);
    border: 1px solid var(--wui-color-gray-glass-002);
    background: var(--wui-color-gray-glass-002);
    cursor: pointer;
  }

  .account-settings-button:hover {
    background: var(--wui-color-gray-glass-005);
  }
`;var __decorate$S=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mProfileView=class extends h$3{constructor(){super(),this.usubscribe=[],this.address=AccountController.state.address,this.profileImage=AccountController.state.profileImage,this.profileName=AccountController.state.profileName,this.accounts=AccountController.state.allAccounts,this.usubscribe.push(AccountController.subscribeKey("address",Mn=>{Mn?this.address=Mn:ModalController.close()})),this.usubscribe.push(AccountController.subscribeKey("profileImage",Mn=>{this.profileImage=Mn})),this.usubscribe.push(AccountController.subscribeKey("profileName",Mn=>{this.profileName=Mn}))}disconnectedCallback(){this.usubscribe.forEach(Mn=>Mn())}render(){if(!this.address)throw new Error("w3m-profile-view: No account provided");return ke`
      <wui-flex flexDirection="column" gap="l" .padding=${["0","xl","m","xl"]}>
        <wui-flex flexDirection="column" alignItems="center" gap="l">
          <wui-avatar
            alt=${this.address}
            address=${this.address}
            imageSrc=${to$2(this.profileImage)}
            size="2lg"
          ></wui-avatar>
          <wui-flex flexDirection="column" alignItems="center">
            <wui-flex gap="3xs" alignItems="center" justifyContent="center">
              <wui-text variant="title-6-600" color="fg-100" data-testid="account-settings-address">
                ${this.profileName?UiHelperUtil.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):UiHelperUtil.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
              </wui-text>
              <wui-icon-link
                size="md"
                icon="copy"
                iconColor="fg-200"
                @click=${this.onCopyAddress}
              ></wui-icon-link>
            </wui-flex>
          </wui-flex>
        </wui-flex>
        <wui-flex
          data-testid="account-settings-button"
          justifyContent="center"
          alignItems="center"
          class="account-settings-button"
          @click=${()=>RouterController.push("AccountSettings")}
        >
          <wui-text variant="paragraph-500" color="fg-100">Account Settings</wui-text>
        </wui-flex>
        ${this.accountsTemplate()}
      </wui-flex>
    `}accountsTemplate(){return ke`<wui-flex flexDirection="column">
      <wui-flex .padding=${["3xs","m","s","s"]}>
        <wui-text color="fg-200" variant="paragraph-400">Your accounts</wui-text>
      </wui-flex>
      <wui-flex flexDirection="column" gap="xxs">
        ${this.accounts.map(Mn=>this.accountTemplate(Mn))}
      </wui-flex>
    </wui-flex>`}async onSwitchAccount(Mn){AccountController.setShouldUpdateToAddress(Mn.address,ChainController.state.activeChain);const rs=ConnectorController.getAuthConnector();rs&&(await rs.provider.setPreferredAccount(Mn.type),await rs.provider.connect())}accountTemplate(Mn){return ke`<wui-list-account accountAddress=${Mn.address} accountType=${Mn.type}>
      ${Mn.address===this.address?"":ke`<wui-button
            slot="action"
            textVariant="small-600"
            size="sm"
            variant="accent"
            @click=${()=>this.onSwitchAccount(Mn)}
            >Switch</wui-button
          >`}
    </wui-list-account>`}onCopyAddress(){try{this.profileName?(CoreHelperUtil.copyToClopboard(this.profileName),SnackController.showSuccess("Name copied")):this.address&&(CoreHelperUtil.copyToClopboard(this.address),SnackController.showSuccess("Address copied"))}catch{SnackController.showError("Failed to copy")}}};W3mProfileView.styles=styles$z;__decorate$S([r$5()],W3mProfileView.prototype,"address",void 0);__decorate$S([r$5()],W3mProfileView.prototype,"profileImage",void 0);__decorate$S([r$5()],W3mProfileView.prototype,"profileName",void 0);__decorate$S([r$5()],W3mProfileView.prototype,"accounts",void 0);W3mProfileView=__decorate$S([customElement("w3m-profile-view")],W3mProfileView);const styles$y=i$4`
  input[type='checkbox'] {
    all: revert;
    width: var(--wui-spacing-xl);
    height: var(--wui-spacing-xl);
    accent-color: var(--wui-color-accent-100);
  }
`;var __decorate$R=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mSelectAddressesView=class extends h$3{constructor(){super(),this.metadata=OptionsController.state.metadata,this.allAccounts=AccountController.state.allAccounts,this.selectedAccounts=AccountController.state.allAccounts,this.selectAll=!0,this.approved=!1,this.isApproving=!1,this.getAddressTemplate=Mn=>{const rs=this.selectedAccounts.some(is=>is.address===Mn.address);return ke`<wui-list-account accountAddress="${Mn.address}" accountType="${Mn.type}">
      <input
        id="${Mn.address}"
        slot="action"
        type="checkbox"
        .checked="${rs}"
        @change="${this.handleClick(Mn)}"
      />
    </wui-list-account>`},this.onSelectAll=Mn=>{const rs=Mn.target.checked;this.selectAll=this.selectedAccounts.length===this.allAccounts.length,this.allAccounts.forEach(is=>{this.onSelect(is,rs)})},this.onSelect=(Mn,rs)=>{rs?this.selectedAccounts.push(Mn):this.selectedAccounts=this.selectedAccounts.filter(is=>is.address!==Mn.address),this.selectedAccounts.length>0&&(this.selectAll=this.selectedAccounts.length===this.allAccounts.length)},AccountController.subscribeKey("allAccounts",Mn=>{this.allAccounts=Mn})}render(){var Mn,rs;return ke`
    <wui-flex justifyContent="center" .padding=${["xl","0","xl","0"]}>
      <wui-banner-img imageSrc="${to$2((Mn=this.metadata)==null?void 0:Mn.icons[0])}" text="${to$2((rs=this.metadata)==null?void 0:rs.url)}" size="sm"></wui-banner>
    </wui-flex>
    <wui-flex .padding=${["0","xl","0","xl"]} flexDirection="row" justifyContent="space-between">
        <wui-text variant="paragraph-400" color="fg-200">Select all</wui-text>
        <input type="checkbox" .checked=${this.selectAll}  @click=${this.onSelectAll.bind(this)} />
    </wui-flex>
      <wui-flex flexDirection="column" .padding=${["l","xl","xl","xl"]}>
        ${this.allAccounts.map(is=>this.getAddressTemplate(is))}
      </wui-flex>
      <wui-flex .padding=${["l","xl","xl","xl"]} gap="s" justifyContent="space-between">
        <wui-button
          size="md"
          ?fullwidth=${!0}
          variant="neutral"
          @click=${this.onCancel.bind(this)}
          data-testid="w3m-connecting-siwe-cancel"
        >
          Cancel
        </wui-button>
        <wui-button
          size="md"
          ?fullwidth=${!0}
          variant="main"
          .disabled=${this.selectedAccounts.length===0}
          @click=${this.onContinue.bind(this)}
          ?loading=${this.isApproving}
        >
          ${this.isApproving?"Signing...":"Continue"}
        </wui-button>
      </wui-flex>
    `}handleClick(Mn){return rs=>{var os;const is=rs.target;(os=this.onSelect)==null||os.call(this,{...Mn},is==null?void 0:is.checked)}}onContinue(){var Mn;this.selectedAccounts.length>0?(this.isApproving=!0,AccountController.setAllAccounts(this.selectedAccounts,ChainController.state.activeChain),AccountController.setShouldUpdateToAddress(((Mn=this.selectedAccounts[0])==null?void 0:Mn.address)??"",ChainController.state.activeChain),this.approved=!0,this.isApproving=!1,ModalController.close()):this.onCancel()}async onCancel(){const{activeCaipAddress:Mn}=ChainController.state;Mn?(await ConnectionController.disconnect(),ModalController.close()):RouterController.push("Connect")}disconnectedCallback(){super.disconnectedCallback(),this.approved||this.onCancel()}};W3mSelectAddressesView.styles=styles$y;__decorate$R([r$5()],W3mSelectAddressesView.prototype,"allAccounts",void 0);__decorate$R([r$5()],W3mSelectAddressesView.prototype,"selectedAccounts",void 0);__decorate$R([r$5()],W3mSelectAddressesView.prototype,"selectAll",void 0);__decorate$R([r$5()],W3mSelectAddressesView.prototype,"approved",void 0);__decorate$R([r$5()],W3mSelectAddressesView.prototype,"isApproving",void 0);W3mSelectAddressesView=__decorate$R([customElement("w3m-select-addresses-view")],W3mSelectAddressesView);const styles$x=i$4`
  wui-avatar {
    width: var(--wui-spacing-3xl);
    height: var(--wui-spacing-3xl);
    box-shadow: 0 0 0 0;
  }

  wui-icon-box {
    position: relative;
    right: 15px;
    top: 15px;
    border: 2px solid var(--wui-color-bg-150);
    background-color: var(--wui-color-bg-125);
  }
`;var __decorate$Q=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mSwitchAddressView=class extends h$3{constructor(){super(),this.metadata=OptionsController.state.metadata,this.allAccounts=AccountController.state.allAccounts||[],this.balances={},this.labels=AccountController.state.addressLabels,this.currentAddress=AccountController.state.address||"",this.connectedConnector=StorageUtil.getConnectedConnector(),this.shouldShowIcon=this.connectedConnector==="AUTH",this.caipNetwork=ChainController.state.activeCaipNetwork,AccountController.subscribeKey("allAccounts",Mn=>{this.allAccounts=Mn})}connectedCallback(){super.connectedCallback(),this.allAccounts.forEach(Mn=>{var rs;BlockchainApiController.getBalance(Mn.address,(rs=this.caipNetwork)==null?void 0:rs.caipNetworkId).then(is=>{let os=this.balances[Mn.address]||0;is.balances.length>0&&(os=is.balances.reduce((as,us)=>as+((us==null?void 0:us.value)||0),0)),this.balances[Mn.address]=os,this.requestUpdate()})})}getAddressIcon(Mn){return Mn==="smartAccount"?"lightbulb":"mail"}render(){var Mn,rs;return ke`
      <wui-flex justifyContent="center" .padding=${["xl","0","xl","0"]}>
        <wui-banner-img
          imageSrc=${to$2((Mn=this.metadata)==null?void 0:Mn.icons[0])}
          text=${to$2((rs=this.metadata)==null?void 0:rs.url)}
          size="sm"
        ></wui-banner-img>
      </wui-flex>
      <wui-flex flexDirection="column" gap="xxl" .padding=${["l","xl","xl","xl"]}>
        ${this.allAccounts.map((is,os)=>this.getAddressTemplate(is,os))}
      </wui-flex>
    `}getAddressTemplate(Mn,rs){var os,as,us,ds;const is=(os=this.labels)==null?void 0:os.get(Mn.address);return ke`
      <wui-flex
        flexDirection="row"
        justifyContent="space-between"
        data-testid="switch-address-item"
      >
        <wui-flex alignItems="center">
          <wui-avatar address=${Mn.address}></wui-avatar>
          ${this.shouldShowIcon?ke`<wui-icon-box
                size="sm"
                iconcolor="fg-200"
                backgroundcolor="glass-002"
                background="gray"
                icon="${this.getAddressIcon(Mn.type)}"
                ?border=${!0}
              ></wui-icon-box>`:ke`<wui-flex .padding="${["0","0","0","s"]}"></wui-flex>`}
          <wui-flex flexDirection="column">
            <wui-text class="address" variant="paragraph-500" color="fg-100"
              >${is||UiHelperUtil.getTruncateString({string:Mn.address,charsStart:4,charsEnd:6,truncate:"middle"})}</wui-text
            >
            <wui-text class="address-description" variant="small-400">
              ${typeof this.balances[Mn.address]=="number"?`$${(as=this.balances[Mn.address])==null?void 0:as.toFixed(2)}`:ke`<wui-loading-spinner size="sm" color="accent-100"></wui-loading-spinner>`}
            </wui-text>
          </wui-flex>
        </wui-flex>
        <wui-flex gap="s" alignItems="center">
          ${((us=Mn.address)==null?void 0:us.toLowerCase())===((ds=this.currentAddress)==null?void 0:ds.toLowerCase())?"":ke`
                <wui-button
                  data-testid=${`w3m-switch-address-button-${rs}`}
                  textVariant="small-600"
                  size="md"
                  variant="accent"
                  @click=${()=>this.onSwitchAddress(Mn.address)}
                  >Switch to</wui-button
                >
              `}
        </wui-flex>
      </wui-flex>
    `}onSwitchAddress(Mn){const rs=ChainController.state.activeCaipNetwork,is=rs==null?void 0:rs.chainNamespace,os=`${is}:${rs==null?void 0:rs.id}:${Mn}`;AccountController.setCaipAddress(os,is),ModalController.close()}};W3mSwitchAddressView.styles=styles$x;__decorate$Q([r$5()],W3mSwitchAddressView.prototype,"allAccounts",void 0);__decorate$Q([r$5()],W3mSwitchAddressView.prototype,"balances",void 0);W3mSwitchAddressView=__decorate$Q([customElement("w3m-switch-address-view")],W3mSwitchAddressView);const styles$w=i$4`
  @keyframes fadein {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  wui-shimmer {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
  }

  wui-qr-code {
    opacity: 0;
    animation-duration: 200ms;
    animation-timing-function: ease;
    animation-name: fadein;
    animation-fill-mode: forwards;
  }

  wui-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--wui-border-radius-m);
  }

  wui-flex:first-child:not(:only-child) {
    position: relative;
  }
  wui-loading-thumbnail {
    position: absolute;
  }
  wui-icon-box {
    position: absolute;
    right: calc(var(--wui-spacing-3xs) * -1);
    bottom: calc(var(--wui-spacing-3xs) * -1);
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
  }
`;var __decorate$P=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingFarcasterView=class extends h$3{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=AccountController.state.socialProvider,this.uri=AccountController.state.farcasterUrl,this.ready=!1,this.loading=!1,this.authConnector=ConnectorController.getAuthConnector(),this.forceUpdate=()=>{this.requestUpdate()},this.unsubscribe.push(AccountController.subscribeKey("farcasterUrl",Mn=>{Mn&&(this.uri=Mn,this.connectFarcaster())}),AccountController.subscribeKey("socialProvider",Mn=>{Mn&&(this.socialProvider=Mn)})),window.addEventListener("resize",this.forceUpdate)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.timeout),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),ke`${this.platformTemplate()}`}platformTemplate(){return CoreHelperUtil.isMobile()?ke`${this.mobileTemplate()}`:ke`${this.desktopTemplate()}`}desktopTemplate(){return this.loading?ke`${this.loadingTemplate()}`:ke`${this.qrTemplate()}`}qrTemplate(){return ke` <wui-flex
      flexDirection="column"
      alignItems="center"
      .padding=${["0","xl","xl","xl"]}
      gap="xl"
    >
      <wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>

      <wui-text variant="paragraph-500" color="fg-100">
        Scan this QR Code with your phone
      </wui-text>
      ${this.copyTemplate()}
    </wui-flex>`}loadingTemplate(){return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        .padding=${["xl","xl","xl","xl"]}
        gap="xl"
      >
        <wui-flex justifyContent="center" alignItems="center">
          <wui-logo logo="farcaster"></wui-logo>
          ${this.loaderTemplate()}
          <wui-icon-box
            backgroundColor="error-100"
            background="opaque"
            iconColor="error-100"
            icon="close"
            size="sm"
            border
            borderColor="wui-color-bg-125"
          ></wui-icon-box>
        </wui-flex>
        <wui-flex flexDirection="column" alignItems="center" gap="xs">
          <wui-text align="center" variant="paragraph-500" color="fg-100">
            Loading user data
          </wui-text>
          <wui-text align="center" variant="small-400" color="fg-200">
            Please wait a moment while we load your data.
          </wui-text>
        </wui-flex>
      </wui-flex>
    `}mobileTemplate(){return ke` <wui-flex
      flexDirection="column"
      alignItems="center"
      .padding=${["3xl","xl","xl","xl"]}
      gap="xl"
    >
      <wui-flex justifyContent="center" alignItems="center">
        <wui-logo logo="farcaster"></wui-logo>
        ${this.loaderTemplate()}
        <wui-icon-box
          backgroundColor="error-100"
          background="opaque"
          iconColor="error-100"
          icon="close"
          size="sm"
          border
          borderColor="wui-color-bg-125"
        ></wui-icon-box>
      </wui-flex>
      <wui-flex flexDirection="column" alignItems="center" gap="xs">
        <wui-text align="center" variant="paragraph-500" color="fg-100"
          >Continue in Farcaster</span></wui-text
        >
        <wui-text align="center" variant="small-400" color="fg-200"
          >Accept connection request in the app</wui-text
        ></wui-flex
      >
      ${this.mobileLinkTemplate()}
    </wui-flex>`}loaderTemplate(){const Mn=ThemeController.state.themeVariables["--w3m-border-radius-master"],rs=Mn?parseInt(Mn.replace("px",""),10):4;return ke`<wui-loading-thumbnail radius=${rs*9}></wui-loading-thumbnail>`}async connectFarcaster(){var Mn;if(this.authConnector)try{await((Mn=this.authConnector)==null?void 0:Mn.provider.connectFarcaster()),this.socialProvider&&StorageUtil.setConnectedSocialProvider(this.socialProvider),this.loading=!0,await ConnectionController.connectExternal(this.authConnector,this.authConnector.chain),this.loading=!1,ModalController.close()}catch(rs){RouterController.goBack(),SnackController.showError(rs)}}mobileLinkTemplate(){return ke`<wui-button
      size="md"
      ?loading=${this.loading}
      ?disabled=${!this.uri||this.loading}
      @click=${()=>{this.uri&&CoreHelperUtil.openHref(this.uri,"_blank")}}
    >
      Open farcaster</wui-button
    >`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},0))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const Mn=this.getBoundingClientRect().width-40;return ke` <wui-qr-code
      size=${Mn}
      theme=${ThemeController.state.themeMode}
      uri=${this.uri}
      ?farcaster=${!0}
      data-testid="wui-qr-code"
    ></wui-qr-code>`}copyTemplate(){const Mn=!this.uri||!this.ready;return ke`<wui-link
      .disabled=${Mn}
      @click=${this.onCopyUri}
      color="fg-200"
      data-testid="copy-wc2-uri"
    >
      <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
      Copy link
    </wui-link>`}onCopyUri(){try{this.uri&&(CoreHelperUtil.copyToClopboard(this.uri),SnackController.showSuccess("Link copied"))}catch{SnackController.showError("Failed to copy")}}};W3mConnectingFarcasterView.styles=styles$w;__decorate$P([r$5()],W3mConnectingFarcasterView.prototype,"socialProvider",void 0);__decorate$P([r$5()],W3mConnectingFarcasterView.prototype,"uri",void 0);__decorate$P([r$5()],W3mConnectingFarcasterView.prototype,"ready",void 0);__decorate$P([r$5()],W3mConnectingFarcasterView.prototype,"loading",void 0);W3mConnectingFarcasterView=__decorate$P([customElement("w3m-connecting-farcaster-view")],W3mConnectingFarcasterView);const styles$v=i$4`
  wui-grid {
    max-height: clamp(360px, 400px, 80vh);
    overflow: scroll;
    scrollbar-width: none;
    grid-auto-rows: min-content;
    grid-template-columns: repeat(auto-fill, 76px);
  }

  @media (max-width: 435px) {
    wui-grid {
      grid-template-columns: repeat(auto-fill, 77px);
    }
  }

  wui-grid[data-scroll='false'] {
    overflow: hidden;
  }

  wui-grid::-webkit-scrollbar {
    display: none;
  }

  wui-loading-spinner {
    padding-top: var(--wui-spacing-l);
    padding-bottom: var(--wui-spacing-l);
    justify-content: center;
    grid-column: 1 / span 4;
  }
`,WalletUtil={filterOutDuplicatesByRDNS(Fn){const Mn=OptionsController.state.enableEIP6963?ConnectorController.state.connectors:[],rs=StorageUtil.getRecentWallets(),is=Mn.map(ds=>{var hs;return(hs=ds.info)==null?void 0:hs.rdns}).filter(Boolean),os=rs.map(ds=>ds.rdns).filter(Boolean),as=is.concat(os);if(as.includes("io.metamask.mobile")&&CoreHelperUtil.isMobile()){const ds=as.indexOf("io.metamask.mobile");as[ds]="io.metamask"}return Fn.filter(ds=>!as.includes(String(ds==null?void 0:ds.rdns)))},filterOutDuplicatesByIds(Fn){const Mn=ConnectorController.state.connectors.filter(ds=>ds.type==="ANNOUNCED"||ds.type==="INJECTED"),rs=StorageUtil.getRecentWallets(),is=Mn.map(ds=>ds.explorerId),os=rs.map(ds=>ds.id),as=is.concat(os);return Fn.filter(ds=>!as.includes(ds==null?void 0:ds.id))},filterOutDuplicateWallets(Fn){const Mn=this.filterOutDuplicatesByRDNS(Fn);return this.filterOutDuplicatesByIds(Mn)},markWalletsAsInstalled(Fn){const{connectors:Mn}=ConnectorController.state,rs=Mn.filter(as=>as.type==="ANNOUNCED").reduce((as,us)=>{var ds;return(ds=us.info)!=null&&ds.rdns&&(as[us.info.rdns]=!0),as},{});return Fn.map(as=>({...as,installed:!!as.rdns&&!!rs[as.rdns??""]})).sort((as,us)=>Number(us.installed)-Number(as.installed))}};var __decorate$O=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const PAGINATOR_ID$1="local-paginator";let W3mAllWalletsList=class extends h$3{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.initial=!ApiController.state.wallets.length,this.wallets=ApiController.state.wallets,this.recommended=ApiController.state.recommended,this.featured=ApiController.state.featured,this.unsubscribe.push(ApiController.subscribeKey("wallets",Mn=>this.wallets=Mn),ApiController.subscribeKey("recommended",Mn=>this.recommended=Mn),ApiController.subscribeKey("featured",Mn=>this.featured=Mn))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var Mn;this.unsubscribe.forEach(rs=>rs()),(Mn=this.paginationObserver)==null||Mn.disconnect()}render(){return ke`
      <wui-grid
        data-scroll=${!this.initial}
        .padding=${["0","s","s","s"]}
        columnGap="xxs"
        rowGap="l"
        justifyContent="space-between"
      >
        ${this.initial?this.shimmerTemplate(16):this.walletsTemplate()}
        ${this.paginationLoaderTemplate()}
      </wui-grid>
    `}async initialFetch(){var rs;const Mn=(rs=this.shadowRoot)==null?void 0:rs.querySelector("wui-grid");this.initial&&Mn&&(await ApiController.fetchWallets({page:1}),await Mn.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.initial=!1,Mn.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(Mn,rs){return[...Array(Mn)].map(()=>ke`
        <wui-card-select-loader type="wallet" id=${to$2(rs)}></wui-card-select-loader>
      `)}walletsTemplate(){const Mn=[...this.featured,...this.recommended,...this.wallets];return WalletUtil.markWalletsAsInstalled(Mn).map(is=>ke`
        <w3m-all-wallets-list-item
          @click=${()=>this.onConnectWallet(is)}
          .wallet=${is}
        ></w3m-all-wallets-list-item>
      `)}paginationLoaderTemplate(){const{wallets:Mn,recommended:rs,featured:is,count:os}=ApiController.state,as=window.innerWidth<352?3:4,us=Mn.length+rs.length;let hs=Math.ceil(us/as)*as-us+as;return hs-=Mn.length?is.length%as:0,os===0&&is.length>0?null:os===0||[...is,...Mn,...rs].length<os?this.shimmerTemplate(hs,PAGINATOR_ID$1):null}createPaginationObserver(){var rs;const Mn=(rs=this.shadowRoot)==null?void 0:rs.querySelector(`#${PAGINATOR_ID$1}`);Mn&&(this.paginationObserver=new IntersectionObserver(([is])=>{if(is!=null&&is.isIntersecting&&!this.initial){const{page:os,count:as,wallets:us}=ApiController.state;us.length<as&&ApiController.fetchWallets({page:os+1})}}),this.paginationObserver.observe(Mn))}onConnectWallet(Mn){const rs=ConnectorController.getConnector(Mn.id,Mn.rdns);rs?RouterController.push("ConnectingExternal",{connector:rs}):RouterController.push("ConnectingWalletConnect",{wallet:Mn})}};W3mAllWalletsList.styles=styles$v;__decorate$O([r$5()],W3mAllWalletsList.prototype,"initial",void 0);__decorate$O([r$5()],W3mAllWalletsList.prototype,"wallets",void 0);__decorate$O([r$5()],W3mAllWalletsList.prototype,"recommended",void 0);__decorate$O([r$5()],W3mAllWalletsList.prototype,"featured",void 0);W3mAllWalletsList=__decorate$O([customElement("w3m-all-wallets-list")],W3mAllWalletsList);const styles$u=i$4`
  button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 76px;
    row-gap: var(--wui-spacing-xs);
    padding: var(--wui-spacing-xs) var(--wui-spacing-0);
    background-color: var(--wui-color-gray-glass-002);
    border-radius: clamp(0px, var(--wui-border-radius-xs), 20px);
    will-change: background-color, color;
    outline: none;
    border: none;
  }

  button > wui-text {
    color: var(--wui-color-fg-100);
    max-width: var(--wui-icon-box-size-xl);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: center;
  }

  button:hover:enabled {
    background-color: var(--wui-color-gray-glass-005);
  }

  button:disabled > wui-text {
    color: var(--wui-color-gray-glass-015);
  }

  [data-selected='true'] {
    background-color: var(--wui-color-accent-glass-020);
  }

  @media (hover: hover) and (pointer: fine) {
    [data-selected='true']:hover:enabled {
      background-color: var(--wui-color-accent-glass-015);
    }
  }

  [data-selected='true']:active:enabled {
    background-color: var(--wui-color-accent-glass-010);
  }
`;var __decorate$N=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAllWalletsListItem=class extends h$3{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(Mn=>{Mn.forEach(rs=>{rs.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){var Mn;return ke`
      <button ontouchstart>
        ${this.imageTemplate()}
        <wui-text variant="tiny-500" color="inherit">${(Mn=this.wallet)==null?void 0:Mn.name}</wui-text>
      </button>
    `}imageTemplate(){var Mn,rs;return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():ke`
      <wui-wallet-image
        size="md"
        imageSrc=${to$2(this.imageSrc)}
        name=${(Mn=this.wallet)==null?void 0:Mn.name}
        .installed=${(rs=this.wallet)==null?void 0:rs.installed}
        badgeSize="sm"
      >
      </wui-wallet-image>
    `}shimmerTemplate(){return ke`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=AssetUtil.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await AssetUtil.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};W3mAllWalletsListItem.styles=styles$u;__decorate$N([r$5()],W3mAllWalletsListItem.prototype,"visible",void 0);__decorate$N([r$5()],W3mAllWalletsListItem.prototype,"imageSrc",void 0);__decorate$N([r$5()],W3mAllWalletsListItem.prototype,"imageLoading",void 0);__decorate$N([n$4()],W3mAllWalletsListItem.prototype,"wallet",void 0);W3mAllWalletsListItem=__decorate$N([customElement("w3m-all-wallets-list-item")],W3mAllWalletsListItem);const styles$t=i$4`
  wui-grid,
  wui-loading-spinner,
  wui-flex {
    height: 360px;
  }

  wui-grid {
    overflow: scroll;
    scrollbar-width: none;
    grid-auto-rows: min-content;
  }

  wui-grid[data-scroll='false'] {
    overflow: hidden;
  }

  wui-grid::-webkit-scrollbar {
    display: none;
  }

  wui-loading-spinner {
    justify-content: center;
    align-items: center;
  }
`;var __decorate$M=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAllWalletsSearch=class extends h$3{constructor(){super(...arguments),this.prevQuery="",this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?ke`<wui-loading-spinner color="accent-100"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){this.query.trim()!==this.prevQuery.trim()&&(this.prevQuery=this.query,this.loading=!0,await ApiController.searchWallet({search:this.query}),this.loading=!1)}walletsTemplate(){const{search:Mn}=ApiController.state,rs=WalletUtil.markWalletsAsInstalled(Mn);return Mn.length?ke`
      <wui-grid
        .padding=${["0","s","s","s"]}
        gridTemplateColumns="repeat(4, 1fr)"
        rowGap="l"
        columnGap="xs"
      >
        ${rs.map(is=>ke`
            <w3m-all-wallets-list-item
              @click=${()=>this.onConnectWallet(is)}
              .wallet=${is}
              data-testid="wallet-search-item-${is.id}"
            ></w3m-all-wallets-list-item>
          `)}
      </wui-grid>
    `:ke`
        <wui-flex justifyContent="center" alignItems="center" gap="s" flexDirection="column">
          <wui-icon-box
            size="lg"
            iconColor="fg-200"
            backgroundColor="fg-300"
            icon="wallet"
            background="transparent"
          ></wui-icon-box>
          <wui-text color="fg-200" variant="paragraph-500">No Wallet found</wui-text>
        </wui-flex>
      `}onConnectWallet(Mn){const rs=ConnectorController.getConnector(Mn.id,Mn.rdns);rs?RouterController.push("ConnectingExternal",{connector:rs}):RouterController.push("ConnectingWalletConnect",{wallet:Mn})}};W3mAllWalletsSearch.styles=styles$t;__decorate$M([r$5()],W3mAllWalletsSearch.prototype,"loading",void 0);__decorate$M([n$4()],W3mAllWalletsSearch.prototype,"query",void 0);W3mAllWalletsSearch=__decorate$M([customElement("w3m-all-wallets-search")],W3mAllWalletsSearch);var __decorate$L=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingHeader=class extends h$3{constructor(){super(),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0,this.buffering=!1,this.unsubscribe.push(ConnectionController.subscribeKey("buffering",Mn=>this.buffering=Mn))}disconnectCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const Mn=this.generateTabs();return ke`
      <wui-flex justifyContent="center" .padding=${["0","0","l","0"]}>
        <wui-tabs
          ?disabled=${this.buffering}
          .tabs=${Mn}
          .onTabChange=${this.onTabChange.bind(this)}
        ></wui-tabs>
      </wui-flex>
    `}generateTabs(){const Mn=this.platforms.map(rs=>rs==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:rs==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:rs==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:rs==="web"?{label:"Webapp",icon:"browser",platform:"web"}:rs==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=Mn.map(({platform:rs})=>rs),Mn}onTabChange(Mn){var is;const rs=this.platformTabs[Mn];rs&&((is=this.onSelectPlatfrom)==null||is.call(this,rs))}};__decorate$L([n$4({type:Array})],W3mConnectingHeader.prototype,"platforms",void 0);__decorate$L([n$4()],W3mConnectingHeader.prototype,"onSelectPlatfrom",void 0);__decorate$L([r$5()],W3mConnectingHeader.prototype,"buffering",void 0);W3mConnectingHeader=__decorate$L([customElement("w3m-connecting-header")],W3mConnectingHeader);var __decorate$K=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingWcBrowser=class extends W3mConnectingWidget{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){var Mn;try{this.error=!1;const{connectors:rs}=ConnectorController.state,is=rs.find(os=>{var as,us,ds;return os.type==="ANNOUNCED"&&((as=os.info)==null?void 0:as.rdns)===((us=this.wallet)==null?void 0:us.rdns)||os.type==="INJECTED"||os.name===((ds=this.wallet)==null?void 0:ds.name)});if(is)await ConnectionController.connectExternal(is,is.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");ModalController.close(),EventsController.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((Mn=this.wallet)==null?void 0:Mn.name)||"Unknown"}})}catch(rs){EventsController.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(rs==null?void 0:rs.message)??"Unknown"}}),this.error=!0}}};W3mConnectingWcBrowser=__decorate$K([customElement("w3m-connecting-wc-browser")],W3mConnectingWcBrowser);var __decorate$J=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingWcDesktop=class extends W3mConnectingWidget{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){var Mn;!this.ready&&this.uri&&(this.ready=!0,(Mn=this.onConnect)==null||Mn.call(this))}onConnectProxy(){var Mn;if((Mn=this.wallet)!=null&&Mn.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:rs,name:is}=this.wallet,{redirect:os,href:as}=CoreHelperUtil.formatNativeUrl(rs,this.uri);ConnectionController.setWcLinking({name:is,href:as}),ConnectionController.setRecentWallet(this.wallet),CoreHelperUtil.openHref(os,"_blank")}catch{this.error=!0}}};W3mConnectingWcDesktop=__decorate$J([customElement("w3m-connecting-wc-desktop")],W3mConnectingWcDesktop);var __decorate$I=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingWcMobile=class extends W3mConnectingWidget{constructor(){if(super(),this.btnLabelTimeout=void 0,this.labelTimeout=void 0,!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel=void 0,this.secondaryLabel=ConstantsUtil$2.CONNECT_LABELS.MOBILE,this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),document.addEventListener("visibilitychange",this.onBuffering.bind(this)),EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}}),this.btnLabelTimeout=setTimeout(()=>{this.secondaryBtnLabel="Try again",this.secondaryLabel=ConstantsUtil$2.CONNECT_LABELS.MOBILE},ConstantsUtil$2.FIVE_SEC_MS),this.labelTimeout=setTimeout(()=>{this.secondaryLabel="Hold tight... it's taking longer than expected"},ConstantsUtil$2.THREE_SEC_MS)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("visibilitychange",this.onBuffering.bind(this)),clearTimeout(this.btnLabelTimeout),clearTimeout(this.labelTimeout)}onRenderProxy(){var Mn;!this.ready&&this.uri&&(this.ready=!0,(Mn=this.onConnect)==null||Mn.call(this))}onConnectProxy(){var Mn;if((Mn=this.wallet)!=null&&Mn.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:rs,name:is}=this.wallet,{redirect:os,href:as}=CoreHelperUtil.formatNativeUrl(rs,this.uri);ConnectionController.setWcLinking({name:is,href:as}),ConnectionController.setRecentWallet(this.wallet),CoreHelperUtil.openHref(os,"_self"),clearTimeout(this.labelTimeout),this.secondaryLabel=ConstantsUtil$2.CONNECT_LABELS.MOBILE}catch(rs){EventsController.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:rs instanceof Error?rs.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}}onBuffering(){const Mn=CoreHelperUtil.isIos();(document==null?void 0:document.visibilityState)==="visible"&&!this.error&&Mn&&(ConnectionController.setBuffering(!0),setTimeout(()=>{ConnectionController.setBuffering(!1)},5e3))}};W3mConnectingWcMobile=__decorate$I([customElement("w3m-connecting-wc-mobile")],W3mConnectingWcMobile);const styles$s=i$4`
  @keyframes fadein {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  wui-shimmer {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
  }

  wui-qr-code {
    opacity: 0;
    animation-duration: 200ms;
    animation-timing-function: ease;
    animation-name: fadein;
    animation-fill-mode: forwards;
  }
`;var __decorate$H=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingWcQrcode=class extends W3mConnectingWidget{constructor(){var Mn;super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((Mn=this.wallet)==null?void 0:Mn.name)??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        .padding=${["0","xl","xl","xl"]}
        gap="xl"
      >
        <wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>

        <wui-text variant="paragraph-500" color="fg-100">
          Scan this QR Code with your phone
        </wui-text>
        ${this.copyTemplate()}
      </wui-flex>

      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
    `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const Mn=this.getBoundingClientRect().width-40,rs=this.wallet?this.wallet.name:void 0;return ConnectionController.setWcLinking(void 0),ConnectionController.setRecentWallet(this.wallet),ke` <wui-qr-code
      size=${Mn}
      theme=${ThemeController.state.themeMode}
      uri=${this.uri}
      imageSrc=${to$2(AssetUtil.getWalletImage(this.wallet))}
      alt=${to$2(rs)}
      data-testid="wui-qr-code"
    ></wui-qr-code>`}copyTemplate(){const Mn=!this.uri||!this.ready;return ke`<wui-link
      .disabled=${Mn}
      @click=${this.onCopyUri}
      color="fg-200"
      data-testid="copy-wc2-uri"
    >
      <wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
      Copy link
    </wui-link>`}};W3mConnectingWcQrcode.styles=styles$s;W3mConnectingWcQrcode=__decorate$H([customElement("w3m-connecting-wc-qrcode")],W3mConnectingWcQrcode);var __decorate$G=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingWcUnsupported=class extends h$3{constructor(){var Mn;if(super(),this.wallet=(Mn=RouterController.state.data)==null?void 0:Mn.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return ke`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        .padding=${["3xl","xl","xl","xl"]}
        gap="xl"
      >
        <wui-wallet-image
          size="lg"
          imageSrc=${to$2(AssetUtil.getWalletImage(this.wallet))}
        ></wui-wallet-image>

        <wui-text variant="paragraph-500" color="fg-100">Not Detected</wui-text>
      </wui-flex>

      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
    `}};W3mConnectingWcUnsupported=__decorate$G([customElement("w3m-connecting-wc-unsupported")],W3mConnectingWcUnsupported);var __decorate$F=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectingWcWeb=class extends W3mConnectingWidget{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel="Open and continue in a new browser tab",this.secondaryBtnIcon="externalLink",EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}onConnectProxy(){var Mn;if((Mn=this.wallet)!=null&&Mn.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:rs,name:is}=this.wallet,{redirect:os,href:as}=CoreHelperUtil.formatUniversalUrl(rs,this.uri);ConnectionController.setWcLinking({name:is,href:as}),ConnectionController.setRecentWallet(this.wallet),CoreHelperUtil.openHref(os,"_blank")}catch{this.error=!0}}};W3mConnectingWcWeb=__decorate$F([customElement("w3m-connecting-wc-web")],W3mConnectingWcWeb);const styles$r=i$4`
  :host {
    width: 100%;
  }

  .details-container > wui-flex {
    background: var(--wui-color-gray-glass-002);
    border-radius: var(--wui-border-radius-xxs);
    width: 100%;
  }

  .details-container > wui-flex > button {
    border: none;
    background: none;
    padding: var(--wui-spacing-s);
    border-radius: var(--wui-border-radius-xxs);
    cursor: pointer;
  }

  .details-content-container {
    padding: var(--wui-spacing-1xs);
    padding-top: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .details-content-container > wui-flex {
    width: 100%;
  }

  .details-row {
    width: 100%;
    padding: var(--wui-spacing-s);
    padding-left: var(--wui-spacing-s);
    padding-right: var(--wui-spacing-1xs);
    border-radius: calc(var(--wui-border-radius-5xs) + var(--wui-border-radius-4xs));
    background: var(--wui-color-gray-glass-002);
  }

  .details-row-title {
    white-space: nowrap;
  }

  .details-row.provider-free-row {
    padding-right: var(--wui-spacing-xs);
  }
`;var __decorate$E=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const slippageRate=ConstantsUtil$2.CONVERT_SLIPPAGE_TOLERANCE;let WuiSwapDetails=class extends h$3{constructor(){var Mn;super(),this.unsubscribe=[],this.networkName=(Mn=ChainController.state.activeCaipNetwork)==null?void 0:Mn.name,this.detailsOpen=!1,this.sourceToken=SwapController.state.sourceToken,this.toToken=SwapController.state.toToken,this.toTokenAmount=SwapController.state.toTokenAmount,this.sourceTokenPriceInUSD=SwapController.state.sourceTokenPriceInUSD,this.toTokenPriceInUSD=SwapController.state.toTokenPriceInUSD,this.gasPriceInUSD=SwapController.state.gasPriceInUSD,this.priceImpact=SwapController.state.priceImpact,this.maxSlippage=SwapController.state.maxSlippage,this.networkTokenSymbol=SwapController.state.networkTokenSymbol,this.inputError=SwapController.state.inputError,this.unsubscribe.push(SwapController.subscribe(rs=>{this.sourceToken=rs.sourceToken,this.toToken=rs.toToken,this.toTokenAmount=rs.toTokenAmount,this.gasPriceInUSD=rs.gasPriceInUSD,this.priceImpact=rs.priceImpact,this.maxSlippage=rs.maxSlippage,this.sourceTokenPriceInUSD=rs.sourceTokenPriceInUSD,this.toTokenPriceInUSD=rs.toTokenPriceInUSD,this.inputError=rs.inputError}))}render(){const Mn=this.toTokenAmount&&this.maxSlippage?NumberUtil.bigNumber(this.toTokenAmount).minus(this.maxSlippage).toString():null;if(!this.sourceToken||!this.toToken||this.inputError)return null;const rs=this.sourceTokenPriceInUSD&&this.toTokenPriceInUSD?1/this.toTokenPriceInUSD*this.sourceTokenPriceInUSD:0;return ke`
      <wui-flex flexDirection="column" alignItems="center" gap="1xs" class="details-container">
        <wui-flex flexDirection="column">
          <button @click=${this.toggleDetails.bind(this)}>
            <wui-flex justifyContent="space-between" .padding=${["0","xs","0","xs"]}>
              <wui-flex justifyContent="flex-start" flexGrow="1" gap="xs">
                <wui-text variant="small-400" color="fg-100">
                  1 ${this.sourceToken.symbol} =
                  ${UiHelperUtil.formatNumberToLocalString(rs,3)}
                  ${this.toToken.symbol}
                </wui-text>
                <wui-text variant="small-400" color="fg-200">
                  $${UiHelperUtil.formatNumberToLocalString(this.sourceTokenPriceInUSD)}
                </wui-text>
              </wui-flex>
              <wui-icon name="chevronBottom"></wui-icon>
            </wui-flex>
          </button>
          ${this.detailsOpen?ke`
                <wui-flex flexDirection="column" gap="xs" class="details-content-container">
                  <wui-flex flexDirection="column" gap="xs">
                    <wui-flex
                      justifyContent="space-between"
                      alignItems="center"
                      class="details-row"
                    >
                      <wui-flex alignItems="center" gap="xs">
                        <wui-text class="details-row-title" variant="small-400" color="fg-150">
                          Network cost
                        </wui-text>
                        <w3m-tooltip-trigger
                          text=${`Network cost is paid in ${this.networkTokenSymbol} on the ${this.networkName} network in order to execute transaction.`}
                        >
                          <wui-icon size="xs" color="fg-250" name="infoCircle"></wui-icon>
                        </w3m-tooltip-trigger>
                      </wui-flex>
                      <wui-text variant="small-400" color="fg-100">
                        $${UiHelperUtil.formatNumberToLocalString(this.gasPriceInUSD,3)}
                      </wui-text>
                    </wui-flex>
                  </wui-flex>
                  ${this.priceImpact?ke` <wui-flex flexDirection="column" gap="xs">
                        <wui-flex
                          justifyContent="space-between"
                          alignItems="center"
                          class="details-row"
                        >
                          <wui-flex alignItems="center" gap="xs">
                            <wui-text class="details-row-title" variant="small-400" color="fg-150">
                              Price impact
                            </wui-text>
                            <w3m-tooltip-trigger
                              text="Price impact reflects the change in market price due to your trade"
                            >
                              <wui-icon size="xs" color="fg-250" name="infoCircle"></wui-icon>
                            </w3m-tooltip-trigger>
                          </wui-flex>
                          <wui-flex>
                            <wui-text variant="small-400" color="fg-200">
                              ${UiHelperUtil.formatNumberToLocalString(this.priceImpact,3)}%
                            </wui-text>
                          </wui-flex>
                        </wui-flex>
                      </wui-flex>`:null}
                  ${this.maxSlippage&&this.sourceToken.symbol?ke`<wui-flex flexDirection="column" gap="xs">
                        <wui-flex
                          justifyContent="space-between"
                          alignItems="center"
                          class="details-row"
                        >
                          <wui-flex alignItems="center" gap="xs">
                            <wui-text class="details-row-title" variant="small-400" color="fg-150">
                              Max. slippage
                            </wui-text>
                            <w3m-tooltip-trigger
                              text=${`Max slippage sets the minimum amount you must receive for the transaction to proceed. ${Mn?`Transaction will be reversed if you receive less than ${UiHelperUtil.formatNumberToLocalString(Mn,6)} ${this.toToken.symbol} due to price changes.`:""}`}
                            >
                              <wui-icon size="xs" color="fg-250" name="infoCircle"></wui-icon>
                            </w3m-tooltip-trigger>
                          </wui-flex>
                          <wui-flex>
                            <wui-text variant="small-400" color="fg-200">
                              ${UiHelperUtil.formatNumberToLocalString(this.maxSlippage,6)}
                              ${this.toToken.symbol} ${slippageRate}%
                            </wui-text>
                          </wui-flex>
                        </wui-flex>
                      </wui-flex>`:null}
                  <wui-flex flexDirection="column" gap="xs">
                    <wui-flex
                      justifyContent="space-between"
                      alignItems="center"
                      class="details-row provider-free-row"
                    >
                      <wui-flex alignItems="center" gap="xs">
                        <wui-text class="details-row-title" variant="small-400" color="fg-150">
                          Provider fee
                        </wui-text>
                      </wui-flex>
                      <wui-flex>
                        <wui-text variant="small-400" color="fg-200">0.85%</wui-text>
                      </wui-flex>
                    </wui-flex>
                  </wui-flex>
                </wui-flex>
              `:null}
        </wui-flex>
      </wui-flex>
    `}toggleDetails(){this.detailsOpen=!this.detailsOpen}};WuiSwapDetails.styles=[styles$r];__decorate$E([r$5()],WuiSwapDetails.prototype,"networkName",void 0);__decorate$E([n$4()],WuiSwapDetails.prototype,"detailsOpen",void 0);__decorate$E([r$5()],WuiSwapDetails.prototype,"sourceToken",void 0);__decorate$E([r$5()],WuiSwapDetails.prototype,"toToken",void 0);__decorate$E([r$5()],WuiSwapDetails.prototype,"toTokenAmount",void 0);__decorate$E([r$5()],WuiSwapDetails.prototype,"sourceTokenPriceInUSD",void 0);__decorate$E([r$5()],WuiSwapDetails.prototype,"toTokenPriceInUSD",void 0);__decorate$E([r$5()],WuiSwapDetails.prototype,"gasPriceInUSD",void 0);__decorate$E([r$5()],WuiSwapDetails.prototype,"priceImpact",void 0);__decorate$E([r$5()],WuiSwapDetails.prototype,"maxSlippage",void 0);__decorate$E([r$5()],WuiSwapDetails.prototype,"networkTokenSymbol",void 0);__decorate$E([r$5()],WuiSwapDetails.prototype,"inputError",void 0);WuiSwapDetails=__decorate$E([customElement("w3m-swap-details")],WuiSwapDetails);const styles$q=i$4`
  :host > wui-flex {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--wui-border-radius-s);
    background-color: var(--wui-color-gray-glass-002);
    padding: var(--wui-spacing-xl);
    padding-right: var(--wui-spacing-s);
    width: 100%;
    height: 100px;
    box-sizing: border-box;
    box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002);
    position: relative;
    transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-lg);
    will-change: background-color;
  }

  :host wui-flex.focus {
    box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-005);
  }

  :host > wui-flex .swap-input,
  :host > wui-flex .swap-token-button {
    z-index: 10;
  }

  :host > wui-flex .swap-input {
    -webkit-mask-image: linear-gradient(
      270deg,
      transparent 0px,
      transparent 8px,
      black 24px,
      black 25px,
      black 32px,
      black 100%
    );
    mask-image: linear-gradient(
      270deg,
      transparent 0px,
      transparent 8px,
      black 24px,
      black 25px,
      black 32px,
      black 100%
    );
  }

  :host > wui-flex .swap-input input {
    background: none;
    border: none;
    height: 42px;
    width: 100%;
    font-size: 32px;
    font-style: normal;
    font-weight: 400;
    line-height: 130%;
    letter-spacing: -1.28px;
    outline: none;
    caret-color: var(--wui-color-accent-100);
    color: var(--wui-color-fg-100);
    padding: 0px;
  }

  :host > wui-flex .swap-input input:focus-visible {
    outline: none;
  }

  :host > wui-flex .swap-input input::-webkit-outer-spin-button,
  :host > wui-flex .swap-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  .max-value-button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: var(--wui-color-gray-glass-020);
    padding-left: 0px;
  }

  .market-value {
    min-height: 18px;
  }
`;var __decorate$D=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const MINIMUM_USD_VALUE_TO_CONVERT=5e-5;let W3mSwapInput=class extends h$3{constructor(){super(...arguments),this.focused=!1,this.price=0,this.target="sourceToken",this.onSetAmount=null,this.onSetMaxValue=null}render(){const Mn=this.marketValue||"0",rs=NumberUtil.bigNumber(Mn).isGreaterThan("0");return ke`
      <wui-flex class="${this.focused?"focus":""}" justifyContent="space-between">
        <wui-flex
          flex="1"
          flexDirection="column"
          alignItems="flex-start"
          justifyContent="center"
          class="swap-input"
        >
          <input
            data-testid="swap-input-${this.target}"
            @focusin=${()=>this.onFocusChange(!0)}
            @focusout=${()=>this.onFocusChange(!1)}
            ?disabled=${this.disabled}
            .value=${this.value}
            @input=${this.dispatchInputChangeEvent}
            @keydown=${this.handleKeydown}
            placeholder="0"
            type="text"
            inputmode="decimal"
          />
          <wui-text class="market-value" variant="small-400" color="fg-200">
            ${rs?`$${UiHelperUtil.formatNumberToLocalString(this.marketValue,3)}`:null}
          </wui-text>
        </wui-flex>
        ${this.templateTokenSelectButton()}
      </wui-flex>
    `}handleKeydown(Mn){return InputUtil.numericInputKeyDown(Mn,this.value,rs=>{var is;return(is=this.onSetAmount)==null?void 0:is.call(this,this.target,rs)})}dispatchInputChangeEvent(Mn){if(!this.onSetAmount)return;const rs=Mn.target.value.replace(/[^0-9.]/gu,"");rs===","||rs==="."?this.onSetAmount(this.target,"0."):rs.endsWith(",")?this.onSetAmount(this.target,rs.replace(",",".")):this.onSetAmount(this.target,rs)}setMaxValueToInput(){var Mn;(Mn=this.onSetMaxValue)==null||Mn.call(this,this.target,this.balance)}templateTokenSelectButton(){return this.token?ke`
      <wui-flex
        class="swap-token-button"
        flexDirection="column"
        alignItems="flex-end"
        justifyContent="center"
        gap="xxs"
      >
        <wui-token-button
          data-testid="swap-input-token-${this.target}"
          text=${this.token.symbol}
          imageSrc=${this.token.logoUri}
          @click=${this.onSelectToken.bind(this)}
        >
        </wui-token-button>
        <wui-flex alignItems="center" gap="xxs"> ${this.tokenBalanceTemplate()} </wui-flex>
      </wui-flex>
    `:ke` <wui-button
        data-testid="swap-select-token-button-${this.target}"
        class="swap-token-button"
        size="md"
        variant="accent"
        @click=${this.onSelectToken.bind(this)}
      >
        Select token
      </wui-button>`}tokenBalanceTemplate(){const Mn=NumberUtil.multiply(this.balance,this.price),rs=Mn?Mn==null?void 0:Mn.isGreaterThan(MINIMUM_USD_VALUE_TO_CONVERT):!1;return ke`
      ${rs?ke`<wui-text variant="small-400" color="fg-200">
            ${UiHelperUtil.formatNumberToLocalString(this.balance,3)}
          </wui-text>`:null}
      ${this.target==="sourceToken"?this.tokenActionButtonTemplate(rs):null}
    `}tokenActionButtonTemplate(Mn){return Mn?ke` <button class="max-value-button" @click=${this.setMaxValueToInput.bind(this)}>
        <wui-text color="accent-100" variant="small-600">Max</wui-text>
      </button>`:ke` <button class="max-value-button" @click=${this.onBuyToken.bind(this)}>
      <wui-text color="accent-100" variant="small-600">Buy</wui-text>
    </button>`}onFocusChange(Mn){this.focused=Mn}onSelectToken(){EventsController.sendEvent({type:"track",event:"CLICK_SELECT_TOKEN_TO_SWAP"}),RouterController.push("SwapSelectToken",{target:this.target})}onBuyToken(){RouterController.push("OnRampProviders")}};W3mSwapInput.styles=[styles$q];__decorate$D([n$4()],W3mSwapInput.prototype,"focused",void 0);__decorate$D([n$4()],W3mSwapInput.prototype,"balance",void 0);__decorate$D([n$4()],W3mSwapInput.prototype,"value",void 0);__decorate$D([n$4()],W3mSwapInput.prototype,"price",void 0);__decorate$D([n$4()],W3mSwapInput.prototype,"marketValue",void 0);__decorate$D([n$4()],W3mSwapInput.prototype,"disabled",void 0);__decorate$D([n$4()],W3mSwapInput.prototype,"target",void 0);__decorate$D([n$4()],W3mSwapInput.prototype,"token",void 0);__decorate$D([n$4()],W3mSwapInput.prototype,"onSetAmount",void 0);__decorate$D([n$4()],W3mSwapInput.prototype,"onSetMaxValue",void 0);W3mSwapInput=__decorate$D([customElement("w3m-swap-input")],W3mSwapInput);const styles$p=i$4`
  :host {
    width: 100%;
  }

  :host > wui-flex {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--wui-border-radius-s);
    padding: var(--wui-spacing-xl);
    padding-right: var(--wui-spacing-s);
    background-color: var(--wui-color-gray-glass-002);
    box-shadow: inset 0px 0px 0px 1px var(--wui-color-gray-glass-002);
    width: 100%;
    height: 100px;
    box-sizing: border-box;
    position: relative;
  }

  wui-shimmer.market-value {
    opacity: 0;
  }

  :host > wui-flex > svg.input_mask {
    position: absolute;
    inset: 0;
    z-index: 5;
  }

  :host wui-flex .input_mask__border,
  :host wui-flex .input_mask__background {
    transition: fill var(--wui-duration-md) var(--wui-ease-out-power-1);
    will-change: fill;
  }

  :host wui-flex .input_mask__border {
    fill: var(--wui-color-gray-glass-020);
  }

  :host wui-flex .input_mask__background {
    fill: var(--wui-color-gray-glass-002);
  }
`;var __decorate$C=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mSwapInputSkeleton=class extends h$3{constructor(){super(...arguments),this.target="sourceToken"}render(){return ke`
      <wui-flex class justifyContent="space-between">
        <wui-flex
          flex="1"
          flexDirection="column"
          alignItems="flex-start"
          justifyContent="center"
          class="swap-input"
          gap="xxs"
        >
          <wui-shimmer width="80px" height="40px" borderRadius="xxs" variant="light"></wui-shimmer>
        </wui-flex>
        ${this.templateTokenSelectButton()}
      </wui-flex>
    `}templateTokenSelectButton(){return ke`
      <wui-flex
        class="swap-token-button"
        flexDirection="column"
        alignItems="flex-end"
        justifyContent="center"
        gap="xxs"
      >
        <wui-shimmer width="80px" height="40px" borderRadius="3xl" variant="light"></wui-shimmer>
      </wui-flex>
    `}};W3mSwapInputSkeleton.styles=[styles$p];__decorate$C([n$4()],W3mSwapInputSkeleton.prototype,"target",void 0);W3mSwapInputSkeleton=__decorate$C([customElement("w3m-swap-input-skeleton")],W3mSwapInputSkeleton);const styles$o=i$4`
  :host {
    height: 64px;
  }

  wui-text {
    text-transform: capitalize;
  }

  wui-flex.w3m-header-title {
    transform: translateY(0);
    opacity: 1;
  }

  wui-flex.w3m-header-title[view-direction='prev'] {
    animation:
      slide-down-out 120ms forwards var(--wui-ease-out-power-2),
      slide-down-in 120ms forwards var(--wui-ease-out-power-2);
    animation-delay: 0ms, 200ms;
  }

  wui-flex.w3m-header-title[view-direction='next'] {
    animation:
      slide-up-out 120ms forwards var(--wui-ease-out-power-2),
      slide-up-in 120ms forwards var(--wui-ease-out-power-2);
    animation-delay: 0ms, 200ms;
  }

  wui-icon-link[data-hidden='true'] {
    opacity: 0 !important;
    pointer-events: none;
  }

  @keyframes slide-up-out {
    from {
      transform: translateY(0px);
      opacity: 1;
    }
    to {
      transform: translateY(3px);
      opacity: 0;
    }
  }

  @keyframes slide-up-in {
    from {
      transform: translateY(-3px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes slide-down-out {
    from {
      transform: translateY(0px);
      opacity: 1;
    }
    to {
      transform: translateY(-3px);
      opacity: 0;
    }
  }

  @keyframes slide-down-in {
    from {
      transform: translateY(3px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
`;var __decorate$B=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const BETA_SCREENS=["SmartSessionList"];function headings$1(){var us,ds,hs,ps,io,fo,mo;const Fn=(ds=(us=RouterController.state.data)==null?void 0:us.connector)==null?void 0:ds.name,Mn=(ps=(hs=RouterController.state.data)==null?void 0:hs.wallet)==null?void 0:ps.name,rs=(fo=(io=RouterController.state.data)==null?void 0:io.network)==null?void 0:fo.name,is=Mn??Fn,os=ConnectorController.getConnectors();return{Connect:`Connect ${os.length===1&&((mo=os[0])==null?void 0:mo.id)==="w3m-email"?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExternal:is??"Connect Wallet",ConnectingWalletConnect:is??"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview convert",Downloads:is?`Get ${is}`:"Downloads",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Profile:void 0,SelectAddresses:"Select accounts",SwitchNetwork:rs??"Switch Network",SwitchAddress:"Switch Address",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade your Wallet",UpgradeToSmartAccount:void 0,UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select token",SwapPreview:"Preview swap",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",ConnectWallets:"Connect wallet",ConnectSocials:"All socials",ConnectingSocial:AccountController.state.socialProvider?AccountController.state.socialProvider:"Connect Social",ConnectingMultiChain:"Select chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch chain",SmartSessionCreated:void 0,SmartSessionList:"Smart Sessions"}}let W3mHeader=class extends h$3{constructor(){super(),this.unsubscribe=[],this.heading=headings$1()[RouterController.state.view],this.network=ChainController.state.activeCaipNetwork,this.buffering=!1,this.showBack=!1,this.isSiweEnabled=OptionsController.state.isSiweEnabled,this.prevHistoryLength=1,this.view=RouterController.state.view,this.viewDirection="",this.headerText=headings$1()[RouterController.state.view],this.unsubscribe.push(RouterController.subscribeKey("view",Mn=>{setTimeout(()=>{this.view=Mn,this.headerText=headings$1()[Mn]},ConstantsUtil.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),ConnectionController.subscribeKey("buffering",Mn=>this.buffering=Mn),ChainController.subscribeKey("activeCaipNetwork",Mn=>this.network=Mn))}disconnectCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return ke`
      <wui-flex .padding=${this.getPadding()} justifyContent="space-between" alignItems="center">
        ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
      </wui-flex>
    `}onWalletHelp(){EventsController.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),RouterController.push("WhatIsAWallet")}async onClose(){if(this.isSiweEnabled){const{SIWEController:Mn}=await __vitePreload(async()=>{const{SIWEController:os}=await import("./index-Bt9bEBgv.js");return{SIWEController:os}},[]),rs=RouterController.state.view==="ApproveTransaction";Mn.state.status!=="success"&&rs?RouterController.popTransactionStack(!0):ModalController.close()}else ModalController.close()}rightHeaderTemplate(){var rs,is;const Mn=(is=(rs=OptionsController==null?void 0:OptionsController.state)==null?void 0:rs.features)==null?void 0:is.smartSessions;return RouterController.state.view!=="Account"||!Mn?this.closeButtonTemplate():ke`<wui-flex>
      <wui-icon-link
        icon="clock"
        @click=${()=>RouterController.push("SmartSessionList")}
        data-testid="w3m-header-smart-sessions"
      ></wui-icon-link>
      ${this.closeButtonTemplate()}
    </wui-flex> `}closeButtonTemplate(){const Mn=RouterController.state.view==="ConnectingSiwe";return this.isSiweEnabled&&Mn?ke`<div style="width:40px" />`:ke`
      <wui-icon-link
        ?disabled=${this.buffering}
        icon="close"
        @click=${this.onClose.bind(this)}
        data-testid="w3m-header-close"
      ></wui-icon-link>
    `}titleTemplate(){const Mn=BETA_SCREENS.includes(this.view);return ke`
      <wui-flex
        view-direction="${this.viewDirection}"
        class="w3m-header-title"
        alignItems="center"
        gap="xs"
      >
        <wui-text variant="paragraph-700" color="fg-100" data-testid="w3m-header-text"
          >${this.headerText}</wui-text
        >
        ${Mn?ke`<wui-tag variant="main">Beta</wui-tag>`:null}
      </wui-flex>
    `}leftHeaderTemplate(){var hs;const{view:Mn}=RouterController.state,rs=Mn==="Connect",is=Mn==="ApproveTransaction",os=Mn==="UpgradeToSmartAccount",as=Mn==="ConnectingSiwe",us=Mn==="Account",ds=is||os||as;return us?ke`<wui-select
        id="dynamic"
        data-testid="w3m-account-select-network"
        active-network=${(hs=this.network)==null?void 0:hs.name}
        @click=${this.onNetworks.bind(this)}
        imageSrc=${to$2(AssetUtil.getNetworkImage(this.network))}
      ></wui-select>`:this.showBack&&!ds?ke`<wui-icon-link
        id="dynamic"
        icon="chevronLeft"
        ?disabled=${this.buffering}
        @click=${this.onGoBack.bind(this)}
      ></wui-icon-link>`:ke`<wui-icon-link
      data-hidden=${!rs}
      id="dynamic"
      icon="helpCircle"
      @click=${this.onWalletHelp.bind(this)}
    ></wui-icon-link>`}onNetworks(){this.isAllowedNetworkSwitch()&&(EventsController.sendEvent({type:"track",event:"CLICK_NETWORKS"}),RouterController.push("Networks"))}isAllowedNetworkSwitch(){const Mn=ChainController.getAllRequestedCaipNetworks(),rs=Mn?Mn.length>1:!1,is=Mn==null?void 0:Mn.find(({id:os})=>{var as;return os===((as=this.network)==null?void 0:as.id)});return rs||!is}getPadding(){return this.heading?["l","2l","l","2l"]:["0","2l","0","2l"]}onViewChange(){const{history:Mn}=RouterController.state;let rs=ConstantsUtil.VIEW_DIRECTION.Next;Mn.length<this.prevHistoryLength&&(rs=ConstantsUtil.VIEW_DIRECTION.Prev),this.prevHistoryLength=Mn.length,this.viewDirection=rs}async onHistoryChange(){var is;const{history:Mn}=RouterController.state,rs=(is=this.shadowRoot)==null?void 0:is.querySelector("#dynamic");Mn.length>1&&!this.showBack&&rs?(await rs.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,rs.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):Mn.length<=1&&this.showBack&&rs&&(await rs.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,rs.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){RouterController.goBack()}};W3mHeader.styles=styles$o;__decorate$B([r$5()],W3mHeader.prototype,"heading",void 0);__decorate$B([r$5()],W3mHeader.prototype,"network",void 0);__decorate$B([r$5()],W3mHeader.prototype,"buffering",void 0);__decorate$B([r$5()],W3mHeader.prototype,"showBack",void 0);__decorate$B([r$5()],W3mHeader.prototype,"isSiweEnabled",void 0);__decorate$B([r$5()],W3mHeader.prototype,"prevHistoryLength",void 0);__decorate$B([r$5()],W3mHeader.prototype,"view",void 0);__decorate$B([r$5()],W3mHeader.prototype,"viewDirection",void 0);__decorate$B([r$5()],W3mHeader.prototype,"headerText",void 0);W3mHeader=__decorate$B([customElement("w3m-header")],W3mHeader);var __decorate$A=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mHelpWidget=class extends h$3{constructor(){super(...arguments),this.data=[]}render(){return ke`
      <wui-flex flexDirection="column" alignItems="center" gap="l">
        ${this.data.map(Mn=>ke`
            <wui-flex flexDirection="column" alignItems="center" gap="xl">
              <wui-flex flexDirection="row" justifyContent="center" gap="1xs">
                ${Mn.images.map(rs=>ke`<wui-visual name=${rs}></wui-visual>`)}
              </wui-flex>
            </wui-flex>
            <wui-flex flexDirection="column" alignItems="center" gap="xxs">
              <wui-text variant="paragraph-500" color="fg-100" align="center">
                ${Mn.title}
              </wui-text>
              <wui-text variant="small-500" color="fg-200" align="center">${Mn.text}</wui-text>
            </wui-flex>
          `)}
      </wui-flex>
    `}};__decorate$A([n$4({type:Array})],W3mHelpWidget.prototype,"data",void 0);W3mHelpWidget=__decorate$A([customElement("w3m-help-widget")],W3mHelpWidget);const styles$n=i$4`
  :host {
    width: 100%;
  }

  :host > wui-flex {
    width: 100%;
    padding: var(--wui-spacing-s);
    border-radius: var(--wui-border-radius-xs);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--wui-spacing-s);
  }

  :host > wui-flex:hover {
    background-color: var(--wui-color-gray-glass-002);
  }

  .purchase-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: var(--wui-icon-box-size-lg);
    height: var(--wui-icon-box-size-lg);
  }

  .purchase-image-container wui-image {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: calc(var(--wui-icon-box-size-lg) / 2);
  }

  .purchase-image-container wui-image::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    border-radius: calc(var(--wui-icon-box-size-lg) / 2);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
  }

  .purchase-image-container wui-icon-box {
    position: absolute;
    right: 0;
    bottom: 0;
    transform: translate(20%, 20%);
  }
`;var __decorate$z=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mOnRampActivityItem=class extends h$3{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="Bought",this.purchaseValue="",this.purchaseCurrency="",this.date="",this.completed=!1,this.inProgress=!1,this.failed=!1,this.onClick=null,this.symbol=""}firstUpdated(){this.icon||this.fetchTokenImage()}render(){return ke`
      <wui-flex>
        ${this.imageTemplate()}
        <wui-flex flexDirection="column" gap="4xs" flexGrow="1">
          <wui-flex gap="xxs" alignItems="center" justifyContent="flex-start">
            ${this.statusIconTemplate()}
            <wui-text variant="paragraph-500" color="fg-100"> ${this.label}</wui-text>
          </wui-flex>
          <wui-text variant="small-400" color="fg-200">
            + ${this.purchaseValue} ${this.purchaseCurrency}
          </wui-text>
        </wui-flex>
        ${this.inProgress?ke`<wui-loading-spinner color="fg-200" size="md"></wui-loading-spinner>`:ke`<wui-text variant="micro-700" color="fg-300"><span>${this.date}</span></wui-text>`}
      </wui-flex>
    `}async fetchTokenImage(){await ApiController._fetchTokenImage(this.purchaseCurrency)}statusIconTemplate(){return this.inProgress?null:this.completed?this.boughtIconTemplate():this.errorIconTemplate()}errorIconTemplate(){return ke`<wui-icon-box
      size="xxs"
      iconColor="error-100"
      backgroundColor="error-100"
      background="opaque"
      icon="close"
      borderColor="wui-color-bg-125"
    ></wui-icon-box>`}imageTemplate(){const Mn=this.icon||`https://avatar.vercel.sh/andrew.svg?size=50&text=${this.symbol}`;return ke`<wui-flex class="purchase-image-container">
      <wui-image src=${Mn}></wui-image>
    </wui-flex>`}boughtIconTemplate(){return ke`<wui-icon-box
      size="xxs"
      iconColor="success-100"
      backgroundColor="success-100"
      background="opaque"
      icon="arrowBottom"
      borderColor="wui-color-bg-125"
    ></wui-icon-box>`}};W3mOnRampActivityItem.styles=[styles$n];__decorate$z([n$4({type:Boolean})],W3mOnRampActivityItem.prototype,"disabled",void 0);__decorate$z([n$4()],W3mOnRampActivityItem.prototype,"color",void 0);__decorate$z([n$4()],W3mOnRampActivityItem.prototype,"label",void 0);__decorate$z([n$4()],W3mOnRampActivityItem.prototype,"purchaseValue",void 0);__decorate$z([n$4()],W3mOnRampActivityItem.prototype,"purchaseCurrency",void 0);__decorate$z([n$4()],W3mOnRampActivityItem.prototype,"date",void 0);__decorate$z([n$4({type:Boolean})],W3mOnRampActivityItem.prototype,"completed",void 0);__decorate$z([n$4({type:Boolean})],W3mOnRampActivityItem.prototype,"inProgress",void 0);__decorate$z([n$4({type:Boolean})],W3mOnRampActivityItem.prototype,"failed",void 0);__decorate$z([n$4()],W3mOnRampActivityItem.prototype,"onClick",void 0);__decorate$z([n$4()],W3mOnRampActivityItem.prototype,"symbol",void 0);__decorate$z([n$4()],W3mOnRampActivityItem.prototype,"icon",void 0);W3mOnRampActivityItem=__decorate$z([customElement("w3m-onramp-activity-item")],W3mOnRampActivityItem);const styles$m=i$4`
  :host {
    width: 100%;
  }

  wui-loading-spinner {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
  }

  .currency-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: var(--wui-spacing-1xs);
    height: 40px;
    padding: var(--wui-spacing-xs) var(--wui-spacing-1xs) var(--wui-spacing-xs)
      var(--wui-spacing-xs);
    min-width: 95px;
    border-radius: var(--FULL, 1000px);
    border: 1px solid var(--wui-color-gray-glass-002);
    background: var(--wui-color-gray-glass-002);
    cursor: pointer;
  }

  .currency-container > wui-image {
    height: 24px;
    width: 24px;
    border-radius: 50%;
  }
`;var __decorate$y=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mInputCurrency=class extends h$3{constructor(){var Mn;super(),this.unsubscribe=[],this.type="Token",this.value=0,this.currencies=[],this.selectedCurrency=(Mn=this.currencies)==null?void 0:Mn[0],this.currencyImages=AssetController.state.currencyImages,this.tokenImages=AssetController.state.tokenImages,this.unsubscribe.push(OnRampController.subscribeKey("purchaseCurrency",rs=>{!rs||this.type==="Fiat"||(this.selectedCurrency=this.formatPurchaseCurrency(rs))}),OnRampController.subscribeKey("paymentCurrency",rs=>{!rs||this.type==="Token"||(this.selectedCurrency=this.formatPaymentCurrency(rs))}),OnRampController.subscribe(rs=>{this.type==="Fiat"?this.currencies=rs.purchaseCurrencies.map(this.formatPurchaseCurrency):this.currencies=rs.paymentCurrencies.map(this.formatPaymentCurrency)}),AssetController.subscribe(rs=>{this.currencyImages={...rs.currencyImages},this.tokenImages={...rs.tokenImages}}))}firstUpdated(){OnRampController.getAvailableCurrencies()}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){var is;const Mn=((is=this.selectedCurrency)==null?void 0:is.symbol)||"",rs=this.currencyImages[Mn]||this.tokenImages[Mn];return ke`<wui-input-text type="number" size="lg" value=${this.value}>
      ${this.selectedCurrency?ke` <wui-flex
            class="currency-container"
            justifyContent="space-between"
            alignItems="center"
            gap="xxs"
            @click=${()=>ModalController.open({view:`OnRamp${this.type}Select`})}
          >
            <wui-image src=${to$2(rs)}></wui-image>
            <wui-text color="fg-100">${this.selectedCurrency.symbol}</wui-text>
          </wui-flex>`:ke`<wui-loading-spinner></wui-loading-spinner>`}
    </wui-input-text>`}formatPaymentCurrency(Mn){return{name:Mn.id,symbol:Mn.id}}formatPurchaseCurrency(Mn){return{name:Mn.name,symbol:Mn.symbol}}};W3mInputCurrency.styles=styles$m;__decorate$y([n$4({type:String})],W3mInputCurrency.prototype,"type",void 0);__decorate$y([n$4({type:Number})],W3mInputCurrency.prototype,"value",void 0);__decorate$y([r$5()],W3mInputCurrency.prototype,"currencies",void 0);__decorate$y([r$5()],W3mInputCurrency.prototype,"selectedCurrency",void 0);__decorate$y([r$5()],W3mInputCurrency.prototype,"currencyImages",void 0);__decorate$y([r$5()],W3mInputCurrency.prototype,"tokenImages",void 0);W3mInputCurrency=__decorate$y([customElement("w3m-onramp-input")],W3mInputCurrency);const styles$l=i$4`
  button {
    padding: var(--wui-spacing-s);
    border-radius: var(--wui-border-radius-xs);
    border: none;
    outline: none;
    background-color: var(--wui-color-gray-glass-002);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--wui-spacing-s);
    transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: background-color;
  }

  button:hover {
    background-color: var(--wui-color-gray-glass-005);
  }

  .provider-image {
    width: var(--wui-spacing-3xl);
    min-width: var(--wui-spacing-3xl);
    height: var(--wui-spacing-3xl);
    border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2));
    position: relative;
    overflow: hidden;
  }

  .provider-image::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2));
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
  }

  .network-icon {
    width: var(--wui-spacing-m);
    height: var(--wui-spacing-m);
    border-radius: calc(var(--wui-spacing-m) / 2);
    overflow: hidden;
    box-shadow:
      0 0 0 3px var(--wui-color-gray-glass-002),
      0 0 0 3px var(--wui-color-modal-bg);
    transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: box-shadow;
  }

  button:hover .network-icon {
    box-shadow:
      0 0 0 3px var(--wui-color-gray-glass-005),
      0 0 0 3px var(--wui-color-modal-bg);
  }
`;var __decorate$x=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mOnRampProviderItem=class extends h$3{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="",this.feeRange="",this.loading=!1,this.onClick=null}render(){return ke`
      <button ?disabled=${this.disabled} ontouchstart>
        <wui-visual name=${to$2(this.name)} class="provider-image"></wui-visual>
        <wui-flex flexDirection="column" gap="4xs">
          <wui-text variant="paragraph-500" color="fg-100">${this.label}</wui-text>
          <wui-flex alignItems="center" justifyContent="flex-start" gap="l">
            <wui-text variant="tiny-500" color="fg-100">
              <wui-text variant="tiny-400" color="fg-200">Fees</wui-text>
              ${this.feeRange}
            </wui-text>
            <wui-flex gap="xxs">
              <wui-icon name="bank" size="xs" color="fg-150"></wui-icon>
              <wui-icon name="card" size="xs" color="fg-150"></wui-icon>
            </wui-flex>
            ${this.networksTemplate()}
          </wui-flex>
        </wui-flex>
        ${this.loading?ke`<wui-loading-spinner color="fg-200" size="md"></wui-loading-spinner>`:ke`<wui-icon name="chevronRight" color="fg-200" size="sm"></wui-icon>`}
      </button>
    `}networksTemplate(){var is;const Mn=ChainController.getAllRequestedCaipNetworks(),rs=(is=Mn==null?void 0:Mn.filter(os=>{var as;return(as=os==null?void 0:os.assets)==null?void 0:as.imageId}))==null?void 0:is.slice(0,5);return ke`
      <wui-flex class="networks">
        ${rs==null?void 0:rs.map(os=>ke`
            <wui-flex class="network-icon">
              <wui-image src=${to$2(AssetUtil.getNetworkImage(os))}></wui-image>
            </wui-flex>
          `)}
      </wui-flex>
    `}};W3mOnRampProviderItem.styles=[styles$l];__decorate$x([n$4({type:Boolean})],W3mOnRampProviderItem.prototype,"disabled",void 0);__decorate$x([n$4()],W3mOnRampProviderItem.prototype,"color",void 0);__decorate$x([n$4()],W3mOnRampProviderItem.prototype,"name",void 0);__decorate$x([n$4()],W3mOnRampProviderItem.prototype,"label",void 0);__decorate$x([n$4()],W3mOnRampProviderItem.prototype,"feeRange",void 0);__decorate$x([n$4({type:Boolean})],W3mOnRampProviderItem.prototype,"loading",void 0);__decorate$x([n$4()],W3mOnRampProviderItem.prototype,"onClick",void 0);W3mOnRampProviderItem=__decorate$x([customElement("w3m-onramp-provider-item")],W3mOnRampProviderItem);const styles$k=i$4`
  wui-flex {
    background-color: var(--wui-color-gray-glass-005);
  }

  a {
    text-decoration: none;
    color: var(--wui-color-fg-175);
    font-weight: 500;
  }
`;var __decorate$w=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mLegalFooter=class extends h$3{render(){const{termsConditionsUrl:Mn,privacyPolicyUrl:rs}=OptionsController.state;return!Mn&&!rs?null:ke`
      <wui-flex .padding=${["m","s","s","s"]} justifyContent="center">
        <wui-text color="fg-250" variant="small-400" align="center">
          By connecting your wallet, you agree to our <br />
          ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
        </wui-text>
      </wui-flex>
    `}andTemplate(){const{termsConditionsUrl:Mn,privacyPolicyUrl:rs}=OptionsController.state;return Mn&&rs?"and":""}termsTemplate(){const{termsConditionsUrl:Mn}=OptionsController.state;return Mn?ke`<a href=${Mn}>Terms of Service</a>`:null}privacyTemplate(){const{privacyPolicyUrl:Mn}=OptionsController.state;return Mn?ke`<a href=${Mn}>Privacy Policy</a>`:null}};W3mLegalFooter.styles=[styles$k];W3mLegalFooter=__decorate$w([customElement("w3m-legal-footer")],W3mLegalFooter);const styles$j=i$4`
  :host {
    display: block;
    padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl);
  }
`;var __decorate$v=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mMobileDownloadLinks=class extends h$3{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:Mn,app_store:rs,play_store:is,chrome_store:os,homepage:as}=this.wallet,us=CoreHelperUtil.isMobile(),ds=CoreHelperUtil.isIos(),hs=CoreHelperUtil.isAndroid(),ps=[rs,is,as,os].filter(Boolean).length>1,io=UiHelperUtil.getTruncateString({string:Mn,charsStart:12,charsEnd:0,truncate:"end"});return ps&&!us?ke`
        <wui-cta-button
          label=${`Don't have ${io}?`}
          buttonLabel="Get"
          @click=${()=>RouterController.push("Downloads",{wallet:this.wallet})}
        ></wui-cta-button>
      `:!ps&&as?ke`
        <wui-cta-button
          label=${`Don't have ${io}?`}
          buttonLabel="Get"
          @click=${this.onHomePage.bind(this)}
        ></wui-cta-button>
      `:rs&&ds?ke`
        <wui-cta-button
          label=${`Don't have ${io}?`}
          buttonLabel="Get"
          @click=${this.onAppStore.bind(this)}
        ></wui-cta-button>
      `:is&&hs?ke`
        <wui-cta-button
          label=${`Don't have ${io}?`}
          buttonLabel="Get"
          @click=${this.onPlayStore.bind(this)}
        ></wui-cta-button>
      `:(this.style.display="none",null)}onAppStore(){var Mn;(Mn=this.wallet)!=null&&Mn.app_store&&CoreHelperUtil.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var Mn;(Mn=this.wallet)!=null&&Mn.play_store&&CoreHelperUtil.openHref(this.wallet.play_store,"_blank")}onHomePage(){var Mn;(Mn=this.wallet)!=null&&Mn.homepage&&CoreHelperUtil.openHref(this.wallet.homepage,"_blank")}};W3mMobileDownloadLinks.styles=[styles$j];__decorate$v([n$4({type:Object})],W3mMobileDownloadLinks.prototype,"wallet",void 0);W3mMobileDownloadLinks=__decorate$v([customElement("w3m-mobile-download-links")],W3mMobileDownloadLinks);const styles$i=i$4`
  wui-flex {
    border-top: 1px solid var(--wui-color-gray-glass-005);
  }

  a {
    text-decoration: none;
    color: var(--wui-color-fg-175);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--wui-spacing-3xs);
  }
`;var __decorate$u=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mOnRampProvidersFooter=class extends h$3{render(){const{termsConditionsUrl:Mn,privacyPolicyUrl:rs}=OptionsController.state;return!Mn&&!rs?null:ke`
      <wui-flex
        .padding=${["m","s","s","s"]}
        flexDirection="column"
        alignItems="center"
        justifyContent="center"
        gap="s"
      >
        <wui-text color="fg-250" variant="small-400" align="center">
          We work with the best providers to give you the lowest fees and best support. More options
          coming soon!
        </wui-text>

        ${this.howDoesItWorkTemplate()}
      </wui-flex>
    `}howDoesItWorkTemplate(){return ke` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
      <wui-icon size="xs" color="accent-100" slot="iconLeft" name="helpCircle"></wui-icon>
      How does it work?
    </wui-link>`}onWhatIsBuy(){EventsController.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("WhatIsABuy")}};W3mOnRampProvidersFooter.styles=[styles$i];W3mOnRampProvidersFooter=__decorate$u([customElement("w3m-onramp-providers-footer")],W3mOnRampProvidersFooter);const styles$h=i$4`
  :host {
    display: block;
    position: absolute;
    opacity: 0;
    pointer-events: none;
    top: 11px;
    left: 50%;
    width: max-content;
  }
`;var __decorate$t=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const presets$1={loading:void 0,success:{backgroundColor:"success-100",iconColor:"success-100",icon:"checkmark"},error:{backgroundColor:"error-100",iconColor:"error-100",icon:"close"}};let W3mSnackBar=class extends h$3{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=SnackController.state.open,this.unsubscribe.push(SnackController.subscribeKey("open",Mn=>{this.open=Mn,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(Mn=>Mn())}render(){const{message:Mn,variant:rs}=SnackController.state,is=presets$1[rs];return ke`
      <wui-snackbar
        message=${Mn}
        backgroundColor=${is==null?void 0:is.backgroundColor}
        iconColor=${is==null?void 0:is.iconColor}
        icon=${is==null?void 0:is.icon}
        .loading=${rs==="loading"}
      ></wui-snackbar>
    `}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(()=>SnackController.hide(),2500)):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};W3mSnackBar.styles=styles$h;__decorate$t([r$5()],W3mSnackBar.prototype,"open",void 0);W3mSnackBar=__decorate$t([customElement("w3m-snackbar")],W3mSnackBar);const styles$g=i$4`
  :host {
    display: block;
    position: absolute;
    top: var(--wui-spacing-s);
    left: var(--wui-spacing-l);
    right: var(--wui-spacing-l);
    opacity: 0;
    pointer-events: none;
  }
`;var __decorate$s=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const presets={info:{backgroundColor:"fg-350",iconColor:"fg-325",icon:"info"},success:{backgroundColor:"success-glass-reown-020",iconColor:"success-125",icon:"checkmark"},warning:{backgroundColor:"warning-glass-reown-020",iconColor:"warning-100",icon:"warningCircle"},error:{backgroundColor:"error-glass-reown-020",iconColor:"error-125",icon:"exclamationTriangle"}};let W3mAlertBar=class extends h$3{constructor(){super(),this.unsubscribe=[],this.open=AlertController.state.open,this.onOpen(!0),this.unsubscribe.push(AlertController.subscribeKey("open",Mn=>{this.open=Mn,this.onOpen(!1)}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const{message:Mn,variant:rs}=AlertController.state,is=presets[rs];return ke`
      <wui-alertbar
        message=${Mn}
        backgroundColor=${is==null?void 0:is.backgroundColor}
        iconColor=${is==null?void 0:is.iconColor}
        icon=${is==null?void 0:is.icon}
      ></wui-alertbar>
    `}onOpen(Mn){this.open?(this.animate([{opacity:0,transform:"scale(0.85)"},{opacity:1,transform:"scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: auto"):Mn||(this.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: none")}};W3mAlertBar.styles=styles$g;__decorate$s([r$5()],W3mAlertBar.prototype,"open",void 0);W3mAlertBar=__decorate$s([customElement("w3m-alertbar")],W3mAlertBar);const styles$f=i$4`
  wui-separator {
    margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1);
    width: calc(100% + var(--wui-spacing-s) * 2);
  }

  wui-email-input {
    width: 100%;
  }

  form {
    width: 100%;
    display: block;
    position: relative;
  }

  wui-icon-link,
  wui-loading-spinner {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  wui-icon-link {
    right: var(--wui-spacing-xs);
  }

  wui-loading-spinner {
    right: var(--wui-spacing-m);
  }
`;var __decorate$r=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mEmailLoginWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.formRef=ii$1(),this.connectors=ConnectorController.state.connectors,this.authConnector=this.connectors.find(Mn=>Mn.type==="AUTH"),this.email="",this.loading=!1,this.error="",this.walletGuide="get-started",this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>{this.connectors=Mn,this.authConnector=Mn.find(rs=>rs.type==="AUTH")}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}firstUpdated(){var Mn;(Mn=this.formRef.value)==null||Mn.addEventListener("keydown",rs=>{rs.key==="Enter"&&this.onSubmitEmail(rs)})}render(){var rs;const Mn=(rs=OptionsController.state.features)==null?void 0:rs.email;return!this.authConnector||!Mn?null:ke`
      <form ${Kt$2(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
        <wui-email-input
          @focus=${this.onFocusEvent.bind(this)}
          .disabled=${this.loading}
          @inputChange=${this.onEmailInputChange.bind(this)}
          .errorMessage=${this.error}
        >
        </wui-email-input>

        ${this.submitButtonTemplate()}${this.loadingTemplate()}
        <input type="submit" hidden />
      </form>
      ${this.separatorTemplate()}
    `}submitButtonTemplate(){return!this.loading&&this.email.length>3?ke`
          <wui-icon-link
            size="sm"
            icon="chevronRight"
            iconcolor="accent-100"
            @click=${this.onSubmitEmail.bind(this)}
          >
          </wui-icon-link>
        `:null}separatorTemplate(){var us,ds;const Mn=(us=OptionsController.state.features)==null?void 0:us.socials,rs=this.connectors.length>1,is=OptionsController.state.enableWallets,os=(ds=OptionsController.state.features)==null?void 0:ds.emailShowWallets;return(Mn&&Mn.length||os||!rs||!is)&&this.walletGuide==="get-started"||Mn&&Mn.length>0?null:ke`
      <wui-flex
        data-testid="w3m-email-login-or-separator"
        .padding=${["xxs","0","0","0"]}
      >
        <wui-separator text="or"></wui-separator>
      </wui-flex>
    `}loadingTemplate(){return this.loading?ke`<wui-loading-spinner size="md" color="accent-100"></wui-loading-spinner>`:null}onEmailInputChange(Mn){this.email=Mn.detail.trim(),this.error=""}async onSubmitEmail(Mn){if(![ConstantsUtil$3.CHAIN.EVM,ConstantsUtil$3.CHAIN.SOLANA].find(os=>os===ChainController.state.activeChain)){RouterController.push("SwitchActiveChain",{switchToChain:ConstantsUtil$3.CHAIN.EVM});return}try{if(this.loading)return;this.loading=!0,Mn.preventDefault();const os=ConnectorController.getAuthConnector();if(!os)throw new Error("w3m-email-login-widget: Auth connector not found");const{action:as}=await os.provider.connectEmail({email:this.email});EventsController.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),as==="VERIFY_OTP"?(EventsController.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),RouterController.push("EmailVerifyOtp",{email:this.email})):as==="VERIFY_DEVICE"&&RouterController.push("EmailVerifyDevice",{email:this.email})}catch(os){const as=CoreHelperUtil.parseError(os);as!=null&&as.includes("Invalid email")?this.error="Invalid email. Try again.":SnackController.showError(os)}finally{this.loading=!1}}onFocusEvent(){EventsController.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};W3mEmailLoginWidget.styles=styles$f;__decorate$r([r$5()],W3mEmailLoginWidget.prototype,"connectors",void 0);__decorate$r([r$5()],W3mEmailLoginWidget.prototype,"authConnector",void 0);__decorate$r([r$5()],W3mEmailLoginWidget.prototype,"email",void 0);__decorate$r([r$5()],W3mEmailLoginWidget.prototype,"loading",void 0);__decorate$r([r$5()],W3mEmailLoginWidget.prototype,"error",void 0);__decorate$r([n$4()],W3mEmailLoginWidget.prototype,"walletGuide",void 0);W3mEmailLoginWidget=__decorate$r([customElement("w3m-email-login-widget")],W3mEmailLoginWidget);const styles$e=i$4`
  wui-flex {
    width: 100%;
  }

  :host > wui-flex:first-child {
    transform: translateY(calc(var(--wui-spacing-xxs) * -1));
  }

  wui-icon-link {
    margin-right: calc(var(--wui-icon-box-size-md) * -1);
  }

  wui-notice-card {
    margin-bottom: var(--wui-spacing-3xs);
  }

  wui-list-item > wui-text {
    flex: 1;
  }

  w3m-transactions-view {
    max-height: 200px;
  }

  .tab-content-container {
    height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }

  .tab-content-container::-webkit-scrollbar {
    display: none;
  }

  .account-button {
    width: auto;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--wui-spacing-s);
    height: 48px;
    padding: var(--wui-spacing-xs);
    padding-right: var(--wui-spacing-s);
    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
    background-color: var(--wui-color-gray-glass-002);
    border-radius: 24px;
    transition: background-color 0.2s linear;
  }

  .account-button:hover {
    background-color: var(--wui-color-gray-glass-005);
  }

  .avatar-container {
    position: relative;
  }

  wui-avatar.avatar {
    width: 32px;
    height: 32px;
    box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
  }

  wui-avatar.network-avatar {
    width: 16px;
    height: 16px;
    position: absolute;
    left: 100%;
    top: 100%;
    transform: translate(-75%, -75%);
    box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
  }

  .account-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .account-links wui-flex {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: red;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 10px;
    flex: 1 0 0;
    border-radius: var(--XS, 16px);
    border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
    background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
    transition:
      background-color var(--wui-ease-out-power-1) var(--wui-duration-md),
      opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
    will-change: background-color, opacity;
  }

  .account-links wui-flex:hover {
    background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
  }

  .account-links wui-flex wui-icon {
    width: var(--S, 20px);
    height: var(--S, 20px);
  }

  .account-links wui-flex wui-icon svg path {
    stroke: #667dff;
  }
`;var __decorate$q=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAccountDefaultWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.caipAddress=AccountController.state.caipAddress,this.address=CoreHelperUtil.getPlainAddress(AccountController.state.caipAddress),this.allAccounts=AccountController.state.allAccounts,this.profileImage=AccountController.state.profileImage,this.profileName=AccountController.state.profileName,this.disconnecting=!1,this.balance=AccountController.state.balance,this.balanceSymbol=AccountController.state.balanceSymbol,this.features=OptionsController.state.features,this.unsubscribe.push(AccountController.subscribeKey("caipAddress",Mn=>{this.address=CoreHelperUtil.getPlainAddress(Mn),this.caipAddress=Mn}),AccountController.subscribeKey("balance",Mn=>this.balance=Mn),AccountController.subscribeKey("balanceSymbol",Mn=>this.balanceSymbol=Mn),AccountController.subscribeKey("profileName",Mn=>this.profileName=Mn),AccountController.subscribeKey("profileImage",Mn=>this.profileImage=Mn),OptionsController.subscribeKey("features",Mn=>this.features=Mn),AccountController.subscribeKey("allAccounts",Mn=>{this.allAccounts=Mn}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){if(!this.caipAddress)throw new Error("w3m-account-view: No account provided");const Mn=ChainController.state.activeChain===ConstantsUtil$3.CHAIN.EVM&&this.allAccounts.length>1;return ke`<wui-flex
        flexDirection="column"
        .padding=${["0","xl","m","xl"]}
        alignItems="center"
        gap="l"
      >
        ${Mn?this.multiAccountTemplate():this.singleAccountTemplate()}
        <wui-flex flexDirection="column" alignItems="center">
          <wui-text variant="paragraph-500" color="fg-200">
            ${CoreHelperUtil.formatBalance(this.balance,this.balanceSymbol)}
          </wui-text>
        </wui-flex>
        ${this.explorerBtnTemplate()}
      </wui-flex>

      <wui-flex flexDirection="column" gap="xs" .padding=${["0","s","s","s"]}>
        ${this.authCardTemplate()} <w3m-account-auth-button></w3m-account-auth-button>
        ${this.onrampTemplate()} ${this.swapsTemplate()} ${this.activityTemplate()}
        <wui-list-item
          variant="icon"
          iconVariant="overlay"
          icon="disconnect"
          ?chevron=${!1}
          .loading=${this.disconnecting}
          @click=${this.onDisconnect.bind(this)}
          data-testid="disconnect-button"
        >
          <wui-text variant="paragraph-500" color="fg-200">Disconnect</wui-text>
        </wui-list-item>
      </wui-flex>`}onrampTemplate(){var rs;return((rs=this.features)==null?void 0:rs.onramp)?ke`
      <wui-list-item
        data-testid="w3m-account-default-onramp-button"
        iconVariant="blue"
        icon="card"
        ?chevron=${!0}
        @click=${this.handleClickPay.bind(this)}
      >
        <wui-text variant="paragraph-500" color="fg-100">Buy crypto</wui-text>
      </wui-list-item>
    `:null}activityTemplate(){const Mn=ChainController.state.activeChain===ConstantsUtil$3.CHAIN.SOLANA;return ke` <wui-list-item
      iconVariant="blue"
      icon="clock"
      iconSize="sm"
      ?chevron=${!Mn}
      ?disabled=${Mn}
      @click=${this.onTransactions.bind(this)}
    >
      <wui-text variant="paragraph-500" color="fg-100" ?disabled=${Mn}> Activity </wui-text>
      ${Mn?ke`<wui-tag variant="main">Coming soon</wui-tag>`:""}
    </wui-list-item>`}swapsTemplate(){var is;const Mn=(is=this.features)==null?void 0:is.swaps,rs=ChainController.state.activeChain===ConstantsUtil$3.CHAIN.SOLANA;return!Mn||rs?null:ke`
      <wui-list-item
        iconVariant="blue"
        icon="recycleHorizontal"
        ?chevron=${!0}
        @click=${this.handleClickSwap.bind(this)}
      >
        <wui-text variant="paragraph-500" color="fg-100">Swap</wui-text>
      </wui-list-item>
    `}authCardTemplate(){const Mn=StorageUtil.getConnectedConnector(),rs=ConnectorController.getAuthConnector(),{origin:is}=location;return!rs||Mn!=="AUTH"||is.includes(ConstantsUtil$2.SECURE_SITE)?null:ke`
      <wui-notice-card
        @click=${this.onGoToUpgradeView.bind(this)}
        label="Upgrade your wallet"
        description="Transition to a self-custodial wallet"
        icon="wallet"
        data-testid="w3m-wallet-upgrade-card"
      ></wui-notice-card>
    `}handleSwitchAccountsView(){RouterController.push("SwitchAddress")}handleClickPay(){RouterController.push("OnRampProviders")}handleClickSwap(){RouterController.push("Swap")}explorerBtnTemplate(){return AccountController.state.addressExplorerUrl?ke`
      <wui-button size="md" variant="neutral" @click=${this.onExplorer.bind(this)}>
        <wui-icon size="sm" color="inherit" slot="iconLeft" name="compass"></wui-icon>
        Block Explorer
        <wui-icon size="sm" color="inherit" slot="iconRight" name="externalLink"></wui-icon>
      </wui-button>
    `:null}singleAccountTemplate(){return ke`
      <wui-avatar
        alt=${to$2(this.caipAddress)}
        address=${to$2(CoreHelperUtil.getPlainAddress(this.caipAddress))}
        imageSrc=${to$2(this.profileImage===null?void 0:this.profileImage)}
        data-testid="single-account-avatar"
      ></wui-avatar>
      <wui-flex flexDirection="column" alignItems="center">
        <wui-flex gap="3xs" alignItems="center" justifyContent="center">
          <wui-text variant="large-600" color="fg-100">
            ${this.profileName?UiHelperUtil.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):UiHelperUtil.getTruncateString({string:this.address||"",charsStart:4,charsEnd:4,truncate:"middle"})}
          </wui-text>
          <wui-icon-link
            size="md"
            icon="copy"
            iconColor="fg-200"
            @click=${this.onCopyAddress}
          ></wui-icon-link> </wui-flex
      ></wui-flex>
    `}multiAccountTemplate(){if(!this.address)throw new Error("w3m-account-view: No account provided");const Mn=this.allAccounts.find(is=>is.address===this.address),rs=AccountController.state.addressLabels.get(this.address);return ke`
      <wui-profile-button-v2
        .onProfileClick=${this.handleSwitchAccountsView.bind(this)}
        address=${to$2(this.address)}
        icon="${(Mn==null?void 0:Mn.type)===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT&&ChainController.state.activeChain===ConstantsUtil$3.CHAIN.EVM?"lightbulb":"mail"}"
        avatarSrc=${to$2(this.profileImage?this.profileImage:void 0)}
        profileName=${to$2(rs||this.profileName)}
        .onCopyClick=${this.onCopyAddress.bind(this)}
      ></wui-profile-button-v2>
    `}onCopyAddress(){try{this.address&&(CoreHelperUtil.copyToClopboard(this.address),SnackController.showSuccess("Address copied"))}catch{SnackController.showError("Failed to copy")}}onTransactions(){EventsController.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0,await ConnectionController.disconnect(),EventsController.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),ModalController.close()}catch{EventsController.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),SnackController.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){const Mn=AccountController.state.addressExplorerUrl;Mn&&CoreHelperUtil.openHref(Mn,"_blank")}onGoToUpgradeView(){EventsController.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),RouterController.push("UpgradeEmailWallet")}};W3mAccountDefaultWidget.styles=styles$e;__decorate$q([r$5()],W3mAccountDefaultWidget.prototype,"caipAddress",void 0);__decorate$q([r$5()],W3mAccountDefaultWidget.prototype,"address",void 0);__decorate$q([r$5()],W3mAccountDefaultWidget.prototype,"allAccounts",void 0);__decorate$q([r$5()],W3mAccountDefaultWidget.prototype,"profileImage",void 0);__decorate$q([r$5()],W3mAccountDefaultWidget.prototype,"profileName",void 0);__decorate$q([r$5()],W3mAccountDefaultWidget.prototype,"disconnecting",void 0);__decorate$q([r$5()],W3mAccountDefaultWidget.prototype,"balance",void 0);__decorate$q([r$5()],W3mAccountDefaultWidget.prototype,"balanceSymbol",void 0);__decorate$q([r$5()],W3mAccountDefaultWidget.prototype,"features",void 0);W3mAccountDefaultWidget=__decorate$q([customElement("w3m-account-default-widget")],W3mAccountDefaultWidget);const styles$d=i$4`
  wui-flex {
    width: 100%;
  }

  wui-promo {
    position: absolute;
    top: -32px;
  }

  wui-profile-button {
    margin-top: calc(-1 * var(--wui-spacing-2l));
  }

  wui-promo + wui-profile-button {
    margin-top: var(--wui-spacing-2l);
  }

  wui-tabs {
    width: 100%;
  }

  .contentContainer {
    height: 280px;
  }

  .contentContainer > wui-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--wui-border-radius-xxs);
  }

  .contentContainer > .textContent {
    width: 65%;
  }
`;var __decorate$p=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const TABS=3,TABS_PADDING=48,MODAL_MOBILE_VIEW_PX=430;let W3mAccountWalletFeaturesWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.address=AccountController.state.address,this.profileImage=AccountController.state.profileImage,this.profileName=AccountController.state.profileName,this.smartAccountDeployed=AccountController.state.smartAccountDeployed,this.network=ChainController.state.activeCaipNetwork,this.currentTab=AccountController.state.currentTab,this.tokenBalance=AccountController.state.tokenBalance,this.preferredAccountType=AccountController.state.preferredAccountType,this.features=OptionsController.state.features,this.unsubscribe.push(AccountController.subscribe(Mn=>{Mn.address?(this.address=Mn.address,this.profileImage=Mn.profileImage,this.profileName=Mn.profileName,this.currentTab=Mn.currentTab,this.tokenBalance=Mn.tokenBalance,this.smartAccountDeployed=Mn.smartAccountDeployed,this.preferredAccountType=Mn.preferredAccountType):ModalController.close()}),ChainController.subscribeKey("activeCaipNetwork",Mn=>this.network=Mn),OptionsController.subscribeKey("features",Mn=>this.features=Mn)),this.watchSwapValues()}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn()),clearInterval(this.watchTokenBalance)}firstUpdated(){AccountController.fetchTokenBalance()}render(){if(!this.address)throw new Error("w3m-account-view: No account provided");const Mn=AssetUtil.getNetworkImage(this.network);return ke`<wui-flex
      flexDirection="column"
      .padding=${["0","xl","m","xl"]}
      alignItems="center"
      gap="m"
    >
      ${this.network&&ke`<wui-network-icon .network=${this.network}></wui-network-icon>`}
      ${this.activateAccountTemplate()}
      <wui-profile-button
        @click=${this.onProfileButtonClick.bind(this)}
        address=${to$2(this.address)}
        networkSrc=${to$2(Mn)}
        icon="chevronBottom"
        avatarSrc=${to$2(this.profileImage?this.profileImage:void 0)}
        profileName=${this.profileName}
        data-testid="w3m-profile-button"
      ></wui-profile-button>
      ${this.tokenBalanceTemplate()}
      <wui-flex gap="s">
        <w3m-tooltip-trigger text="Buy">
          <wui-icon-button
            data-testid="wallet-features-onramp-button"
            @click=${this.onBuyClick.bind(this)}
            icon="card"
          ></wui-icon-button>
        </w3m-tooltip-trigger>
        ${this.swapsTemplate()}
        <w3m-tooltip-trigger text="Receive">
          <wui-icon-button
            data-testid="wallet-features-receive-button"
            @click=${this.onReceiveClick.bind(this)}
            icon="arrowBottomCircle"
          >
          </wui-icon-button>
        </w3m-tooltip-trigger>
        <w3m-tooltip-trigger text="Send">
          <wui-icon-button
            data-testid="wallet-features-send-button"
            @click=${this.onSendClick.bind(this)}
            icon="send"
          ></wui-icon-button>
        </w3m-tooltip-trigger>
      </wui-flex>

      <wui-tabs
        .onTabChange=${this.onTabChange.bind(this)}
        .activeTab=${this.currentTab}
        localTabWidth=${CoreHelperUtil.isMobile()&&window.innerWidth<MODAL_MOBILE_VIEW_PX?`${(window.innerWidth-TABS_PADDING)/TABS}px`:"104px"}
        .tabs=${ConstantsUtil.ACCOUNT_TABS}
      ></wui-tabs>
      ${this.listContentTemplate()}
    </wui-flex>`}swapsTemplate(){var rs;return((rs=this.features)==null?void 0:rs.swaps)?ke`
      <w3m-tooltip-trigger text="Swap">
        <wui-icon-button
          data-testid="wallet-features-swap-button"
          @click=${this.onSwapClick.bind(this)}
          icon="recycleHorizontal"
        >
        </wui-icon-button>
      </w3m-tooltip-trigger>
    `:null}watchSwapValues(){this.watchTokenBalance=setInterval(()=>AccountController.fetchTokenBalance(),1e4)}listContentTemplate(){return this.currentTab===0?ke`<w3m-account-tokens-widget></w3m-account-tokens-widget>`:this.currentTab===1?ke`<w3m-account-nfts-widget></w3m-account-nfts-widget>`:this.currentTab===2?ke`<w3m-account-activity-widget></w3m-account-activity-widget>`:ke`<w3m-account-tokens-widget></w3m-account-tokens-widget>`}tokenBalanceTemplate(){var Mn;if(this.tokenBalance&&((Mn=this.tokenBalance)==null?void 0:Mn.length)>=0){const rs=CoreHelperUtil.calculateBalance(this.tokenBalance),{dollars:is="0",pennies:os="00"}=CoreHelperUtil.formatTokenBalance(rs);return ke`<wui-balance dollars=${is} pennies=${os}></wui-balance>`}return ke`<wui-balance dollars="0" pennies="00"></wui-balance>`}activateAccountTemplate(){return!ChainController.checkIfSmartAccountEnabled()||this.preferredAccountType!==W3mFrameRpcConstants.ACCOUNT_TYPES.EOA||this.smartAccountDeployed?null:ke` <wui-promo
      text=${"Activate your account"}
      @click=${this.onUpdateToSmartAccount.bind(this)}
      data-testid="activate-smart-account-promo"
    ></wui-promo>`}onTabChange(Mn){AccountController.setCurrentTab(Mn)}onProfileButtonClick(){RouterController.push("Profile")}onBuyClick(){RouterController.push("OnRampProviders")}onSwapClick(){var Mn,rs,is;(Mn=this.network)!=null&&Mn.caipNetworkId&&!ConstantsUtil$2.SWAP_SUPPORTED_NETWORKS.includes((rs=this.network)==null?void 0:rs.caipNetworkId)?RouterController.push("UnsupportedChain",{swapUnsupportedChain:!0}):(EventsController.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:((is=this.network)==null?void 0:is.caipNetworkId)||"",isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("Swap"))}onReceiveClick(){RouterController.push("WalletReceive")}onSendClick(){var Mn;EventsController.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:((Mn=this.network)==null?void 0:Mn.caipNetworkId)||"",isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("WalletSend")}onUpdateToSmartAccount(){RouterController.push("UpgradeToSmartAccount")}};W3mAccountWalletFeaturesWidget.styles=styles$d;__decorate$p([r$5()],W3mAccountWalletFeaturesWidget.prototype,"watchTokenBalance",void 0);__decorate$p([r$5()],W3mAccountWalletFeaturesWidget.prototype,"address",void 0);__decorate$p([r$5()],W3mAccountWalletFeaturesWidget.prototype,"profileImage",void 0);__decorate$p([r$5()],W3mAccountWalletFeaturesWidget.prototype,"profileName",void 0);__decorate$p([r$5()],W3mAccountWalletFeaturesWidget.prototype,"smartAccountDeployed",void 0);__decorate$p([r$5()],W3mAccountWalletFeaturesWidget.prototype,"network",void 0);__decorate$p([r$5()],W3mAccountWalletFeaturesWidget.prototype,"currentTab",void 0);__decorate$p([r$5()],W3mAccountWalletFeaturesWidget.prototype,"tokenBalance",void 0);__decorate$p([r$5()],W3mAccountWalletFeaturesWidget.prototype,"preferredAccountType",void 0);__decorate$p([r$5()],W3mAccountWalletFeaturesWidget.prototype,"features",void 0);W3mAccountWalletFeaturesWidget=__decorate$p([customElement("w3m-account-wallet-features-widget")],W3mAccountWalletFeaturesWidget);const styles$c=i$4`
  :host {
    width: 100%;
    max-height: 280px;
    overflow: scroll;
    scrollbar-width: none;
  }

  :host::-webkit-scrollbar {
    display: none;
  }
`;var __decorate$o=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAccountActivityWidget=class extends h$3{render(){return ke`<w3m-activity-list page="account"></w3m-activity-list>`}};W3mAccountActivityWidget.styles=styles$c;W3mAccountActivityWidget=__decorate$o([customElement("w3m-account-activity-widget")],W3mAccountActivityWidget);const styles$b=i$4`
  .contentContainer {
    height: 280px;
  }

  .contentContainer > wui-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--wui-border-radius-xxs);
  }

  .contentContainer > .textContent {
    width: 65%;
  }
`;var __decorate$n=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAccountNftsWidget=class extends h$3{render(){return ke`${this.nftTemplate()}`}nftTemplate(){return ke` <wui-flex
      class="contentContainer"
      alignItems="center"
      justifyContent="center"
      flexDirection="column"
      gap="l"
    >
      <wui-icon-box
        icon="wallet"
        size="inherit"
        iconColor="fg-200"
        backgroundColor="fg-200"
        iconSize="lg"
      ></wui-icon-box>
      <wui-flex
        class="textContent"
        gap="xs"
        flexDirection="column"
        justifyContent="center"
        flexDirection="column"
      >
        <wui-text variant="paragraph-500" align="center" color="fg-100">Coming soon</wui-text>
        <wui-text variant="small-400" align="center" color="fg-200"
          >Stay tuned for our upcoming NFT feature</wui-text
        >
      </wui-flex>
      <wui-link @click=${this.onReceiveClick.bind(this)}>Receive funds</wui-link>
    </wui-flex>`}onReceiveClick(){RouterController.push("WalletReceive")}};W3mAccountNftsWidget.styles=styles$b;W3mAccountNftsWidget=__decorate$n([customElement("w3m-account-nfts-widget")],W3mAccountNftsWidget);const styles$a=i$4`
  :host {
    width: 100%;
  }

  wui-flex {
    width: 100%;
  }

  .contentContainer {
    max-height: 280px;
    overflow: scroll;
    scrollbar-width: none;
  }

  .contentContainer::-webkit-scrollbar {
    display: none;
  }
`;var __decorate$m=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAccountTokensWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.tokenBalance=AccountController.state.tokenBalance,this.unsubscribe.push(AccountController.subscribe(Mn=>{this.tokenBalance=Mn.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return ke`${this.tokenTemplate()}`}tokenTemplate(){var Mn;return this.tokenBalance&&((Mn=this.tokenBalance)==null?void 0:Mn.length)>0?ke`<wui-flex class="contentContainer" flexDirection="column" gap="xs">
        ${this.tokenItemTemplate()}
      </wui-flex>`:ke` <wui-flex flexDirection="column" gap="xs"
      ><wui-list-description
        @click=${this.onBuyClick.bind(this)}
        text="Buy Crypto"
        description="Easy with card or bank account"
        icon="card"
        iconColor="success-100"
        iconBackgroundColor="success-100"
        tag="popular"
      ></wui-list-description
      ><wui-list-description
        @click=${this.onReceiveClick.bind(this)}
        text="Receive funds"
        description="Transfer tokens on your wallet"
        icon="arrowBottomCircle"
        iconColor="fg-200"
        iconBackgroundColor="fg-200"
      ></wui-list-description
    ></wui-flex>`}tokenItemTemplate(){var Mn;return(Mn=this.tokenBalance)==null?void 0:Mn.map(rs=>ke`<wui-list-token
          tokenName=${rs.name}
          tokenImageUrl=${rs.iconUrl}
          tokenAmount=${rs.quantity.numeric}
          tokenValue=${rs.value}
          tokenCurrency=${rs.symbol}
        ></wui-list-token>`)}onReceiveClick(){RouterController.push("WalletReceive")}onBuyClick(){EventsController.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}),RouterController.push("OnRampProviders")}};W3mAccountTokensWidget.styles=styles$a;__decorate$m([r$5()],W3mAccountTokensWidget.prototype,"tokenBalance",void 0);W3mAccountTokensWidget=__decorate$m([customElement("w3m-account-tokens-widget")],W3mAccountTokensWidget);const styles$9=i$4`
  :host {
    min-height: 100%;
  }

  .group-container[last-group='true'] {
    padding-bottom: var(--wui-spacing-m);
  }

  .contentContainer {
    height: 280px;
  }

  .contentContainer > wui-icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--wui-border-radius-xxs);
  }

  .contentContainer > .textContent {
    width: 65%;
  }

  .emptyContainer {
    height: 100%;
  }
`;var __decorate$l=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const PAGINATOR_ID="last-transaction",LOADING_ITEM_COUNT=7;let W3mActivityList=class extends h$3{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.caipAddress=ChainController.state.activeCaipAddress,this.transactionsByYear=TransactionsController.state.transactionsByYear,this.loading=TransactionsController.state.loading,this.empty=TransactionsController.state.empty,this.next=TransactionsController.state.next,TransactionsController.clearCursor(),this.unsubscribe.push(ChainController.subscribeKey("activeCaipAddress",Mn=>{Mn&&this.caipAddress!==Mn&&(TransactionsController.resetTransactions(),TransactionsController.fetchTransactions(Mn)),this.caipAddress=Mn}),ChainController.subscribeKey("activeCaipNetwork",()=>{this.updateTransactionView()}),TransactionsController.subscribe(Mn=>{this.transactionsByYear=Mn.transactionsByYear,this.loading=Mn.loading,this.empty=Mn.empty,this.next=Mn.next}))}firstUpdated(){this.updateTransactionView(),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){return ke` ${this.empty?null:this.templateTransactionsByYear()}
    ${this.loading?this.templateLoading():null}
    ${!this.loading&&this.empty?this.templateEmpty():null}`}updateTransactionView(){var is;const Mn=(is=ChainController.state.activeCaipNetwork)==null?void 0:is.caipNetworkId;TransactionsController.state.lastNetworkInView!==Mn&&(TransactionsController.resetTransactions(),this.caipAddress&&TransactionsController.fetchTransactions(CoreHelperUtil.getPlainAddress(this.caipAddress))),TransactionsController.setLastNetworkInView(Mn)}templateTransactionsByYear(){return Object.keys(this.transactionsByYear).sort().reverse().map(rs=>{const is=parseInt(rs,10),os=new Array(12).fill(null).map((as,us)=>{var ps;const ds=TransactionUtil.getTransactionGroupTitle(is,us),hs=(ps=this.transactionsByYear[is])==null?void 0:ps[us];return{groupTitle:ds,transactions:hs}}).filter(({transactions:as})=>as).reverse();return os.map(({groupTitle:as,transactions:us},ds)=>{const hs=ds===os.length-1;return us?ke`
          <wui-flex
            flexDirection="column"
            class="group-container"
            last-group="${hs?"true":"false"}"
          >
            <wui-flex
              alignItems="center"
              flexDirection="row"
              .padding=${["xs","s","s","s"]}
            >
              <wui-text variant="paragraph-500" color="fg-200">${as}</wui-text>
            </wui-flex>
            <wui-flex flexDirection="column" gap="xs">
              ${this.templateTransactions(us,hs)}
            </wui-flex>
          </wui-flex>
        `:null})})}templateRenderTransaction(Mn,rs){const{date:is,descriptions:os,direction:as,isAllNFT:us,images:ds,status:hs,transfers:ps,type:io}=this.getTransactionListItemProps(Mn),fo=(ps==null?void 0:ps.length)>1;return(ps==null?void 0:ps.length)===2&&!us?ke`
        <wui-transaction-list-item
          date=${is}
          .direction=${as}
          id=${rs&&this.next?PAGINATOR_ID:""}
          status=${hs}
          type=${io}
          .images=${ds}
          .descriptions=${os}
        ></wui-transaction-list-item>
      `:fo?ps.map((Ao,$o)=>{const Lo=TransactionUtil.getTransferDescription(Ao),Go=rs&&$o===ps.length-1;return ke` <wui-transaction-list-item
          date=${is}
          direction=${Ao.direction}
          id=${Go&&this.next?PAGINATOR_ID:""}
          status=${hs}
          type=${io}
          .onlyDirectionIcon=${!0}
          .images=${[ds[$o]]}
          .descriptions=${[Lo]}
        ></wui-transaction-list-item>`}):ke`
      <wui-transaction-list-item
        date=${is}
        .direction=${as}
        id=${rs&&this.next?PAGINATOR_ID:""}
        status=${hs}
        type=${io}
        .images=${ds}
        .descriptions=${os}
      ></wui-transaction-list-item>
    `}templateTransactions(Mn,rs){return Mn.map((is,os)=>{const as=rs&&os===Mn.length-1;return ke`${this.templateRenderTransaction(is,as)}`})}emptyStateActivity(){return ke`<wui-flex
      class="emptyContainer"
      flexGrow="1"
      flexDirection="column"
      justifyContent="center"
      alignItems="center"
      .padding=${["3xl","xl","3xl","xl"]}
      gap="xl"
    >
      <wui-icon-box
        backgroundColor="gray-glass-005"
        background="gray"
        iconColor="fg-200"
        icon="wallet"
        size="lg"
        ?border=${!0}
        borderColor="wui-color-bg-125"
      ></wui-icon-box>
      <wui-flex flexDirection="column" alignItems="center" gap="xs">
        <wui-text align="center" variant="paragraph-500" color="fg-100"
          >No Transactions yet</wui-text
        >
        <wui-text align="center" variant="small-500" color="fg-200"
          >Start trading on dApps <br />
          to grow your wallet!</wui-text
        >
      </wui-flex>
    </wui-flex>`}emptyStateAccount(){return ke`<wui-flex
      class="contentContainer"
      alignItems="center"
      justifyContent="center"
      flexDirection="column"
      gap="l"
    >
      <wui-icon-box
        icon="swapHorizontal"
        size="inherit"
        iconColor="fg-200"
        backgroundColor="fg-200"
        iconSize="lg"
      ></wui-icon-box>
      <wui-flex
        class="textContent"
        gap="xs"
        flexDirection="column"
        justifyContent="center"
        flexDirection="column"
      >
        <wui-text variant="paragraph-500" align="center" color="fg-100">No activity yet</wui-text>
        <wui-text variant="small-400" align="center" color="fg-200"
          >Your next transactions will appear here</wui-text
        >
      </wui-flex>
      <wui-link @click=${this.onReceiveClick.bind(this)}>Trade</wui-link>
    </wui-flex>`}templateEmpty(){return this.page==="account"?ke`${this.emptyStateAccount()}`:ke`${this.emptyStateActivity()}`}templateLoading(){return this.page==="activity"?Array(LOADING_ITEM_COUNT).fill(ke` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map(Mn=>Mn):null}onReceiveClick(){RouterController.push("WalletReceive")}createPaginationObserver(){const{projectId:Mn}=OptionsController.state;this.paginationObserver=new IntersectionObserver(([rs])=>{rs!=null&&rs.isIntersecting&&!this.loading&&(TransactionsController.fetchTransactions(CoreHelperUtil.getPlainAddress(this.caipAddress)),EventsController.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:CoreHelperUtil.getPlainAddress(this.caipAddress),projectId:Mn,cursor:this.next,isSmartAccount:AccountController.state.preferredAccountType===W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT}}))},{}),this.setPaginationObserver()}setPaginationObserver(){var rs,is,os;(rs=this.paginationObserver)==null||rs.disconnect();const Mn=(is=this.shadowRoot)==null?void 0:is.querySelector(`#${PAGINATOR_ID}`);Mn&&((os=this.paginationObserver)==null||os.observe(Mn))}getTransactionListItemProps(Mn){var hs,ps,io,fo,mo;const rs=DateUtil.formatDate((hs=Mn==null?void 0:Mn.metadata)==null?void 0:hs.minedAt),is=TransactionUtil.getTransactionDescriptions(Mn),os=Mn==null?void 0:Mn.transfers,as=(ps=Mn==null?void 0:Mn.transfers)==null?void 0:ps[0],us=!!as&&((io=Mn==null?void 0:Mn.transfers)==null?void 0:io.every(Ao=>!!Ao.nft_info)),ds=TransactionUtil.getTransactionImages(os);return{date:rs,direction:as==null?void 0:as.direction,descriptions:is,isAllNFT:us,images:ds,status:(fo=Mn.metadata)==null?void 0:fo.status,transfers:os,type:(mo=Mn.metadata)==null?void 0:mo.operationType}}};W3mActivityList.styles=styles$9;__decorate$l([n$4()],W3mActivityList.prototype,"page",void 0);__decorate$l([r$5()],W3mActivityList.prototype,"caipAddress",void 0);__decorate$l([r$5()],W3mActivityList.prototype,"transactionsByYear",void 0);__decorate$l([r$5()],W3mActivityList.prototype,"loading",void 0);__decorate$l([r$5()],W3mActivityList.prototype,"empty",void 0);__decorate$l([r$5()],W3mActivityList.prototype,"next",void 0);W3mActivityList=__decorate$l([customElement("w3m-activity-list")],W3mActivityList);const styles$8=i$4`
  :host {
    width: 100%;
    height: 100px;
    border-radius: var(--wui-border-radius-s);
    border: 1px solid var(--wui-color-gray-glass-002);
    background-color: var(--wui-color-gray-glass-002);
    transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
    will-change: background-color;
  }

  :host(:hover) {
    background-color: var(--wui-color-gray-glass-005);
  }

  wui-flex {
    width: 100%;
    height: fit-content;
  }

  wui-button {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  wui-input-amount {
    mask-image: linear-gradient(
      270deg,
      transparent 0px,
      transparent 8px,
      black 24px,
      black 25px,
      black 32px,
      black 100%
    );
  }

  .totalValue {
    width: 100%;
  }
`;var __decorate$k=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mInputToken=class extends h$3{render(){return ke` <wui-flex
      flexDirection="column"
      gap="4xs"
      .padding=${["xl","s","l","l"]}
    >
      <wui-flex alignItems="center">
        <wui-input-amount
          @inputChange=${this.onInputChange.bind(this)}
          ?disabled=${!this.token&&!0}
          .value=${this.sendTokenAmount?String(this.sendTokenAmount):""}
        ></wui-input-amount>
        ${this.buttonTemplate()}
      </wui-flex>
      <wui-flex alignItems="center" justifyContent="space-between">
        ${this.sendValueTemplate()}
        <wui-flex alignItems="center" gap="4xs" justifyContent="flex-end">
          ${this.maxAmountTemplate()} ${this.actionTemplate()}
        </wui-flex>
      </wui-flex>
    </wui-flex>`}buttonTemplate(){return this.token?ke`<wui-token-button
        text=${this.token.symbol}
        imageSrc=${this.token.iconUrl}
        @click=${this.handleSelectButtonClick.bind(this)}
      >
      </wui-token-button>`:ke`<wui-button
      size="md"
      variant="accent"
      @click=${this.handleSelectButtonClick.bind(this)}
      >Select token</wui-button
    >`}handleSelectButtonClick(){RouterController.push("WalletSendSelectToken")}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const rs=this.token.price*this.sendTokenAmount;return ke`<wui-text class="totalValue" variant="small-400" color="fg-200"
        >${rs?`$${UiHelperUtil.formatNumberToLocalString(rs,2)}`:"Incorrect value"}</wui-text
      >`}return null}maxAmountTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?ke` <wui-text variant="small-400" color="error-100">
          ${UiHelperUtil.roundNumber(Number(this.token.quantity.numeric),6,5)}
        </wui-text>`:ke` <wui-text variant="small-400" color="fg-200">
        ${UiHelperUtil.roundNumber(Number(this.token.quantity.numeric),6,5)}
      </wui-text>`:null}actionTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?ke`<wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>`:ke`<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>`:null}onInputChange(Mn){SendController.setTokenAmount(Mn.detail)}onMaxClick(){if(this.token&&typeof this.gasPrice<"u"){const Mn=this.token.address===void 0||Object.values(ConstantsUtil$2.NATIVE_TOKEN_ADDRESS).some(os=>{var as;return((as=this.token)==null?void 0:as.address)===os}),rs=NumberUtil.bigNumber(this.gasPrice).shiftedBy(-this.token.quantity.decimals),is=Mn?NumberUtil.bigNumber(this.token.quantity.numeric).minus(rs):NumberUtil.bigNumber(this.token.quantity.numeric);SendController.setTokenAmount(Number(is.toFixed(20)))}}onBuyClick(){RouterController.push("OnRampProviders")}};W3mInputToken.styles=styles$8;__decorate$k([n$4({type:Object})],W3mInputToken.prototype,"token",void 0);__decorate$k([n$4({type:Number})],W3mInputToken.prototype,"sendTokenAmount",void 0);__decorate$k([n$4({type:Number})],W3mInputToken.prototype,"gasPriceInUSD",void 0);__decorate$k([n$4({type:Number})],W3mInputToken.prototype,"gasPrice",void 0);W3mInputToken=__decorate$k([customElement("w3m-input-token")],W3mInputToken);const styles$7=i$4`
  :host {
    width: 100%;
    height: 100px;
    border-radius: var(--wui-border-radius-s);
    border: 1px solid var(--wui-color-gray-glass-002);
    background-color: var(--wui-color-gray-glass-002);
    transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
    will-change: background-color;
    position: relative;
  }

  :host(:hover) {
    background-color: var(--wui-color-gray-glass-005);
  }

  wui-flex {
    width: 100%;
    height: fit-content;
  }

  wui-button {
    display: ruby;
    color: var(--wui-color-fg-100);
    margin: 0 var(--wui-spacing-xs);
  }

  .instruction {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
  }

  .paste {
    display: inline-flex;
  }

  textarea {
    background: transparent;
    width: 100%;
    font-family: var(--w3m-font-family);
    font-size: var(--wui-font-size-medium);
    font-style: normal;
    font-weight: var(--wui-font-weight-light);
    line-height: 130%;
    letter-spacing: var(--wui-letter-spacing-medium);
    color: var(--wui-color-fg-100);
    caret-color: var(--wui-color-accent-100);
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    padding: 0px;
    border: none;
    outline: none;
    appearance: none;
    resize: none;
    overflow: hidden;
  }
`;var __decorate$j=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mInputAddress=class extends h$3{constructor(){super(...arguments),this.inputElementRef=ii$1(),this.instructionElementRef=ii$1(),this.instructionHidden=!!this.value,this.pasting=!1,this.onDebouncedSearch=CoreHelperUtil.debounce(async Mn=>{const rs=await ConnectionController.getEnsAddress(Mn);if(SendController.setLoading(!1),rs){SendController.setReceiverProfileName(Mn),SendController.setReceiverAddress(rs);const is=await ConnectionController.getEnsAvatar(Mn);SendController.setReceiverProfileImageUrl(is||void 0)}else SendController.setReceiverAddress(Mn),SendController.setReceiverProfileName(void 0),SendController.setReceiverProfileImageUrl(void 0)})}firstUpdated(){this.value&&(this.instructionHidden=!0),this.checkHidden()}render(){return ke` <wui-flex
      @click=${this.onBoxClick.bind(this)}
      flexDirection="column"
      justifyContent="center"
      gap="4xs"
      .padding=${["2xl","l","xl","l"]}
    >
      <wui-text
        ${Kt$2(this.instructionElementRef)}
        class="instruction"
        color="fg-300"
        variant="medium-400"
      >
        Type or
        <wui-button
          class="paste"
          size="md"
          variant="neutral"
          iconLeft="copy"
          @click=${this.onPasteClick.bind(this)}
        >
          <wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon>
          Paste
        </wui-button>
        address
      </wui-text>
      <textarea
        spellcheck="false"
        ?disabled=${!this.instructionHidden}
        ${Kt$2(this.inputElementRef)}
        @input=${this.onInputChange.bind(this)}
        @blur=${this.onBlur.bind(this)}
        .value=${this.value??""}
        autocomplete="off"
      >
${this.value??""}</textarea
      >
    </wui-flex>`}async focusInput(){var Mn;this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",(Mn=this.inputElementRef.value)==null||Mn.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){var Mn;this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",(Mn=this.inputElementRef.value)==null||Mn.blur())}async toggleInstructionFocus(Mn){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:Mn?0:1},{opacity:Mn?1:0}],{duration:100,easing:"ease",fill:"forwards"}).finished}onBoxClick(){!this.value&&!this.instructionHidden&&this.focusInput()}onBlur(){!this.value&&this.instructionHidden&&!this.pasting&&this.focusInstruction()}checkHidden(){this.instructionHidden&&this.focusInput()}async onPasteClick(){this.pasting=!0;const Mn=await navigator.clipboard.readText();SendController.setReceiverAddress(Mn),this.focusInput()}onInputChange(Mn){this.pasting=!1;const rs=Mn.target;rs.value&&!this.instructionHidden&&this.focusInput(),SendController.setLoading(!0),this.onDebouncedSearch(rs.value)}};W3mInputAddress.styles=styles$7;__decorate$j([n$4()],W3mInputAddress.prototype,"value",void 0);__decorate$j([r$5()],W3mInputAddress.prototype,"instructionHidden",void 0);__decorate$j([r$5()],W3mInputAddress.prototype,"pasting",void 0);W3mInputAddress=__decorate$j([customElement("w3m-input-address")],W3mInputAddress);const styles$6=i$4`
  :host {
    display: flex;
    width: auto;
    flex-direction: column;
    gap: var(--wui-border-radius-1xs);
    border-radius: var(--wui-border-radius-s);
    background: var(--wui-color-gray-glass-002);
    padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs)
      var(--wui-spacing-1xs);
  }

  wui-text {
    padding: 0 var(--wui-spacing-1xs);
  }

  wui-flex {
    margin-top: var(--wui-spacing-1xs);
  }

  .network {
    cursor: pointer;
    transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
    will-change: background-color;
  }

  .network:focus-visible {
    border: 1px solid var(--wui-color-accent-100);
    background-color: var(--wui-color-gray-glass-005);
    -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
    -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
    box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
  }

  .network:hover {
    background-color: var(--wui-color-gray-glass-005);
  }

  .network:active {
    background-color: var(--wui-color-gray-glass-010);
  }
`;var __decorate$i=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mWalletSendDetails=class extends h$3{render(){return ke` <wui-text variant="small-400" color="fg-200">Details</wui-text>
      <wui-flex flexDirection="column" gap="xxs">
        <wui-list-content textTitle="Network cost" textValue="$${to$2(UiHelperUtil.formatNumberToLocalString(this.networkFee,2))}"></wui-list-content></wui-list-content>
        <wui-list-content
          textTitle="Address"
          textValue=${UiHelperUtil.getTruncateString({string:this.receiverAddress??"",charsStart:4,charsEnd:4,truncate:"middle"})}
        >
        </wui-list-content>
        ${this.networkTemplate()}
      </wui-flex>`}networkTemplate(){var Mn;return(Mn=this.caipNetwork)!=null&&Mn.name?ke` <wui-list-content
        @click=${()=>this.onNetworkClick(this.caipNetwork)}
        class="network"
        textTitle="Network"
        imageSrc=${to$2(AssetUtil.getNetworkImage(this.caipNetwork))}
      ></wui-list-content>`:null}onNetworkClick(Mn){Mn&&RouterController.push("Networks",{network:Mn})}};W3mWalletSendDetails.styles=styles$6;__decorate$i([n$4()],W3mWalletSendDetails.prototype,"receiverAddress",void 0);__decorate$i([n$4({type:Object})],W3mWalletSendDetails.prototype,"caipNetwork",void 0);__decorate$i([n$4({type:Number})],W3mWalletSendDetails.prototype,"networkFee",void 0);W3mWalletSendDetails=__decorate$i([customElement("w3m-wallet-send-details")],W3mWalletSendDetails);const styles$5=i$4`
  :host {
    pointer-events: none;
  }

  :host > wui-flex {
    display: var(--w3m-tooltip-display);
    opacity: var(--w3m-tooltip-opacity);
    padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s);
    border-radius: var(--wui-border-radius-xxs);
    color: var(--wui-color-bg-100);
    position: fixed;
    top: var(--w3m-tooltip-top);
    left: var(--w3m-tooltip-left);
    transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
    max-width: calc(var(--w3m-modal-width) - var(--wui-spacing-xl));
    transition: opacity 0.2s var(--wui-ease-out-power-2);
    will-change: opacity;
  }

  :host([data-variant='shade']) > wui-flex {
    background-color: var(--wui-color-bg-150);
    border: 1px solid var(--wui-color-gray-glass-005);
  }

  :host([data-variant='shade']) > wui-flex > wui-text {
    color: var(--wui-color-fg-150);
  }

  :host([data-variant='fill']) > wui-flex {
    background-color: var(--wui-color-fg-100);
    border: none;
  }

  wui-icon {
    position: absolute;
    width: 12px !important;
    height: 4px !important;
    color: var(--wui-color-bg-150);
  }

  wui-icon[data-placement='top'] {
    bottom: 0px;
    left: 50%;
    transform: translate(-50%, 95%);
  }

  wui-icon[data-placement='bottom'] {
    top: 0;
    left: 50%;
    transform: translate(-50%, -95%) rotate(180deg);
  }

  wui-icon[data-placement='right'] {
    top: 50%;
    left: 0;
    transform: translate(-65%, -50%) rotate(90deg);
  }

  wui-icon[data-placement='left'] {
    top: 50%;
    right: 0%;
    transform: translate(65%, -50%) rotate(270deg);
  }
`;var __decorate$h=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mTooltip=class extends h$3{constructor(){super(),this.unsubscribe=[],this.open=TooltipController.state.open,this.message=TooltipController.state.message,this.triggerRect=TooltipController.state.triggerRect,this.variant=TooltipController.state.variant,this.unsubscribe.push(TooltipController.subscribe(Mn=>{this.open=Mn.open,this.message=Mn.message,this.triggerRect=Mn.triggerRect,this.variant=Mn.variant}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){this.dataset.variant=this.variant;const Mn=this.triggerRect.top,rs=this.triggerRect.left;return this.style.cssText=`
    --w3m-tooltip-top: ${Mn}px;
    --w3m-tooltip-left: ${rs}px;
    --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;
    --w3m-tooltip-display: ${this.open?"flex":"none"};
    --w3m-tooltip-opacity: ${this.open?1:0};
    `,ke`<wui-flex>
      <wui-icon data-placement="top" color="fg-100" size="inherit" name="cursor"></wui-icon>
      <wui-text color="inherit" variant="small-500">${this.message}</wui-text>
    </wui-flex>`}};W3mTooltip.styles=[styles$5];__decorate$h([r$5()],W3mTooltip.prototype,"open",void 0);__decorate$h([r$5()],W3mTooltip.prototype,"message",void 0);__decorate$h([r$5()],W3mTooltip.prototype,"triggerRect",void 0);__decorate$h([r$5()],W3mTooltip.prototype,"variant",void 0);W3mTooltip=__decorate$h([customElement("w3m-tooltip")],W3mTooltip);const styles$4=i$4`
  :host {
    width: 100%;
    display: block;
  }
`;var __decorate$g=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let WuiTooltipTrigger=class extends h$3{constructor(){super(),this.unsubscribe=[],this.text="",this.open=TooltipController.state.open,this.unsubscribe.push(RouterController.subscribeKey("view",()=>{TooltipController.hide()}),ModalController.subscribeKey("open",Mn=>{Mn||TooltipController.hide()}),TooltipController.subscribeKey("open",Mn=>{this.open=Mn}))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn()),TooltipController.hide()}render(){return ke`
      <div
        @pointermove=${this.onMouseEnter.bind(this)}
        @pointerleave=${this.onMouseLeave.bind(this)}
      >
        ${this.renderChildren()}
      </div>
    `}renderChildren(){return ke`<slot></slot> `}onMouseEnter(){const Mn=this.getBoundingClientRect();this.open||TooltipController.showTooltip({message:this.text,triggerRect:{width:Mn.width,height:Mn.height,left:Mn.left,top:Mn.top},variant:"shade"})}onMouseLeave(Mn){this.contains(Mn.relatedTarget)||TooltipController.hide()}};WuiTooltipTrigger.styles=[styles$4];__decorate$g([n$4()],WuiTooltipTrigger.prototype,"text",void 0);__decorate$g([r$5()],WuiTooltipTrigger.prototype,"open",void 0);WuiTooltipTrigger=__decorate$g([customElement("w3m-tooltip-trigger")],WuiTooltipTrigger);const styles$3=i$4`
  :host > wui-flex:first-child {
    margin-top: var(--wui-spacing-s);
  }
  wui-separator {
    margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-m)
      calc(var(--wui-spacing-m) * -1);
    width: calc(100% + var(--wui-spacing-s) * 2);
  }
`;var __decorate$f=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};const MAX_TOP_VIEW=2,MAXIMUM_LENGTH=6;let W3mSocialLoginWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.features=OptionsController.state.features,this.authConnector=this.connectors.find(Mn=>Mn.type==="AUTH"),this.walletGuide="get-started",this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>{this.connectors=Mn,this.authConnector=this.connectors.find(rs=>rs.type==="AUTH")}),OptionsController.subscribeKey("features",Mn=>this.features=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){var rs;const Mn=(rs=this.features)==null?void 0:rs.socials;return!this.authConnector||!Mn||!(Mn!=null&&Mn.length)?null:ke`
      <wui-flex
        class="container"
        flexDirection="column"
        gap="xs"
        .padding=${["0","0","xs","0"]}
        data-testid="w3m-social-login-widget"
      >
        ${this.topViewTemplate()}${this.bottomViewTemplate()}
      </wui-flex>
      ${this.separatorTemplate()}
    `}topViewTemplate(){var rs;const Mn=(rs=this.features)==null?void 0:rs.socials;return!this.authConnector||!Mn||!(Mn!=null&&Mn.length)?null:Mn.length===2?ke` <wui-flex gap="xs">
        ${Mn.slice(0,MAX_TOP_VIEW).map(is=>ke`<wui-logo-select
              data-testid=${`social-selector-${is}`}
              @click=${()=>{this.onSocialClick(is)}}
              logo=${is}
            ></wui-logo-select>`)}
      </wui-flex>`:ke` <wui-list-social
      data-testid=${`social-selector-${Mn==null?void 0:Mn[0]}`}
      @click=${()=>{this.onSocialClick(Mn==null?void 0:Mn[0])}}
      logo=${to$2(Mn[0])}
      align="center"
      name=${`Continue with ${Mn[0]}`}
    ></wui-list-social>`}bottomViewTemplate(){var rs;const Mn=(rs=this.features)==null?void 0:rs.socials;return!this.authConnector||!Mn||!(Mn!=null&&Mn.length)||Mn.length<=MAX_TOP_VIEW?null:Mn.length>MAXIMUM_LENGTH?ke`<wui-flex gap="xs">
        ${Mn.slice(1,MAXIMUM_LENGTH-1).map(is=>ke`<wui-logo-select
              data-testid=${`social-selector-${is}`}
              @click=${()=>{this.onSocialClick(is)}}
              logo=${is}
            ></wui-logo-select>`)}
        <wui-logo-select logo="more" @click=${this.onMoreSocialsClick.bind(this)}></wui-logo-select>
      </wui-flex>`:ke`<wui-flex gap="xs">
      ${Mn.slice(1,Mn.length).map(is=>ke`<wui-logo-select
            data-testid=${`social-selector-${is}`}
            @click=${()=>{this.onSocialClick(is)}}
            logo=${is}
          ></wui-logo-select>`)}
    </wui-flex>`}separatorTemplate(){const Mn=this.connectors.find(is=>is.id==="walletConnect"),rs=OptionsController.state.enableWallets;return Mn&&rs||this.walletGuide==="explore"?ke`<wui-separator text="or"></wui-separator>`:null}onMoreSocialsClick(){RouterController.push("ConnectSocials")}async onSocialClick(Mn){var rs,is;if(Mn&&(AccountController.setSocialProvider(Mn,ChainController.state.activeChain),EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:Mn}})),Mn===SocialProviderEnum.Farcaster){RouterController.push("ConnectingFarcaster");const os=ConnectorController.getAuthConnector();if(os&&!AccountController.state.farcasterUrl)try{const{url:as}=await os.provider.getFarcasterUri();AccountController.setFarcasterUrl(as,ChainController.state.activeChain)}catch(as){RouterController.goBack(),SnackController.showError(as)}}else{RouterController.push("ConnectingSocial");const os=ConnectorController.getAuthConnector();this.popupWindow=CoreHelperUtil.returnOpenHref("","popupWindow","width=600,height=800,scrollbars=yes");try{if(os&&Mn){const{uri:as}=await os.provider.getSocialRedirectUri({provider:Mn});if(this.popupWindow&&as)AccountController.setSocialWindow(this.popupWindow,ChainController.state.activeChain),this.popupWindow.location.href=as;else throw(rs=this.popupWindow)==null||rs.close(),new Error("Something went wrong")}}catch{(is=this.popupWindow)==null||is.close(),SnackController.showError("Something went wrong")}}}};W3mSocialLoginWidget.styles=styles$3;__decorate$f([r$5()],W3mSocialLoginWidget.prototype,"connectors",void 0);__decorate$f([r$5()],W3mSocialLoginWidget.prototype,"features",void 0);__decorate$f([r$5()],W3mSocialLoginWidget.prototype,"authConnector",void 0);__decorate$f([n$4()],W3mSocialLoginWidget.prototype,"walletGuide",void 0);W3mSocialLoginWidget=__decorate$f([customElement("w3m-social-login-widget")],W3mSocialLoginWidget);var __decorate$e=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mWalletLoginList=class extends h$3{render(){return ke`
      <wui-flex flexDirection="column" gap="xs">
        <w3m-connector-list></w3m-connector-list>
        <w3m-all-wallets-widget></w3m-all-wallets-widget>
      </wui-flex>
    `}};W3mWalletLoginList=__decorate$e([customElement("w3m-wallet-login-list")],W3mWalletLoginList);const styles$2=i$4`
  :host {
    margin-top: var(--wui-spacing-3xs);
  }
  wui-separator {
    margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
      calc(var(--wui-spacing-m) * -1);
    width: calc(100% + var(--wui-spacing-s) * 2);
  }
`;var __decorate$d=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mSocialLoginList=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.authConnector=this.connectors.find(Mn=>Mn.type==="AUTH"),this.features=OptionsController.state.features,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>{this.connectors=Mn,this.authConnector=this.connectors.find(rs=>rs.type==="AUTH")}),OptionsController.subscribeKey("features",Mn=>this.features=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){var rs;const Mn=(rs=this.features)==null?void 0:rs.socials;return!this.authConnector||!Mn||!(Mn!=null&&Mn.length)?null:ke` <wui-flex flexDirection="column" gap="xs">
      ${Mn.map(is=>ke`<wui-list-social
            @click=${()=>{this.onSocialClick(is)}}
            name=${is}
            logo=${is}
          ></wui-list-social>`)}
    </wui-flex>`}async onSocialClick(Mn){var rs,is;if(Mn&&(AccountController.setSocialProvider(Mn,ChainController.state.activeChain),EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:Mn}})),Mn===SocialProviderEnum.Farcaster){RouterController.push("ConnectingFarcaster");const os=ConnectorController.getAuthConnector();if(os&&!AccountController.state.farcasterUrl)try{const{url:as}=await os.provider.getFarcasterUri();AccountController.setFarcasterUrl(as,ChainController.state.activeChain)}catch(as){RouterController.goBack(),SnackController.showError(as)}}else{RouterController.push("ConnectingSocial");const os=ConnectorController.getAuthConnector();this.popupWindow=CoreHelperUtil.returnOpenHref("","popupWindow","width=600,height=800,scrollbars=yes");try{if(os&&Mn){const{uri:as}=await os.provider.getSocialRedirectUri({provider:Mn});if(this.popupWindow&&as)AccountController.setSocialWindow(this.popupWindow,ChainController.state.activeChain),this.popupWindow.location.href=as;else throw(rs=this.popupWindow)==null||rs.close(),new Error("Something went wrong")}}catch{(is=this.popupWindow)==null||is.close(),SnackController.showError("Something went wrong")}}}};W3mSocialLoginList.styles=styles$2;__decorate$d([r$5()],W3mSocialLoginList.prototype,"connectors",void 0);__decorate$d([r$5()],W3mSocialLoginList.prototype,"authConnector",void 0);__decorate$d([r$5()],W3mSocialLoginList.prototype,"features",void 0);W3mSocialLoginList=__decorate$d([customElement("w3m-social-login-list")],W3mSocialLoginList);var __decorate$c=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectAnnouncedWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>this.connectors=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const Mn=this.connectors.filter(rs=>rs.type==="ANNOUNCED");return Mn!=null&&Mn.length?ke`
      <wui-flex flexDirection="column" gap="xs">
        ${Mn.map(rs=>{var is,os;return(is=rs.info)!=null&&is.rdns&&ApiController.state.excludedRDNS&&ApiController.state.excludedRDNS.includes((os=rs==null?void 0:rs.info)==null?void 0:os.rdns)?null:ke`
            <wui-list-wallet
              imageSrc=${to$2(AssetUtil.getConnectorImage(rs))}
              name=${rs.name??"Unknown"}
              @click=${()=>this.onConnector(rs)}
              tagVariant="success"
              tagLabel="installed"
              data-testid=${`wallet-selector-${rs.id}`}
              .installed=${!0}
            >
            </wui-list-wallet>
          `})}
      </wui-flex>
    `:(this.style.cssText="display: none",null)}onConnector(Mn){Mn.id==="walletConnect"?CoreHelperUtil.isMobile()?RouterController.push("AllWallets"):RouterController.push("ConnectingWalletConnect"):RouterController.push("ConnectingExternal",{connector:Mn})}};__decorate$c([r$5()],W3mConnectAnnouncedWidget.prototype,"connectors",void 0);W3mConnectAnnouncedWidget=__decorate$c([customElement("w3m-connect-announced-widget")],W3mConnectAnnouncedWidget);var __decorate$b=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectCustomWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>this.connectors=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const{customWallets:Mn}=OptionsController.state;if(!(Mn!=null&&Mn.length))return this.style.cssText="display: none",null;const rs=this.filterOutDuplicateWallets(Mn);return ke`<wui-flex flexDirection="column" gap="xs">
      ${rs.map(is=>ke`
          <wui-list-wallet
            imageSrc=${to$2(AssetUtil.getWalletImage(is))}
            name=${is.name??"Unknown"}
            @click=${()=>this.onConnectWallet(is)}
            data-testid=${`wallet-selector-${is.id}`}
          >
          </wui-list-wallet>
        `)}
    </wui-flex>`}filterOutDuplicateWallets(Mn){const rs=StorageUtil.getRecentWallets(),is=this.connectors.map(ds=>{var hs;return(hs=ds.info)==null?void 0:hs.rdns}).filter(Boolean),os=rs.map(ds=>ds.rdns).filter(Boolean),as=is.concat(os);if(as.includes("io.metamask.mobile")&&CoreHelperUtil.isMobile()){const ds=as.indexOf("io.metamask.mobile");as[ds]="io.metamask"}return Mn.filter(ds=>!as.includes(String(ds==null?void 0:ds.rdns)))}onConnectWallet(Mn){RouterController.push("ConnectingWalletConnect",{wallet:Mn})}};__decorate$b([r$5()],W3mConnectCustomWidget.prototype,"connectors",void 0);W3mConnectCustomWidget=__decorate$b([customElement("w3m-connect-custom-widget")],W3mConnectCustomWidget);var __decorate$a=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectFeaturedWidget=class extends h$3{constructor(){super(...arguments),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const{featured:Mn}=ApiController.state;if(!Mn.length)return this.style.cssText="display: none",null;const rs=WalletUtil.filterOutDuplicateWallets(Mn);return ke`
      <wui-flex flexDirection="column" gap="xs">
        ${rs.map(is=>ke`
            <wui-list-wallet
              imageSrc=${to$2(AssetUtil.getWalletImage(is))}
              name=${is.name??"Unknown"}
              @click=${()=>this.onConnectWallet(is)}
            >
            </wui-list-wallet>
          `)}
      </wui-flex>
    `}onConnectWallet(Mn){const rs=ConnectorController.getConnector(Mn.id,Mn.rdns);rs?RouterController.push("ConnectingExternal",{connector:rs}):RouterController.push("ConnectingWalletConnect",{wallet:Mn})}};W3mConnectFeaturedWidget=__decorate$a([customElement("w3m-connect-featured-widget")],W3mConnectFeaturedWidget);var __decorate$9=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectInjectedWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>this.connectors=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){var rs;const Mn=this.connectors.filter(is=>is.type==="INJECTED");return!(Mn!=null&&Mn.length)||Mn.length===1&&((rs=Mn[0])==null?void 0:rs.name)==="Browser Wallet"&&!CoreHelperUtil.isMobile()?(this.style.cssText="display: none",null):ke`
      <wui-flex flexDirection="column" gap="xs">
        ${Mn.map(is=>{var as;if(!CoreHelperUtil.isMobile()&&is.name==="Browser Wallet")return null;const os=(as=is.info)==null?void 0:as.rdns;return!os&&!ConnectionController.checkInstalled(void 0,is.chain)?(this.style.cssText="display: none",null):os&&ApiController.state.excludedRDNS&&ApiController.state.excludedRDNS.includes(os)?null:ke`
            <wui-list-wallet
              imageSrc=${to$2(AssetUtil.getConnectorImage(is))}
              .installed=${!0}
              name=${is.name??"Unknown"}
              tagVariant="success"
              tagLabel="installed"
              data-testid=${`wallet-selector-${is.id}`}
              @click=${()=>this.onConnector(is)}
            >
            </wui-list-wallet>
          `})}
      </wui-flex>
    `}onConnector(Mn){ChainController.setActiveConnector(Mn),RouterController.push("ConnectingExternal",{connector:Mn})}};__decorate$9([r$5()],W3mConnectInjectedWidget.prototype,"connectors",void 0);W3mConnectInjectedWidget=__decorate$9([customElement("w3m-connect-injected-widget")],W3mConnectInjectedWidget);var __decorate$8=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectMultiChainWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>this.connectors=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const Mn=this.connectors.filter(rs=>rs.type==="MULTI_CHAIN"&&rs.name!=="WalletConnect");return Mn!=null&&Mn.length?ke`
      <wui-flex flexDirection="column" gap="xs">
        ${Mn.map(rs=>ke`
            <wui-list-wallet
              imageSrc=${to$2(AssetUtil.getConnectorImage(rs))}
              .installed=${!0}
              name=${rs.name??"Unknown"}
              tagVariant="shade"
              tagLabel="multichain"
              data-testid=${`wallet-selector-${rs.id}`}
              @click=${()=>this.onConnector(rs)}
            >
            </wui-list-wallet>
          `)}
      </wui-flex>
    `:(this.style.cssText="display: none",null)}onConnector(Mn){ChainController.setActiveConnector(Mn),RouterController.push("ConnectingMultiChain")}};__decorate$8([r$5()],W3mConnectMultiChainWidget.prototype,"connectors",void 0);W3mConnectMultiChainWidget=__decorate$8([customElement("w3m-connect-multi-chain-widget")],W3mConnectMultiChainWidget);var __decorate$7=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectExternalWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>this.connectors=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const rs=this.connectors.filter(is=>is.type==="EXTERNAL").filter(is=>is.id!=="coinbaseWalletSDK");return rs!=null&&rs.length?ke`
      <wui-flex flexDirection="column" gap="xs">
        ${rs.map(is=>ke`
            <wui-list-wallet
              imageSrc=${to$2(AssetUtil.getConnectorImage(is))}
              .installed=${!0}
              name=${is.name??"Unknown"}
              data-testid=${`wallet-selector-external-${is.id}`}
              @click=${()=>this.onConnector(is)}
            >
            </wui-list-wallet>
          `)}
      </wui-flex>
    `:(this.style.cssText="display: none",null)}onConnector(Mn){RouterController.push("ConnectingExternal",{connector:Mn})}};__decorate$7([r$5()],W3mConnectExternalWidget.prototype,"connectors",void 0);W3mConnectExternalWidget=__decorate$7([customElement("w3m-connect-external-widget")],W3mConnectExternalWidget);var __decorate$6=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectRecentWidget=class extends h$3{render(){const Mn=StorageUtil.getRecentWallets();return Mn!=null&&Mn.length?ke`
      <wui-flex flexDirection="column" gap="xs">
        ${Mn.map(rs=>ke`
            <wui-list-wallet
              imageSrc=${to$2(AssetUtil.getWalletImage(rs))}
              name=${rs.name??"Unknown"}
              @click=${()=>this.onConnectWallet(rs)}
              tagLabel="recent"
              tagVariant="shade"
            >
            </wui-list-wallet>
          `)}
      </wui-flex>
    `:(this.style.cssText="display: none",null)}onConnectWallet(Mn){RouterController.push("ConnectingWalletConnect",{wallet:Mn})}};W3mConnectRecentWidget=__decorate$6([customElement("w3m-connect-recent-widget")],W3mConnectRecentWidget);var __decorate$5=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectRecommendedWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>this.connectors=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){if(!this.connectors.find(mo=>mo.id==="walletConnect"))return null;const{recommended:rs}=ApiController.state,{customWallets:is,featuredWalletIds:os}=OptionsController.state,{connectors:as}=ConnectorController.state,us=StorageUtil.getRecentWallets(),hs=as.filter(mo=>mo.type==="INJECTED"||mo.type==="ANNOUNCED"||mo.type==="MULTI_CHAIN").filter(mo=>mo.name!=="Browser Wallet");if(os||is||!rs.length)return this.style.cssText="display: none",null;const ps=hs.length+us.length,io=Math.max(0,2-ps),fo=WalletUtil.filterOutDuplicateWallets(rs).slice(0,io);return fo.length?ke`
      <wui-flex flexDirection="column" gap="xs">
        ${fo.map(mo=>ke`
            <wui-list-wallet
              imageSrc=${to$2(AssetUtil.getWalletImage(mo))}
              name=${(mo==null?void 0:mo.name)??"Unknown"}
              @click=${()=>this.onConnectWallet(mo)}
            >
            </wui-list-wallet>
          `)}
      </wui-flex>
    `:(this.style.cssText="display: none",null)}onConnectWallet(Mn){const rs=ConnectorController.getConnector(Mn.id,Mn.rdns);rs?RouterController.push("ConnectingExternal",{connector:rs}):RouterController.push("ConnectingWalletConnect",{wallet:Mn})}};__decorate$5([r$5()],W3mConnectRecommendedWidget.prototype,"connectors",void 0);W3mConnectRecommendedWidget=__decorate$5([customElement("w3m-connect-recommended-widget")],W3mConnectRecommendedWidget);var __decorate$4=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectWalletConnectWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>this.connectors=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){if(CoreHelperUtil.isMobile())return this.style.cssText="display: none",null;const Mn=this.connectors.find(rs=>rs.id==="walletConnect");return Mn?ke`
      <wui-list-wallet
        imageSrc=${to$2(AssetUtil.getConnectorImage(Mn))}
        name=${Mn.name??"Unknown"}
        @click=${()=>this.onConnector(Mn)}
        tagLabel="qr code"
        tagVariant="main"
        data-testid="wallet-selector-walletconnect"
      >
      </wui-list-wallet>
    `:(this.style.cssText="display: none",null)}onConnector(Mn){ChainController.setActiveConnector(Mn),RouterController.push("ConnectingWalletConnect")}};__decorate$4([r$5()],W3mConnectWalletConnectWidget.prototype,"connectors",void 0);W3mConnectWalletConnectWidget=__decorate$4([customElement("w3m-connect-walletconnect-widget")],W3mConnectWalletConnectWidget);const styles$1=i$4`
  :host {
    margin-top: var(--wui-spacing-3xs);
  }
  wui-separator {
    margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
      calc(var(--wui-spacing-m) * -1);
    width: calc(100% + var(--wui-spacing-s) * 2);
  }
`;var __decorate$3=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mConnectorList=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>this.connectors=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const{custom:Mn,recent:rs,announced:is,injected:os,multiChain:as,recommended:us,featured:ds,external:hs}=this.getConnectorsByType(),ps=OptionsController.state.enableWalletConnect;return ke`
      <wui-flex flexDirection="column" gap="xs">
        ${ps?ke`<w3m-connect-walletconnect-widget></w3m-connect-walletconnect-widget>`:null}
        ${rs.length?ke`<w3m-connect-recent-widget></w3m-connect-recent-widget>`:null}
        ${as.length?ke`<w3m-connect-multi-chain-widget></w3m-connect-multi-chain-widget>`:null}
        ${is.length?ke`<w3m-connect-announced-widget></w3m-connect-announced-widget>`:null}
        ${os.length?ke`<w3m-connect-injected-widget></w3m-connect-injected-widget>`:null}
        ${ds.length?ke`<w3m-connect-featured-widget></w3m-connect-featured-widget>`:null}
        ${Mn!=null&&Mn.length?ke`<w3m-connect-custom-widget></w3m-connect-custom-widget>`:null}
        ${hs.length?ke`<w3m-connect-external-widget></w3m-connect-external-widget>`:null}
        ${us.length?ke`<w3m-connect-recommended-widget></w3m-connect-recommended-widget>`:null}
      </wui-flex>
    `}getConnectorsByType(){const{featured:Mn,recommended:rs}=ApiController.state,{customWallets:is}=OptionsController.state,os=StorageUtil.getRecentWallets(),as=WalletUtil.filterOutDuplicateWallets(rs),us=WalletUtil.filterOutDuplicateWallets(Mn),ds=this.connectors.filter(Ao=>Ao.type==="MULTI_CHAIN"),hs=this.connectors.filter(Ao=>Ao.type==="ANNOUNCED"),ps=this.connectors.filter(Ao=>Ao.type==="INJECTED"),io=this.connectors.filter(Ao=>Ao.type==="EXTERNAL"),mo=ChainController.state.activeChain===ConstantsUtil$3.CHAIN.EVM?OptionsController.state.enableEIP6963:!0;return{custom:is,recent:os,external:io,multiChain:ds,announced:mo?hs:[],injected:mo?ps:[],recommended:as,featured:us}}};W3mConnectorList.styles=styles$1;__decorate$3([r$5()],W3mConnectorList.prototype,"connectors",void 0);W3mConnectorList=__decorate$3([customElement("w3m-connector-list")],W3mConnectorList);var __decorate$2=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAllWalletsWidget=class extends h$3{constructor(){super(),this.unsubscribe=[],this.connectors=ConnectorController.state.connectors,this.count=ApiController.state.count,this.unsubscribe.push(ConnectorController.subscribeKey("connectors",Mn=>this.connectors=Mn),ApiController.subscribeKey("count",Mn=>this.count=Mn))}disconnectedCallback(){this.unsubscribe.forEach(Mn=>Mn())}render(){const Mn=this.connectors.find(ds=>ds.id==="walletConnect"),{allWallets:rs}=OptionsController.state;if(!Mn||rs==="HIDE"||rs==="ONLY_MOBILE"&&!CoreHelperUtil.isMobile())return null;const is=ApiController.state.featured.length,os=this.count+is,as=os<10?os:Math.floor(os/10)*10,us=as<os?`${as}+`:`${as}`;return ke`
      <wui-list-wallet
        name="All Wallets"
        walletIcon="allWallets"
        showAllWallets
        @click=${this.onAllWallets.bind(this)}
        tagLabel=${us}
        tagVariant="shade"
        data-testid="all-wallets"
      ></wui-list-wallet>
    `}onAllWallets(){EventsController.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),RouterController.push("AllWallets")}};__decorate$2([r$5()],W3mAllWalletsWidget.prototype,"connectors",void 0);__decorate$2([r$5()],W3mAllWalletsWidget.prototype,"count",void 0);W3mAllWalletsWidget=__decorate$2([customElement("w3m-all-wallets-widget")],W3mAllWalletsWidget);var __decorate$1=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mAccountAuthButton=class extends h$3{constructor(){super(...arguments),this.socialProvider=StorageUtil.getConnectedSocialProvider(),this.socialUsername=StorageUtil.getConnectedSocialUsername()}render(){const Mn=StorageUtil.getConnectedConnector(),rs=ConnectorController.getAuthConnector();if(!rs||Mn!=="AUTH")return this.style.cssText="display: none",null;const is=rs.provider.getEmail()??"";return ke`
      <wui-list-item
        variant="icon"
        iconVariant="overlay"
        icon=${this.socialProvider??"mail"}
        iconSize=${this.socialProvider?"xxl":"sm"}
        data-testid="w3m-account-email-update"
        ?chevron=${!this.socialProvider}
        @click=${()=>{this.onGoToUpdateEmail(is,this.socialProvider)}}
      >
        <wui-text variant="paragraph-500" color="fg-100">${this.getAuthName(is)}</wui-text>
      </wui-list-item>
    `}onGoToUpdateEmail(Mn,rs){rs||RouterController.push("UpdateEmailWallet",{email:Mn})}getAuthName(Mn){return this.socialUsername?this.socialProvider==="discord"&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:Mn.length>30?`${Mn.slice(0,-3)}...`:Mn}};W3mAccountAuthButton=__decorate$1([customElement("w3m-account-auth-button")],W3mAccountAuthButton);const styles=i$4`
  wui-flex {
    width: 100%;
  }

  .wallet-guide {
    width: 100%;
  }

  .chip-box {
    width: fit-content;
    background-color: var(--wui-color-gray-glass-005);
    border-radius: var(--wui-border-radius-3xl);
  }
`;var __decorate=function(Fn,Mn,rs,is){var os=arguments.length,as=os<3?Mn:is===null?is=Object.getOwnPropertyDescriptor(Mn,rs):is,us;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")as=Reflect.decorate(Fn,Mn,rs,is);else for(var ds=Fn.length-1;ds>=0;ds--)(us=Fn[ds])&&(as=(os<3?us(as):os>3?us(Mn,rs,as):us(Mn,rs))||as);return os>3&&as&&Object.defineProperty(Mn,rs,as),as};let W3mWalletGuide=class extends h$3{constructor(){super(...arguments),this.walletGuide="get-started"}render(){return this.walletGuide==="explore"?ke`<wui-flex
          class="wallet-guide"
          flexDirection="column"
          alignItems="center"
          justifyContent="center"
          rowGap="xs"
          data-testid="w3m-wallet-guide-explore"
        >
          <wui-text variant="small-400" color="fg-200" align="center">
            Looking for a self-custody wallet?
          </wui-text>

          <wui-flex class="chip-box">
            <wui-chip
              imageIcon="walletConnectLightBrown"
              icon="externalLink"
              variant="transparent"
              href="https://explorer.walletconnect.com"
              title="Visit our Explorer"
            ></wui-chip>
          </wui-flex>
        </wui-flex>`:ke`<wui-flex
          columnGap="4xs"
          flexDirection="row"
          alignItems="center"
          justifyContent="center"
        >
          <wui-text variant="small-400" class="title" color="fg-200"
            >Haven't got a wallet?</wui-text
          >
          <wui-link
            data-testid="w3m-wallet-guide-get-started"
            color="blue-100"
            class="get-started-link"
            @click=${this.onGetStarted}
          >
            Get started
          </wui-link>
        </wui-flex>`}onGetStarted(){RouterController.push("Create")}};W3mWalletGuide.styles=styles;__decorate([n$4()],W3mWalletGuide.prototype,"walletGuide",void 0);W3mWalletGuide=__decorate([customElement("w3m-wallet-guide")],W3mWalletGuide);let modal;function createAppKit(Fn){return modal||(modal=new AppKit({...Fn,sdkVersion:CoreHelperUtil.generateSdkVersion(Fn.adapters??[],"react",PACKAGE_VERSION)}),getAppKit(modal)),modal}const useStyles=()=>{const{isDarkMode:Fn}=useStore();return{tooltipStyle:{backgroundColor:Fn?"#fff":"#000",color:Fn?"#000":"#fff",backdropFilter:"1rem"},notificationStyle:{backgroundColor:Fn?"#fff":"#111213",color:"#0E9384"}}},Navbar=Fn=>{var Ul,Jl;const[Mn,rs]=reactExports.useState(!1),[is,os]=reactExports.useState(!1),[as,us]=reactExports.useState(!1),[ds,hs]=reactExports.useState(!1),{disconnect:ps}=useDisconnect();reactExports.useState(!1);const{open:io}=useAppKit(),{isDarkMode:fo,isSelectedChain:mo,updateIsWalletConnectVisible:Ao,updateIsDarkMode:$o,updateIsSelectedChain:Lo,web3AuthInfo:Go,updateIsAdvancedView:Yo,updateIsLoader:Wo,updateIsLoaderFaucet:Jo,isLoaderFaucet:xl,selectedCrypto:_l,setSelectedCrypto:Tl,selectedTokenPrice:Sl}=useStore(),{connector:$l,address:Pl,isConnected:Dl}=useAccount(),{t:Ol}=useTranslation(),Rl=reactExports.useRef(null),Vo=reactExports.useRef(null),jo=Sl?`$ ${Number(Sl).toLocaleString("en-US",{minimumFractionDigits:TOKEN_PRICE_USE_DECIMALS[_l]})}  USDC`:"0.00 USDC",{tooltipStyle:Ho,notificationStyle:Qo}=useStyles(),El=(fu,_d)=>{Lo(fu),Tl(_d),os(!1),Ll(!1)},Xo=()=>{us(!Mn)},Al=()=>{hs(fu=>!fu)},wl=()=>{rs(!1)};reactExports.useEffect(()=>{const fu=_d=>{Rl.current&&!Rl.current.contains(_d.target)&&wl()};return Mn?document.addEventListener("click",fu):document.removeEventListener("click",fu),()=>{document.removeEventListener("click",fu)}},[]),reactExports.useEffect(()=>{const fu=_d=>{Vo.current&&!Vo.current.contains(_d.target)&&os(!1)};return document.addEventListener("mousedown",fu),()=>{document.removeEventListener("mousedown",fu)}},[]);const[yl,Il]=reactExports.useState(1),[Bl,Gl]=reactExports.useState(!1),[Nl,zl]=reactExports.useState(!1),[Vl,Hl]=reactExports.useState(!1),[Yl,Ll]=reactExports.useState(!1),Zl=fu=>{if(fu===1){if(fu===yl)return;Il(fu)}fu===2&&Il(fu),fu===3&&Il(fu),fu===4&&Il(fu),fu===5&&Il(fu)},[Xl,wu]=reactExports.useState(!1),yu=()=>{Yo(!1),Hl(!1),zl(!1),wu(!Xl)},rp=reactExports.useCallback(async fu=>{await navigator.clipboard.writeText(fu)},[]),dp=()=>{as&&us(!1)},up=()=>{ds&&hs(!1)},[wp,vp]=reactExports.useState(!1),pp=()=>{wp&&vp(!1)},cp=async()=>{if(Dl)try{if(Wo(!0),Pl){Jo(!0);const fu=await submitFaucetPayload(Pl,mo);if(fu.success){const _d=CHAIN_PARAMS_CONFIG[mo].explorer_link;Fn.onBalanceUpdate(Pl),staticMethods.success({message:"Token minted successfully.",style:Qo,description:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("a",{className:"text-purple-700 underline hover:underline hover:text-purple-500",href:`${_d}/tx/${fu==null?void 0:fu.data}`,target:"_blank",rel:"noreferrer",children:"View transaction"})})})})}else staticMethods.error({message:"Faucet Error",description:"Faucet already dispensed to this address. Please try again later or after 72 hours.",style:Qo})}}catch(fu){console.log("Error executing order:",fu),staticMethods.error({message:"Error executing order",description:"An error occurred while executing the order. Please try again later.",style:Qo})}finally{Wo(!1),Jo(!1)}else Dl||staticMethods.info({message:"Wallet Connect",description:"Please connect your wallet",style:Qo})},gp=()=>{localStorage.setItem("isShowPopup","false"),ps()},mp=()=>{Bl===!1?(Gl(!0),wl()):(Gl(!1),wl())};reactExports.useEffect(()=>{Tl("ETH"),Lo(DEFAULT_CHAIN_ID)},[]);const fp="TESTNET",[hp,xp]=reactExports.useState(!1),Kl=()=>{xp(fu=>!fu),vp(fu=>!fu)};let Fl=[];for(const[fu,_d]of Object.entries(CHOOSE_OPTION_TYPE))for(const tp of Object.keys(_d))Fl.push([+fu,tp]);return jsxRuntimeExports.jsx("div",{className:"!sticky !z-[3] !top-0 !right-0 xxl:w-full bxl:w-full xl:w-full sxl:w-full lg:w-full md:w-screen sm:w-screen xd:w-screen ",children:jsxRuntimeExports.jsxs("div",{className:" xxl:w-full bxl:w-full xl:w-full sxl:w-full lg:w-full md:w-screen sm:w-screen xd:w-screen !sticky !top-0 flex flex-col justify-between items-start !font-inter",children:[jsxRuntimeExports.jsx("div",{className:`${fo?"!bg-[#FCFDFE]":"!bg-[#111213]"} !h-[5.5rem] flex flex-row  items-center justify-between px-4 w-full xxl:!rounded-[0_0_1rem_1rem] bxl:!rounded-[0_0_1rem_1rem] xl:!rounded-[0_0_1rem_1rem] sxl:!rounded-[0_0_1rem_1rem] lg:!rounded-none md:!rounded-none sm:!rounded-none xd:!rounded-none `,children:jsxRuntimeExports.jsxs("div",{className:"  py-6  flex flex-row   gap-4 !items-center !justify-between w-full ",children:[jsxRuntimeExports.jsxs("div",{className:"cursor-pointer xxl:flex bxl:flex xl:flex sxl:flex lg:hidden md:hidden sm:hidden xd:hidden flex-col justify-center items-start h-14 leading-[normal] ml-10",children:[jsxRuntimeExports.jsx("div",{className:`${fo?"text-[#A5A5A6]":"text-[rgba(255,255,255,0.50)]"} text-xs font-inter pb-1`,children:"Powered by"}),jsxRuntimeExports.jsx("a",{href:"https://www.ethosx.finance/",target:"_blank",rel:"noreferrer",children:fo?jsxRuntimeExports.jsx("img",{src:EthosX,alt:"EthosX",className:"w-[6.6rem] h-8 mt-[-0.5rem]"}):jsxRuntimeExports.jsx("img",{src:EthosX,alt:"EthosX",className:"w-[6.6rem] h-8 mt-[-0.5rem]"})})]}),fp===Network.TESTNET&&jsxRuntimeExports.jsx(Tooltip$1,{placement:as?"right":"top",title:"Receive testnet ETH and USDC",arrow:!1,overlayInnerStyle:Ho,children:jsxRuntimeExports.jsxs("div",{className:` cursor-pointer  ${fo?"!bg-[#EFF7F8] text-[#0E9384]":"!bg-[#1D1E20] text-[#2ED3B7]"}   font-extrabold  xxl:flex bxl:flex xl:flex sxl:flex lg:hidden md:hidden sm:hidden xd:hidden flex-col justify-start items-center h-14 leading-[normal] py-4 px-6  rounded-2xl lg:!w-full md:!w-full sm:!w-full xd:!w-full  font-inter text-sm ml-auto`,onClick:Xo,children:[jsxRuntimeExports.jsx("div",{className:"w-full flex flex-row justify-between items-center",children:xl?jsxRuntimeExports.jsx("div",{className:" flex justify-center items-center",children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-[2.2rem] h-[1.2rem] flex justify-center items-center"})}):jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-between items-center gap-4 w-full",children:jsxRuntimeExports.jsxs("span",{className:"flex flex-row justify-start items-center gap-2",children:[jsxRuntimeExports.jsx("img",{src:fo?FaucetDark:Faucet,alt:""}),"Faucet"]})})}),as&&jsxRuntimeExports.jsx(c$9,{onClickAway:dp,children:jsxRuntimeExports.jsxs("div",{id:"dropdown-options",className:`${fo?"bg-[#EFF7F8]":"bg-[#1D1E20]"} h-auto cursor-pointer mt-2 absolute !z-[100] rounded-2xl overflow-auto scroll-smooth top-[4.5rem] flex flex-col justify-start items-start w-[170px]`,children:[jsxRuntimeExports.jsx("div",{className:`${fo?"hover:!bg-[#E4F2F3]":"hover:!bg-[#1f2122]"} top-[5rem] cursor-pointer rounded-2xl flex flex-row justify-between items-center p-[0.5rem_1rem] w-full`,onClick:()=>cp(),children:jsxRuntimeExports.jsx("div",{className:" flex py-3.5",children:jsxRuntimeExports.jsx("div",{className:`px-2 ${fo?"text-[#364152]":"text-[#ffffff]"}`,children:"Automatic"})})}),jsxRuntimeExports.jsx("div",{className:`${fo?"hover:!bg-[#E4F2F3]":"hover:!bg-[#1f2122]"} top-[5rem] cursor-pointer rounded-2xl flex flex-row justify-between items-center p-[0.5rem_1rem] w-full`,onClick:()=>{const fu=CHAIN_PARAMS_CONFIG[mo].faucet_url;window.open(fu)},children:jsxRuntimeExports.jsx("div",{className:"flex py-3.5",children:jsxRuntimeExports.jsx("div",{className:`px-2 ${fo?"text-[#364152]":"text-[#ffffff]"}`,children:"Manual"})})})]})})]})}),jsxRuntimeExports.jsxs("div",{className:`${fo?"!bg-[#EFF7F8] hover:!bg-[#E4F2F3] text-[#0E9384]":"!bg-[#1D1E20] hover:!bg-[#1f2122] text-[#2ED3B7]"} common-pointer xxl:flex bxl:flex xl:flex sxl:flex lg:hidden md:hidden sm:hidden xd:hidden flex-row justify-start items-center h-14 leading-[normal] py-4 px-6  rounded-2xl font-inter font-extrabold text-sm ${fp===Network.MAINNET&&"ml-auto"} ${Dl?"":"cursor-pointer"}`,id:"element-id-for-guide-9",onClick:()=>{Dl||Ao(!0)},children:[jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-start items-center "}),Dl?jsxRuntimeExports.jsxs("div",{className:"flex justify-between gap-2  items-center !w-full cursor-pointer",children:[jsxRuntimeExports.jsxs("div",{className:" flex",onClick:()=>{io()},children:[jsxRuntimeExports.jsx("img",{className:" !w-[1.3rem] !h-[1.3rem]",src:($l==null?void 0:$l.name)==="MetaMask"?MetaMask:($l==null?void 0:$l.name)==="WalletConnect"?walletConnect$1:defaultFallback,alt:""}),jsxRuntimeExports.jsxs("div",{className:" p-1",children:[" ",(Pl==null?void 0:Pl.slice(0,5))+".."+((Ul=Pl==null?void 0:Pl.toString())==null?void 0:Ul.slice(-5))]})]}),jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx(Tooltip$1,{placement:"bottom",title:"Copy Wallet Address",arrow:!1,overlayInnerStyle:Ho,children:jsxRuntimeExports.jsx("img",{src:fo?CopyDark:Copy,alt:"Copy",onClick:()=>{rp(Pl),staticMethods.success({message:"Address Copied",style:Qo})}})}),jsxRuntimeExports.jsx(Tooltip$1,{placement:"bottom",title:"Disconnect Wallet",arrow:!1,overlayInnerStyle:Ho,children:jsxRuntimeExports.jsx("img",{src:Power,alt:"Power ",onClick:()=>{gp()}})})]})]}):jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center gap-2 ",onClick:()=>{Ao(!0)},children:[fo?jsxRuntimeExports.jsx("img",{src:UserCircleWhite,alt:"UserCircle",className:"!bg-transparent"}):jsxRuntimeExports.jsx("img",{src:UserCircle,alt:"UserCircle",className:"!bg-transparent"}),"Connect Wallet"]})]}),jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",overlayInnerStyle:Ho,arrow:!1,children:jsxRuntimeExports.jsxs("div",{className:` cursor-pointer  ${fo?"!bg-[#EFF7F8] text-[#0E9384]  ":"!bg-[#1D1E20]    text-[#2ED3B7]"}   font-extrabold  xxl:flex bxl:flex xl:flex sxl:flex lg:hidden md:hidden sm:hidden xd:hidden flex-col justify-start items-center gap-2 h-14 leading-[normal]   py-4 px-6  rounded-2xl    font-inter   text-sm`,onClick:Kl,children:[jsxRuntimeExports.jsx("div",{className:"w-full flex flex-row justify-between items-center",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-between items-center gap-4 w-full",children:[jsxRuntimeExports.jsxs("span",{className:"flex flex-row justify-start items-center gap-1",children:[jsxRuntimeExports.jsx("img",{src:fo?Mainnet:MainnetLight,alt:""}),fp===Network.MAINNET?"Mainnet":"Testnet"]}),jsxRuntimeExports.jsx("img",{src:fo?Vectorlight:Vectordown,alt:"VectorDown"})]})}),hp&&jsxRuntimeExports.jsx(c$9,{onClickAway:()=>{xp(!1)},children:jsxRuntimeExports.jsxs("div",{id:"dropdown-options",className:`${fo?"bg-[#EFF7F8]":"bg-[#1D1E20]"} absolute cursor-pointer mt-2 !z-[100] rounded-2xl overflow-auto scroll-smooth top-[4.5rem] h-auto flex flex-col justify-start items-start w-[170px]`,children:[jsxRuntimeExports.jsx("div",{className:`${fo?"hover:!bg-[#E4F2F3]":"hover:!bg-[#1f2122]"} top-[5rem] cursor-pointer rounded-2xl flex flex-row justify-between items-center p-[0.5rem_1rem] w-full`,onClick:()=>window.location.href=NetworkURL.MAINNET,children:jsxRuntimeExports.jsx("div",{className:"flex py-3.5",children:jsxRuntimeExports.jsx("div",{className:`px-2 ${fo?"text-[#364152]":"text-[#ffffff]"}`,children:"Mainnet"})})}),jsxRuntimeExports.jsx("div",{className:`${fo?"hover:!bg-[#E4F2F3]":"hover:!bg-[#1f2122]"} top-[5rem] flex flex-row justify-between items-center p-[0.5rem_1rem] w-full cursor-pointer rounded-2xl`,onClick:()=>window.location.href=NetworkURL.TESTNET,children:jsxRuntimeExports.jsx("div",{className:"flex py-3.5",children:jsxRuntimeExports.jsx("div",{className:`px-2 ${fo?"text-[#364152]":"text-[#ffffff]"}`,children:"Testnet"})})})]})})]})}),jsxRuntimeExports.jsx("div",{className:`${fo?"!bg-[#EFF7F8]":"!bg-[#1D1E20]"} cursor-pointer xxl:flex bxl:flex xl:flex sxl:flex lg:hidden md:hidden sm:hidden xd:hidden justify-center items-center h-14 py-4 px-6 rounded-2xl`,children:jsxRuntimeExports.jsxs("div",{className:`${fo?"text-[#A5A5A6]":"text-[rgba(255,255,255,0.50)]"} text-sm font-extrabold font-inter gap-2 flex justify-center items-center`,children:[jsxRuntimeExports.jsx("img",{src:Coins,alt:""}),jsxRuntimeExports.jsx("h1",{children:"Coming soon"})]})}),jsxRuntimeExports.jsxs("div",{className:" pl-2 !w-full justify-between items-center xxl:!hidden max-xxl:!hidden bxl:!hidden xl:!hidden sxl:!hidden lg:!flex md:!flex sm:!flex xd:!flex lg:!flex-row gap-4",children:[jsxRuntimeExports.jsx("a",{href:"/",children:jsxRuntimeExports.jsx("img",{src:Kana,alt:"kana-logo",className:"w-8 h-8"})}),jsxRuntimeExports.jsx(c$9,{onClickAway:()=>Ll(!1),children:jsxRuntimeExports.jsxs("div",{className:"md:flex sm:flex xd:flex w-[80%]",children:[jsxRuntimeExports.jsxs("div",{className:`  ${fo?"!bg-[#EFF7F8] text-[#0E9384]":"!bg-[#1D1E20] text-[#2ED3B7]"} flex flex-row   justify-between cursor-pointer  items-center min-w-[200px] w-full p-[12px] rounded-2xl`,onClick:()=>Ll(!Yl),id:"element-id-for-guide-10-small",children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-between items-center gap-2 ",children:[jsxRuntimeExports.jsx("img",{src:TOKEN_LOGO[_l],alt:_l,className:" w-6"}),jsxRuntimeExports.jsxs("span",{className:`${fo?"text-[#364152]":"text-white"} flex flex-col font-bold 2xl:text-base xl:text-base lg:text-base md:text-base sm:text-sm max-sm:text-sm`,children:[jsxRuntimeExports.jsx("span",{children:_l}),jsxRuntimeExports.jsx("div",{className:" font-normal flex justify-between",children:jsxRuntimeExports.jsx("span",{className:" text-[#a5a5a6] text-xs",children:CHAIN_PARAMS_CONFIG[mo].name})})]})]}),jsxRuntimeExports.jsxs("div",{className:`${fo?"text-[#0E9384]":"text-[#e5fcf8]"} text-xs font-manrope font-extrabold flex items-center`,children:[jsxRuntimeExports.jsx("span",{className:" font-normal text-[#a5a5a6] flex justify-end mr-1",children:mo===DEFAULT_CHAIN_ID?"5 Mins":"2 Hrs"}),jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx("img",{src:ChevronDown,alt:"",width:20,height:20})})]})]}),Yl&&jsxRuntimeExports.jsx("div",{id:"dropdown-options",ref:Vo,className:`${fo?"bg-[#EFF7F8]":"bg-[#1D1E20]"} flex flex-col justify-start items-start max-h-[80vh] xxl:!w-[20%] bxl:!w-[20%] xl:!w-[20%] sxl:!w-[21%] lg:!w-full md:!w-[80%] sm:!w-[80%] xd:!w-[80%] cursor-pointer mt-2 absolute !z-[100] rounded-2xl overflow-y-auto scroll-smooth backdrop-blur-sm top-[5rem]`,children:Fl.map((fu,_d)=>jsxRuntimeExports.jsxs("div",{className:`${fo?"bg-[#EFF7F8] hover:!bg-[#E4F2F3]":"bg-[#1D1E20] hover:!bg-[#1f2122]"} cursor-pointer rounded-2xl flex flex-row justify-between items-center p-[0.5rem_1rem] w-full`,onClick:()=>El(fu[0],fu[1]),children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center py-3.5",children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("img",{src:TOKEN_LOGO[fu[1]],alt:"ETH",className:"w-6"})}),jsxRuntimeExports.jsxs("div",{className:`flex flex-col px-2 ${fo?"text-[#364152]":"text-[#ffffff]"}`,children:[jsxRuntimeExports.jsx("span",{children:fu[1]}),jsxRuntimeExports.jsx("span",{className:" text-[#a5a5a6] text-[0.7rem]",children:CHAIN_PARAMS_CONFIG[fu[0]].name})]})]}),jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-end items-center gap-[0.2rem]",onClick:()=>El(fu[0],fu[1]),children:jsxRuntimeExports.jsxs("div",{className:`${fo?"text-[#0E9384]":"text-[#2ED3B7]"} text-sm font-manrope font-extrabold flex flex-col`,children:[jsxRuntimeExports.jsx("span",{children:jo}),jsxRuntimeExports.jsx("span",{className:" font-normal text-[#a5a5a6] flex justify-end",children:fu[0]===DEFAULT_CHAIN_ID?"5 Mins":"2 Hrs"})]})})]},_d))})]})}),jsxRuntimeExports.jsx(c$9,{onClickAway:()=>Hl(!1),children:jsxRuntimeExports.jsxs("div",{className:"text-[2rem] !float-right text-[rgba(255,255,255,0.6)] cursor-pointer xxl:!hidden xl:hidden lg:flex md:flex sm:flex",onClick:()=>{Hl(!Vl),zl(!1),wu(!1)},children:[Vl?jsxRuntimeExports.jsx("img",{width:26,height:26,src:CoinsGreen,alt:"Coins"}):jsxRuntimeExports.jsx("img",{width:26,height:26,src:fo?CoinsBlack:Coins,alt:"Coins"}),Vl&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{onClick:()=>{},className:`${fo?"bg-[#E4F2F3] text-[black] border-[#E3E8EF]":"bg-[#1D1E20] text-[#FFFFFFCC] border-[#FFFFFF1A]"} absolute top-16 right-8 text-sm font-bold rounded-lg border py-3 px-4 w-40 font-inter`,children:jsxRuntimeExports.jsx("span",{className:"font-normal text-xs",children:"Coming Soon"})})})]})}),jsxRuntimeExports.jsx("div",{className:"text-[2rem] !float-right text-[rgba(255,255,255,0.6)] cursor-pointer xxl:!hidden xl:hidden lg:hidden md:flex sm:flex",onClick:()=>{zl(!Nl),Hl(!1),wu(!1)},id:"",children:Nl?jsxRuntimeExports.jsx("img",{width:26,height:26,src:fo?BellDark:Bell,alt:"Notification"}):jsxRuntimeExports.jsx("img",{width:26,height:26,src:BellInactive,alt:"Notification"})}),jsxRuntimeExports.jsx("div",{className:"text-[2rem]  text-[rgba(255,255,255,0.6)] cursor-pointer xxl:!hidden xl:hidden lg:flex md:flex sm:flex",onClick:yu,children:Xl?jsxRuntimeExports.jsx("img",{src:WrongRed,alt:"WrongRed"}):jsxRuntimeExports.jsx("img",{src:fo?BarMenuDark:BarMenu,alt:"BarMenu"})})]}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between gap-4",children:[jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",overlayInnerStyle:Ho,title:"Notification",arrow:!1,children:jsxRuntimeExports.jsx("div",{className:`${fo?"bg-[#EFF7F8] hover:!bg-[#E4F2F3]":"bg-[#1D1E20] hover:!bg-[#1f2122]"} w-[3.5rem]  xxl:flex bxl:flex xl:flex sxl:flex lg:hidden md:hidden sm:hidden xd:hidden h-14 flex-row justify-center items-center cursor-pointer !rounded-2xl`,children:jsxRuntimeExports.jsx("img",{src:Notification,alt:"Notification"})})}),jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",overlayInnerStyle:Ho,title:"Theme",arrow:!1,children:jsxRuntimeExports.jsx("div",{onClick:()=>$o(!fo),className:`${fo?"bg-[#EFF7F8] hover:!bg-[#E4F2F3]":"bg-[#1D1E20] hover:!bg-[#1f2122]"} w-[3.5rem]  xxl:flex bxl:flex xl:flex sxl:flex lg:hidden md:hidden sm:hidden xd:hidden h-14 flex-row justify-center items-center cursor-pointer !rounded-2xl`,children:jsxRuntimeExports.jsx("img",{src:fo?SettingGreen:SettingDark,alt:"sun"})})})]})]})}),Xl?jsxRuntimeExports.jsxs("ul",{className:`flex flex-col min-h-screen max-h-full align-middle  gap-2  w-full lg:!px-0 md:!px-4 sm:!px-4 xd:!px-4 !overflow-y-scroll h-full justify-start items-start py-3 mt-24 xxl:!hidden bxl:!hidden xl:!hidden sxl:!hidden lg:!flex md:!flex sm:!flex xd:!flex lg:!mx-0 md:!mx-0 sm:!mx-0 xd:!mx-0 md:w-full sm:w-full xd:w-full  md:pb-0 md:mt-24 sm:mt-24 xd:mt-24 z-[9] ${fo?"!bg-[#FCFDFE]":"!bg-[#17181A]"} ${Xl?"!fixed !right-0 !left-0 !bottom-0 !top-0":"hidden"}`,children:[jsxRuntimeExports.jsxs("div",{className:`${fo?"!bg-[#EFF7F8] text-[#0E9384]":"!bg-[#1D1E20] text-[#2ED3B7]"} common-pointer  !w-full  flex   flex-row justify-start items-center gap-2     cursor-pointer   h-14 leading-[normal]   py-4 px-4  rounded-2xl    font-inter font-extrabold  text-base`,onClick:()=>{Dl||(Ao(!0),wu(!1))},children:[jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-start items-center gap-2"}),Dl?jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{className:"!w-[1.3rem] !h-[1.3rem] mr-1",src:($l==null?void 0:$l.name)==="MetaMask"?MetaMask:($l==null?void 0:$l.name)==="WalletConnect"?walletConnect$1:defaultFallback,alt:""}),(Pl==null?void 0:Pl.slice(0,7))+".."+((Jl=Pl==null?void 0:Pl.toString())==null?void 0:Jl.slice(-7)),jsxRuntimeExports.jsx("img",{src:fo?CopyDark:Copy,alt:"Copy",onClick:()=>{rp(Pl),staticMethods.success({message:"Address Copied",style:Qo})}}),jsxRuntimeExports.jsx("img",{src:Power,alt:"Power ",onClick:()=>{gp()}})]}):jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center gap-4",children:[fo?jsxRuntimeExports.jsx("img",{src:UserCircleWhite,alt:"UserCircle",className:"!bg-transparent"}):jsxRuntimeExports.jsx("img",{src:UserCircle,alt:"UserCircle",className:"!bg-transparent"}),"Connect Wallet"]})]}),fp===Network.TESTNET&&jsxRuntimeExports.jsx(c$9,{onClickAway:up,children:jsxRuntimeExports.jsxs("div",{className:` cursor-pointer !z-[100]  ${fo?"!bg-[#EFF7F8] text-[#0E9384]  ":"!bg-[#1D1E20]    text-[#2ED3B7]"} w-full  font-extrabold  flex  flex-col justify-start items-center gap-2   h-14 leading-[normal]   py-4 px-6  rounded-2xl    font-inter   text-sm`,onClick:Al,children:[jsxRuntimeExports.jsx("div",{className:"w-full flex flex-row justify-between items-center",children:xl?jsxRuntimeExports.jsx("div",{className:" flex justify-center items-center",children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-[2.2rem] h-[1.2rem] flex justify-center items-center"})}):jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-between items-center w-full",children:[jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-between items-center w-full",children:jsxRuntimeExports.jsxs("span",{className:"flex flex-row justify-start items-center gap-1",children:[jsxRuntimeExports.jsx("img",{src:fo?FaucetDark:Faucet,alt:""}),"Faucet"]})}),jsxRuntimeExports.jsx("img",{src:fo?Vectorlight:Vectordown,alt:"VectorDown"})]})}),ds&&jsxRuntimeExports.jsxs("div",{id:"dropdown-options",className:`${fo?"bg-[#EFF7F8]":"bg-[#1D1E20]"} cursor-pointer !z-[100] rounded-2xl overflow-auto scroll-smooth h-auto absolute top-[9rem] flex flex-col justify-start items-start lg:!w-[97%] md:!w-[96%] sm:!w-[93%] xd:!w-[93%]`,children:[jsxRuntimeExports.jsx("div",{className:`${fo?"hover:!bg-[#E4F2F3]":"hover:!bg-[#1f2122]"} top-[5rem] cursor-pointer rounded-2xl flex flex-row justify-between items-center p-[0.5rem_1rem] w-full`,onClick:()=>cp(),children:jsxRuntimeExports.jsx("div",{className:" flex py-3.5",children:jsxRuntimeExports.jsx("div",{className:`px-2 ${fo?"text-[#364152]":"text-[#ffffff]"}`,children:"Automatic"})})}),jsxRuntimeExports.jsx("div",{className:`${fo?"hover:!bg-[#E4F2F3]":"hover:!bg-[#1f2122]"} top-[5rem] cursor-pointer rounded-2xl flex flex-row justify-between items-center p-[0.5rem_1rem] w-full`,onClick:()=>window.open("https://testnet.bnbchain.org/faucet-smart"),children:jsxRuntimeExports.jsx("div",{className:" flex py-3.5",children:jsxRuntimeExports.jsx("div",{className:`px-2 ${fo?"text-[#364152]":"text-[#ffffff]"}`,children:"Manual"})})})]})]})}),jsxRuntimeExports.jsx(c$9,{onClickAway:pp,children:jsxRuntimeExports.jsxs("div",{className:` cursor-pointer  ${fo?"!bg-[#EFF7F8] text-[#0E9384]":"!bg-[#1D1E20] text-[#2ED3B7]"} w-full  font-extrabold flex  flex-col justify-start items-center gap-2   h-14 leading-[normal]   py-4 px-6  rounded-2xl    font-inter   text-sm`,onClick:Kl,children:[jsxRuntimeExports.jsx("div",{className:"w-full flex flex-row justify-between items-center",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-between items-center w-full",children:[jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-between items-center w-full",children:jsxRuntimeExports.jsxs("span",{className:"flex flex-row justify-start items-center gap-1",children:[jsxRuntimeExports.jsx("img",{src:fo?Mainnet:MainnetLight,alt:""}),fp===Network.MAINNET?"Mainnet":"Testnet"]})}),jsxRuntimeExports.jsx("img",{src:fo?Vectorlight:Vectordown,alt:"VectorDown"})]})}),wp&&jsxRuntimeExports.jsxs("div",{id:"dropdown-options",className:`${fo?"bg-[#EFF7F8]":"bg-[#1D1E20]"} cursor-pointer rounded-2xl overflow-auto scroll-smooth top-[13rem] absolute !z-[100]  h-auto flex flex-col justify-start items-start lg:!w-[97%] md:!w-[96%] sm:!w-[93%] xd:!w-[93%] `,children:[jsxRuntimeExports.jsx("div",{className:`${fo?"hover:!bg-[#E4F2F3]":"hover:!bg-[#1f2122]"} top-[5rem] flex flex-row justify-between items-center p-[0.5rem_1rem] w-full cursor-pointer rounded-2xl`,onClick:()=>window.location.href=NetworkURL.MAINNET,children:jsxRuntimeExports.jsx("div",{className:" flex py-3.5",children:jsxRuntimeExports.jsx("div",{className:`px-2 ${fo?"text-[#364152]":"text-[#ffffff]"}`,children:"Mainnet"})})}),jsxRuntimeExports.jsx("div",{className:`${fo?" hover:!bg-[#E4F2F3]":"  hover:!bg-[#1f2122]"} top-[5rem] cursor-pointer rounded-2xl flex flex-row justify-between items-center p-[0.5rem_1rem]  w-full`,onClick:()=>window.location.href=NetworkURL.TESTNET,children:jsxRuntimeExports.jsx("div",{className:" flex py-3.5",children:jsxRuntimeExports.jsx("div",{className:`px-2 ${fo?"text-[#364152]":"text-[#ffffff]"}`,children:"Testnet"})})})]})]})}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://app.kanalabs.io/swap",className:"w-full flex  h-[52px] flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${fo?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${yl===2?`!font-extrabold !opacity-[1]  ${fo?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:fo?SwapDark:Swap,alt:"Swap"}),jsxRuntimeExports.jsx("div",{className:fo?"text-[#0C0C0D]":"text-[white]",children:Ol("Swap")})]})})}),jsxRuntimeExports.jsx("a",{id:"swap",rel:"noreferrer",href:"https://app.kanalabs.io/perps",className:"w-full flex  h-[52px] flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${fo?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.2rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${yl===8?`!font-extrabold !opacity-[1]  ${fo?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{width:26,height:26,className:"bg-transparent  !h-4",src:fo?PerpsDark:PerpsLight,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:fo?"text-[#0C0C0D]":"text-[white]",children:"Perps"})]})})}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:" https://tradebook.kanalabs.io/?market=APT-USDC",className:"w-full flex  h-[52px] flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${fo?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${yl===3?`!font-extrabold !opacity-[1]  ${fo?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:fo?Trade_dark:TradeIcon,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:fo?"text-[#0C0C0D]":"text-[white]",children:Ol("Trade")})]})})}),jsxRuntimeExports.jsx("div",{className:"w-full flex  h-[52px] flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${fo?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${yl===1?`!font-extrabold !opacity-[1]  ${fo?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:fo?SwitchDark:Switch,alt:"Switch"}),jsxRuntimeExports.jsx("div",{className:fo?"text-[#0C0C0D]":"text-[white]",children:Ol("operps")})]})})}),jsxRuntimeExports.jsx("div",{className:` ${fo?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} cursor-pointer bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${yl===5?`!font-extrabold !opacity-[1]  ${fo?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>Zl(5),children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-between w-full items-center",onClick:mp,children:[jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:fo?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:fo?"text-[#0C0C0D]":"text-[white]",children:"Leaderboard"})]}),jsxRuntimeExports.jsx("img",{src:fo?ChevronDownDark:ChevronDown,alt:"ChevronDown",className:Bl?" rotate-180 ml-2":" ml-2 rotate-0"})]})}),Bl&&jsxRuntimeExports.jsxs("div",{className:"submenu w-full",children:[jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://app.kanalabs.io/Leaderboard",className:"w-full  h-[52px] flex flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` bg-transparent menu-item text-base my-1  w-full h-auto text-[white] font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl hover:bg-[rgba(255,255,255,0.06)] hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${yl===4?"font-extrabold opacity-[1] bg-[rgba(255,255,255,0.06)]":"opacity-[0.5]"}`,onClick:()=>Zl(4),children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4 opacity-0",src:fo?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:fo?"text-[#0C0C0D]":"text-[white]",children:"Points Leaderboard"})]})})}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://tradebook.kanalabs.io/leaderboard",className:"w-full  h-[52px] flex flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` bg-transparent menu-item text-base my-1  w-full h-auto text-[white] font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl hover:bg-[rgba(255,255,255,0.06)] hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${yl===6?"font-extrabold opacity-[1] bg-[rgba(255,255,255,0.06)]":"opacity-[0.5]"}`,onClick:()=>Zl(6),children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4 opacity-0",src:fo?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:fo?"text-[#0C0C0D]":"text-[white]",children:"Trade Leaderboard"})]})})})]}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://app.kanalabs.io/rewards",className:"w-full  h-[52px] flex flex-row justify-start items-center  bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` bg-transparent menu-item text-base my-1  w-full h-auto text-[white] font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl hover:bg-[rgba(255,255,255,0.06)] hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${yl===7?"font-extrabold opacity-[1] bg-[rgba(255,255,255,0.06)]":"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:fo?ReferralDark:Referral,alt:"Referral"}),jsxRuntimeExports.jsx("div",{className:fo?"text-[#0C0C0D]":"text-[white]",children:"Dashboard"})]})})}),jsxRuntimeExports.jsxs("div",{onClick:()=>$o(!fo),className:`${fo?"bg-[#EFF7F8] text-[#0C0C0D] ":"bg-[#1D1E20] text-[#FFF]"} w-full  font-extrabold  h-14  py-4 px-6 flex flex-row justify-between gap-4 items-center  cursor-pointer !rounded-[2rem]`,children:[jsxRuntimeExports.jsx("div",{children:"Theme"}),jsxRuntimeExports.jsx("img",{src:fo?SettingGreen:SettingDark,alt:"sun"})]}),jsxRuntimeExports.jsxs("div",{className:" flex mb-[7rem] h-14 flex-row justify-center items-center gap-4 w-full",children:[jsxRuntimeExports.jsx("div",{className:`${fo?"text-[#A5A5A6]":"text-[rgba(255,255,255,0.50)]"} text-xs  p-5 font-inter`,children:"Powered by"}),jsxRuntimeExports.jsx("img",{src:EthosX,alt:"EconiaImg",className:"w-[6.6rem] h-4"})]})]}):jsxRuntimeExports.jsx("ul",{}),Nl&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("ul",{className:`flex-1 flex flex-col justify-between items-start pb-3 mt-24 xxl:hidden bxl:hidden xl:hidden sxl:hidden lg:flex md:flex md:pb-0 md:mt-24 sm:mt-24 xd:mt-24 z-[9] ${fo?"!bg-[#FCFDFE]":"!bg-[#17181A]"} ${Nl?"!fixed !right-0 !left-0 lg:!bottom-0 md:!bottom-24 sm:!bottom-24 xd:!bottom-24 !top-0":"hidden"}`,children:[jsxRuntimeExports.jsxs("div",{className:`w-full flex items-center justify-between p-4 border-b ${fo?"bg-[white] border-[#E3E8EF]":"!bg-[#111213] border-[#FFFFFF1A]"}`,children:[jsxRuntimeExports.jsx("h1",{className:`${fo?"text-[black]":"text-[white]"}`,children:"Notifications"}),jsxRuntimeExports.jsx("img",{src:fo?CloseBlack:close,alt:"Close",className:"w-4 h-4",onClick:()=>zl(!Nl)})]}),jsxRuntimeExports.jsx("div",{className:"flex flex-col  overflow-y-scroll  items-start justify-between align-middle  h-full  w-full mt-2 lg:!px-2 md:!px-2 sm:!px-2 xd:!px-2 !bg-transparent",children:jsxRuntimeExports.jsx("div",{className:"flex flex-col  items-start justify-start align-middle  h-full  w-full  !bg-transparent",children:jsxRuntimeExports.jsx("div",{className:`${fo?"bg-[#EFF7F8]":"!bg-[#1D1E20]"} w-full flex flex-row justify-start items-center gap-2   h-14 leading-[normal]   py-4 px-6  rounded-lg`,children:jsxRuntimeExports.jsx("div",{className:`${fo?"text-[#000]":"text-[#FFFFFFCC]"} text-xs py-5 font-inter`,children:"No new notifications"})})})})]})})]})})},kanaBlack="/assets/kanablack-C512tm-t.svg",help$1="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='M9.09%209C9.3251%208.33167%209.78915%207.76811%2010.4%207.40913C11.0108%207.05016%2011.7289%206.91894%2012.4272%207.03871C13.1255%207.15849%2013.7588%207.52152%2014.2151%208.06353C14.6713%208.60553%2014.9211%209.29152%2014.92%2010C14.92%2012%2011.92%2013%2011.92%2013M12%2017H12.01M22%2012C22%2017.5228%2017.5228%2022%2012%2022C6.47715%2022%202%2017.5228%202%2012C2%206.47715%206.47715%202%2012%202C17.5228%202%2022%206.47715%2022%2012Z'%20stroke='%23D2D2D2'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",helpDark="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='M9.09%209C9.3251%208.33167%209.78915%207.76811%2010.4%207.40913C11.0108%207.05016%2011.7289%206.91894%2012.4272%207.03871C13.1255%207.15849%2013.7588%207.52152%2014.2151%208.06353C14.6713%208.60553%2014.9211%209.29152%2014.92%2010C14.92%2012%2011.92%2013%2011.92%2013M12%2017H12.01M22%2012C22%2017.5228%2017.5228%2022%2012%2022C6.47715%2022%202%2017.5228%202%2012C2%206.47715%206.47715%202%2012%202C17.5228%202%2022%206.47715%2022%2012Z'%20stroke='%234A4B4D'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",KanaLogo="/assets/kana_logo-COjmpByX.svg",Sidebar=({isSidebarExpanded:Fn,setIsSidebarExpanded:Mn,isSidebarHidden:rs})=>{const{t:is}=useTranslation(),{isDarkMode:os,isSelectedChain:as,updateIsWalletConnectVisible:us}=useStore(),{address:ds}=useAccount();reactExports.useEffect(()=>{switch(as){case BINANCE_CHAIN_ID:us(!1);break}},[ds]);const[hs,ps]=reactExports.useState(1),io=$o=>{if($o===1){if($o===hs)return;ps($o)}$o===2&&ps($o),$o===3&&ps($o),$o===4&&ps($o),$o===5&&ps($o),$o===6&&ps($o)},[fo,mo]=reactExports.useState(!1),Ao=()=>{mo(fo===!1)};return jsxRuntimeExports.jsx("div",{className:` ${os?"bg-[#FCFDFE]":"bg-[#17181A]"} !z-[3]  !font-inter   !sticky  !top-0 !bottom-0  !h-screen  flex flex-col gap-4  transition-all ease-in hover:ease-out transform    duration-300  items-center justify-between  py-2  !inset-0  xxl:flex bxl:flex xl:flex sxl:flex lg:flex md:flex sm:flex xd:flex ${Fn?"!min-w-[17rem]":"!min-w-[6rem]"} ${rs?"hidden":"flex"}`,onMouseEnter:()=>window.innerWidth>1200&&Mn(!0),onMouseLeave:()=>{window.innerWidth>1200&&Mn(!1),mo(!1)},children:jsxRuntimeExports.jsxs("div",{className:"w-auto hover:w-full bg-transparent flex flex-col text-left items-center h-full justify-between p-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-col text-left items-center h-full justify-start w-full",children:[jsxRuntimeExports.jsx("div",{className:` ${os?"bg-[#FCFDFE]":"bg-[#17181A]"} p-4 w-full top-0 !sticky  mb-9 flex flex-row text-left items-center justify-start !z-[2]`,children:jsxRuntimeExports.jsx("a",{href:"https://app.kanalabs.io/",className:"flex flex-row text-left items-center justify-start w-full",rel:"noreferrer",children:Fn?jsxRuntimeExports.jsx("img",{className:"bg-transparent !h-8 !w-auto cursor-pointer",src:os?kanaBlack:KanaLogo,alt:"KanaLogo"}):jsxRuntimeExports.jsx("img",{className:"bg-transparent !h-8 !w-auto",src:Kana,alt:"Kana"})})}),jsxRuntimeExports.jsxs("div",{className:"  flex flex-col justify-start items-start bg-transparent w-full gap-2",children:[jsxRuntimeExports.jsx("a",{href:"https://app.kanalabs.io/swap",rel:"noreferrer",className:"   h-[52px] flex flex-row justify-start items-center  w-full  bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${os?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto  font-normal flex flex-row justify-start items-center ${Fn?"py-4 px-[1.4rem]":"py-[1.2rem] px-[1.4rem]"}  rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${hs===2?`!font-extrabold !opacity-[1]  ${os?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>io(2),children:Fn?jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?SwapDark:Swap,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:os?"text-[#0C0C0D]":"text-[white]",children:is("Swap")})]}):jsxRuntimeExports.jsx("div",{className:" flex flex-row justify-start items-center w-full",children:jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?SwapDark:Swap,alt:"TradeIcon"})})})}),jsxRuntimeExports.jsx("a",{id:"operps",href:"https://app.kanalabs.io/perps",rel:"noreferrer",className:" cursor-pointer   h-[52px] flex flex-row justify-start items-center  w-full  bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${os?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center ${Fn?"py-4 px-[1.4rem]":"py-[1.2rem] px-[1.4rem]"}  rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${hs===8?`!font-extrabold !opacity-[1]  ${os?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>io(8),children:Fn?jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?PerpsDark:PerpsLight,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:os?"text-[#0C0C0D]":"text-[white]",children:"Perps"})]}):jsxRuntimeExports.jsx("div",{className:" flex flex-row justify-start items-center w-full",children:jsxRuntimeExports.jsx("img",{className:"bg-transparent !h-4",src:os?PerpsDark:PerpsLight,alt:"TradeIcon"})})})}),jsxRuntimeExports.jsx("a",{href:"https://tradebook.kanalabs.io/?market=APT-USDC",rel:"noreferrer",className:"h-[52px] flex flex-row justify-start items-center w-full bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${os?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1 w-full h-auto font-normal flex flex-row justify-start items-center ${Fn?"py-4 px-[1.4rem]":"py-[1.2rem] px-[1.4rem]"}  rounded-2xl hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${hs===4?`!font-extrabold !opacity-[1]  ${os?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>io(4),children:Fn?jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?Trade_dark:TradeIcon,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:os?"text-[#0C0C0D]":"text-[white]",children:is("Trade")})]}):jsxRuntimeExports.jsx("div",{className:" flex flex-row justify-start items-center w-full",children:jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?Trade_dark:TradeIcon,alt:"TradeIcon"})})})}),jsxRuntimeExports.jsx(Link,{to:"/",className:" cursor-pointer   h-[52px] flex flex-row justify-start items-center  w-full  bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${os?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto  font-normal flex flex-row justify-start items-center ${Fn?"py-4 px-[1.4rem]":"py-[1.2rem] px-[1.4rem]"}  rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${hs===1?`!font-extrabold !opacity-[1]  ${os?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>io(1),children:Fn?jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?SwitchDark:Switch,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:os?"text-[#0C0C0D]":"text-[white]",children:is("operps")})]}):jsxRuntimeExports.jsx("div",{className:" flex flex-row justify-start items-center w-full",children:jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?SwitchDark:Switch,alt:"TradeIcon"})})})}),jsxRuntimeExports.jsx("div",{className:` cursor-pointer ${os?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base   w-full h-auto   font-normal flex flex-row justify-start items-center ${Fn?"py-4 px-[1.4rem]":"py-[1.2rem] px-[1.4rem]"} rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${hs===0?`!font-extrabold !opacity-[1]  ${os?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:Fn?jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-between w-full items-center",onClick:Ao,children:[jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:os?"text-[#0C0C0D]":"text-[white]",children:"Leaderboard"})]}),jsxRuntimeExports.jsx("img",{src:os?ChevronDownDark:ChevronDown,alt:"ChevronDown",className:fo?" rotate-180 ml-2":" ml-2 rotate-0"})]}):jsxRuntimeExports.jsx("div",{className:" flex flex-row justify-start items-center w-full",children:jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?LeaderboardDark:Leaderboard,alt:"TradeIcon"})})}),fo?jsxRuntimeExports.jsxs("div",{className:"submenu w-full gap-2 flex flex-col",children:[jsxRuntimeExports.jsx("a",{href:"https://app.kanalabs.io/Leaderboard",rel:"noreferrer",className:"   h-[52px] flex flex-row justify-start items-center  w-full  bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${os?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto   font-normal flex flex-row justify-start items-center ${Fn?"py-4 px-[1.4rem]":"py-[1.2rem] px-[1.4rem]"}  rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${hs===5?`!font-extrabold !opacity-[1]  ${os?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>io(5),children:Fn?jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4 opacity-0",src:os?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:os?"text-[#0C0C0D]":"text-[white]",children:"Points Leaderboard"})]}):jsxRuntimeExports.jsx("div",{className:" flex flex-row justify-start items-center w-full",children:jsxRuntimeExports.jsx("img",{className:"bg-transparent  opacity-0 !h-4",src:os?LeaderboardDark:Leaderboard,alt:"TradeIcon"})})})}),jsxRuntimeExports.jsx("a",{href:"https://tradebook.kanalabs.io/leaderboard",rel:"noreferrer",className:"   h-[52px] flex flex-row justify-start items-center  w-full  bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${os?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center ${Fn?"py-4 px-[1.4rem]":"py-[1.2rem] px-[1.4rem]"}  rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${hs===6?`!font-extrabold !opacity-[1]  ${os?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>io(6),children:Fn?jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4 opacity-0",src:os?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:os?"text-[#0C0C0D]":"text-[white]",children:"Trade Leaderboard"})]}):jsxRuntimeExports.jsx("div",{className:" flex flex-row justify-start items-center w-full",children:jsxRuntimeExports.jsx("img",{className:"bg-transparent  opacity-0 !h-4",src:os?LeaderboardDark:Leaderboard,alt:"TradeIcon"})})})})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),jsxRuntimeExports.jsx("a",{href:"https://app.kanalabs.io/rewards",rel:"noreferrer",className:"   h-[52px] flex flex-row justify-start items-center  w-full  bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${os?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center ${Fn?"py-4 px-[1.4rem]":"py-[1.2rem] px-[1.4rem]"}  rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${hs===6?`!font-extrabold !opacity-[1]  ${os?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>io(6),children:Fn?jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?ReferralDark:Referral,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:os?"text-[#0C0C0D]":"text-[white]",children:"Dashboard"})]}):jsxRuntimeExports.jsx("div",{className:" flex flex-row justify-start items-center w-full",children:jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:os?ReferralDark:Referral,alt:"TradeIcon"})})})})]})]}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:" https://kanalabs.io/contact-us-dev",className:"w-full",children:Fn?jsxRuntimeExports.jsxs("div",{className:` ${os?"bg-[#EFF7F8]":"bg-[#0C0C0D]"}   py-4 px-[1.4rem]  rounded-2xl  w-full text-[white] text-base font-normal gap-4 flex flex-row justify-start items-center`,children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent !w-6  !h-[1.1rem]",src:os?helpDark:help$1,alt:"Swap"}),jsxRuntimeExports.jsx("div",{className:os?"text-[#0C0C0D]":"text-[white]",children:is("help")})]}):jsxRuntimeExports.jsx("div",{className:` ${os?"bg-[#EFF7F8]":"bg-[#0C0C0D]"}  py-[1.2rem] px-[1.4rem]  rounded-2xl w-full text-[white] text-base font-normal gap-4 flex flex-row justify-start items-center`,children:jsxRuntimeExports.jsx("img",{className:"bg-transparent !w-6  !h-[1.1rem]",src:os?helpDark:help$1,alt:"Swap"})})})]})})};var propTypes$1={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function Fn(is,os,as,us,ds,hs){if(hs!==ReactPropTypesSecret){var ps=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 ps.name="Invariant Violation",ps}}Fn.isRequired=Fn;function Mn(){return Fn}var rs={array:Fn,bigint:Fn,bool:Fn,func:Fn,number:Fn,object:Fn,string:Fn,symbol:Fn,any:Fn,arrayOf:Mn,element:Fn,elementType:Fn,instanceOf:Mn,node:Fn,objectOf:Mn,oneOf:Mn,oneOfType:Mn,shape:Mn,exact:Mn,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return rs.PropTypes=rs,rs};propTypes$1.exports=factoryWithThrowingShims();var propTypesExports=propTypes$1.exports;function makeTypeChecker(Fn){return Mn=>!!Mn.type&&Mn.type.tabsRole===Fn}const isTab=makeTypeChecker("Tab"),isTabList=makeTypeChecker("TabList"),isTabPanel=makeTypeChecker("TabPanel");function isTabChild(Fn){return isTab(Fn)||isTabList(Fn)||isTabPanel(Fn)}function deepMap(Fn,Mn){return reactExports.Children.map(Fn,rs=>rs===null?null:isTabChild(rs)?Mn(rs):rs.props&&rs.props.children&&typeof rs.props.children=="object"?reactExports.cloneElement(rs,{...rs.props,children:deepMap(rs.props.children,Mn)}):rs)}function deepForEach(Fn,Mn){return reactExports.Children.forEach(Fn,rs=>{rs!==null&&(isTab(rs)||isTabPanel(rs)?Mn(rs):rs.props&&rs.props.children&&typeof rs.props.children=="object"&&(isTabList(rs)&&Mn(rs),deepForEach(rs.props.children,Mn)))})}function r$1(Fn){var Mn,rs,is="";if(typeof Fn=="string"||typeof Fn=="number")is+=Fn;else if(typeof Fn=="object")if(Array.isArray(Fn)){var os=Fn.length;for(Mn=0;Mn<os;Mn++)Fn[Mn]&&(rs=r$1(Fn[Mn]))&&(is&&(is+=" "),is+=rs)}else for(rs in Fn)Fn[rs]&&(is&&(is+=" "),is+=rs);return is}function clsx(){for(var Fn,Mn,rs=0,is="",os=arguments.length;rs<os;rs++)(Fn=arguments[rs])&&(Mn=r$1(Fn))&&(is&&(is+=" "),is+=Mn);return is}function getTabsCount(Fn){let Mn=0;return deepForEach(Fn,rs=>{isTab(rs)&&Mn++}),Mn}function isNode(Fn){return Fn&&"getAttribute"in Fn}function isTabNode(Fn){return isNode(Fn)&&Fn.getAttribute("data-rttab")}function isTabDisabled(Fn){return isNode(Fn)&&Fn.getAttribute("aria-disabled")==="true"}let canUseActiveElement;function determineCanUseActiveElement(Fn){const Mn=Fn||(typeof window<"u"?window:void 0);try{canUseActiveElement=!!(typeof Mn<"u"&&Mn.document&&Mn.document.activeElement)}catch{canUseActiveElement=!1}}const defaultProps$6={className:"react-tabs",focus:!1},UncontrolledTabs=Fn=>{let Mn=reactExports.useRef([]),rs=reactExports.useRef([]);const is=reactExports.useRef();function os(Vo,jo){if(Vo<0||Vo>=ps())return;const{onSelect:Ho,selectedIndex:Qo}=Fn;Ho(Vo,Qo,jo)}function as(Vo){const jo=ps();for(let Ho=Vo+1;Ho<jo;Ho++)if(!isTabDisabled(io(Ho)))return Ho;for(let Ho=0;Ho<Vo;Ho++)if(!isTabDisabled(io(Ho)))return Ho;return Vo}function us(Vo){let jo=Vo;for(;jo--;)if(!isTabDisabled(io(jo)))return jo;for(jo=ps();jo-- >Vo;)if(!isTabDisabled(io(jo)))return jo;return Vo}function ds(){const Vo=ps();for(let jo=0;jo<Vo;jo++)if(!isTabDisabled(io(jo)))return jo;return null}function hs(){let Vo=ps();for(;Vo--;)if(!isTabDisabled(io(Vo)))return Vo;return null}function ps(){const{children:Vo}=Fn;return getTabsCount(Vo)}function io(Vo){return Mn.current[`tabs-${Vo}`]}function fo(){let Vo=0;const{children:jo,disabledTabClassName:Ho,focus:Qo,forceRenderTabPanel:El,selectedIndex:Xo,selectedTabClassName:Al,selectedTabPanelClassName:wl,environment:yl}=Fn;rs.current=rs.current||[];let Il=rs.current.length-ps();const Bl=reactExports.useId();for(;Il++<0;)rs.current.push(`${Bl}${rs.current.length}`);return deepMap(jo,Gl=>{let Nl=Gl;if(isTabList(Gl)){let zl=0,Vl=!1;canUseActiveElement==null&&determineCanUseActiveElement(yl);const Hl=yl||(typeof window<"u"?window:void 0);canUseActiveElement&&Hl&&(Vl=React.Children.toArray(Gl.props.children).filter(isTab).some((Yl,Ll)=>Hl.document.activeElement===io(Ll))),Nl=reactExports.cloneElement(Gl,{children:deepMap(Gl.props.children,Yl=>{const Ll=`tabs-${zl}`,Zl=Xo===zl,Xl={tabRef:wu=>{Mn.current[Ll]=wu},id:rs.current[zl],selected:Zl,focus:Zl&&(Qo||Vl)};return Al&&(Xl.selectedClassName=Al),Ho&&(Xl.disabledClassName=Ho),zl++,reactExports.cloneElement(Yl,Xl)})})}else if(isTabPanel(Gl)){const zl={id:rs.current[Vo],selected:Xo===Vo};El&&(zl.forceRender=El),wl&&(zl.selectedClassName=wl),Vo++,Nl=reactExports.cloneElement(Gl,zl)}return Nl})}function mo(Vo){const{direction:jo,disableUpDownKeys:Ho,disableLeftRightKeys:Qo}=Fn;if($o(Vo.target)){let{selectedIndex:El}=Fn,Xo=!1,Al=!1;(Vo.code==="Space"||Vo.keyCode===32||Vo.code==="Enter"||Vo.keyCode===13)&&(Xo=!0,Al=!1,Ao(Vo)),!Qo&&(Vo.keyCode===37||Vo.code==="ArrowLeft")||!Ho&&(Vo.keyCode===38||Vo.code==="ArrowUp")?(jo==="rtl"?El=as(El):El=us(El),Xo=!0,Al=!0):!Qo&&(Vo.keyCode===39||Vo.code==="ArrowRight")||!Ho&&(Vo.keyCode===40||Vo.code==="ArrowDown")?(jo==="rtl"?El=us(El):El=as(El),Xo=!0,Al=!0):Vo.keyCode===35||Vo.code==="End"?(El=hs(),Xo=!0,Al=!0):(Vo.keyCode===36||Vo.code==="Home")&&(El=ds(),Xo=!0,Al=!0),Xo&&Vo.preventDefault(),Al&&os(El,Vo)}}function Ao(Vo){let jo=Vo.target;do if($o(jo)){if(isTabDisabled(jo))return;const Ho=[].slice.call(jo.parentNode.children).filter(isTabNode).indexOf(jo);os(Ho,Vo);return}while((jo=jo.parentNode)!=null)}function $o(Vo){if(!isTabNode(Vo))return!1;let jo=Vo.parentElement;do{if(jo===is.current)return!0;if(jo.getAttribute("data-rttabs"))break;jo=jo.parentElement}while(jo);return!1}const{children:Lo,className:Go,disabledTabClassName:Yo,domRef:Wo,focus:Jo,forceRenderTabPanel:xl,onSelect:_l,selectedIndex:Tl,selectedTabClassName:Sl,selectedTabPanelClassName:$l,environment:Pl,disableUpDownKeys:Dl,disableLeftRightKeys:Ol,...Rl}={...defaultProps$6,...Fn};return React.createElement("div",Object.assign({},Rl,{className:clsx(Go),onClick:Ao,onKeyDown:mo,ref:Vo=>{is.current=Vo,Wo&&Wo(Vo)},"data-rttabs":!0}),fo())};UncontrolledTabs.propTypes={};const MODE_CONTROLLED=0,MODE_UNCONTROLLED=1,defaultProps$5={defaultFocus:!1,focusTabOnClick:!0,forceRenderTabPanel:!1,selectedIndex:null,defaultIndex:null,environment:null,disableUpDownKeys:!1,disableLeftRightKeys:!1},getModeFromProps=Fn=>Fn.selectedIndex===null?MODE_UNCONTROLLED:MODE_CONTROLLED,Tabs=Fn=>{const{children:Mn,defaultFocus:rs,defaultIndex:is,focusTabOnClick:os,onSelect:as,...us}={...defaultProps$5,...Fn},[ds,hs]=reactExports.useState(rs),[ps]=reactExports.useState(getModeFromProps(us)),[io,fo]=reactExports.useState(ps===MODE_UNCONTROLLED?is||0:null);if(reactExports.useEffect(()=>{hs(!1)},[]),ps===MODE_UNCONTROLLED){const $o=getTabsCount(Mn);reactExports.useEffect(()=>{if(io!=null){const Lo=Math.max(0,$o-1);fo(Math.min(io,Lo))}},[$o])}const mo=($o,Lo,Go)=>{typeof as=="function"&&as($o,Lo,Go)===!1||(os&&hs(!0),ps===MODE_UNCONTROLLED&&fo($o))};let Ao={...Fn,...us};return Ao.focus=ds,Ao.onSelect=mo,io!=null&&(Ao.selectedIndex=io),delete Ao.defaultFocus,delete Ao.defaultIndex,delete Ao.focusTabOnClick,React.createElement(UncontrolledTabs,Ao,Mn)};Tabs.propTypes={};Tabs.tabsRole="Tabs";const defaultProps$4={className:"react-tabs__tab-list"},TabList=Fn=>{const{children:Mn,className:rs,...is}={...defaultProps$4,...Fn};return React.createElement("ul",Object.assign({},is,{className:clsx(rs),role:"tablist"}),Mn)};TabList.tabsRole="TabList";TabList.propTypes={};const DEFAULT_CLASS$1="react-tabs__tab",defaultProps$3={className:DEFAULT_CLASS$1,disabledClassName:`${DEFAULT_CLASS$1}--disabled`,focus:!1,id:null,selected:!1,selectedClassName:`${DEFAULT_CLASS$1}--selected`},Tab=Fn=>{let Mn=reactExports.useRef();const{children:rs,className:is,disabled:os,disabledClassName:as,focus:us,id:ds,selected:hs,selectedClassName:ps,tabIndex:io,tabRef:fo,...mo}={...defaultProps$3,...Fn};return reactExports.useEffect(()=>{hs&&us&&Mn.current.focus()},[hs,us]),React.createElement("li",Object.assign({},mo,{className:clsx(is,{[ps]:hs,[as]:os}),ref:Ao=>{Mn.current=Ao,fo&&fo(Ao)},role:"tab",id:`tab${ds}`,"aria-selected":hs?"true":"false","aria-disabled":os?"true":"false","aria-controls":`panel${ds}`,tabIndex:io||(hs?"0":null),"data-rttab":!0}),rs)};Tab.propTypes={};Tab.tabsRole="Tab";const DEFAULT_CLASS="react-tabs__tab-panel",defaultProps$2={className:DEFAULT_CLASS,forceRender:!1,selectedClassName:`${DEFAULT_CLASS}--selected`},TabPanel=Fn=>{const{children:Mn,className:rs,forceRender:is,id:os,selected:as,selectedClassName:us,...ds}={...defaultProps$2,...Fn};return React.createElement("div",Object.assign({},ds,{className:clsx(rs,{[us]:as}),role:"tabpanel",id:`panel${os}`,"aria-labelledby":`tab${os}`}),is||as?Mn:null)};TabPanel.tabsRole="TabPanel";TabPanel.propTypes={};const refreshIcon="/assets/refresh-B1XNbKsW.svg",refreshIconBlack="/assets/refresh_black-CE9XJagn.svg",RunningClock=({startTime:Fn,endTime:Mn})=>{const[rs,is]=reactExports.useState(0),{setProgressPercent:os}=useStore();reactExports.useEffect(()=>{const hs=Mn-Fn,ps=setInterval(()=>{const io=Math.floor(Date.now()/1e3),fo=Mn-io;if(fo<=0)clearInterval(ps),is(0),os(100);else{is(fo);const mo=hs-fo,Ao=Math.round(mo/hs*100);os(Ao)}},1e3);return()=>clearInterval(ps)},[Fn,Mn]);const as=Math.floor(rs/3600),us=Math.floor(rs%3600/60),ds=Math.floor(rs%60);return jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("div",{className:`flex flex-col justify-center items-center w-full ${!rs&&"text-center"}`,children:rs?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{children:as>0?`${as} hr ${us>0?`${us} mins`:""} ${ds>0?`${ds} sec`:""}`:us>0?`${us} mins ${ds>0?`${ds} sec`:""}`:`${ds} sec`})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"w-full text-center",children:"Cycle settlement in progress ...."})})})})})},LinearProgressBar=({Percentage:Fn})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Progress,{percent:Fn,showInfo:!1,className:"progress-custom w-full !text-[#107569] h-3 rounded-2xl"})});function t(Fn,Mn){const rs={...Fn};for(const is in Mn)typeof Fn[is]!="object"||Fn[is]===null||Array.isArray(Fn[is])?Mn[is]!==void 0&&(rs[is]=Mn[is]):rs[is]=t(Fn[is],Mn[is]);return rs}const e={width:800,height:500,interval:"1D",timezone:"Etc/UTC",container:"",library_path:"",locale:"en",widgetbar:{details:!1,watchlist:!1,news:!1,datawindow:!1,watchlist_settings:{default_symbols:[]}},overrides:{"mainSeriesProperties.showCountdown":!1},studies_overrides:{},trading_customization:{position:{},order:{}},brokerConfig:{configFlags:{}},fullscreen:!1,autosize:!1,disabled_features:[],enabled_features:[],debug:!1,logo:{},time_frames:[{text:"5y",resolution:"1W"},{text:"1y",resolution:"1W"},{text:"6m",resolution:"120"},{text:"3m",resolution:"60"},{text:"1m",resolution:"30"},{text:"5d",resolution:"5"},{text:"1d",resolution:"1"}],client_id:"0",user_id:"0",charts_storage_api_version:"1.0",favorites:{intervals:[],chartTypes:[],indicators:[],drawingTools:[]}},n=JSON.parse('[{"iso":"ar","dir":"rtl","language":"ar"},{"iso":"pt","dir":"ltr","language":"pt"},{"iso":"ca","dir":"ltr","language":"ca_ES"},{"iso":"cs","dir":"ltr","language":"cs"},{"iso":"de","dir":"ltr","language":"de"},{"iso":"en","dir":"ltr","language":"en"},{"iso":"es","dir":"ltr","language":"es"},{"iso":"fa","dir":"rtl","language":"fa"},{"iso":"fr","dir":"ltr","language":"fr"},{"iso":"he","dir":"rtl","language":"he_IL"},{"iso":"hu","dir":"ltr","language":"hu_HU"},{"iso":"id","dir":"ltr","language":"id_ID"},{"iso":"en","dir":"ltr","language":"en"},{"iso":"it","dir":"ltr","language":"it"},{"iso":"ja","dir":"ltr","language":"ja"},{"iso":"ko","dir":"ltr","language":"ko"},{"iso":"ms","dir":"ltr","language":"ms_MY"},{"iso":"pl","dir":"ltr","language":"pl"},{"iso":"ru","dir":"ltr","language":"ru"},{"iso":"sv","dir":"ltr","language":"sv"},{"iso":"th","dir":"ltr","language":"th"},{"iso":"tr","dir":"ltr","language":"tr"},{"iso":"vi","dir":"ltr","language":"vi"},{"iso":"zh-Hans","dir":"ltr","language":"zh"},{"iso":"zh-Hant","dir":"ltr","language":"zh_TW"},{"iso":"el","dir":"ltr","language":"el"},{"iso":"nl","dir":"ltr","language":"nl_NL"},{"iso":"ro","dir":"ltr","language":"ro"}]');let i=!1;function o(){return"CL v27.006 (internal id c7d57a22 @ 2024-05-21T16:14:30.134Z)"}const s=class{constructor(Fn){var Mn,rs;if(this._id=`tradingview_${(1048576*(1+Math.random())|0).toString(16).substring(1)}`,this._ready=!1,this._readyHandlers=[],this._onWindowResize=this._autoResizeChart.bind(this),!Fn.datafeed)throw new Error("Datafeed is not defined");!((Mn=Fn.overrides)===null||Mn===void 0)&&Mn["mainSeriesProperties.priceAxisProperties.lockScale"]&&(console.warn("mainSeriesProperties.priceAxisProperties.lockScale can not be set to true within the widget constructor"),delete Fn.overrides["mainSeriesProperties.priceAxisProperties.lockScale"]),this._options=t(e,Fn),((rs=this._options.theme)!==null&&rs!==void 0?rs:"light").toLowerCase()==="dark"&&this._options.loading_screen===void 0&&(this._options.loading_screen={backgroundColor:"#131722"}),this._options.debug&&(i||(i=!0,console.log("Using CL v27.006 (internal id c7d57a22 @ 2024-05-21T16:14:30.134Z)"))),this._create()}setDebugMode(Fn){this._innerAPI().setDebugMode(Fn)}onChartReady(Fn){this._ready?Fn.call(this):this._readyHandlers.push(Fn)}headerReady(){return this._innerWindowLoaded.then(()=>this._innerWindow().headerReady())}onGrayedObjectClicked(Fn){this._doWhenInnerApiLoaded(Mn=>{Mn.onGrayedObjectClicked(Fn)})}onShortcut(Fn,Mn){this._doWhenInnerWindowLoaded(rs=>{rs.createShortcutAction(Fn,Mn)})}subscribe(Fn,Mn){this._doWhenInnerApiLoaded(rs=>{rs.subscribe(Fn,Mn)})}unsubscribe(Fn,Mn){this._doWhenInnerApiLoaded(rs=>{rs.unsubscribe(Fn,Mn)})}chart(Fn){return this._innerAPI().chart(Fn)}getLanguage(){return this._options.locale}setSymbol(Fn,Mn,rs){this._innerAPI().changeSymbol(Fn,Mn,rs)}remove(){window.removeEventListener("resize",this._onWindowResize),this._readyHandlers.splice(0,this._readyHandlers.length),delete window[this._id],this._iFrame.parentNode&&this._iFrame.parentNode.removeChild(this._iFrame)}closePopupsAndDialogs(){this._doWhenInnerApiLoaded(Fn=>{Fn.closePopupsAndDialogs()})}selectLineTool(Fn,Mn){this._innerAPI().selectLineTool(Fn,Mn)}selectedLineTool(){return this._innerAPI().selectedLineTool()}save(Fn,Mn){this._innerAPI().saveChart(Fn,Mn)}load(Fn,Mn){this._innerAPI().loadChart({json:Fn,extendedData:Mn})}getSavedCharts(Fn){this._innerAPI().getSavedCharts(Fn)}loadChartFromServer(Fn){this._innerAPI().loadChartFromServer(Fn)}saveChartToServer(Fn,Mn,rs){this._innerAPI().saveChartToServer(Fn,Mn,rs)}removeChartFromServer(Fn,Mn){this._innerAPI().removeChartFromServer(Fn,Mn)}onContextMenu(Fn){this._doWhenInnerApiLoaded(Mn=>{Mn.onContextMenu(Fn)})}createButton(Fn){return this._innerWindow().createButton(Fn)}createDropdown(Fn){return this._innerWindow().createDropdown(Fn)}showNoticeDialog(Fn){this._doWhenInnerApiLoaded(Mn=>{Mn.showNoticeDialog(Fn)})}showConfirmDialog(Fn){this._doWhenInnerApiLoaded(Mn=>{Mn.showConfirmDialog(Fn)})}showLoadChartDialog(){this._innerAPI().showLoadChartDialog()}showSaveAsChartDialog(){this._innerAPI().showSaveAsChartDialog()}symbolInterval(){return this._innerAPI().getSymbolInterval()}mainSeriesPriceFormatter(){return this._innerAPI().mainSeriesPriceFormatter()}getIntervals(){return this._innerAPI().getIntervals()}getStudiesList(){return this._innerAPI().getStudiesList()}getStudyInputs(Fn){return this._innerAPI().getStudyInputs(Fn)}getStudyStyles(Fn){return this._innerAPI().getStudyStyles(Fn)}addCustomCSSFile(Fn){this._innerWindow().addCustomCSSFile(Fn)}applyOverrides(Fn){this._options=t(this._options,{overrides:Fn}),this._doWhenInnerWindowLoaded(Mn=>{Mn.applyOverrides(Fn)})}applyStudiesOverrides(Fn){this._doWhenInnerWindowLoaded(Mn=>{Mn.applyStudiesOverrides(Fn)})}watchList(){return this._innerAPI().watchlist()}news(){return this._innerAPI().news()}widgetbar(){return this._innerAPI().widgetbar()}activeChart(){return this._innerAPI().activeChart()}activeChartIndex(){return this._innerAPI().activeChartIndex()}setActiveChart(Fn){return this._innerAPI().setActiveChart(Fn)}chartsCount(){return this._innerAPI().chartsCount()}layout(){return this._innerAPI().layout()}setLayout(Fn){this._innerAPI().setLayout(Fn)}layoutName(){return this._innerAPI().layoutName()}resetLayoutSizes(Fn){this._innerAPI().resetLayoutSizes(Fn)}changeTheme(Fn,Mn){return this._innerWindow().changeTheme(Fn,Mn)}getTheme(){return this._innerWindow().getTheme()}takeScreenshot(){this._doWhenInnerApiLoaded(Fn=>{Fn.takeScreenshot()})}lockAllDrawingTools(){return this._innerAPI().lockAllDrawingTools()}hideAllDrawingTools(){return this._innerAPI().hideAllDrawingTools()}drawOnAllChartsEnabled(){return this._innerAPI().drawOnAllChartsEnabled()}drawOnAllCharts(Fn){this._innerAPI().drawOnAllCharts(Fn)}magnetEnabled(){return this._innerAPI().magnetEnabled()}magnetMode(){return this._innerAPI().magnetMode()}undoRedoState(){return this._innerAPI().undoRedoState()}setIntervalLinkingEnabled(Fn){this._innerAPI().setIntervalLinkingEnabled(Fn)}setDateRangeLinkingEnabled(Fn){this._innerAPI().setDateRangeLinkingEnabled(Fn)}setTimeFrame(Fn){this._innerAPI().setTimeFrame(Fn)}symbolSync(){return this._innerAPI().symbolSync()}intervalSync(){return this._innerAPI().intervalSync()}crosshairSync(){return this._innerAPI().crosshairSync()}timeSync(){return this._innerAPI().timeSync()}dateRangeSync(){return this._innerAPI().dateRangeSync()}setFeatureEnabled(Fn,Mn){this._innerAPI().setFeatureEnabled(Fn,Mn)}getAllFeatures(){return this._innerWindow().getAllFeatures()}clearUndoHistory(){return this._innerAPI().clearUndoHistory()}undo(){return this._innerAPI().undo()}redo(){return this._innerAPI().redo()}startFullscreen(){this._innerAPI().startFullscreen()}exitFullscreen(){this._innerAPI().exitFullscreen()}takeClientScreenshot(Fn){return this._innerAPI().takeClientScreenshot(Fn)}navigationButtonsVisibility(){return this._innerWindow().getNavigationButtonsVisibility()}paneButtonsVisibility(){return this._innerWindow().getPaneButtonsVisibility()}dateFormat(){return this._innerWindow().getDateFormat()}timeHoursFormat(){return this._innerWindow().getTimeHoursFormat()}currencyAndUnitVisibility(){return this._innerWindow().getCurrencyAndUnitVisibility()}supportedChartTypes(){return this._innerAPI().supportedChartTypes()}watermark(){return this._innerAPI().watermark()}customSymbolStatus(){return this._innerWindow().customSymbolStatus()}setCSSCustomProperty(Fn,Mn){if(Fn.startsWith("--")===!1)throw new Error("customPropertyName should begin with a double hyphen");this._innerWindow().document.body.style.setProperty(Fn,Mn)}getCSSCustomPropertyValue(Fn){if(Fn.startsWith("--")===!1)throw new Error("customPropertyName should begin with a double hyphen");const Mn=this._innerWindow().document.body,rs=Mn.style.getPropertyValue(Fn);return rs||getComputedStyle(Mn).getPropertyValue(Fn)}unloadUnusedCharts(){this._innerAPI().unloadUnusedCharts()}linking(){return this._innerAPI().linking}_innerAPI(){return this._innerWindow().tradingViewApi}_innerWindow(){return this._iFrame.contentWindow}_doWhenInnerWindowLoaded(Fn){this._ready?Fn(this._innerWindow()):this._innerWindowLoaded.then(()=>{Fn(this._innerWindow())})}_doWhenInnerApiLoaded(Fn){this._doWhenInnerWindowLoaded(Mn=>{Mn.doWhenApiIsReady(()=>Fn(this._innerAPI()))})}_autoResizeChart(){this._options.fullscreen&&(this._iFrame.style.height=window.innerHeight+"px",r&&setTimeout(()=>{this._iFrame.style.height=window.innerHeight+"px"},30))}_create(){var Fn,Mn;const rs=(Mn=(Fn=this._options.enabled_features)===null||Fn===void 0?void 0:Fn.includes("iframe_loading_compatibility_mode"))!==null&&Mn!==void 0&&Mn,[is,os]=this._render(!rs),as=this._options.container,us=typeof as=="string"?document.getElementById(as):as;if(us===null)throw new Error(`There is no such element - #${this._options.container}`);us.innerHTML=is,this._iFrame=us.querySelector(`#${this._id}`);const ds=this._iFrame;this._innerWindowLoaded=new Promise(hs=>{const ps=()=>{ds.removeEventListener("load",ps,!1),hs()};ds.addEventListener("load",ps,!1)}),rs&&(ds.contentWindow?(ds.contentWindow.document.open(),ds.contentWindow.document.write(os),ds.contentWindow.document.close()):console.warn("Unable to locate contentWindow for the created iframe. Please try disabling the `iframe_loading_compatibility_mode` featureset.")),(this._options.autosize||this._options.fullscreen)&&(ds.style.width="100%",this._options.fullscreen||(ds.style.height="100%")),window.addEventListener("resize",this._onWindowResize),this._onWindowResize(),this._innerWindowLoaded.then(()=>{try{this._innerWindow().widgetReady(()=>{this._ready=!0;for(const hs of this._readyHandlers)try{hs.call(this)}catch(ps){console.error(ps)}this._innerWindow().initializationFinished()})}catch(hs){if(hs instanceof Error&&/widgetReady is not a function/.test(hs.message))throw new Error(`There was an error when loading the library. Usually this error means the library failed to load its static files. Check that the library files are available at ${window.location.host}/${this._options.library_path||""} or correct the library_path option.`)}})}_render(Fn){const Mn=window;if(Mn[this._id]={datafeed:this._options.datafeed,customFormatters:this._options.custom_formatters,brokerFactory:this._options.broker_factory,overrides:this._options.overrides,studiesOverrides:this._options.studies_overrides,tradingCustomization:this._options.trading_customization,disabledFeatures:this._options.disabled_features,enabledFeatures:this._options.enabled_features,brokerConfig:this._options.broker_config||this._options.brokerConfig,restConfig:this._options.restConfig,favorites:this._options.favorites,logo:this._options.logo,numeric_formatting:this._options.numeric_formatting,rss_news_feed:this._options.rss_news_feed,rss_news_title:this._options.rss_news_title,newsProvider:this._options.news_provider,loadLastChart:this._options.load_last_chart,saveLoadAdapter:this._options.save_load_adapter,loading_screen:this._options.loading_screen,settingsAdapter:this._options.settings_adapter,getCustomIndicators:this._options.custom_indicators_getter,additionalSymbolInfoFields:this._options.additional_symbol_info_fields,headerWidgetButtonsMode:this._options.header_widget_buttons_mode,customTranslateFunction:this._options.custom_translate_function,symbolSearchComplete:this._options.symbol_search_complete,contextMenu:this._options.context_menu,settingsOverrides:this._options.settings_overrides,timeframe:this._options.timeframe,customTimezones:this._options.custom_timezones,customChartDescriptionFunction:this._options.custom_chart_description_function},this._options.saved_data)Mn[this._id].chartContent={json:this._options.saved_data},this._options.saved_data_meta_info&&(Mn[this._id].chartContentExtendedData=this._options.saved_data_meta_info);else if(!this._options.load_last_chart&&!this._options.symbol)throw new Error("Symbol is not defined: either 'symbol' or 'load_last_chart' option must be set");if(this._options.library_path&&!this._options.library_path.endsWith("/")&&console.warn("library_path option should contain a trailing forward slash"),this._options.locale){const as=encodeURIComponent(this._options.locale);n.findIndex(us=>us.language===as)>=0||(console.warn("locale isn't supported. Using default of `en`."),this._options.locale="en")}const rs=function(as,us){var ds;const hs=new URL(`${as||""}`,location.href).href,ps=JSON.parse('["bundles/runtime.1f6691a05496db116913.js","bundles/__LANG__.4716.e4ac74dfc9ec5374b00c.js","bundles/6150.bda60280b05cea478076.css","bundles/5142.2c34c8656148cc5203b7.js","bundles/library.ed30e653462ab0610aff.js"]'),io=encodeURIComponent(us),fo=(ds=n.find(Lo=>Lo.language===io))!==null&&ds!==void 0?ds:{iso:"en",dir:"ltr"},mo=`lang="${fo.iso}" dir="${fo.dir}"`;return`<!DOCTYPE html><html ${($o={bundles:`
${function(Lo,Go,Yo){if(Lo===void 0)return"";const Wo=[],Jo=[];for(const xl of Lo)xl.endsWith(".js")?Wo.push(`<script defer crossorigin="anonymous" src="${xl.replace("__LANG__",Yo)}"><\/script>`):xl.endsWith(".css")&&Jo.push(`<link type="text/css" href="${Go?xl.replace(/\.css$/i,".rtl.css"):xl}" rel="stylesheet"/>`);return[...Wo,...Jo].join(`
`)}(ps,fo.dir==="rtl",io)}
`,localeLanguage:io,htmlAttrs:mo,libraryPath:hs}).htmlAttrs}><head><base href="${$o.libraryPath}"><meta charset="utf-8"><script>window===window.parent&&(location.href="about:blank")<\/script> ${$o.bundles} </head><body class="chart-page unselectable on-widget"><div class="loading-indicator" id="loading-indicator"></div><script>var JSServer={},__initialEnabledFeaturesets=["charting_library"]<\/script><script>(function() {
		window.urlParams = (function () {
			var match,
				pl	 = /\\+/g,  // Regex for replacing addition symbol with a space
				search = /([^&=]+)=?([^&]*)/g,
				decode = function (s) { return decodeURIComponent(s.replace(pl, ' ')).replace(/<\\/?[^>]+(>|$)/g, ''); },
				query = function() {
					// We don't use hash on the url because: safari 13 throws an error if you attempt this
					// on a blob, and safari 14 will strip hash from blob urls.
					if (frameElement && frameElement.dataset.widgetOptions) {
						return frameElement.dataset.widgetOptions;
					} else {
						throw "Unexpected use of this page";
					}
				}(),
				result = {};

			while (match = search.exec(query)) {
				result[decode(match[1])] = decode(match[2]);
			}

			var additionalSettingsObject = window.parent[result.uid];

			var customObjectNames = ['datafeed', 'customFormatters', 'brokerFactory', 'save_load_adapter', 'customTranslateFunction', 'contextMenu'];

			for (var p in additionalSettingsObject) {
				if (customObjectNames.indexOf(p) === -1) {
					result[p] = JSON.stringify(additionalSettingsObject[p]);
				}
			}

			return result;
		})();

		window.locale = urlParams.locale;
		window.language = urlParams.locale; // a very big attention needed here
		window.customTranslateFunction = window.parent[urlParams.uid].customTranslateFunction;
		window.customChartDescriptionFunction = window.parent[urlParams.uid].customChartDescriptionFunction;

		window.addCustomCSSFile = function(href) {
			var link = document.createElement('link');
			link.setAttribute('type', 'text/css');
			link.setAttribute('rel', 'stylesheet');
			link.setAttribute('href', href);
			link.setAttribute('cross-origin', 'anonymous');

			window.loadedCustomCss = new Promise((resolve) => {
				link.onload = resolve;
				link.onerror = resolve;
			});
			document.body.appendChild(link);
		};

		window.loadedCustomCss = Promise.resolve();
		if (!!urlParams.customCSS) {
			window.addCustomCSSFile(urlParams.customCSS);
		}

		var loadingScreenParams = {};

		if (typeof urlParams.loading_screen === 'string') {
			try {
				loadingScreenParams = JSON.parse(urlParams.loading_screen);
			} catch(e) {}
		}

		var loadingIndicatorElement = document.getElementById('loading-indicator');

		if (loadingScreenParams.backgroundColor) {
			loadingIndicatorElement.style = 'background-color: ' + loadingScreenParams.backgroundColor;
		}

		!function(){"use strict";var t,e=new WeakMap;!function(t){t[t.Element=1]="Element",t[t.Document=9]="Document"}(t||(t={}));var n={mini:"xsmall",xxsmall:"xxsmall",xsmall:"xsmall",small:"small",medium:"medium",large:"large"};var s,i,o,r,l,c=(void 0===l&&(l=""),s='<div class="tv-spinner '.concat(l,'" role="progressbar"></div>'),o=function(n,s){var i,o;return i=null==s?document.documentElement:s.nodeType===t.Document?s.documentElement:s,e&&(o=e.get(i)),o||((o=i.ownerDocument.createRange()).selectNodeContents(i),e&&e.set(i,o)),o.createContextualFragment(n)}(s,i),null!==(r=o.firstElementChild)&&o.removeChild(r),r),a=function(){function t(t){this._shown=!1,this._el=c.cloneNode(!0),this.setSize(n[t||"large"])}return t.prototype.spin=function(t){return this._el.classList.add("tv-spinner--shown"),void 0===this._container&&(this._container=t,void 0!==t&&t.appendChild(this._el)),this._shown=!0,this},t.prototype.stop=function(t){return t&&void 0!==this._container&&this._container.removeChild(this._el),this._el&&this._el.classList.remove("tv-spinner--shown"),this._shown=!1,this},t.prototype.setStyle=function(t){var e=this;return Object.keys(t).forEach((function(n){var s=t[n];void 0!==s&&e._el.style.setProperty(n,s)})),this},t.prototype.style=function(){return this._el.style},t.prototype.setSize=function(t){var e=void 0!==t?"tv-spinner--size_".concat(t):"";return this._el.className="tv-spinner ".concat(e," ").concat(this._shown?"tv-spinner--shown":""),this},t.prototype.getEl=function(){return this._el},t.prototype.destroy=function(){this.stop(),delete this._el,delete this._container},t}();window.Spinner=a}();


		var spinnerColor = (loadingScreenParams.foregroundColor) ? loadingScreenParams.foregroundColor : undefined;

		var loadingSpinner = new Spinner('large').setStyle({
			'--tv-spinner-color': spinnerColor,
			zIndex: String(2e9),
		});
		loadingSpinner.getEl().classList.add('spinner');
		loadingSpinner.spin(loadingIndicatorElement);
	})();<\/script></body></html>`;var $o}(this._options.library_path||"",this._options.locale);let is=new URL("about:blank");if(Fn){const as=new Blob([rs],{type:"text/html"}),us=URL.createObjectURL(as);is=new URL(us)}const os="symbol="+encodeURIComponent(this._options.symbol||"")+"&interval="+encodeURIComponent(this._options.interval)+(this._options.toolbar_bg?"&toolbarbg="+encodeURIComponent(this._options.toolbar_bg.replace("#","")):"")+(this._options.studies_access?"&studiesAccess="+encodeURIComponent(JSON.stringify(this._options.studies_access)):"")+"&widgetbar="+encodeURIComponent(JSON.stringify(this._options.widgetbar))+(this._options.drawings_access?"&drawingsAccess="+encodeURIComponent(JSON.stringify(this._options.drawings_access)):"")+"&timeFrames="+encodeURIComponent(JSON.stringify(this._options.time_frames))+"&locale="+encodeURIComponent(this._options.locale)+"&uid="+encodeURIComponent(this._id)+"&clientId="+encodeURIComponent(String(this._options.client_id))+"&userId="+encodeURIComponent(String(this._options.user_id))+(this._options.charts_storage_url?"&chartsStorageUrl="+encodeURIComponent(this._options.charts_storage_url):"")+(this._options.charts_storage_api_version?"&chartsStorageVer="+encodeURIComponent(this._options.charts_storage_api_version):"")+(this._options.custom_css_url?"&customCSS="+encodeURIComponent(this._options.custom_css_url):"")+(this._options.custom_font_family?"&customFontFamily="+encodeURIComponent(this._options.custom_font_family):"")+(this._options.auto_save_delay?"&autoSaveDelay="+encodeURIComponent(String(this._options.auto_save_delay)):"")+"&debug="+encodeURIComponent(String(this._options.debug))+(this._options.snapshot_url?"&snapshotUrl="+encodeURIComponent(this._options.snapshot_url):"")+(this._options.timezone?"&timezone="+encodeURIComponent(this._options.timezone):"")+(this._options.study_count_limit?"&studyCountLimit="+encodeURIComponent(String(this._options.study_count_limit)):"")+(this._options.symbol_search_request_delay?"&ssreqdelay="+encodeURIComponent(String(this._options.symbol_search_request_delay)):"")+(this._options.compare_symbols?"&compareSymbols="+encodeURIComponent(JSON.stringify(this._options.compare_symbols)):"")+(this._options.theme?"&theme="+encodeURIComponent(String(this._options.theme)):"")+(this._options.header_widget_buttons_mode?"&header_widget_buttons_mode="+encodeURIComponent(String(this._options.header_widget_buttons_mode)):"")+(this._options.time_scale?"&time_scale="+encodeURIComponent(JSON.stringify(this._options.time_scale)):"");return[`<iframe
		id="${this._id}" name="${this._id}" src="${is.href}" data-widget-options="${os}"
		${this._options.autosize||this._options.fullscreen?"":`width="${this._options.width}" height="${this._options.height}"`} title="Financial Chart" frameborder="0" allowTransparency="true" scrolling="no" allowfullscreen style="display:block;">
	</iframe>`,rs]}};typeof window<"u"&&(window.TradingView=window.TradingView||{},window.TradingView.version=o);const r=!(typeof window>"u"||!window.navigator||!window.navigator.userAgent)&&window.navigator.userAgent.includes("CriOS"),streamingUrl="https://benchmarks.pyth.network/v1/shims/tradingview/streaming",channelToSubscription=new Map;let isStreaming=!1;function handleStreamingData(Fn){const{id:Mn,p:rs,t:is}=Fn,os=rs,as=is*1e3,us=Mn,ds=channelToSubscription.get(us);if(!ds)return;const hs=ds.lastDailyBar,ps=getNextDailyBarTime(hs.time);let io;as>=ps?io={time:ps,open:os,high:os,low:os,close:os}:io={...hs,high:Math.max(hs.high,os),low:Math.min(hs.low,os),close:os},ds.lastDailyBar=io,ds.handlers.forEach(fo=>fo.callback(io)),channelToSubscription.set(us,ds)}function startStreaming(Fn=3,Mn=3e3){if(isStreaming)return;isStreaming=!0,fetch(streamingUrl).then(is=>{const os=is.body.getReader();function as(){os.read().then(({value:us,done:ds})=>{if(ds){isStreaming=!1;return}new TextDecoder().decode(us).split(`
`).forEach(ps=>{const io=ps.trim();if(io)try{var fo=JSON.parse(io);handleStreamingData(fo)}catch{}}),as()}).catch(us=>{isStreaming=!1,rs(Fn,Mn)})}as()}).catch(is=>{isStreaming=!1,rs(Fn,Mn)});function rs(is,os){is>0&&setTimeout(()=>{startStreaming(is-1,os)},os)}}function getNextDailyBarTime(Fn){const Mn=new Date(Fn*1e3);return Mn.setDate(Mn.getDate()+1),Mn.getTime()/1e3}function subscribeOnStream(Fn,Mn,rs,is,os,as){const us=Fn.ticker,ds={id:is,callback:rs};let hs=channelToSubscription.get(us);hs?hs.handlers.push(ds):hs={subscriberUID:is,resolution:Mn,lastDailyBar:as,handlers:[ds]},channelToSubscription.set(us,hs),startStreaming()}function unsubscribeFromStream(Fn){for(const Mn of channelToSubscription.keys()){const rs=channelToSubscription.get(Mn),is=rs.handlers.findIndex(os=>os.id===Fn);if(is!==-1){rs.handlers.splice(is,1),rs.handlers.length===0?channelToSubscription.delete(Mn):channelToSubscription.set(Mn,rs);break}}}const API_ENDPOINT="https://benchmarks.pyth.network/v1/shims/tradingview",lastBarsCache=new Map,datafeed={onReady:Fn=>{fetch(`${API_ENDPOINT}/config`).then(Mn=>{Mn.json().then(rs=>{setTimeout(()=>Fn(rs))})})},searchSymbols:(Fn,Mn,rs,is)=>{fetch(`${API_ENDPOINT}/search?query=${Fn}`).then(os=>{os.json().then(as=>{is(as)})})},resolveSymbol:(Fn,Mn,rs)=>{fetch(`${API_ENDPOINT}/symbols?symbol=${Fn}`).then(is=>{is.json().then(os=>{Mn(os)}).catch(os=>{rs("Cannot resolve symbol")})})},getBars:(Fn,Mn,rs,is,os)=>{const{from:as,to:us,firstDataRequest:ds}=rs,hs=365*24*60*60;let ps=[],io=as,fo;for(;io<us;){fo=Math.min(us,io+hs);const mo=`${API_ENDPOINT}/history?symbol=${Fn.ticker}&from=${io}&to=${fo}&resolution=${Mn}`;ps.push(fetch(mo).then(Ao=>Ao.json())),io=fo}Promise.all(ps).then(mo=>{const Ao=[];mo.forEach($o=>{$o.t.length>0&&$o.t.forEach((Lo,Go)=>{Ao.push({time:Lo*1e3,low:$o.l[Go],high:$o.h[Go],open:$o.o[Go],close:$o.c[Go]})})}),ds&&Ao.length>0&&lastBarsCache.set(Fn.ticker,{...Ao[Ao.length-1]}),is(Ao,{noData:Ao.length===0})}).catch(mo=>{os(mo)})},subscribeBars:(Fn,Mn,rs,is,os)=>{subscribeOnStream(Fn,Mn,rs,is,os,lastBarsCache.get(Fn.ticker))},unsubscribeBars:Fn=>{unsubscribeFromStream(Fn)}},TVChartContainer=()=>{const Fn=reactExports.useRef(),{selectedCrypto:Mn,isDarkMode:rs,timing:is}=useStore(),os=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,us={symbol:`${Mn}USD`,interval:"5",datafeedUrl:"https://benchmarks.pyth.network/v1/shims/tradingview/streaming",libraryPath:"/charting_library/",chartsStorageUrl:"https://saveload.tradingview.com",chartsStorageApiVersion:"1.1",clientId:"tradingview.com",userId:"public_user_id",fullscreen:!1,autosize:!0};return reactExports.useEffect(()=>{const ds={symbol:us.symbol,datafeed,interval:us.interval,container:Fn.current,library_path:us.libraryPath,toolbar_bg:us.toolbar_bg,locale:"en",theme:rs?"light":"dark",timezone:os(),disabled_features:["use_localstorage_for_settings"],enabled_features:["study_templates"],charts_storage_url:us.chartsStorageUrl,charts_storage_api_version:us.chartsStorageApiVersion,client_id:us.clientId,user_id:us.userId,fullscreen:us.fullscreen,autosize:us.autosize,studies_overrides:us.studiesOverrides,custom_css_url:"../custom_tradingview.css",overrides:{"paneProperties.background":rs?"white":"#17181A","paneProperties.backgroundType":"solid"},custom_formatters:{priceFormatterFactory:ps=>{const io=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:TOKEN_PRICE_USE_DECIMALS[Mn]});return{format:fo=>io.format(fo)}}}},hs=new s(ds);return hs.onChartReady(()=>{hs.activeChart().createMultipointShape([{price:is.breakEvenPrice}],{text:"Breakeven Price",shape:"horizontal_line",lock:!0,disableSelection:!0,disableSave:!0,disableUndo:!0,overrides:{bold:!0,fontsize:12,linecolor:"#FF0000",linestyle:0,linewidth:1,showLabel:!0,textcolor:"#FF0000",horzLabelsAlign:"right"}})}),()=>{hs.remove()}},[Mn,rs,is.breakEvenPrice]),jsxRuntimeExports.jsx("div",{className:"tradingview-widget-container",children:jsxRuntimeExports.jsx("div",{ref:Fn,className:"TVChartContainer h-[30rem] sxl:h-[23rem] rounded-b-[0.5rem] "})})},CandlestickChart=({id:Fn,ref10:Mn})=>{const{isDarkMode:rs,progressPercent:is,setIsItLongSwitchChart:os,timing:as}=useStore();return reactExports.useEffect(()=>{const us=localStorage.getItem("isItLongSwitchChart");us!==null&&os(us==="true")},[]),jsxRuntimeExports.jsxs("div",{className:"w-full h-full flex flex-col rounded-b-[0.5rem] overflow-hidden",children:[jsxRuntimeExports.jsxs("div",{className:`${rs?"text-[#0C0C0D] border-t-[#E3E8EF] ":"text-[white] border-t-[#1e1f22]  "} text-sm px-4 py-2 h-auto w-full border-t flex justify-between gap-2 flex-col items-center`,id:"element-id-for-guide-5",children:[jsxRuntimeExports.jsx(LinearProgressBar,{Percentage:is}),jsxRuntimeExports.jsx("div",{className:"flex justify-start flex-row items-center rounded-2xl w-full h-2"}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between flex-row items-center w-full",ref:Mn,children:[jsxRuntimeExports.jsx("div",{children:isNaN(Number(as.lastSettlementTime))?"00:00:00":formatTimestamp(Number(as.lastSettlementTime))}),jsxRuntimeExports.jsx("div",{className:"font-bold",children:as?jsxRuntimeExports.jsx(RunningClock,{startTime:Number(as.lastSettlementTime),endTime:Number(as.nextSettlementTime)}):"00:00:00"}),jsxRuntimeExports.jsx("div",{children:isNaN(Number(as.nextSettlementTime))?"00:00:00":formatTimestamp(Number(as.nextSettlementTime))})]})]}),jsxRuntimeExports.jsx("div",{style:{width:"100%"},className:"cursor-default relative mt-2",children:jsxRuntimeExports.jsx(TVChartContainer,{})})]})},alertTriangeOrange="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.9998%209.49999V13.5M11.9998%2017.5H12.0098M10.6151%204.39171L2.39019%2018.5983C1.93398%2019.3863%201.70588%2019.7803%201.73959%2020.1037C1.769%2020.3857%201.91677%2020.642%202.14613%2020.8088C2.40908%2021%202.86435%2021%203.77487%2021H20.2246C21.1352%2021%2021.5904%2021%2021.8534%2020.8088C22.0827%2020.642%2022.2305%2020.3857%2022.2599%2020.1037C22.2936%2019.7803%2022.0655%2019.3863%2021.6093%2018.5983L13.3844%204.39171C12.9299%203.60654%2012.7026%203.21396%2012.4061%203.08211C12.1474%202.9671%2011.8521%202.9671%2011.5935%203.08211C11.2969%203.21396%2011.0696%203.60655%2010.6151%204.39171Z'%20stroke='%23F79009'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ConnectWallet=()=>{const{t:Fn}=useTranslation(),{open:Mn}=useAppKit(),{connect:rs,connectors:is}=useConnect(),{connector:os}=useAccount(),{disconnect:as}=useDisconnect(),[us,ds]=reactExports.useState(0),[hs,ps]=reactExports.useState(!1),[io,fo]=reactExports.useState([]),mo=xl=>{ds(xl)},{isDarkMode:Ao,updateIsWalletConnectVisible:$o,isSelectedChain:Lo}=useStore(),Go=`flex xxl:w-full bxl:w-full xl:w-full sxl:w-full lg:w-full md:w-full sm:w-full max-sm:w-[21rem] h-12 cursor-pointer transition-all ease-in-out duration-500 ${Ao?"bg-[#eff7f8]":"bg-gradient-to-r from-[#f5fffa0f] to-[#F5F7FA00] border-b-2 border-b-[#313337]"}`,Yo=` w-full xxl:h-[60%] bxl:h-[60%] xl:h-[60%] sxl:h-[50%] lg:h-[50%] md:h-[50%] sm:h-[50%] xd:h-[50%] bg-${Ao?"bg-[#0f1012]":"gradient-to-r from-[#f5fffa0f] to-[#F5F7FA00] rounded-b-[1rem] "}   `,Wo=async(xl,_l)=>{await rs({connector:_l}),$o(!1)},Jo=()=>{$o(!1)};return reactExports.useEffect(()=>{(()=>{const _l=navigator.userAgent.toLowerCase(),Tl=navigator.vendor.toLowerCase(),Sl=/safari/.test(_l)&&/apple computer/.test(Tl)&&!/chrome/.test(_l)&&!/crios/.test(_l)&&!/fxios/.test(_l)&&!/chromium/.test(_l);ps(Sl)})()},[]),reactExports.useEffect(()=>{if(is){const _l=is.filter(Tl=>Tl.name==="MetaMask"||Tl.name==="WalletConnect").filter((Tl,Sl,$l)=>$l.findIndex(Pl=>Pl.name===Tl.name)===Sl);fo(_l)}},[is]),jsxRuntimeExports.jsxs("div",{className:"fixed z-[4] gap-4 inset-0 h-full w-full bg-[rgba(0,0,0,0.20)] backdrop-blur-[54px] flex flex-col justify-center  items-center",children:[hs?jsxRuntimeExports.jsxs("div",{className:`${Ao?"text-[#364152]":"text-[white]"} font-manrope font-extrabold text-sm xxl:w-[40%] bxl:w-[40%] xl:w-[40%] sxl:w-[40%] lg:w-[40%] md:w-[60%] sm:w-[95%] xd:w-[95%]  ${Ao?"bg-[#FFFFFF] border-[#DAECEF]":"bg-gradient-to-r from-[#f5fffa0f] to-[#F5F7FA00] border-[#1e1f22] backdrop-blur-[54.36563491821289px]"} border-2 rounded-2xl flex flex-row justify-start items-center p-4 gap-4`,children:[jsxRuntimeExports.jsx("div",{className:` ${Ao?"border-[#DAECEF] bg-[#FCFDFE]":" border-[rgba(255,255,255,0.10)] bg-[#111213] "} p-[0.75rem] rounded-lg border  `,children:jsxRuntimeExports.jsx("img",{src:alertTriangeOrange,alt:""})}),"Safari browser not supported currently. Try another browser."]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),jsxRuntimeExports.jsx(c$9,{onClickAway:Jo,children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[40%] bxl:w-[40%] xl:w-[40%] sxl:w-[40%] lg:w-[40%] md:w-[60%] sm:w-[95%] xd:w-[95%]  ${Ao?"bg-[#FFFFFF] border-[#DAECEF]":"bg-gradient-to-r from-[#f5fffa0f] to-[#F5F7FA00] border-[#1e1f22] backdrop-blur-[54.36563491821289px]"} border-2 rounded-2xl`,children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-between p-[3%_5%] connect_bg_container  rounded-t-[1rem]  w-full",children:[jsxRuntimeExports.jsx("div",{className:`${Ao?"text-[#364152]":"text-white"} font-[500] text-[1.25rem]`,children:Fn("connect_wallet")}),jsxRuntimeExports.jsx("img",{src:Ao?CloseBlack:close,alt:"close",className:"cursor-pointer",onClick:()=>{$o(!1)}})]}),jsxRuntimeExports.jsx("div",{className:"flex justify-center  w-full  ",children:jsxRuntimeExports.jsxs(Tabs,{className:"w-full",children:[jsxRuntimeExports.jsx(TabList,{className:Go,children:jsxRuntimeExports.jsx(Tab,{className:`${Ao?"text-[#364152]":"text-white"} py-3 outline-none Tab_container px-8 ${us===0?"selected-tab":""}`,onClick:()=>mo(0),children:Fn("web3_wallets")})}),jsxRuntimeExports.jsx(TabPanel,{className:"w-full",children:jsxRuntimeExports.jsx("div",{className:Yo,children:jsxRuntimeExports.jsx("ul",{className:"flex flex-col overflow-y-scroll !h-[21.5rem]",children:io&&io.map((xl,_l)=>jsxRuntimeExports.jsxs("div",{className:` ${Ao?"text-black":"text-white"} flex items-center py-7 px-10 my-1 rounded-2xl cursor-pointer hover:bg-[#00000033]`,onClick:xl.name==="WalletConnect"?()=>{Jo(),Mn()}:()=>{Wo(Lo,xl)},children:[xl.name==="MetaMask"?jsxRuntimeExports.jsx("img",{className:"w-6 h-6",src:MetaMask,alt:"token"}):xl.name==="WalletConnect"?jsxRuntimeExports.jsx("img",{className:"w-6 h-6",src:walletConnect$1,alt:"token"}):jsxRuntimeExports.jsx("img",{className:"w-6 h-6",src:defaultFallback,alt:"token"}),jsxRuntimeExports.jsx("div",{className:"font-inter font-bold leading-5 pl-4",children:jsxRuntimeExports.jsx("div",{className:"text-lg ",children:xl.name})}),(os==null?void 0:os.id)===xl.id&&jsxRuntimeExports.jsx("div",{className:"flex-1 text-right text-greyText",onClick:Tl=>{Tl.stopPropagation(),as()},children:Fn("disconnect")})]},_l))})})})]})})]})})]})},instruction="data:image/svg+xml,%3csvg%20width='12'%20height='13'%20viewBox='0%200%2012%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%2012.5C7.5913%2012.5%209.11742%2011.8679%2010.2426%2010.7426C11.3679%209.61742%2012%208.0913%2012%206.5C12%204.9087%2011.3679%203.38258%2010.2426%202.25736C9.11742%201.13214%207.5913%200.5%206%200.5C4.4087%200.5%202.88258%201.13214%201.75736%202.25736C0.632141%203.38258%200%204.9087%200%206.5C0%208.0913%200.632141%209.61742%201.75736%2010.7426C2.88258%2011.8679%204.4087%2012.5%206%2012.5ZM5.0625%208.375H5.625V6.875H5.0625C4.75078%206.875%204.5%206.62422%204.5%206.3125C4.5%206.00078%204.75078%205.75%205.0625%205.75H6.1875C6.49922%205.75%206.75%206.00078%206.75%206.3125V8.375H6.9375C7.24922%208.375%207.5%208.62578%207.5%208.9375C7.5%209.24922%207.24922%209.5%206.9375%209.5H5.0625C4.75078%209.5%204.5%209.24922%204.5%208.9375C4.5%208.62578%204.75078%208.375%205.0625%208.375ZM6%203.5C6.19891%203.5%206.38968%203.57902%206.53033%203.71967C6.67098%203.86032%206.75%204.05109%206.75%204.25C6.75%204.44891%206.67098%204.63968%206.53033%204.78033C6.38968%204.92098%206.19891%205%206%205C5.80109%205%205.61032%204.92098%205.46967%204.78033C5.32902%204.63968%205.25%204.44891%205.25%204.25C5.25%204.05109%205.32902%203.86032%205.46967%203.71967C5.61032%203.57902%205.80109%203.5%206%203.5Z'%20fill='white'%20fill-opacity='0.8'/%3e%3c/svg%3e",instructiondark="data:image/svg+xml,%3csvg%20width='12'%20height='13'%20viewBox='0%200%2012%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_607_250)'%3e%3cpath%20d='M6%2012.5C7.5913%2012.5%209.11742%2011.8679%2010.2426%2010.7426C11.3679%209.61742%2012%208.0913%2012%206.5C12%204.9087%2011.3679%203.38258%2010.2426%202.25736C9.11742%201.13214%207.5913%200.5%206%200.5C4.4087%200.5%202.88258%201.13214%201.75736%202.25736C0.632141%203.38258%200%204.9087%200%206.5C0%208.0913%200.632141%209.61742%201.75736%2010.7426C2.88258%2011.8679%204.4087%2012.5%206%2012.5ZM5.0625%208.375H5.625V6.875H5.0625C4.75078%206.875%204.5%206.62422%204.5%206.3125C4.5%206.00078%204.75078%205.75%205.0625%205.75H6.1875C6.49922%205.75%206.75%206.00078%206.75%206.3125V8.375H6.9375C7.24922%208.375%207.5%208.62578%207.5%208.9375C7.5%209.24922%207.24922%209.5%206.9375%209.5H5.0625C4.75078%209.5%204.5%209.24922%204.5%208.9375C4.5%208.62578%204.75078%208.375%205.0625%208.375ZM6%203.5C6.19891%203.5%206.38968%203.57902%206.53033%203.71967C6.67098%203.86032%206.75%204.05109%206.75%204.25C6.75%204.44891%206.67098%204.63968%206.53033%204.78033C6.38968%204.92098%206.19891%205%206%205C5.80109%205%205.61032%204.92098%205.46967%204.78033C5.32902%204.63968%205.25%204.44891%205.25%204.25C5.25%204.05109%205.32902%203.86032%205.46967%203.71967C5.61032%203.57902%205.80109%203.5%206%203.5Z'%20fill='%23777879'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_607_250'%3e%3crect%20width='12'%20height='12'%20fill='%23777879'%20transform='translate(0%200.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function useDebounce(Fn,Mn){const[rs,is]=reactExports.useState(Fn);return reactExports.useEffect(()=>{const os=setTimeout(()=>{is(Fn)},Mn);return()=>{clearTimeout(os)}},[Fn,Mn]),rs}const WrongBlack="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.4081%203.41559C20.189%202.6347%2020.189%201.36655%2019.4081%200.585663C18.6272%20-0.195221%2017.359%20-0.195221%2016.5782%200.585663L10%207.17008L3.41559%200.59191C2.6347%20-0.188974%201.36655%20-0.188974%200.585663%200.59191C-0.195221%201.37279%20-0.195221%202.64095%200.585663%203.42183L7.17008%2010L0.59191%2016.5844C-0.188974%2017.3653%20-0.188974%2018.6335%200.59191%2019.4143C1.37279%2020.1952%202.64095%2020.1952%203.42183%2019.4143L10%2012.8299L16.5844%2019.4081C17.3653%2020.189%2018.6335%2020.189%2019.4143%2019.4081C20.1952%2018.6272%2020.1952%2017.359%2019.4143%2016.5782L12.8299%2010L19.4081%203.41559Z'%20fill='%231D1E20'/%3e%3c/svg%3e",alertTriangle="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='M7.99951%206.00003V8.6667M7.99951%2011.3334H8.00618M7.07639%202.59451L1.59313%2012.0656C1.289%2012.5909%201.13693%2012.8536%201.1594%2013.0692C1.17901%2013.2572%201.27752%2013.4281%201.43043%2013.5392C1.60573%2013.6667%201.90924%2013.6667%202.51625%2013.6667H13.4828C14.0898%2013.6667%2014.3933%2013.6667%2014.5686%2013.5392C14.7215%2013.4281%2014.82%2013.2572%2014.8396%2013.0692C14.8621%2012.8536%2014.71%2012.5909%2014.4059%2012.0656L8.92263%202.59451C8.61959%202.07107%208.46806%201.80935%208.27038%201.72145C8.09794%201.64477%207.90108%201.64477%207.72865%201.72145C7.53096%201.80935%207.37944%202.07107%207.07639%202.59451Z'%20stroke='%23D2D2D2'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",AlertTriangle="data:image/svg+xml,%3csvg%20width='12'%20height='13'%20viewBox='0%200%2012%2013'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.9989%205.00012V7.00012M5.9989%209.00012H6.0039M5.30656%202.44598L1.19412%209.54929C0.966015%209.94328%200.851963%2010.1403%200.86882%2010.302C0.883523%2010.443%200.957408%2010.5711%201.07209%2010.6545C1.20357%2010.7501%201.4312%2010.7501%201.88646%2010.7501H10.1113C10.5666%2010.7501%2010.7942%2010.7501%2010.9257%2010.6545C11.0404%2010.5711%2011.1143%2010.443%2011.129%2010.302C11.1458%2010.1403%2011.0318%209.94328%2010.8037%209.54929L6.69124%202.44598C6.46396%202.05339%206.35032%201.8571%206.20205%201.79118C6.07272%201.73367%205.92508%201.73367%205.79575%201.79118C5.64749%201.8571%205.53384%202.05339%205.30656%202.44598Z'%20stroke='%23D92D20'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",CalculatePopup=()=>{const[Fn,Mn]=reactExports.useState(""),[rs,is]=reactExports.useState(""),[os,as]=reactExports.useState(""),[us,ds]=reactExports.useState(0),[hs,ps]=reactExports.useState(""),[io,fo]=reactExports.useState(""),{t:mo}=useTranslation(),{isDarkMode:Ao,isCalculateVisible:$o,updateIsCalculateVisible:Lo,updateDashboardInputValue:Go,selectedTokenPrice:Yo,isSelectedChain:Wo,selectedCrypto:Jo,isMode:xl,timing:_l}=useStore();let Tl=useDebounce(Fn,1500),Sl=useDebounce(rs,1500),$l=useDebounce(os,1500);reactExports.useEffect(()=>{(async()=>{is("10"),as(xl===OPTIONS.CALL?"2":"-2")})()},[]),reactExports.useEffect(()=>{if(Tl!==Fn)return;(async()=>{if(Fn&&Number(Fn)!==0){const Ho=await calculateValue(Fn,_l,Yo);ps(Ho)}})()},[Tl,Fn]),reactExports.useEffect(()=>{if(Sl!==rs||$l!==os)return;(async()=>{if(rs&&Number(rs)!==0){const Ho=await calculateAmounttobeInvestedLong(rs,_l,os,Wo,xl);fo(Ho)}else fo("0")})()},[Sl,rs,$l,os]);const Pl=async jo=>{var Qo,El;let Ho=jo.target.value;if(/^[0-9\.]*$/gm.test(Ho)&&(Ho.match(/[\.,]/gm)&&Ho.match(/^[0-9]{0,9}(\.|,)?[0-9]{0,8}$/gm)||!Ho.match(/[\.,]/gm)&&Ho.match(/^[0-9]{0,9}$/gm)&&(!Ho.match(/\./gm)||((Qo=Ho.match(/\./gm))==null?void 0:Qo.length)<=1)&&(!Ho.match(/,/gm)||((El=Ho.match(/,/gm))==null?void 0:El.length)<=1))){const Xo=Ho.replace(/\.+/gm,".").replace(/,+/gm,",").replace(/^0+/gm,"0").replace(/^\./,"0.");is(Xo)}},Dl=async jo=>{var Qo,El;let Ho=jo.target.value;if(/^-?[0-9\.]*$/gm.test(Ho)&&(Ho.match(/[\.,]/gm)&&Ho.match(/^-?[0-9]{0,9}(\.|,)?[0-9]{0,8}$/gm)||!Ho.match(/[\.,]/gm)&&Ho.match(/^-?[0-9]{0,9}$/gm)&&(!Ho.match(/\./gm)||((Qo=Ho.match(/\./gm))==null?void 0:Qo.length)<=1)&&(!Ho.match(/,/gm)||((El=Ho.match(/,/gm))==null?void 0:El.length)<=1))){const Xo=Ho.replace(/\.+/gm,".").replace(/,+/gm,",").replace(/^0+/gm,"0").replace(/^\./,"0.");as(Xo)}},Ol=async jo=>{var Qo,El;let Ho=jo.target.value;if(/^[0-9\.]*$/gm.test(Ho)&&(Ho.match(/[\.,]/gm)&&Ho.match(/^[0-9]{0,9}(\.|,)?[0-9]{0,8}$/gm)||!Ho.match(/[\.,]/gm)&&Ho.match(/^[0-9]{0,9}$/gm)&&(!Ho.match(/\./gm)||((Qo=Ho.match(/\./gm))==null?void 0:Qo.length)<=1)&&(!Ho.match(/,/gm)||((El=Ho.match(/,/gm))==null?void 0:El.length)<=1))){const Xo=Ho.replace(/\.+/gm,".").replace(/,+/gm,",").replace(/^0+/gm,"0").replace(/^\./,"0.");Mn(Xo),ds(Number(Xo)*Number(Yo))}},Rl=jo=>{jo&&(Lo(!1),Go(jo))},Vo=()=>{Lo(!1)};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:$o?jsxRuntimeExports.jsx("div",{className:"fixed z-[4] inset-0 h-full w-full backdrop-blur-lg flex flex-row justify-center font-inter  items-start",children:jsxRuntimeExports.jsx(c$9,{onClickAway:Vo,children:jsxRuntimeExports.jsxs("div",{className:`${Ao?"bg-[rgba(252,253,254,0.70)]  border-[rgba(245,247,250,0.06)] backdrop-blur-[54.36563491821289px]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)] backdrop-blur-[54.36563491821289px]"} border-2 rounded-2xl xxl:!w-[560px] bxl:!w-[560px] xl:!w-[560px] sxl:!w-[560px] lg:!w-[560px] md:!w-full sm:!w-full xd:!w-full xxl:mt-[15%] bxl:mt-[10%] xl:mt-28 sxl:mt-1 lg:mt-5 md:mt-5 sm:mt-2 xd:mt-2`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-start py-5 rounded-t-[1rem] px-6 ${Ao?"bg-[#FCFDFE]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`font-inter text-xl font-bold ${Ao?" text-[#000000]":"text-[white]"}`,children:mo("calculate")}),jsxRuntimeExports.jsx("div",{onClick:()=>{Lo(!1)},className:"cursor-pointer  ",children:Ao?jsxRuntimeExports.jsx("img",{src:WrongBlack,alt:"WrongBlack"}):jsxRuntimeExports.jsx("img",{src:close,alt:"close"})})]}),jsxRuntimeExports.jsxs(Tabs,{children:[jsxRuntimeExports.jsx(TabList,{className:`${Ao?"bg-[#eff7f8] h-12 border-[#eff7f8]":"bg-[#0f1012] h-12 border-[#292a2d]"} w-full h-[42px] border-b flex justify-around cursor-pointer backdrop-blur-sm transition-all ease-in-out duration-500`,children:jsxRuntimeExports.jsxs(Tab,{className:`${Ao?"text-[#364152] social_web_login_light_calculate":"text-white social_web_login_calculate"} flex flex-col justify-center items-center gap-1 w-full outline-none`,children:["Earn from ",xl===OPTIONS.CALL?"rising":"falling"," markets"]})}),jsxRuntimeExports.jsxs(TabPanel,{className:`p-6 flex flex-col gap-2 w-full rounded-[0rem_0rem_1rem_1rem] ${Ao?"bg-transparent":"bg-[#1D1E20]"}`,children:[jsxRuntimeExports.jsx("div",{className:`text-sm font-normal flex flex-row justify-start items-center ${Ao?"text-[#1D1E20]":"text-[rgba(255,255,255,0.80)]"}`,children:"Amount to be Invested"}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center w-full",children:[jsxRuntimeExports.jsx("input",{id:"long-switch-token-amount",type:"text",placeholder:"0.00",min:"0",autoFocus:!0,autoComplete:"off",onWheel:jo=>jo.currentTarget.blur(),onKeyDown:jo=>["e","E","+","-"].includes(jo.key)&&jo.preventDefault(),onPaste:preventPasteNegativeNumber,value:rs,onChange:Pl,className:`text-right text-xl font-[500] w-full rounded-2xl outline-none px-6 py-4 border ${Ao?"text-[black] bg-[#F6FEFC] border-[#CFE7EA] placeholder:text-[black]":"text-[white] bg-[#111213] border-[rgba(255,255,255,0.10)]"}`}),jsxRuntimeExports.jsx("div",{className:`rounded-lg p-2 text-xs font-normal cursor-pointer ml-[-95%] ${Ao?"text-[black]":"text-[rgba(255,255,255,0.60)]"}`,children:"USDC"})]}),jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal flex flex-row justify-start items-center ${Ao?"text-[#1D1E20]":"text-[rgba(255,255,255,0.80)]"}`,children:["Expected Market Movement in next ",CHAIN_PARAMS_CONFIG[Wo].cycle_duration," minute cycle",jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:`Enter -1.5 if you expect ${Jo} price to fall by 1.5% in next cycle`,arrow:!1,children:jsxRuntimeExports.jsx("img",{src:Ao?instructiondark:instruction,alt:"/instruction",className:" pl-2"})})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center w-full",children:[jsxRuntimeExports.jsx("input",{id:"long-switch-token-amount",type:"text",placeholder:"0.00",min:"0",autoFocus:!0,autoComplete:"off",onWheel:jo=>jo.currentTarget.blur(),onKeyDown:jo=>["e","E","+"].includes(jo.key)&&jo.preventDefault(),value:os,onChange:Dl,className:`text-right text-xl font-[500] w-full rounded-2xl outline-none px-6 py-4 border ${Ao?"text-[black] bg-[#F6FEFC] border-[#CFE7EA] placeholder:text-[black]":"text-[white] bg-[#111213] border-[rgba(255,255,255,0.10)]"}`}),jsxRuntimeExports.jsx("div",{className:` rounded-lg p-2 text-xs font-normal cursor-pointer ml-[-95%] ${Ao?"text-[black]":"text-[rgba(255,255,255,0.60)]"}`,children:"%"})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center gap-2",children:[jsxRuntimeExports.jsx("img",{src:AlertTriangle,alt:""}),jsxRuntimeExports.jsx("div",{className:"text-[#D92D20] font-normal text-xs font-manrope",children:"To safeguard your funds, OPerps restricts market movements to ±2.5% per cycle."})]}),jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-between items-center w-full pt-1",children:jsxRuntimeExports.jsxs("div",{className:`${Ao?"text-[#1D1E20]":"text-[rgba(255,255,255,0.80)]"} w-[80%] text-sm font-normal flex flex-row justify-start items-center`,children:["Expected P&L",jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Expected profit or loss in $ based on your inputs, given the current market conditions",arrow:!1,children:jsxRuntimeExports.jsx("img",{src:Ao?instructiondark:instruction,alt:"/instruction",className:" pl-2"})})]})}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center w-full",children:[jsxRuntimeExports.jsx("input",{readOnly:!0,placeholder:"0.00",value:io,className:`text-right text-xl font-[500] bg-transparent border w-full rounded-2xl outline-none px-6 py-4 ${Ao?"text-[black] border-[#CFE7EA] placeholder:text-[black]":"text-[white] border-[rgba(255,255,255,0.10)]"}`}),jsxRuntimeExports.jsx("div",{className:`rounded-lg cursor-pointer ml-[-95%] p-2 text-xs font-normal ${Ao?"bg-[#C5E1E6] text-[black]":"bg-[#1D1E20] text-[rgba(255,255,255,0.60)]"}`,children:"USDC"})]}),jsxRuntimeExports.jsxs("div",{className:"pl-2 w-full flex flex-row justify-start items-center gap-4 font-manrope",children:[jsxRuntimeExports.jsx("img",{src:alertTriangle,alt:"alert"}),jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal flex flex-col justify-start items-start ${Ao?"text-[black]":"text-[#D2D2D2]"}`,children:[jsxRuntimeExports.jsx("div",{className:"text-[#777879] ",children:"Note:"}),jsxRuntimeExports.jsx("div",{children:"We are not considering any existing OPerps holdings in wallet"})]})]}),jsxRuntimeExports.jsx("div",{className:`${Ao?"buy-button-light ":"buy-button"}`,onClick:()=>{Rl(Number(rs).toFixed(2))},children:jsxRuntimeExports.jsx("div",{className:`cursor-pointer text-base font-bold text-center ${Ao?"buy-button-inner-light text-[#107569]":"buy-button-inner text-[#00f9a9]"}`,children:mo("apply")})})]}),jsxRuntimeExports.jsxs(TabPanel,{className:`${Ao?"bg-transparent":"bg-[#1D1E20]"} mt-[-3rem] p-6 flex flex-col gap-2 w-full rounded-[0rem_0rem_1rem_1rem]`,children:[jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal flex flex-row justify-start items-center ${Ao?"text-[#1D1E20]":"text-[rgba(255,255,255,0.80)]"}`,children:[mo("amount_to_be_hedged"),jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:`Please key in your ${Jo} holdings`,arrow:!1,children:jsxRuntimeExports.jsx("img",{src:Ao?instructiondark:instruction,alt:"/instruction",className:" pl-2"})})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center w-full",children:[jsxRuntimeExports.jsx("input",{id:"long-switch-token-amount",type:"text",placeholder:"0.00",min:"0",autoFocus:!0,autoComplete:"off",onWheel:jo=>jo.currentTarget.blur(),onKeyDown:jo=>["e","E","+","-"].includes(jo.key)&&jo.preventDefault(),onPaste:preventPasteNegativeNumber,value:Fn,onChange:Ol,className:`text-right text-xl font-[500] border w-full rounded-2xl outline-none px-6 py-4 ${Ao?"text-[black] bg-[#F6FEFC] border-[#CFE7EA] placeholder:text-[black]":"text-[white] bg-[#111213] border-[rgba(255,255,255,0.10)]"}`}),jsxRuntimeExports.jsx("div",{className:`rounded-lg p-2 text-xs font-normal cursor-pointer ml-[-95%] ${Ao?"text-[black]":"text-[rgba(255,255,255,0.60)]"}`,children:Jo})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-between items-center w-full pt-1",children:[jsxRuntimeExports.jsxs("div",{className:`${Ao?"text-[#1D1E20]":"text-[rgba(255,255,255,0.80)]"} w-[80%] text-sm font-normal flex flex-row justify-start items-center`,children:[mo("long_switch_token_to_buy"),jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:`LS tokens to buy to hedge your ${Jo} position`,arrow:!1,children:jsxRuntimeExports.jsx("img",{src:Ao?instructiondark:instruction,alt:"/instruction",className:" pl-2"})})]}),jsxRuntimeExports.jsxs("div",{className:`${Ao?"text-[black]":"text-[rgba(255,255,255,0.40)]"} flex flex-row justify-end items-end w-full px-1 w-[20%] text-sm font-normal`,children:[Number(us).toLocaleString("en-US")," USD"]})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center w-full",children:[jsxRuntimeExports.jsx("input",{readOnly:!0,placeholder:"0.00",value:Number(hs).toFixed(2),className:`text-right text-xl font-[500] bg-transparent border w-full rounded-2xl outline-none px-6 py-4 ${Ao?"text-[black] border-[#CFE7EA] placeholder:text-[black]":"text-[white] border-[rgba(255,255,255,0.10)]"}`}),jsxRuntimeExports.jsx("div",{className:`rounded-lg p-2 text-xs font-normal cursor-pointer ml-[-95%] ${Ao?"bg-[#C5E1E6] text-[black]":"bg-[#1D1E20] text-[rgba(255,255,255,0.60)]"}`,children:mo("ls")})]}),jsxRuntimeExports.jsxs("div",{className:"p-[32px] w-full flex flex-row justify-start items-center gap-4 font-manrope",children:[jsxRuntimeExports.jsx("img",{src:alertTriangle,alt:"alert"}),jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal flex flex-col justify-start items-start ${Ao?"text-[black]":"text-[#D2D2D2]"}`,children:[jsxRuntimeExports.jsx("div",{className:"text-[#777879] ",children:"Note:"}),jsxRuntimeExports.jsx("div",{children:"We are not considering any existing LS/SS holdings in wallet"})]})]}),jsxRuntimeExports.jsx("div",{className:`${Ao?"buy-button-light ":"buy-button"}`,onClick:()=>{Rl(Number(hs).toFixed(2))},children:jsxRuntimeExports.jsx("div",{className:`cursor-pointer text-base font-bold text-center ${Ao?"buy-button-inner-light text-[#107569]":"buy-button-inner text-[#00f9a9]"}`,children:mo("apply")})})]})]})]})})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})})},CalculatePopupShort=()=>{const[Fn,Mn]=reactExports.useState(""),[rs,is]=reactExports.useState(""),[os,as]=reactExports.useState("");reactExports.useState(0);const[us,ds]=reactExports.useState(""),[hs,ps]=reactExports.useState(""),{t:io}=useTranslation(),{isDarkMode:fo,updateDashboardInputValue:mo,selectedTokenPrice:Ao,updateIsCalculateVisibleShort:$o,isSelectedChain:Lo,isMode:Go,timing:Yo}=useStore();let Wo=useDebounce(Fn,1500),Jo=useDebounce(rs,1500),xl=useDebounce(os,1500);reactExports.useEffect(()=>{(async()=>{is("10"),as(Go===OPTIONS.CALL?"-2":"2")})()},[]),reactExports.useEffect(()=>{if(Wo!==Fn)return;(async()=>{if(Fn&&Number(Fn)!==0){const Dl=await calculateValue(Fn,Yo,Ao);ds(Dl)}})()},[Wo,Fn]),reactExports.useEffect(()=>{if(Jo!==rs||xl!==os)return;(async()=>{if(rs&&Number(rs)!==0){const Dl=await calculateAmounttobeInvestedShort(rs,Yo,os,Lo,Go);ps(Dl)}else ps("0")})()},[Jo,rs,xl,os]);const _l=async Pl=>{var Ol,Rl;let Dl=Pl.target.value;if(/^[0-9\.]*$/gm.test(Dl)&&(Dl.match(/[\.,]/gm)&&Dl.match(/^[0-9]{0,9}(\.|,)?[0-9]{0,8}$/gm)||!Dl.match(/[\.,]/gm)&&Dl.match(/^[0-9]{0,9}$/gm)&&(!Dl.match(/\./gm)||((Ol=Dl.match(/\./gm))==null?void 0:Ol.length)<=1)&&(!Dl.match(/,/gm)||((Rl=Dl.match(/,/gm))==null?void 0:Rl.length)<=1))){const Vo=Dl.replace(/\.+/gm,".").replace(/,+/gm,",").replace(/^0+/gm,"0").replace(/^\./,"0.");is(Vo)}},Tl=async Pl=>{var Ol,Rl;let Dl=Pl.target.value;if(/^-?[0-9\.]*$/gm.test(Dl)&&(Dl.match(/[\.,]/gm)&&Dl.match(/^-?[0-9]{0,9}(\.|,)?[0-9]{0,8}$/gm)||!Dl.match(/[\.,]/gm)&&Dl.match(/^-?[0-9]{0,9}$/gm)&&(!Dl.match(/\./gm)||((Ol=Dl.match(/\./gm))==null?void 0:Ol.length)<=1)&&(!Dl.match(/,/gm)||((Rl=Dl.match(/,/gm))==null?void 0:Rl.length)<=1))){const Vo=Dl.replace(/\.+/gm,".").replace(/,+/gm,",").replace(/^0+/gm,"0").replace(/^\./,"0.");as(Vo)}},Sl=Pl=>{Pl&&($o(!1),mo(Pl))},$l=()=>{$o(!1)};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"fixed z-[4] inset-0 h-full w-full   backdrop-blur-lg flex flex-row justify-center font-inter  items-start",children:jsxRuntimeExports.jsx(c$9,{onClickAway:$l,children:jsxRuntimeExports.jsxs("div",{className:`${fo?"bg-[rgba(252,253,254,0.70)] border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"} h-auto xxl:!w-[560px] bxl:!w-[560px] xl:!w-[560px] sxl:!w-[560px] lg:!w-[560px] md:!w-full sm:!w-full xd:!w-full xxl:mt-[15%] bxl:mt-[10%] xl:mt-28 sxl:mt-12 lg:mt-5 md:mt-5 sm:mt-2 xd:mt-2 border-2 rounded-2xl backdrop-blur-[54.36563491821289px]`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-start py-5 rounded-t-[1rem] px-6 ${fo?"bg-[#FCFDFE]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`font-inter text-xl font-bold ${fo?" text-[#000000]":"text-[white]"}`,children:io("calculate")}),jsxRuntimeExports.jsx("div",{onClick:()=>{$o(!1)},className:"cursor-pointer  ",children:fo?jsxRuntimeExports.jsx("img",{src:WrongBlack,alt:"WrongBlack"}):jsxRuntimeExports.jsx("img",{src:close,alt:"close"})})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{className:`${fo?"bg-[#eff7f8] h-12 border-[#eff7f8]":"bg-[#0f1012] h-12 border-[#292a2d]"} h-[72px] border-r-transparent border-l-transparent flex justify-around border-t border-b cursor-pointer backdrop-blur-sm transition-all ease-in-out duration-500 w-full`,children:jsxRuntimeExports.jsxs("div",{className:`${fo?"text-[#364152] social_web_login_light_calculate !bg-[#FCFDFE]":"text-white social_web_login_calculate bg-[rgba(255,255,255,0.06)]"} flex flex-col justify-center items-center gap-1 w-full outline-none`,children:["Earn from ",Go===OPTIONS.CALL?"falling":"rising"," markets"]})}),jsxRuntimeExports.jsxs("div",{className:`p-6 flex flex-col gap-2 w-full rounded-[0rem_0rem_1rem_1rem] ${fo?"bg-transparent":"bg-[#1D1E20]"}`,children:[jsxRuntimeExports.jsx("div",{className:`flex flex-row justify-start items-center text-sm font-normal ${fo?"text-[#1D1E20]":"text-[rgba(255,255,255,0.80)]"}`,children:"Amount to be Invested"}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center w-full",children:[jsxRuntimeExports.jsx("input",{id:"long-switch-token-amount",type:"text",placeholder:"0.00",min:"0",autoFocus:!0,autoComplete:"off",onWheel:Pl=>Pl.currentTarget.blur(),onKeyDown:Pl=>["e","E","+","-"].includes(Pl.key)&&Pl.preventDefault(),onPaste:preventPasteNegativeNumber,value:rs,onChange:_l,className:`text-right text-xl font-[500] border w-full rounded-2xl outline-none px-6 py-4 ${fo?"text-[black] bg-[#F6FEFC] border-[#CFE7EA] placeholder:text-[black]":"text-[white] bg-[#111213] border-[rgba(255,255,255,0.10)]"}`}),jsxRuntimeExports.jsx("div",{className:`rounded-lg p-2 text-xs font-normal cursor-pointer ml-[-95%] ${fo?"text-[black]":"text-[rgba(255,255,255,0.60)]"}`,children:"USDC"})]}),jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal flex flex-row justify-start items-center ${fo?"text-[#1D1E20]":"text-[rgba(255,255,255,0.80)]"}`,children:["Expected Market Movement in next ",CHAIN_PARAMS_CONFIG[Lo].cycle_duration," minute cycle",jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Enter 1.5 if you expect ETH price to rise by 1.5% in next cycle",arrow:!1,children:jsxRuntimeExports.jsx("img",{src:fo?instructiondark:instruction,alt:"/instruction",className:" pl-2"})})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center w-full",children:[jsxRuntimeExports.jsx("input",{id:"long-switch-token-amount",type:"text",placeholder:"0.00",min:"0",autoFocus:!0,autoComplete:"off",onWheel:Pl=>Pl.currentTarget.blur(),onKeyDown:Pl=>["e","E","+"].includes(Pl.key)&&Pl.preventDefault(),value:os,onChange:Tl,className:`text-right text-xl font-[500] w-full rounded-2xl outline-none px-6 py-4 border ${fo?"text-[black] bg-[#F6FEFC] border-[#CFE7EA] placeholder:text-[black]":"text-[white] bg-[#111213] border-[rgba(255,255,255,0.10)]"}`}),jsxRuntimeExports.jsx("div",{className:`rounded-lg p-2 text-xs font-normal cursor-pointer ml-[-95%] ${fo?"text-[black]":"text-[rgba(255,255,255,0.60)]"}`,children:"%"})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center gap-2",children:[jsxRuntimeExports.jsx("img",{src:AlertTriangle,alt:""}),jsxRuntimeExports.jsx("div",{className:"text-[#D92D20] font-normal text-xs font-manrope",children:"To safeguard your funds, OPerps restricts market movements to ±2.5% per cycle."})]}),jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-between items-center w-full pt-1",children:jsxRuntimeExports.jsxs("div",{className:`${fo?"text-[#1D1E20]":"text-[rgba(255,255,255,0.80)]"} w-[80%] text-sm font-normal flex flex-row justify-start items-center`,children:["Expected P&L",jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Expected profit or loss in $ based on your inputs, given the current market condition ",arrow:!1,children:jsxRuntimeExports.jsx("img",{src:fo?instructiondark:instruction,alt:"/instruction",className:" pl-2"})})]})}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-center w-full",children:[jsxRuntimeExports.jsx("input",{readOnly:!0,placeholder:"0.00",value:hs,className:`text-right text-xl font-[500] bg-transparent border w-full rounded-2xl outline-none px-6 py-4 ${fo?"text-[black] border-[#CFE7EA] placeholder:text-[black]":"text-[white] border-[rgba(255,255,255,0.10)]"}`}),jsxRuntimeExports.jsx("div",{className:`rounded-lg p-2 text-xs font-normal cursor-pointer ml-[-95%] ${fo?"bg-[#C5E1E6] text-[black]":"bg-[#1D1E20] text-[rgba(255,255,255,0.60)]"}`,children:"USDC"})]}),jsxRuntimeExports.jsxs("div",{className:"p-[32px] w-full flex flex-row justify-start items-center gap-4 font-manrope",children:[jsxRuntimeExports.jsx("img",{src:alertTriangle,alt:"alert"}),jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal flex flex-col justify-start items-start ${fo?"text-[black]":"text-[#D2D2D2]"}`,children:[jsxRuntimeExports.jsx("div",{className:"text-[#777879] ",children:"Note:"}),jsxRuntimeExports.jsx("div",{children:"We are not considering any existing OPerps holdings in wallet"})]})]}),jsxRuntimeExports.jsx("div",{className:`${fo?"buy-button-light ":"buy-button"}`,onClick:()=>{Sl(Number(rs).toFixed(2))},children:jsxRuntimeExports.jsx("div",{className:`cursor-pointer text-base font-bold text-center ${fo?"buy-button-inner-light text-[#107569]":"buy-button-inner text-[#00f9a9]"}`,children:io("apply")})})]})]})]})})})})},help="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='M20%209.5V6.8C20%205.11984%2020%204.27976%2019.673%203.63803C19.3854%203.07354%2018.9265%202.6146%2018.362%202.32698C17.7202%202%2016.8802%202%2015.2%202H8.8C7.11984%202%206.27976%202%205.63803%202.32698C5.07354%202.6146%204.6146%203.07354%204.32698%203.63803C4%204.27976%204%205.11984%204%206.8V17.2C4%2018.8802%204%2019.7202%204.32698%2020.362C4.6146%2020.9265%205.07354%2021.3854%205.63803%2021.673C6.27976%2022%207.11984%2022%208.8%2022H14M16.5%2015.0022C16.6762%2014.5014%2017.024%2014.079%2017.4817%2013.81C17.9395%2013.5409%2018.4777%2013.4426%2019.001%2013.5324C19.5243%2013.6221%2019.999%2013.8942%2020.3409%2014.3004C20.6829%2014.7066%2020.87%2015.2207%2020.8692%2015.7517C20.8692%2017.2506%2018.6209%2018%2018.6209%2018M18.65%2021H18.66'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",GuideTour="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='M9%203.5V2M5.06066%205.06066L4%204M5.06066%2013L4%2014.0607M13%205.06066L14.0607%204M3.5%209H2M8.5%208.5L12.6111%2021.2778L15.5%2018.3889L19.1111%2022L22%2019.1111L18.3889%2015.5L21.2778%2012.6111L8.5%208.5Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",market="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%202.26953V6.40007C14%206.96012%2014%207.24015%2014.109%207.45406C14.2049%207.64222%2014.3578%207.7952%2014.546%207.89108C14.7599%208.00007%2015.0399%208.00007%2015.6%208.00007H19.7305M16%2018.5L14.5%2017M14%202H8.8C7.11984%202%206.27976%202%205.63803%202.32698C5.07354%202.6146%204.6146%203.07354%204.32698%203.63803C4%204.27976%204%205.11984%204%206.8V17.2C4%2018.8802%204%2019.7202%204.32698%2020.362C4.6146%2020.9265%205.07354%2021.3854%205.63803%2021.673C6.27976%2022%207.11984%2022%208.8%2022H15.2C16.8802%2022%2017.7202%2022%2018.362%2021.673C18.9265%2021.3854%2019.3854%2020.9265%2019.673%2020.362C20%2019.7202%2020%2018.8802%2020%2017.2V8L14%202ZM15.5%2014.5C15.5%2016.433%2013.933%2018%2012%2018C10.067%2018%208.5%2016.433%208.5%2014.5C8.5%2012.567%2010.067%2011%2012%2011C13.933%2011%2015.5%2012.567%2015.5%2014.5Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Docs="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='M13%207L11.8845%204.76892C11.5634%204.1268%2011.4029%203.80573%2011.1634%203.57116C10.9516%203.36373%2010.6963%203.20597%2010.4161%203.10931C10.0992%203%209.74021%203%209.02229%203H5.2C4.0799%203%203.51984%203%203.09202%203.21799C2.71569%203.40973%202.40973%203.71569%202.21799%204.09202C2%204.51984%202%205.0799%202%206.2V7M2%207H17.2C18.8802%207%2019.7202%207%2020.362%207.32698C20.9265%207.6146%2021.3854%208.07354%2021.673%208.63803C22%209.27976%2022%2010.1198%2022%2011.8V16.2C22%2017.8802%2022%2018.7202%2021.673%2019.362C21.3854%2019.9265%2020.9265%2020.3854%2020.362%2020.673C19.7202%2021%2018.8802%2021%2017.2%2021H6.8C5.11984%2021%204.27976%2021%203.63803%2020.673C3.07354%2020.3854%202.6146%2019.9265%202.32698%2019.362C2%2018.7202%202%2017.8802%202%2016.2V7Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",report="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%208V12M12%2016H12.01M7.8%2021H16.2C17.8802%2021%2018.7202%2021%2019.362%2020.673C19.9265%2020.3854%2020.3854%2019.9265%2020.673%2019.362C21%2018.7202%2021%2017.8802%2021%2016.2V7.8C21%206.11984%2021%205.27976%2020.673%204.63803C20.3854%204.07354%2019.9265%203.6146%2019.362%203.32698C18.7202%203%2017.8802%203%2016.2%203H7.8C6.11984%203%205.27976%203%204.63803%203.32698C4.07354%203.6146%203.6146%204.07354%203.32698%204.63803C3%205.27976%203%206.11984%203%207.8V16.2C3%2017.8802%203%2018.7202%203.32698%2019.362C3.6146%2019.9265%204.07354%2020.3854%204.63803%2020.673C5.27976%2021%206.11984%2021%207.8%2021Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Helpup="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='M18%2015L12%209L6%2015'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";var name="@vercel/analytics",version$1="1.3.1",initQueue=()=>{window.va||(window.va=function(...Mn){(window.vaq=window.vaq||[]).push(Mn)})};function isBrowser(){return typeof window<"u"}function detectEnvironment(){try{const Fn="production"}catch{}return"production"}function setMode(Fn="auto"){if(Fn==="auto"){window.vam=detectEnvironment();return}window.vam=Fn}function getMode(){return(isBrowser()?window.vam:detectEnvironment())||"production"}function isDevelopment(){return getMode()==="development"}var DEV_SCRIPT_URL="https://va.vercel-scripts.com/v1/script.debug.js",PROD_SCRIPT_URL="/_vercel/insights/script.js";function inject(Fn={debug:!0}){var Mn;if(!isBrowser())return;setMode(Fn.mode),initQueue(),Fn.beforeSend&&((Mn=window.va)==null||Mn.call(window,"beforeSend",Fn.beforeSend));const rs=Fn.scriptSrc||(isDevelopment()?DEV_SCRIPT_URL:PROD_SCRIPT_URL);if(document.head.querySelector(`script[src*="${rs}"]`))return;const is=document.createElement("script");is.src=rs,is.defer=!0,is.dataset.sdkn=name+(Fn.framework?`/${Fn.framework}`:""),is.dataset.sdkv=version$1,Fn.disableAutoTrack&&(is.dataset.disableAutoTrack="1"),Fn.endpoint&&(is.dataset.endpoint=Fn.endpoint),Fn.dsn&&(is.dataset.dsn=Fn.dsn),is.onerror=()=>{const os=isDevelopment()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${rs}. ${os}`)},isDevelopment()&&Fn.debug===!1&&(is.dataset.debug="false"),document.head.appendChild(is)}function pageview({route:Fn,path:Mn}){var rs;(rs=window.va)==null||rs.call(window,"pageview",{route:Fn,path:Mn})}function Analytics(Fn){return reactExports.useEffect(()=>{inject({framework:Fn.framework||"react",...Fn.route!==void 0&&{disableAutoTrack:!0},...Fn})},[]),reactExports.useEffect(()=>{Fn.route&&Fn.path&&pageview({route:Fn.route,path:Fn.path})},[Fn.route,Fn.path]),null}const BookOpen="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.99479%2016.9L9.91808%2016.7849C9.38552%2015.9861%209.11924%2015.5867%208.76744%2015.2975C8.45598%2015.0415%208.09711%2014.8495%207.71136%2014.7323C7.27562%2014.6%206.79557%2014.6%205.83549%2014.6H4.78146C3.92271%2014.6%203.49334%2014.6%203.16534%2014.4329C2.87682%2014.2859%202.64225%2014.0513%202.49525%2013.7628C2.32812%2013.4348%202.32812%2013.0054%202.32812%2012.1467V5.55334C2.32812%204.69459%202.32812%204.26522%202.49525%203.93722C2.64225%203.64871%202.87682%203.41414%203.16534%203.26713C3.49334%203.10001%203.92271%203.10001%204.78146%203.10001H5.08812C6.80562%203.10001%207.66437%203.10001%208.32036%203.43425C8.89739%203.72826%209.36653%204.1974%209.66054%204.77444C9.99479%205.43043%209.99479%206.28918%209.99479%208.00667M9.99479%2016.9V8.00667M9.99479%2016.9L10.0715%2016.7849C10.6041%2015.9861%2010.8703%2015.5867%2011.2221%2015.2975C11.5336%2015.0415%2011.8925%2014.8495%2012.2782%2014.7323C12.714%2014.6%2013.194%2014.6%2014.1541%2014.6H15.2081C16.0669%2014.6%2016.4962%2014.6%2016.8242%2014.4329C17.1128%2014.2859%2017.3473%2014.0513%2017.4943%2013.7628C17.6615%2013.4348%2017.6615%2013.0054%2017.6615%2012.1467V5.55334C17.6615%204.69459%2017.6615%204.26522%2017.4943%203.93722C17.3473%203.64871%2017.1128%203.41414%2016.8242%203.26713C16.4962%203.10001%2016.0669%203.10001%2015.2081%203.10001H14.9015C13.184%203.10001%2012.3252%203.10001%2011.6692%203.43425C11.0922%203.72826%2010.623%204.1974%2010.329%204.77444C9.99479%205.43043%209.99479%206.28918%209.99479%208.00667'%20stroke='%23777879'%20stroke-width='1.53333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",BookOpenLight="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9.99479%2016.9L9.91808%2016.7849C9.38552%2015.9861%209.11924%2015.5867%208.76744%2015.2975C8.45598%2015.0415%208.09711%2014.8495%207.71136%2014.7323C7.27562%2014.6%206.79557%2014.6%205.83549%2014.6H4.78146C3.92271%2014.6%203.49334%2014.6%203.16534%2014.4329C2.87682%2014.2859%202.64225%2014.0513%202.49525%2013.7628C2.32812%2013.4348%202.32812%2013.0054%202.32812%2012.1467V5.55334C2.32812%204.69459%202.32812%204.26522%202.49525%203.93722C2.64225%203.64871%202.87682%203.41414%203.16534%203.26713C3.49334%203.10001%203.92271%203.10001%204.78146%203.10001H5.08812C6.80562%203.10001%207.66437%203.10001%208.32036%203.43425C8.89739%203.72826%209.36653%204.1974%209.66054%204.77444C9.99479%205.43043%209.99479%206.28918%209.99479%208.00667M9.99479%2016.9V8.00667M9.99479%2016.9L10.0715%2016.7849C10.6041%2015.9861%2010.8703%2015.5867%2011.2221%2015.2975C11.5336%2015.0415%2011.8925%2014.8495%2012.2782%2014.7323C12.714%2014.6%2013.194%2014.6%2014.1541%2014.6H15.2081C16.0669%2014.6%2016.4962%2014.6%2016.8242%2014.4329C17.1128%2014.2859%2017.3473%2014.0513%2017.4943%2013.7628C17.6615%2013.4348%2017.6615%2013.0054%2017.6615%2012.1467V5.55334C17.6615%204.69459%2017.6615%204.26522%2017.4943%203.93722C17.3473%203.64871%2017.1128%203.41414%2016.8242%203.26713C16.4962%203.10001%2016.0669%203.10001%2015.2081%203.10001H14.9015C13.184%203.10001%2012.3252%203.10001%2011.6692%203.43425C11.0922%203.72826%2010.623%204.1974%2010.329%204.77444C9.99479%205.43043%209.99479%206.28918%209.99479%208.00667'%20stroke='%23107569'%20stroke-width='1.53333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",LearnSwitch=({onClose:Fn})=>{const{isDarkMode:Mn,setIsGuideOpen:rs}=useStore();return jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"bg-[#FFFFFF] border-[#E3E8EF] ":"bg-[#17181A] border-[rgba(245,247,250,0.06)]"} rounded-2xl border-[0.063rem] !w-full h-[4.5rem] px-4 py-2 flex justify-between items-center`,children:[jsxRuntimeExports.jsxs("div",{className:" flex gap-2",children:[jsxRuntimeExports.jsx("div",{className:`${Mn?"bg-[#F2F9F9] border-[#E3E8EF]":"bg-[#111213] border-[#ffffff1a]"} rounded-[0.4rem] w-10 h-10 border-[0.025rem] flex justify-center items-center`,children:jsxRuntimeExports.jsx("img",{src:Mn?BookOpenLight:BookOpen,alt:"BookOpen"})}),jsxRuntimeExports.jsx("div",{className:"flex items-center",children:jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[#0C0C0D]":"text-[#FFFFFF]"} text-sm font-extrabold font-inter`,children:"Learn OPerps"})})]}),jsxRuntimeExports.jsxs("div",{className:" flex justify-center items-center gap-6",children:[jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[#A5A5A6]":"text-[#777879]"} text-xs flex gap-4`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?"hover:text-[#0C0C0D]":"hover:text-white"} cursor-pointer px-1 py-1`,onClick:()=>{rs(!0)},children:"Guide"}),jsxRuntimeExports.jsx("a",{className:`${Mn?"hover:text-[#0C0C0D]":"hover:text-white"} cursor-pointer px-1 py-1`,href:"https://youtube.com/playlist?list=PL7wovngMr1uo6ZpBB_1fSluC1bLJnq5DK&feature=shared",target:"_blank",children:"Video"}),jsxRuntimeExports.jsx("a",{className:`${Mn?"hover:text-[#0C0C0D]":"hover:text-white"} cursor-pointer px-1 py-1`,href:LINKS.GITBOOK,target:"_blank",children:"Docs"})]}),jsxRuntimeExports.jsx("img",{src:Mn?CloseBlack:close,alt:"close",onClick:Fn,className:"cursor-pointer w-4 h-4"})]})]})})},Download="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%2010V10.8C14%2011.9201%2014%2012.4802%2013.782%2012.908C13.5903%2013.2843%2013.2843%2013.5903%2012.908%2013.782C12.4802%2014%2011.9201%2014%2010.8%2014H5.2C4.07989%2014%203.51984%2014%203.09202%2013.782C2.71569%2013.5903%202.40973%2013.2843%202.21799%2012.908C2%2012.4802%202%2011.9201%202%2010.8V10M11.3333%206.66667L8%2010M8%2010L4.66667%206.66667M8%2010V2'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ChevronWhite="data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.5%209L12.5%2015L18.5%209'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",DisclaimerImg="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%3e%3cpath%20d='M7.99853%206.50015V9.16682M7.99853%2011.8335H8.0052M7.07541%203.09464L1.59216%2012.5657C1.28802%2013.091%201.13595%2013.3537%201.15843%2013.5693C1.17803%2013.7573%201.27654%2013.9282%201.42945%2014.0394C1.60475%2014.1668%201.90826%2014.1668%202.51528%2014.1668H13.4818C14.0888%2014.1668%2014.3923%2014.1668%2014.5676%2014.0394C14.7205%2013.9282%2014.819%2013.7573%2014.8386%2013.5693C14.8611%2013.3537%2014.709%2013.091%2014.4049%2012.5657L8.92166%203.09463C8.61861%202.57119%208.46709%202.30947%208.2694%202.22157C8.09696%202.14489%207.90011%202.14489%207.72767%202.22157C7.52998%202.30947%207.37846%202.57119%207.07541%203.09464Z'%20stroke='white'%20stroke-opacity='0.8'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",DisclaimerDark="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%3e%3cpath%20d='M7.99853%206.50015V9.16682M7.99853%2011.8335H8.0052M7.07541%203.09464L1.59216%2012.5657C1.28802%2013.091%201.13595%2013.3537%201.15843%2013.5693C1.17803%2013.7573%201.27654%2013.9282%201.42945%2014.0394C1.60475%2014.1668%201.90826%2014.1668%202.51528%2014.1668H13.4818C14.0888%2014.1668%2014.3923%2014.1668%2014.5676%2014.0394C14.7205%2013.9282%2014.819%2013.7573%2014.8386%2013.5693C14.8611%2013.3537%2014.709%2013.091%2014.4049%2012.5657L8.92166%203.09463C8.61861%202.57119%208.46709%202.30947%208.2694%202.22157C8.09696%202.14489%207.90011%202.14489%207.72767%202.22157C7.52998%202.30947%207.37846%202.57119%207.07541%203.09464Z'%20stroke='%234A4B4D'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ConnectWalletPrompt=()=>{const{isDarkMode:Fn,isWalletConnectVisible:Mn,updateIsWalletConnectVisible:rs,setIsConnectWalletPrompt:is,isConnectWalletPrompt:os}=useStore();reactExports.useEffect(()=>{const us=localStorage.getItem("isConnectWalletPrompt");us!==null&&is(JSON.parse(us))},[is]);const as=()=>{rs(!0),is(!1),localStorage.setItem("isConnectWalletPrompt","false")};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:os&&jsxRuntimeExports.jsxs("div",{className:"fixed z-[4] inset-0 h-full w-full backdrop-blur-[0.75rem] flex flex-row xxl:items-center bxl:items-center xl:items-center sxl:items-center lg:items-center md:items-end sm:items-end xd:items-end font-manrope justify-center",children:[jsxRuntimeExports.jsxs("div",{className:`xxl:w-[40%] bxl:w-[40%] xl:w-[40%] sxl:w-[40%] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto rounded-2xl border ${Fn?"bg-[rgba(252,253,254,0.70)] backdrop-blur-[1.25rem] border-[rgba(245,247,250,0.06)] backdrop-blur-[54.36563491821289px] border-[#E3E8EF]":"bg-[#17181A] backdrop-blur-[1.25rem] border-[rgba(245,247,250,0.06)] backdrop-blur-[54.36563491821289px] border-[rgba(255,255,255,0.10)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-[1rem] px-6 border-b ${Fn?"bg-[#FCFDFE] border-b-[#E3E8EF]":"bg-[rgba(255,255,255,0.06)] border-b-[rgba(255,255,255,0.10)]"}`,children:jsxRuntimeExports.jsx("div",{className:`font-inter text-xl font-bold ${Fn?"text-[#000000]":"text-[white]"}`,children:"Connect wallet"})}),jsxRuntimeExports.jsxs("div",{className:"p-6 flex flex-col gap-4 w-full rounded-[0rem_0rem_1rem_1rem]",children:[jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-[rgba(0,0,0,0.80)]":"text-[rgba(255,255,255,0.80)]"} gap-2 text-sm font-normal flex flex-row justify-start items-center`,children:[jsxRuntimeExports.jsx("img",{src:Fn?DisclaimerDark:DisclaimerImg,alt:""}),"Please connect wallet before proceeding"]}),jsxRuntimeExports.jsx("button",{className:"cursor-pointer w-full outline-none",onClick:as,children:jsxRuntimeExports.jsx("div",{className:`cursor-pointer ${Fn?"buy-button-light":"buy-button"}`,children:jsxRuntimeExports.jsx("div",{className:`cursor-pointer text-base font-bold text-center ${Fn?"buy-button-inner-light text-[#0E9384]":"buy-button-inner text-[#2ED3B7]"}`,children:"Connect wallet"})})})]})]}),Mn&&jsxRuntimeExports.jsx(ConnectWallet,{})]})})},Menu="data:image/svg+xml,%3csvg%20width='4'%20height='12'%20viewBox='0%200%204%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.33073%205.99984C1.33073%206.36803%201.62921%206.6665%201.9974%206.6665C2.36559%206.6665%202.66406%206.36803%202.66406%205.99984C2.66406%205.63165%202.36559%205.33317%201.9974%205.33317C1.62921%205.33317%201.33073%205.63165%201.33073%205.99984Z'%20fill='%234A4B4D'/%3e%3cpath%20d='M1.33073%2010.6665C1.33073%2011.0347%201.62921%2011.3332%201.9974%2011.3332C2.36559%2011.3332%202.66406%2011.0347%202.66406%2010.6665C2.66406%2010.2983%202.36559%209.99984%201.9974%209.99984C1.62921%209.99984%201.33073%2010.2983%201.33073%2010.6665Z'%20fill='%234A4B4D'/%3e%3cpath%20d='M1.33073%201.33317C1.33073%201.70136%201.62921%201.99984%201.9974%201.99984C2.36559%201.99984%202.66406%201.70136%202.66406%201.33317C2.66406%200.964981%202.36559%200.666504%201.9974%200.666504C1.62921%200.666504%201.33073%200.964981%201.33073%201.33317Z'%20fill='%234A4B4D'/%3e%3cpath%20d='M1.33073%205.99984C1.33073%206.36803%201.62921%206.6665%201.9974%206.6665C2.36559%206.6665%202.66406%206.36803%202.66406%205.99984C2.66406%205.63165%202.36559%205.33317%201.9974%205.33317C1.62921%205.33317%201.33073%205.63165%201.33073%205.99984Z'%20stroke='%234A4B4D'%20stroke-width='1.33'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M1.33073%2010.6665C1.33073%2011.0347%201.62921%2011.3332%201.9974%2011.3332C2.36559%2011.3332%202.66406%2011.0347%202.66406%2010.6665C2.66406%2010.2983%202.36559%209.99984%201.9974%209.99984C1.62921%209.99984%201.33073%2010.2983%201.33073%2010.6665Z'%20stroke='%234A4B4D'%20stroke-width='1.33'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M1.33073%201.33317C1.33073%201.70136%201.62921%201.99984%201.9974%201.99984C2.36559%201.99984%202.66406%201.70136%202.66406%201.33317C2.66406%200.964981%202.36559%200.666504%201.9974%200.666504C1.62921%200.666504%201.33073%200.964981%201.33073%201.33317Z'%20stroke='%234A4B4D'%20stroke-width='1.33'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",InVaultPosition=Fn=>{const{invault:Mn,executeClaim:rs,executeInvaultSell:is}=Fn,[os,as]=reactExports.useState(!1),[us,ds]=reactExports.useState(!1),hs=()=>{as(!os)},{isDarkMode:ps,isLoader:io}=useStore(),fo=new Date(Mn.entryTime).toLocaleTimeString(),mo=new Date(Mn.entryTime).toLocaleDateString(),Ao=TOKEN_LOGO[Mn.token],$o=Mn.token,Lo=Mn.option_type,Go=Mn.direction,Yo=Mn["Invested Amount"],Wo=Mn.Balance,Jo=Mn.pnl,xl=Jo/Yo*100,_l=Mn.onChainBalance,Tl=_l>=.01||Yo>=.01,{notificationStyle:Sl}=useStyles(),$l=async()=>{try{if(io){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:Sl});return}ds(!0),as(!1),await rs(Mn.vault_id,Mn.token,Mn.option_type),ds(!1)}catch(Dl){console.log(Dl),ds(!1)}},Pl=async()=>{try{if(io){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:Sl});return}ds(!0),await is(Mn.vault_id,"sell"+Go,Yo,_l,_l,Mn.token,Mn.option_type),ds(!1)}catch(Dl){console.log(Dl),ds(!1)}};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`${Tl?"":"hidden"} flex justify-center relative my-2 sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen px-4 text-[0.625rem]`,children:[jsxRuntimeExports.jsx("div",{className:`${ps?"bg-[#effdf9]":"bg-[#111213]"} rounded-2xl sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen py-5`,children:jsxRuntimeExports.jsxs("div",{className:" flex px-4 gap-10",children:[jsxRuntimeExports.jsx("div",{className:"w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:" flex flex-col",children:[jsxRuntimeExports.jsx("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:fo}),jsxRuntimeExports.jsx("div",{className:"text-[0.65rem] text-[#777879]",children:mo})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:"   flex flex-col ",children:[jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("img",{src:Ao,alt:$o,className:"w-4"}),jsxRuntimeExports.jsx("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:$o})]}),jsxRuntimeExports.jsx("div",{className:"text-[0.625rem] flex pt-1",children:jsxRuntimeExports.jsxs("div",{className:"text-[#777879]",children:[Lo,jsxRuntimeExports.jsx("span",{className:" px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${Go==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:Go})]})})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%]  flex justify-start items-center align-middle  text-xs",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Yo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",_l.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Wo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"w-[10%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:" flex  flex-col",children:[jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Jo.toFixed(2)]}),jsxRuntimeExports.jsxs("div",{className:`text-[0.65rem]  ${Jo>=0?"text-[#12B76A]":"text-[#F04438]"}`,children:[Jo>=0?"+"+xl.toFixed(2):xl.toFixed(2),"%"]})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle text-xs",children:jsxRuntimeExports.jsx("div",{className:"text-[#FDB022] font-extrabold text-xs",children:"In Vault"})}),jsxRuntimeExports.jsxs("div",{className:"w-[10%] flex justify-between items-center",children:[io&&us?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:`${ps?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] border-[#F79009] text-[#F79009]  border-[0.063rem font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`}):jsxRuntimeExports.jsx("button",{className:`${ps?"bg-[#FCFDFE]":"bg-[#17181A]"} mr-4 h-8 text-xs cursor-pointer rounded-lg border-[0.063rem]  border-[#F79009] text-[#F79009] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:Pl,children:"Sell"}),jsxRuntimeExports.jsx("img",{onClick:hs,src:Menu,alt:"Dropdown",className:"w-4 h-4 cursor-pointer pr-3"})]})]})}),os&&jsxRuntimeExports.jsx("div",{className:"flex absolute right-10 cursor-pointer mt-16",onClick:$l,children:jsxRuntimeExports.jsx("button",{className:" w-[7.5rem] h-[2.125rem] rounded-lg bg-[#111213] border-[0.063rem] border-[rgba(245,247,250,0.06)] flex justify-center items-center text-[#FFFFFFCC] text-xs z-[2]",children:"Transfer to wallet"})})]})})},MobileInVaultPosition=Fn=>{const{invault:Mn,executeClaim:rs,executeInvaultSell:is}=Fn,[os,as]=reactExports.useState(!1),[us,ds]=reactExports.useState(!1),hs=()=>{as(!os)},{isDarkMode:ps,isLoader:io}=useStore(),fo=new Date(Mn.entryTime).toLocaleTimeString(),mo=new Date(Mn.entryTime).toLocaleDateString(),Ao=TOKEN_LOGO[Mn.token],$o=Mn.token,Lo=Mn.option_type,Go=Mn.direction,Yo=Mn["Invested Amount"],Wo=Mn.Balance,Jo=Mn.pnl,xl=Jo/Yo*100,_l=Mn.onChainBalance,{tooltipStyle:Tl,notificationStyle:Sl}=useStyles(),$l=async()=>{try{if(io){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:Sl});return}ds(!0),as(!1),await rs(Mn.vault_id,Mn.token,Mn.option_type),ds(!1)}catch(Dl){console.log(Dl),ds(!1)}},Pl=async()=>{try{if(io){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:Sl});return}ds(!0),await is(Mn.vault_id,"sell"+Go,Yo,_l,_l,Mn.token,Mn.option_type),ds(!1)}catch(Dl){console.log(Dl),ds(!1)}};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"px-2",children:jsxRuntimeExports.jsxs("div",{className:`my-4 rounded-2xl p-4 ${ps?"bg-[#F2F9F9]":"bg-[#17181A] text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsxs("div",{className:"relative flex items-center justify-between mb-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-end items-center text-xs",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:Ao,alt:$o,className:"w-4"}),jsxRuntimeExports.jsx("p",{className:`${ps?"text-[black] text-xs pl-1":"text-[#FFFFFFCC] text-xs pl-1"}`,children:$o})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center text-[#777879] ml-1",children:[Lo,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${Go==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:Go})]})]}),jsxRuntimeExports.jsx("img",{onClick:hs,src:Menu,alt:"Dropdown",className:"w-4 h-4 cursor-pointer pr-3"}),os&&jsxRuntimeExports.jsx("div",{className:"flex absolute right-0 -bottom-9 cursor-pointer",onClick:$l,children:jsxRuntimeExports.jsx("button",{className:`w-[7.5rem] h-[2.125rem] rounded-lg border-[0.063rem] flex justify-center items-center text-xs z-[2] ${ps?"bg-[white] text-black":"bg-[#111213] text-[#FFFFFFCC] border-[rgba(245,247,250,0.06)]"}`,children:"Transfer to wallet"})})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-start gap-2 justify-between text-[0.625rem]",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-5",children:[jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Invested Amount"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your token balance at the start of ongoing cycle",arrow:!1,overlayInnerStyle:Tl,children:jsxRuntimeExports.jsx("span",{children:"Current Balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your expected token balance at the end of ongoing cycle, which changes dynamically with change in price",arrow:!1,overlayInnerStyle:Tl,children:jsxRuntimeExports.jsx("span",{children:"Tentative balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"PnL "})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your tokens can be either in Vault (smart contract) or your Wallet or mixed. All tokens are participating in the ongoing cycle",arrow:!1,overlayInnerStyle:Tl,children:jsxRuntimeExports.jsx("span",{children:"Status "})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Entry Time"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{})})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-4 text-[white] text-xs",children:[jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"}`,children:["$",Yo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"}`,children:["$",_l.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"}`,children:["$",Wo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:"flex flex-row",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"}`,children:["$",Jo.toFixed(2)," ",jsxRuntimeExports.jsxs("span",{className:`text-[0.65rem]  ${Jo>=0?"text-[#12B76A]":"text-[#F04438]"}`,children:[Jo>=0?"+"+xl.toFixed(2):xl.toFixed(2),"%"]})]})})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:"text-[#FDB022] text-xs font-extrabold",children:"In Vault"})}),jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:[fo," ",jsxRuntimeExports.jsx("span",{className:"text-[0.65rem] text-[#777879]",children:mo})]})})]})]}),jsxRuntimeExports.jsx("div",{className:"relative flex justify-end items-center",children:io&&us?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:`${ps?"bg-[#FCFDFE]":"bg-[#17181A] "} w-full h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] border-[#F79009] text-[#F79009]  border-[0.063rem font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`}):jsxRuntimeExports.jsx("button",{className:`${ps?"bg-[#FCFDFE]":"bg-[#17181A] "} w-full h-8 text-xs cursor-pointer rounded-lg border-[0.063rem]  border-[#F79009] text-[#F79009] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:Pl,children:"Sell"})})]})})})},dots$1="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%20id='dots-horizontal'%3e%3cg%20id='Icon'%3e%3cpath%20d='M7.9974%208.66665C8.36559%208.66665%208.66406%208.36817%208.66406%207.99998C8.66406%207.63179%208.36559%207.33331%207.9974%207.33331C7.62921%207.33331%207.33073%207.63179%207.33073%207.99998C7.33073%208.36817%207.62921%208.66665%207.9974%208.66665Z'%20stroke='white'%20stroke-opacity='0.8'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.6641%208.66665C13.0323%208.66665%2013.3307%208.36817%2013.3307%207.99998C13.3307%207.63179%2013.0323%207.33331%2012.6641%207.33331C12.2959%207.33331%2011.9974%207.63179%2011.9974%207.99998C11.9974%208.36817%2012.2959%208.66665%2012.6641%208.66665Z'%20stroke='white'%20stroke-opacity='0.8'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M3.33073%208.66665C3.69892%208.66665%203.9974%208.36817%203.9974%207.99998C3.9974%207.63179%203.69892%207.33331%203.33073%207.33331C2.96254%207.33331%202.66406%207.63179%202.66406%207.99998C2.66406%208.36817%202.96254%208.66665%203.33073%208.66665Z'%20stroke='white'%20stroke-opacity='0.8'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",dotsBlack="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%20id='dots-horizontal'%3e%3cg%20id='Icon'%3e%3cpath%20d='M7.9974%208.66665C8.36559%208.66665%208.66406%208.36817%208.66406%207.99998C8.66406%207.63179%208.36559%207.33331%207.9974%207.33331C7.62921%207.33331%207.33073%207.63179%207.33073%207.99998C7.33073%208.36817%207.62921%208.66665%207.9974%208.66665Z'%20stroke='black'%20stroke-opacity='0.8'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.6641%208.66665C13.0323%208.66665%2013.3307%208.36817%2013.3307%207.99998C13.3307%207.63179%2013.0323%207.33331%2012.6641%207.33331C12.2959%207.33331%2011.9974%207.63179%2011.9974%207.99998C11.9974%208.36817%2012.2959%208.66665%2012.6641%208.66665Z'%20stroke='black'%20stroke-opacity='0.8'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M3.33073%208.66665C3.69892%208.66665%203.9974%208.36817%203.9974%207.99998C3.9974%207.63179%203.69892%207.33331%203.33073%207.33331C2.96254%207.33331%202.66406%207.63179%202.66406%207.99998C2.66406%208.36817%202.96254%208.66665%203.33073%208.66665Z'%20stroke='black'%20stroke-opacity='0.8'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Button=({children:Fn,className:Mn="",leftIcon:rs,rightIcon:is,...os})=>jsxRuntimeExports.jsxs("button",{className:`${Mn}`,...os,children:[!!rs&&rs,Fn,!!is&&is]}),SellInwalletPosition=Fn=>{const{isSellOpen:Mn,setIsSellOpen:rs,currentBalance:is,executeOrder:os,direction:as,investedAmount:us,selectedToken:ds,selectedMode:hs,setIsLoading:ps}=Fn,[io,fo]=reactExports.useState(is.toString()),{isDarkMode:mo,isLoader:Ao}=useStore(),$o=async()=>{try{if(parseFloat(io)<=0){staticMethods.error({message:"Error",description:"You cannot sell less than 0"});return}if(isNaN(parseFloat(io))){staticMethods.error({message:"Error",description:"Please enter a valid amount"});return}if(parseFloat(io)>is){staticMethods.error({message:"Error",description:"You cannot sell more than your current balance"}),fo(is.toString());return}rs(!1),await os("sell"+as,us,is,parseFloat(io),!1,ds,hs),ps(!1)}catch(Lo){console.log(Lo)}};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Mn&&jsxRuntimeExports.jsx("div",{className:"overflow-x-hidden !font-manrope !fixed !inset-0 !z-[24] xxl:pt-24 xl:pt-24 lg:pt-24 md:pt-24 sm:!pt-0 max-h-[full] flex flex-row xxl:items-center bxl:items-center xl:items-center sxl:items-center lg:items-center md:items-center sm:items-center xd:items-center justify-center align-middle backdrop-blur-[1rem] overflow-y-auto bg-transparent sm:w-full md:w-full",children:jsxRuntimeExports.jsx(c$9,{onClickAway:()=>{rs(!1),ps(!1)},children:jsxRuntimeExports.jsx("div",{className:` ${mo?"  bg-[#FCFDFE]  xxl:border-[#E3E8EF] bxl:border-[#E3E8EF] xl:border-[#E3E8EF] sxl:border-[#E3E8EF] lg:border-[#E3E8EF] md:border-[#E3E8EF]":"xxl:border-[rgba(255,255,255,0.10)] bxl:border-[rgba(255,255,255,0.10)] xl:border-[rgba(255,255,255,0.10)] sxl:border-[rgba(255,255,255,0.10)] lg:border-[rgba(255,255,255,0.10)] md:border-[rgba(255,255,255,0.10)] bg-[#111213]"} !border border-solid   sm:border-transparent xd:border-transparent rounded-2xl `,children:jsxRuntimeExports.jsxs("div",{className:"    flex flex-col   items-center justify-start   rounded-2xl   sm:w-full !backdrop-blur-[2.5rem]",children:[jsxRuntimeExports.jsxs("div",{className:`${mo?"bg-[#EFF7F8]":"bg-[rgba(255,255,255,0.06)] "} p-[20px_24px] flex rounded-[1rem_1rem_0rem_0rem] flex-row sm:flex-row  gap-6 items-start justify-between xxl:w-[560px] bxl:w-[560px] xl:w-[560px] sxl:w-[560px] lg:w-[560px] md:w-screen sm:w-screen xd:w-screen`,children:[jsxRuntimeExports.jsx("div",{className:`${mo?"text-[#0C0C0D] ":"text-[#fff] "} font-semibold md:text-[1.375rem]  w-auto bg-transparent`,children:"Sell"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer flex flex-row gap-2 items-center justify-start w-auto bg-transparent",onClick:()=>{rs(!1),ps(!1)},children:jsxRuntimeExports.jsx("img",{className:" cursor-pointer h-5 w-5 ",src:mo?CloseBlack:close,alt:"close"})})]}),jsxRuntimeExports.jsxs("div",{className:"p-4 w-full flex flex-col gap-4 ",children:[jsxRuntimeExports.jsx("div",{className:`text-sm font-normal  ${mo?"text-[#4A4B4D]":"text-[rgba(255,255,255,0.80)]"} `,children:"please enter the amount you want to sell"}),jsxRuntimeExports.jsx("div",{className:` ${mo?"bg-[#EFF7F8] border-[#E3E8EF] ":"bg-[#17181A] border-[rgba(255,255,255,0.10)]"} flex flex-col gap-4 items-center !justify-between w-full h-full p-4 border  rounded-2xl `,children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[jsxRuntimeExports.jsx("div",{className:"flex flex-row text-sm font-normal justify-between items-center w-full",children:jsxRuntimeExports.jsxs("div",{className:` ${mo?"text-[#4A4B4D]":"text-[rgba(255,255,255,0.80)]"} `,children:[" ","Amount"]})}),jsxRuntimeExports.jsx("div",{className:"flex gap-2 flex-row  items-center justify-center  bg-transparent w-full ",children:jsxRuntimeExports.jsxs("div",{className:` w-full  text-sm  text-right ${mo?"text-[#4A4B4D] ":"text-[rgba(255,255,255,0.80)]"}   ${mo?" border-[#E3E8EF]":" border-[rgba(255,255,255,0.10)] "} ${mo?"bg-[#FCFDFE]":"bg-[#0C0C0D]"}   border rounded-2xl p-4 flex flex-row   items-center justify-between        `,children:[jsxRuntimeExports.jsx("div",{className:`text-[0.625rem] font-normal ${mo?"text-[#A5A5A6]":"text-[#777879]"}`,children:"Token"}),jsxRuntimeExports.jsx("input",{className:`border-none outline-none text-right ${mo?"bg-[#FCFDFE]":"bg-[#0C0C0D]"} `,placeholder:"0",min:"0",value:io,autoFocus:!0,onKeyDown:Lo=>["e","E","+","-"].includes(Lo.key)&&Lo.preventDefault(),onChange:Lo=>{const Go=Lo.target.value;if(Go==="."||Go===".0"||Go===".."||Go===".0"){fo("0.");return}/^\d*\.?\d{0,3}$/.test(Go)||(Lo.target.value=Go.slice(0,-1));const Wo=Lo.target.value.replace(/[^0-9.]/g,"");fo(Wo)}})]})})]})}),jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-between items-center gap-2 w-full mt-2",children:jsxRuntimeExports.jsx(Button,{className:`  cursor-pointer ${mo?"buy-button-light":"buy-button"} w-full `,onClick:()=>$o(),children:jsxRuntimeExports.jsx("div",{className:` ${mo?"buy-button-inner-light":"buy-button-inner"} w-full h-full py-[0.938rem] flex flex-row justify-center items-center    font-bold leading-[normal] rounded-2xl text-center text-gray-900 text-xl`,children:Ao?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"}):jsxRuntimeExports.jsx("span",{className:` ${mo?"button-text_dark":"button-text"} `,children:" Confirm"})})})})]})]})})})})})},InWalletPosition=Fn=>{const{inwallet:Mn,executeOrder:rs}=Fn,{isDarkMode:is,isLoader:os}=useStore(),{notificationStyle:as}=useStyles(),[us,ds]=reactExports.useState(!1),[hs,ps]=reactExports.useState(!1),io=()=>{if(os){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:as});return}ps(!0),ds(!us)},fo=TOKEN_LOGO[Mn.token],mo=Mn.token,Ao=Mn.option_type,$o=Mn.direction,Lo=Mn["Invested Amount"],Go=Mn.Balance,Yo=Mn.pnl,Wo=Yo/Lo*100,Jo=Mn.onChainBalance,xl=Jo>=.01||Lo>=.01;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`${xl?"":"hidden"} flex justify-center relative my-2 sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen px-4 text-[0.625rem]`,children:[jsxRuntimeExports.jsx("div",{className:`${is?"bg-[#effdf9]":"bg-[#111213]"} rounded-2xl sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen py-5`,children:jsxRuntimeExports.jsxs("div",{className:" flex px-4 gap-10",children:[jsxRuntimeExports.jsx("div",{className:"w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsx("div",{className:" flex ml-4",children:jsxRuntimeExports.jsx("img",{src:is?dotsBlack:dots$1,alt:"dots"})})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:"   flex flex-col ",children:[jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("img",{src:fo,alt:mo,className:"w-4"}),jsxRuntimeExports.jsx("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:mo})]}),jsxRuntimeExports.jsx("div",{className:"text-[0.625rem] flex pt-1",children:jsxRuntimeExports.jsxs("div",{className:"text-[#777879]",children:[Ao,jsxRuntimeExports.jsx("span",{className:" px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${$o==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:$o})]})})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%]  flex justify-start items-center align-middle  text-xs",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Lo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Jo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Go.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"w-[10%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:" flex  flex-col",children:[jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Yo.toFixed(2)]}),jsxRuntimeExports.jsxs("div",{className:`text-[0.65rem]  ${Yo>=0?"text-[#12B76A]":"text-[#F04438]"}`,children:[Yo>=0?"+"+Wo.toFixed(2):Wo.toFixed(2),"%"]})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle text-xs",children:jsxRuntimeExports.jsx("div",{className:"text-[#2ED3B7] !font-extrabold text-xs",children:"In Wallet"})}),jsxRuntimeExports.jsxs("div",{className:" w-[10%] flex justify-between items-center",children:[os&&hs?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:`${is?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7]  border-[0.063rem font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`}):jsxRuntimeExports.jsx("button",{className:`${is?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:io,children:"Sell"}),jsxRuntimeExports.jsx("img",{src:Menu,alt:"Dropdown",className:"ml-3 w-4 h-4 mt-2 opacity-0"})]})]})}),us&&jsxRuntimeExports.jsx(SellInwalletPosition,{isSellOpen:us,setIsSellOpen:ds,currentBalance:Jo,executeOrder:rs,direction:$o,investedAmount:Lo,setIsLoading:ps,selectedToken:mo,selectedMode:Ao})]})})},MobileInWalletPosition=Fn=>{const{inwallet:Mn,executeOrder:rs}=Fn,{isDarkMode:is,isLoader:os}=useStore(),{notificationStyle:as,tooltipStyle:us}=useStyles(),[ds,hs]=reactExports.useState(!1),[ps,io]=reactExports.useState(!1),fo=()=>{if(os){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:as});return}io(!0),hs(!ds)},mo=TOKEN_LOGO[Mn.token],Ao=Mn.token,$o=Mn.option_type,Lo=Mn.direction,Go=Mn["Invested Amount"],Yo=Mn.Balance,Wo=Mn.pnl,Jo=Wo/Go*100,xl=Mn.onChainBalance;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`my-4 rounded-2xl p-4 ${is?"bg-[#F2F9F9]":"bg-[#17181A] text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsxs("div",{className:"flex items-start gap-2 justify-between text-[0.625rem]",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-5",children:[jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Market"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Invested Amount"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your token balance at the start of ongoing cycle",arrow:!1,overlayInnerStyle:us,children:jsxRuntimeExports.jsx("span",{children:"Current Balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your expected token balance at the end of ongoing cycle, which changes dynamically with change in price",arrow:!1,overlayInnerStyle:us,children:jsxRuntimeExports.jsx("span",{children:"Tentative balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"PnL "})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your tokens can be either in Vault (smart contract) or your Wallet or mixed. All tokens are participating in the ongoing cycle",arrow:!1,overlayInnerStyle:us,children:jsxRuntimeExports.jsx("span",{children:"Status "})})})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-end items-center text-xs",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:mo,alt:Ao,className:"w-4"}),jsxRuntimeExports.jsx("p",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:Ao})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center text-[#777879] ml-1",children:[$o,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${Lo==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:Lo})]})]}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Go.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",xl.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Yo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Wo.toFixed(2),jsxRuntimeExports.jsxs("span",{className:`text-[0.65rem] ml-1 ${Wo>=0?"text-[#12B76A]":"text-[#F04438]"}`,children:[Wo>=0?"+"+Jo.toFixed(2):Jo.toFixed(2),"%"]})]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:"text-[#2ED3B7] !font-extrabold text-xs",children:"In Wallet"})})]})]}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center mt-4 w-full",children:os&&ps?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:`${is?"bg-[#FCFDFE]":"bg-[#17181A]"} w-full h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7]  border-[0.063rem font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`}):jsxRuntimeExports.jsx("button",{className:`${is?"bg-[#FCFDFE]":"bg-[#17181A]"} w-full h-8 text-xs rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:fo,children:"Sell"})}),jsxRuntimeExports.jsx("div",{className:"space-y-4 text-[white] text-xs",children:ds&&jsxRuntimeExports.jsx(SellInwalletPosition,{isSellOpen:ds,setIsSellOpen:hs,currentBalance:xl,executeOrder:rs,direction:Lo,investedAmount:Go,setIsLoading:io,selectedToken:Ao,selectedMode:$o})})]})})},Updropdown="data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%205L5%201L1%205'%20stroke='white'%20stroke-opacity='0.8'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",DownDropdown="data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1%201L5%205L9%201'%20stroke='white'%20stroke-opacity='0.8'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",TotalInVaultPosition=({invault:Fn,executeClaim:Mn,executeInvaultSell:rs})=>{const[is,os]=reactExports.useState(!1),[as,us]=reactExports.useState(!1),{notificationStyle:ds}=useStyles(),hs=()=>{os(!is)},{isDarkMode:ps,isLoader:io}=useStore(),fo=new Date(Fn.entryTime).toLocaleTimeString(),mo=new Date(Fn.entryTime).toLocaleDateString(),Ao=TOKEN_LOGO[Fn.token],$o=Fn.token,Lo=Fn.option_type,Go=Fn.direction,Yo=Fn["Invested Amount"],Wo=Fn.Balance,Jo=Fn.pnl,xl=Jo/Yo*100,_l=Fn.onChainBalance,Tl=_l>=.01||Yo>=.01,Sl=async()=>{try{if(io){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:ds});return}us(!0),os(!1),await Mn(Fn.vault_id,Fn.token,Fn.option_type),us(!1)}catch(Pl){console.log(Pl),us(!1)}},$l=async()=>{try{if(io){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:ds});return}us(!0),await rs(Fn.vault_id,"sell"+Go,Yo,_l,_l,Fn.token,Fn.option_type),us(!1)}catch(Pl){console.log(Pl),us(!1)}};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:`${Tl?"":"hidden"} flex justify-center relative my-2 sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen px-2 text-[0.625rem]`,children:jsxRuntimeExports.jsx("div",{className:`${ps?"bg-[#EFF7F8]":" bg-[#1D1E20]"} rounded-2xl w-full py-5`,children:jsxRuntimeExports.jsxs("div",{className:" flex px-4 gap-10",children:[jsxRuntimeExports.jsx("div",{className:"w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:" flex flex-col",children:[jsxRuntimeExports.jsx("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:fo}),jsxRuntimeExports.jsx("div",{className:"text-[0.65rem] text-[#777879]",children:mo})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:"   flex flex-col ",children:[jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("img",{src:Ao,alt:$o,className:"w-4"}),jsxRuntimeExports.jsx("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:$o})]}),jsxRuntimeExports.jsxs("div",{className:"text-[0.625rem] flex pt-1",children:[jsxRuntimeExports.jsxs("div",{className:"text-[#777879]",children:[Lo," ",jsxRuntimeExports.jsx("span",{className:" pl-1",children:" •"})]}),jsxRuntimeExports.jsxs("div",{className:`${Go==="Long"?"text-[#12B76A]":"text-[#F04438]"}  pl-1 `,children:[" ",Go]})]})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%]  flex justify-start items-center align-middle  text-xs",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Yo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsx("div",{className:" flex flex-col",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",_l.toFixed(2)]})})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsx("div",{className:" flex flex-col",children:jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} pl-1 text-xs`,children:["$",Wo.toFixed(2)]})})}),jsxRuntimeExports.jsx("div",{className:"w-[10%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:" flex justify-center flex-col",children:[jsxRuntimeExports.jsxs("div",{className:`${ps?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Jo.toFixed(2)]}),jsxRuntimeExports.jsxs("div",{className:`text-[0.65rem]  ${Jo>=0?"text-[#12B76A]":"text-[#F04438]"}`,children:[Jo>=0?"+"+xl.toFixed(2):xl.toFixed(2),"%"]})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle text-xs",children:jsxRuntimeExports.jsx("div",{className:"text-[#FDB022] font-extrabold text-xs",children:"In Vault"})}),jsxRuntimeExports.jsxs("div",{className:" w-[10%] flex justify-between items-center",children:[io&&as?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:`${ps?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] border-[#F79009] text-[#F79009]  border-[0.063rem font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`}):jsxRuntimeExports.jsx("button",{className:`${ps?"bg-[#FCFDFE] border-[#F79009] text-[#F79009]":"bg-[#17181A] border-[#F79009] text-[#F79009]"} border-[0.063rem] h-8 text-xs rounded-lg font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:$l,children:"Sell"}),jsxRuntimeExports.jsx("img",{onClick:hs,src:Menu,alt:"menu",className:"ml-2 w-4 h-4 cursor-pointer"})]}),is&&jsxRuntimeExports.jsx("div",{className:"flex w-full justify-end right-0 absolute cursor-pointer mt-8",onClick:Sl,children:jsxRuntimeExports.jsx("button",{className:`${ps?"bg-[#FCFDFEB2] text-[black]":"bg-[#111213] border-[rgba(245,247,250,0.06)] text-[#FFFFFFCC]"}  w-[7.5rem] h-[2.125rem] rounded-lg text-xs border-[0.063rem] flex justify-center items-center z-[2]`,children:"Transfer to wallet"})})]})})})})},MobileTotalInVaultPosition=({invault:Fn,executeClaim:Mn,executeInvaultSell:rs})=>{const[is,os]=reactExports.useState(!1),[as,us]=reactExports.useState(!1),ds=()=>{os(!is)},{notificationStyle:hs,tooltipStyle:ps}=useStyles(),{isDarkMode:io,isLoader:fo}=useStore(),mo=new Date(Fn.entryTime).toLocaleTimeString(),Ao=new Date(Fn.entryTime).toLocaleDateString(),$o=TOKEN_LOGO[Fn.token],Lo=Fn.token,Go=Fn.option_type,Yo=Fn.direction,Wo=Fn["Invested Amount"],Jo=Fn.Balance,xl=Fn.pnl,_l=xl/Wo*100,Tl=Fn.onChainBalance,Sl=async()=>{try{if(fo){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:hs});return}us(!0),os(!1),await Mn(Fn.vault_id,Fn.token,Fn.option_type),us(!1)}catch(Pl){console.log(Pl),us(!1)}},$l=async()=>{try{if(fo){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:hs});return}us(!0),await rs(Fn.vault_id,"sell"+Yo,Wo,Tl,Tl,Fn.token,Fn.option_type),us(!1)}catch(Pl){console.log(Pl),us(!1)}};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`my-4 rounded-2xl p-4 ${io?"bg-[#fff]":"bg-[#111213] text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsxs("div",{className:"relative flex items-center justify-between mb-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-end items-center text-xs",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:$o,alt:Lo,className:"w-4"}),jsxRuntimeExports.jsx("p",{className:`${io?"text-[black] text-xs pl-1":"text-[#FFFFFFCC] text-xs pl-1"}`,children:Lo})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center text-[#777879] ml-1",children:[Go,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${Yo==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:Yo})]})]}),jsxRuntimeExports.jsx("img",{onClick:ds,src:Menu,alt:"Dropdown",className:"w-4 h-4 cursor-pointer pr-3"}),is&&jsxRuntimeExports.jsx("div",{className:"flex absolute right-0 -bottom-9 cursor-pointer",onClick:Sl,children:jsxRuntimeExports.jsx("button",{className:`w-[7.5rem] h-[2.125rem] rounded-lg border-[0.063rem] flex justify-center items-center text-xs z-[2] ${io?"bg-[white] text-black":"bg-[#111213] text-[#FFFFFFCC] border-[rgba(245,247,250,0.06)]"}`,children:"Transfer to wallet"})})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-between text-[0.625rem]",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-5",children:[jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Invested Amount"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your token balance at the start of ongoing cycle",arrow:!1,overlayInnerStyle:ps,children:jsxRuntimeExports.jsx("span",{children:"Current Balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your expected token balance at the end of ongoing cycle, which changes dynamically with change in price",arrow:!1,overlayInnerStyle:ps,children:jsxRuntimeExports.jsx("span",{children:"Tentative balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"PnL "})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your tokens can be either in Vault (smart contract) or your Wallet or mixed. All tokens are participating in the ongoing cycle",arrow:!1,overlayInnerStyle:ps,children:jsxRuntimeExports.jsx("span",{children:"Status "})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Entry Time"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{})})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${io?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"}`,children:["$",Wo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:" flex flex-col",children:jsxRuntimeExports.jsxs("div",{className:`${io?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"} `,children:["$",Tl.toFixed(2)]})})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:" flex flex-col",children:jsxRuntimeExports.jsxs("div",{className:`${io?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"} pl-1`,children:["$",Jo.toFixed(2)]})})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:" flex justify-center flex-col",children:jsxRuntimeExports.jsxs("div",{className:`${io?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"}`,children:["$",xl.toFixed(2),jsxRuntimeExports.jsxs("span",{className:`text-[0.65rem] ml-1 ${xl>=0?"text-[#12B76A]":"text-[#F04438]"}`,children:[xl>=0?"+"+_l.toFixed(2):_l.toFixed(2),"%"]})]})})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:"text-[#FDB022] text-xs font-extrabold",children:"In Vault"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:"flex flex-col",children:jsxRuntimeExports.jsxs("div",{className:`${io?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:[mo," ",jsxRuntimeExports.jsx("span",{className:"text-[0.65rem] text-[#777879]",children:Ao})]})})})]})]}),jsxRuntimeExports.jsx("div",{className:"w-full flex justify-between items-center",children:fo&&as?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:`${io?"bg-[#FCFDFE]":"bg-[#17181A] "} w-full h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] border-[#F79009] text-[#F79009]  border-[0.063rem font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`}):jsxRuntimeExports.jsx("button",{className:`${io?"bg-[#FCFDFE] border-[#F79009] text-[#F79009]":"bg-[#17181A] border-[#F79009] text-[#F79009]"} w-full border-[0.063rem] h-8 text-xs rounded-lg font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:$l,children:"Sell"})})]})})},TotalInWalletPosition=Fn=>{const{inwallet:Mn,executeOrder:rs}=Fn,{isDarkMode:is,isLoader:os}=useStore(),{notificationStyle:as}=useStyles(),[us,ds]=reactExports.useState(!1),[hs,ps]=reactExports.useState(!1),io=()=>{if(os){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:as});return}ps(!0),ds(!us)},fo=TOKEN_LOGO[Mn.token],mo=Mn.token,Ao=Mn.option_type,$o=Mn.direction,Lo=Mn["Invested Amount"],Go=Mn.Balance,Yo=Mn.pnl,Wo=Yo/Lo*100,Jo=Mn.onChainBalance,xl=Jo>=.01||Lo>=.01;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:`${xl?"":"hidden"} flex justify-center relative my-2 sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen px-2 text-[0.625rem]`,children:jsxRuntimeExports.jsxs("div",{className:`${is?"bg-[#EFF7F8]":" bg-[#1D1E20]"} rounded-2xl w-full py-5`,children:[jsxRuntimeExports.jsxs("div",{className:" flex px-4 gap-10",children:[jsxRuntimeExports.jsx("div",{className:"w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsx("div",{className:"flex justify-center items-center ml-4",children:jsxRuntimeExports.jsx("img",{src:is?dotsBlack:dots$1,alt:"dots"})})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:"   flex flex-col ",children:[jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("img",{src:fo,alt:mo,className:"w-4"}),jsxRuntimeExports.jsx("div",{className:`text-xs pl-1 ${is?"text-[black]":"text-[#FFFFFFCC]"}`,children:mo})]}),jsxRuntimeExports.jsxs("div",{className:"text-[0.625rem] flex pt-1",children:[jsxRuntimeExports.jsxs("div",{className:"text-[#777879]",children:[Ao," ",jsxRuntimeExports.jsx("span",{className:" pl-1",children:" •"})]}),jsxRuntimeExports.jsx("div",{className:`${$o==="Long"?"text-[#12B76A]":"text-[#F04438]"}  pl-1 `,children:$o})]})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%]  flex justify-start items-center align-middle  text-xs",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Lo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsx("div",{className:" flex flex-col",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} pt- text-xs2`,children:["$",Jo.toFixed(2)]})})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsx("div",{className:" flex flex-col",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} pt-2 text-xs`,children:["$",Go.toFixed(2)]})})}),jsxRuntimeExports.jsx("div",{className:"w-[10%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:" flex justify-center flex-col",children:[jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Yo.toFixed(2)]}),jsxRuntimeExports.jsxs("div",{className:`text-[0.65rem]  ${Yo>=0?"text-[#12B76A]":"text-[#F04438]"}`,children:[Yo>=0?"+"+Wo.toFixed(2):Wo.toFixed(2),"%"]})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle text-xs",children:jsxRuntimeExports.jsx("div",{className:"text-[#2ED3B7] !font-extrabold text-xs",children:"In Wallet"})}),jsxRuntimeExports.jsxs("div",{className:" w-[10%] flex justify-between items-center",children:[os&&hs?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:`${is?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7]  border-[0.063rem font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`}):jsxRuntimeExports.jsx("button",{className:`${is?"bg-[#FCFDFE]":"bg-[#17181A]"} border-[0.063rem] h-8 text-xs rounded-lg border-[#2ED3B7] text-[#2ED3B7] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:io,children:"Sell"}),jsxRuntimeExports.jsx("img",{src:Menu,alt:"menu",className:" w-4 h-4 ml-2 mt-2.5 opacity-0"})]})]}),us&&jsxRuntimeExports.jsx(SellInwalletPosition,{isSellOpen:us,setIsSellOpen:ds,currentBalance:Jo,executeOrder:rs,direction:$o,investedAmount:Lo,setIsLoading:ps,selectedToken:mo,selectedMode:Ao})]})})})},MobileTotalInWalletPosition=Fn=>{const{inwallet:Mn,executeOrder:rs}=Fn,{isDarkMode:is,isLoader:os}=useStore(),[as,us]=reactExports.useState(!1),[ds,hs]=reactExports.useState(!1),{notificationStyle:ps,tooltipStyle:io}=useStyles(),fo=()=>{if(os){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:ps});return}hs(!0),us(!as)},mo=TOKEN_LOGO[Mn.token],Ao=Mn.token,$o=Mn.option_type,Lo=Mn.direction,Go=Mn["Invested Amount"],Yo=Mn.Balance,Wo=Mn.pnl,Jo=Wo/Go*100,xl=Mn.onChainBalance;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`my-4 rounded-2xl p-4 ${is?"bg-[#fff]":"bg-[#111213] text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsx("div",{className:"relative flex items-center justify-between mb-4",children:jsxRuntimeExports.jsxs("div",{className:"flex justify-end items-center text-xs",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:mo,alt:Ao,className:"w-4"}),jsxRuntimeExports.jsx("p",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:Ao})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center text-[#777879] ml-1",children:[$o,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${Lo==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:Lo})]})]})}),jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-between text-[0.625rem]",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-5",children:[jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Invested Amount"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your token balance at the start of ongoing cycle",arrow:!1,overlayInnerStyle:io,children:jsxRuntimeExports.jsx("span",{children:"Current Balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your expected token balance at the end of ongoing cycle, which changes dynamically with change in price",arrow:!1,overlayInnerStyle:io,children:jsxRuntimeExports.jsx("span",{children:"Tentative balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"PnL "})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your tokens can be either in Vault (smart contract) or your Wallet or mixed. All tokens are participating in the ongoing cycle",arrow:!1,overlayInnerStyle:io,children:jsxRuntimeExports.jsx("span",{children:"Status "})})})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-3",children:[jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Go.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} pt-2 text-xs`,children:["$",xl.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} pt-2 text-xs`,children:["$",Yo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${is?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Wo.toFixed(2),jsxRuntimeExports.jsxs("span",{className:`text-[0.65rem] ml-1 ${Wo>=0?"text-[#12B76A]":"text-[#F04438]"}`,children:[Wo>=0?"+"+Jo.toFixed(2):Jo.toFixed(2),"%"]})]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:"text-[#2ED3B7] !font-extrabold text-xs",children:"In Wallet"})})]}),as&&jsxRuntimeExports.jsx(SellInwalletPosition,{isSellOpen:as,setIsSellOpen:us,currentBalance:xl,executeOrder:rs,direction:Lo,investedAmount:Go,setIsLoading:hs,selectedToken:Ao,selectedMode:$o})]}),jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center items-center mt-4",children:os&&ds?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:`${is?"bg-[#FCFDFE]":"bg-[#17181A] "} w-full h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7]  border-[0.063rem font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`}):jsxRuntimeExports.jsx("button",{className:`${is?"bg-[#FCFDFE]":"bg-[#17181A]"} w-full border-[0.063rem] h-8 text-xs rounded-lg border-[#2ED3B7] text-[#2ED3B7] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:fo,children:"Sell"})})]})})},GreenArrowUp="data:image/svg+xml,%3csvg%20width='8'%20height='4'%20viewBox='0%200%208%204'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20transform='matrix(1,-1.2246467991473532e-16,1.2246467991473532e-16,1,0,0)'%3e%3cpath%20d='M4%200C3.67695%200%203.35391%200.125617%203.10932%200.372201L0.100375%203.40564C-0.0334583%203.54056%20-0.0334583%203.76388%200.100375%203.89881C0.234208%204.03373%200.455725%204.03373%200.589559%203.89881L3.5985%200.865367C3.82002%200.642047%204.17998%200.642047%204.4015%200.865367L7.41044%203.89881C7.54427%204.03373%207.76579%204.03373%207.89962%203.89881C8.03346%203.76388%208.03346%203.54056%207.89962%203.40564L4.89068%200.372201C4.64609%200.125617%204.32305%200%204%200Z'%20fill='%230E9384'%3e%3c/path%3e%3c/svg%3e",GreenArrowDown="data:image/svg+xml,%3csvg%20width='8'%20height='4'%20viewBox='0%200%208%204'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20transform='matrix(-1,1.2246467991473532e-16,-1.2246467991473532e-16,-1,0,0)'%3e%3cpath%20d='M4%200C3.67695%200%203.35391%200.125617%203.10932%200.372201L0.100375%203.40564C-0.0334583%203.54056%20-0.0334583%203.76388%200.100375%203.89881C0.234208%204.03373%200.455725%204.03373%200.589559%203.89881L3.5985%200.865367C3.82002%200.642047%204.17998%200.642047%204.4015%200.865367L7.41044%203.89881C7.54427%204.03373%207.76579%204.03373%207.89962%203.89881C8.03346%203.76388%208.03346%203.54056%207.89962%203.40564L4.89068%200.372201C4.64609%200.125617%204.32305%200%204%200Z'%20fill='%230E9384'%3e%3c/path%3e%3c/svg%3e",TotalPosition=Fn=>{const{totalItem:Mn,inwalletItem:rs,invaultItem:is,executeOrder:os,executeClaim:as,executeInvaultSell:us}=Fn,[ds,hs]=reactExports.useState(!1),ps=()=>{hs(!ds)},{isDarkMode:io}=useStore(),fo=TOKEN_LOGO[Mn.token],mo=Mn.token,Ao=Mn.option_type,$o=Mn.direction,Lo=Mn["Invested Amount"],Go=Mn.Balance,Yo=Mn.pnl,Wo=Yo/Lo*100,Jo=Mn.onChainBalance,xl=Jo>=.01||Lo>=.01;return jsxRuntimeExports.jsx("div",{className:`${xl?"":"hidden"} flex justify-center relative my-2 sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen px-4 text-[0.625rem]`,children:jsxRuntimeExports.jsxs("div",{className:`${io?"bg-[#effdf9]":"bg-[#111213]"} rounded-2xl sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen ${ds?"pt-5":"py-5"}`,children:[jsxRuntimeExports.jsxs("div",{className:" flex px-8 gap-10",children:[jsxRuntimeExports.jsx("div",{className:"w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsx("div",{className:`${io?"text-[black]":"text-[#FFFFFFCC]"} flex justify-center items-center align-middle ml-2 text-xs`,children:"Total"})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:"   flex flex-col ",children:[jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("img",{src:fo,alt:mo,className:"w-4"}),jsxRuntimeExports.jsx("div",{className:`${io?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:mo})]}),jsxRuntimeExports.jsx("div",{className:"text-[0.625rem] flex pt-1",children:jsxRuntimeExports.jsxs("div",{className:"text-[#777879]",children:[Ao,jsxRuntimeExports.jsx("span",{className:" px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${$o==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:$o})]})})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%]  flex justify-start items-center align-middle  text-xs",children:jsxRuntimeExports.jsxs("div",{className:`${io?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Lo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:`${io?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Jo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:`${io?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Go.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"w-[10%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:" flex  flex-col",children:[jsxRuntimeExports.jsxs("div",{className:`${io?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Yo.toFixed(2)]}),jsxRuntimeExports.jsxs("div",{className:`text-[0.65rem]  ${Yo>=0?"text-[#12B76A]":"text-[#F04438]"}`,children:[Yo>=0?"+"+Wo.toFixed(2):Wo.toFixed(2),"%"]})]})}),jsxRuntimeExports.jsx("div",{className:" w-[13%] flex justify-start items-center align-middle text-xs",children:jsxRuntimeExports.jsx("div",{className:"text-[#FDB022] font-extrabold text-xs",children:rs.onChainBalance>=.01||rs["Invested Amount"]>=.01?"Vault & Wallet":"In Vault"})}),jsxRuntimeExports.jsxs("div",{className:" w-[10%] flex justify-between items-center cursor-pointer",onClick:ps,children:[jsxRuntimeExports.jsx("button",{className:`${io?"bg-[#FCFDFE] border-[#F79009] text-[#F79009]":"bg-[#17181A] border-[#F79009] text-[#F79009]"} border-[0.063rem] h-8 text-xs rounded-lg font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,children:"Sell"}),jsxRuntimeExports.jsx("img",{src:ds?io?GreenArrowUp:Updropdown:io?GreenArrowDown:DownDropdown,alt:"Dropdown",className:"ml-3 w-4 h-4 mt-2"})]})]}),ds&&jsxRuntimeExports.jsxs("div",{className:"mt-6",children:[is.map((_l,Tl)=>jsxRuntimeExports.jsx(TotalInVaultPosition,{isAlone:!1,invault:_l,executeClaim:as,executeInvaultSell:us},Tl)),jsxRuntimeExports.jsx(TotalInWalletPosition,{isAlone:!1,inwallet:rs,executeOrder:os})]})]})})},MobileTotalPosition=Fn=>{const{isDarkMode:Mn}=useStore(),{totalItem:rs,inwalletItem:is,invaultItem:os,executeOrder:as,executeClaim:us,executeInvaultSell:ds}=Fn,[hs,ps]=reactExports.useState(!1),{tooltipStyle:io}=useStyles(),fo=()=>{ps(!hs)},mo=TOKEN_LOGO[rs.token],Ao=rs.token,$o=rs.option_type,Lo=rs.direction,Go=rs["Invested Amount"],Yo=rs.Balance,Wo=rs.pnl,Jo=Wo/Go*100,xl=rs.onChainBalance;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"px-2",children:jsxRuntimeExports.jsxs("div",{className:`my-4 rounded-2xl p-4 ${Mn?"bg-[#F2F9F9]":"bg-[#17181A] text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-start items-center text-xs",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:mo,alt:Ao,className:"w-4"}),jsxRuntimeExports.jsx("p",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:Ao})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center text-[#777879] ml-1",children:[$o,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${Lo==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:Lo})]})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center border border-[#2ED3B7] rounded-lg py-2 pl-4 text-[10px] text-[#2ED3B7] cursor-pointer",onClick:fo,children:["Expand",jsxRuntimeExports.jsx("img",{src:hs?GreenArrowUp:GreenArrowDown,alt:"Dropdown",className:"w-3 h-3 ml-3 mr-2"})]})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-start gap-2 justify-between text-[0.625rem]",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-5",children:[jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Invested Amount"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your token balance at the start of ongoing cycle",arrow:!1,overlayInnerStyle:io,children:jsxRuntimeExports.jsx("span",{children:"Current Balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your expected token balance at the end of ongoing cycle, which changes dynamically with change in price",arrow:!1,overlayInnerStyle:io,children:jsxRuntimeExports.jsx("span",{children:"Tentative balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"PnL "})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your tokens can be either in Vault (smart contract) or your Wallet or mixed. All tokens are participating in the ongoing cycle",arrow:!1,overlayInnerStyle:io,children:jsxRuntimeExports.jsx("span",{children:"Status "})})})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center text-xs",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Go.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center text-xs",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",xl.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center text-xs",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Yo.toFixed(2)]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center text-xs",children:jsxRuntimeExports.jsx("div",{className:" flex  flex-col",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",Wo.toFixed(2),jsxRuntimeExports.jsxs("span",{className:`text-[0.65rem] ${Wo>=0?"text-[#12B76A]":"text-[#F04438]"} ml-1`,children:[Wo>=0?"+"+Jo.toFixed(2):Jo.toFixed(2),"%"]})]})})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center text-xs",children:jsxRuntimeExports.jsx("div",{className:"text-[#FDB022] font-extrabold text-xs",children:is.onChainBalance>=.01||is["Invested Amount"]>=.01?"Vault & Wallet":"In Vault"})})]})]}),hs&&jsxRuntimeExports.jsxs("div",{className:"mt-6",children:[os.map((_l,Tl)=>jsxRuntimeExports.jsx(MobileTotalInVaultPosition,{isAlone:!1,invault:_l,executeClaim:us,executeInvaultSell:ds},Tl)),jsxRuntimeExports.jsx(MobileTotalInWalletPosition,{isAlone:!1,inwallet:is,executeOrder:as})]}),jsxRuntimeExports.jsx("div",{className:"w-full flex justify-end items-center text-xs cursor-pointer mt-4",onClick:fo,children:jsxRuntimeExports.jsx("button",{className:`${Mn?"bg-[#FCFDFE] border-[#F79009] text-[#F79009]":"bg-[#17181A] border-[#F79009] text-[#F79009]"} w-full border-[0.063rem] h-8 text-xs rounded-lg font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,children:"Sell"})})]})})})},Positions=({executeOrder:Fn,executeClaim:Mn,executeInvaultSell:rs})=>{const{isDarkMode:is,updateIsWalletConnectVisible:os,isFetchingData:as}=useStore(),{isConnected:us}=useAccount(),{positions:ds}=useStore(),[hs,ps]=reactExports.useState(!1),{tooltipStyle:io,notificationStyle:fo}=useStyles();reactExports.useEffect(()=>{if(ds===null){ps(!1);return}const Ao=Object.values(ds).some($o=>Object.values($o).some(Lo=>{var Go,Yo,Wo,Jo;return(((Go=Lo==null?void 0:Lo.inWalletLongItem)==null?void 0:Go.onChainBalance)??0)>.01||(((Yo=Lo==null?void 0:Lo.inWalletShortItem)==null?void 0:Yo.onChainBalance)??0)>.01||(((Wo=Lo==null?void 0:Lo.longClaims)==null?void 0:Wo.length)??0)>0||(((Jo=Lo==null?void 0:Lo.shortClaims)==null?void 0:Jo.length)??0)>0}));ps(Ao)},[ds]);const mo=(Ao,$o)=>$o?Object.entries($o).map(([Lo,Go])=>{const{inWalletLongItem:Yo,inWalletShortItem:Wo,longClaims:Jo,shortClaims:xl,totalLongItem:_l,totalShortItem:Tl}=Go,Sl=((Yo==null?void 0:Yo.onChainBalance)??0)>.01||((Jo==null?void 0:Jo.length)??0)>0,$l=((Wo==null?void 0:Wo.onChainBalance)??0)>.01||((xl==null?void 0:xl.length)??0)>0,Pl=((Yo==null?void 0:Yo.onChainBalance)??0)>.01&&((Jo==null?void 0:Jo.length)??0)>0||((Jo==null?void 0:Jo.length)??0)>1,Dl=((Wo==null?void 0:Wo.onChainBalance)??0)>.01&&((xl==null?void 0:xl.length)??0)>0||((xl==null?void 0:xl.length)??0)>1;return jsxRuntimeExports.jsxs("div",{children:[Sl&&Pl&&_l&&Jo&&Yo?jsxRuntimeExports.jsx(TotalPosition,{totalItem:_l,invaultItem:Jo,inwalletItem:Yo,executeOrder:(Ol,Rl,Vo,jo,Ho,Qo,El)=>Fn(Ol,Rl,Vo,jo,Ho,Qo,El),executeClaim:Ol=>Mn(Ol,Ao,Lo,"long"),executeInvaultSell:(Ol,Rl,Vo,jo,Ho,Qo,El)=>rs(Ol,Rl,Vo,jo,Ho,Qo,El)}):((Yo==null?void 0:Yo.onChainBalance)??0)>.01&&Yo?jsxRuntimeExports.jsx(InWalletPosition,{isAlone:!0,inwallet:Yo,executeOrder:(Ol,Rl,Vo,jo,Ho,Qo,El)=>Fn(Ol,Rl,Vo,jo,Ho,Qo,El)}):((Jo==null?void 0:Jo.length)??0)>0&&Jo[0]&&jsxRuntimeExports.jsx(InVaultPosition,{isAlone:!0,invault:Jo[0],executeClaim:Ol=>Mn(Ol,Ao,Lo,"long"),executeInvaultSell:(Ol,Rl,Vo,jo,Ho,Qo,El)=>rs(Ol,Rl,Vo,jo,Ho,Qo,El)}),$l&&Dl&&Tl&&xl&&Wo?jsxRuntimeExports.jsx(TotalPosition,{totalItem:Tl,invaultItem:xl,inwalletItem:Wo,executeOrder:(Ol,Rl,Vo,jo,Ho,Qo,El)=>Fn(Ol,Rl,Vo,jo,Ho,Qo,El),executeClaim:Ol=>Mn(Ol,Ao,Lo,"short"),executeInvaultSell:(Ol,Rl,Vo,jo,Ho,Qo,El)=>rs(Ol,Rl,Vo,jo,Ho,Qo,El)}):((Wo==null?void 0:Wo.onChainBalance)??0)>.01&&Wo?jsxRuntimeExports.jsx(InWalletPosition,{isAlone:!0,inwallet:Wo,executeOrder:(Ol,Rl,Vo,jo,Ho,Qo,El)=>Fn(Ol,Rl,Vo,jo,Ho,Qo,El)}):((xl==null?void 0:xl.length)??0)>0&&xl[0]&&jsxRuntimeExports.jsx(InVaultPosition,{isAlone:!0,invault:xl[0],executeClaim:Ol=>Mn(Ol,Ao,Lo,"short"),executeInvaultSell:(Ol,Rl,Vo,jo,Ho,Qo,El)=>rs(Ol,Rl,Vo,jo,Ho,Qo,El)})]},`${Ao}-${Lo}`)}):null;return jsxRuntimeExports.jsxs("div",{className:"w-full",children:[jsxRuntimeExports.jsxs("div",{className:`${is?"bg-[#F2F9F9] border-[#E3E8EF]":"bg-[#111213] text-[#A5A5A6] border-[rgba(245,247,250,0.06)]"} flex border-b-[0.063rem] p-[0.5rem_2rem_0.5rem_2rem] text-[0.625rem] sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen gap-10`,children:[jsxRuntimeExports.jsx("div",{className:" flex justify-start w-[13%] ",children:jsxRuntimeExports.jsx("span",{children:"Entry Time"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start w-[13%]",children:jsxRuntimeExports.jsx("span",{children:"Market"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start w-[13%]",children:jsxRuntimeExports.jsx("span",{children:"Invested Amount"})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start w-[13%]",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your token balance at the start of ongoing cycle",arrow:!1,overlayInnerStyle:io,children:jsxRuntimeExports.jsx("span",{children:"Current Balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start w-[13%]",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your expected token balance at the end of ongoing cycle, which changes dynamically with change in price",arrow:!1,overlayInnerStyle:io,children:jsxRuntimeExports.jsx("span",{children:"Tentative balance"})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start w-[10%]",children:jsxRuntimeExports.jsx("span",{children:"PnL "})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start w-[13%]",children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your tokens can be either in Vault (smart contract) or your Wallet or mixed. All tokens are participating in the ongoing cycle",arrow:!1,overlayInnerStyle:io,children:jsxRuntimeExports.jsx("span",{children:"Status "})})}),jsxRuntimeExports.jsx("div",{className:" flex justify-start w-[10%]",children:jsxRuntimeExports.jsx("span",{})})]}),ds!==null&&!as&&hs?Object.entries(ds).map(([Ao,$o])=>mo(Ao,$o)):as?jsxRuntimeExports.jsx("div",{className:"flex justify-center items-center h-12",children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"})}):jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center h-12 rounded-b-[1rem] ${is?"bg-[#F2F9F9]":"bg-[#17181A80] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsx("span",{className:"text-xs",children:us?"No open positions":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("span",{className:"text-[#2ED3B7] cursor-pointer font-bold",onClick:()=>os(!0),children:["Connect Wallet"," "]}),"to view positions"]})})})]})},MobilePositions=({executeOrder:Fn,executeClaim:Mn,executeInvaultSell:rs})=>{const{isDarkMode:is,updateIsWalletConnectVisible:os,isFetchingData:as}=useStore(),{positions:us}=useStore(),[ds,hs]=reactExports.useState(!1),{isConnected:ps}=useAccount();reactExports.useEffect(()=>{if(us===null){hs(!1);return}const fo=Object.values(us).some(mo=>Object.values(mo).some(Ao=>{var $o,Lo,Go,Yo;return((($o=Ao==null?void 0:Ao.inWalletLongItem)==null?void 0:$o.onChainBalance)??0)>.01||(((Lo=Ao==null?void 0:Ao.inWalletShortItem)==null?void 0:Lo.onChainBalance)??0)>.01||(((Go=Ao==null?void 0:Ao.longClaims)==null?void 0:Go.length)??0)>0||(((Yo=Ao==null?void 0:Ao.shortClaims)==null?void 0:Yo.length)??0)>0}));hs(fo)},[us]);const io=(fo,mo)=>mo?Object.entries(mo).map(([Ao,$o])=>{const{inWalletLongItem:Lo,inWalletShortItem:Go,longClaims:Yo,shortClaims:Wo,totalLongItem:Jo,totalShortItem:xl}=$o,_l=((Lo==null?void 0:Lo.onChainBalance)??0)>.01||((Yo==null?void 0:Yo.length)??0)>0,Tl=((Go==null?void 0:Go.onChainBalance)??0)>.01||((Wo==null?void 0:Wo.length)??0)>0,Sl=((Lo==null?void 0:Lo.onChainBalance)??0)>.01&&((Yo==null?void 0:Yo.length)??0)>0||((Yo==null?void 0:Yo.length)??0)>1,$l=((Go==null?void 0:Go.onChainBalance)??0)>.01&&((Wo==null?void 0:Wo.length)??0)>0||((Wo==null?void 0:Wo.length)??0)>1;return jsxRuntimeExports.jsxs("div",{children:[_l&&Sl&&Jo&&Yo&&Lo?jsxRuntimeExports.jsx(MobileTotalPosition,{totalItem:Jo,invaultItem:Yo,inwalletItem:Lo,executeOrder:(Pl,Dl,Ol,Rl,Vo,jo,Ho)=>Fn(Pl,Dl,Ol,Rl,Vo,jo,Ho),executeClaim:Pl=>Mn(Pl,fo,Ao,"long"),executeInvaultSell:(Pl,Dl,Ol,Rl,Vo,jo,Ho)=>rs(Pl,Dl,Ol,Rl,Vo,jo,Ho)}):((Lo==null?void 0:Lo.onChainBalance)??0)>.01&&Lo?jsxRuntimeExports.jsx(MobileInWalletPosition,{isAlone:!0,inwallet:Lo,executeOrder:(Pl,Dl,Ol,Rl,Vo,jo,Ho)=>Fn(Pl,Dl,Ol,Rl,Vo,jo,Ho)}):((Yo==null?void 0:Yo.length)??0)>0&&Yo[0]&&jsxRuntimeExports.jsx(MobileInVaultPosition,{isAlone:!0,invault:Yo[0],executeClaim:Pl=>Mn(Pl,fo,Ao,"long"),executeInvaultSell:(Pl,Dl,Ol,Rl,Vo,jo,Ho)=>rs(Pl,Dl,Ol,Rl,Vo,jo,Ho)}),Tl&&$l&&xl&&Wo&&Go?jsxRuntimeExports.jsx(MobileTotalPosition,{totalItem:xl,invaultItem:Wo,inwalletItem:Go,executeOrder:(Pl,Dl,Ol,Rl,Vo,jo,Ho)=>Fn(Pl,Dl,Ol,Rl,Vo,jo,Ho),executeClaim:Pl=>Mn(Pl,fo,Ao,"short"),executeInvaultSell:(Pl,Dl,Ol,Rl,Vo,jo,Ho)=>rs(Pl,Dl,Ol,Rl,Vo,jo,Ho)}):((Go==null?void 0:Go.onChainBalance)??0)>.01&&Go?jsxRuntimeExports.jsx(MobileInWalletPosition,{isAlone:!0,inwallet:Go,executeOrder:(Pl,Dl,Ol,Rl,Vo,jo,Ho)=>Fn(Pl,Dl,Ol,Rl,Vo,jo,Ho)}):((Wo==null?void 0:Wo.length)??0)>0&&Wo[0]&&jsxRuntimeExports.jsx(MobileInVaultPosition,{isAlone:!0,invault:Wo[0],executeClaim:Pl=>Mn(Pl,fo,Ao,"short"),executeInvaultSell:(Pl,Dl,Ol,Rl,Vo,jo,Ho)=>rs(Pl,Dl,Ol,Rl,Vo,jo,Ho)})]},`${fo}-${Ao}`)}):null;return jsxRuntimeExports.jsx("div",{className:"w-full",children:us!==null&&!as&&ds?Object.entries(us).map(([fo,mo])=>io(fo,mo)):as?jsxRuntimeExports.jsx("div",{className:"flex justify-center items-center h-12",children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"})}):jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center h-12 rounded-2xl mt-4 mx-2 ${is?"bg-[#F2F9F9]":"bg-[#17181A80] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsx("span",{className:"text-xs",children:ps?"No open positions":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("span",{className:"text-[#2ED3B7] cursor-pointer font-bold",onClick:()=>os(!0),children:["Connect Wallet"," "]}),"to view positions"]})})})})},OrderInfo=Fn=>{const{balance:Mn,direction:rs,nextSettlementTime:is,option_type:os,symbol:as,token:us,name:ds,executeCancel:hs,id:ps,can_cancel:io,in_symbol:fo,in_vaule:mo,out_symbol:Ao,out_vaule:$o}=Fn,{isDarkMode:Lo,isLoader:Go}=useStore(),[Yo,Wo]=reactExports.useState(""),[Jo,xl]=reactExports.useState(new Date().getTime()),[_l,Tl]=reactExports.useState(!1),{notificationStyle:Sl}=useStyles();reactExports.useEffect(()=>{const Dl=setInterval(()=>{const Ol=new Date().getTime(),Rl=is*1e3-Ol,Vo=Math.floor(Rl/(1e3*60)),jo=Math.floor(Rl%(1e3*60)/1e3);Wo(`${Vo}:${jo}`),xl(Ol)},1e3);return()=>clearInterval(Dl)},[is]);const $l=TOKEN_LOGO[us],Pl=async()=>{if(Go){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:Sl});return}try{Tl(!0),await hs(ps,us,os),Tl(!1)}catch{Tl(!1)}};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`${is*1e3-Jo<=0?"hidden":""} h-16 flex justify-between p-[0.5rem_2rem_0.5rem_0.8rem] gap-1 border-b-[0.063rem] last:rounded-b-[1rem] ${Lo?"border-[#E3E8EF]":"border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:"w-[25%] flex flex-col justify-center",children:[jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("img",{src:$l,alt:us,className:"w-4"}),jsxRuntimeExports.jsx("div",{className:`${Lo?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:us})]}),jsxRuntimeExports.jsx("div",{className:"text-[0.625rem] flex mt-[0.1rem]",children:jsxRuntimeExports.jsxs("div",{className:"text-[#777879]",children:[os,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${rs==="Long"?"text-[#12B76A]":"text-[#F04438]"} `,children:rs})]})})]}),jsxRuntimeExports.jsx("div",{className:"w-[25%] flex py-2 text-xs items-center",children:jsxRuntimeExports.jsx("div",{className:`${Lo?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:ds.includes("Buy")?"Buy":"Sell"})}),jsxRuntimeExports.jsxs("div",{className:"w-[25%] flex flex-col justify-center",children:[jsxRuntimeExports.jsx("div",{className:`${Lo?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:$o}),jsxRuntimeExports.jsx("div",{className:"text-[0.65rem] text-[#777879]",children:Ao})]}),jsxRuntimeExports.jsxs("div",{className:"w-[25%] flex flex-col justify-center",children:[jsxRuntimeExports.jsx("div",{className:`${Lo?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:mo.toLocaleString()}),jsxRuntimeExports.jsx("div",{className:"text-[0.65rem] text-[#777879]",children:fo})]}),jsxRuntimeExports.jsxs("div",{className:"w-[15%] flex flex-col justify-center",children:[jsxRuntimeExports.jsx("div",{className:`${Lo?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:Yo}),jsxRuntimeExports.jsx("div",{className:"text-[0.65rem] text-[#777879]",children:"Minutes"})]}),io?jsxRuntimeExports.jsx("div",{className:"w-[10%] flex items-center",children:Go&&_l?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:`${Lo?"text-[#B42318] bg-[#FEF3F2] border-[#FDA29B]":"text-[#FF5555] border-[#FF4D5433]"} h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`}):jsxRuntimeExports.jsx("button",{className:`${Lo?"text-[#B42318] bg-[#FEF3F2] border-[#FDA29B]":"text-[#FF5555] border-[#FF4D5433]"} h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:Pl,children:"Cancel"})}):jsxRuntimeExports.jsx("div",{className:"w-[10%] flex items-center"})]})})},MobileOrderInfo=Fn=>{const{balance:Mn,direction:rs,nextSettlementTime:is,option_type:os,symbol:as,token:us,name:ds,executeCancel:hs,id:ps,can_cancel:io,in_symbol:fo,in_vaule:mo,out_symbol:Ao,out_vaule:$o}=Fn,{isDarkMode:Lo,isLoader:Go}=useStore(),[Yo,Wo]=reactExports.useState(""),[Jo,xl]=reactExports.useState(new Date().getTime()),[_l,Tl]=reactExports.useState(!1),{notificationStyle:Sl}=useStyles();reactExports.useEffect(()=>{const Dl=setInterval(()=>{const Ol=new Date().getTime(),Rl=is*1e3-Ol,Vo=Math.floor(Rl/(1e3*60)),jo=Math.floor(Rl%(1e3*60)/1e3);Wo(`${Vo}:${jo}`),xl(Ol)},1e3);return()=>clearInterval(Dl)},[is]);const $l=TOKEN_LOGO[us],Pl=async()=>{if(Go){staticMethods.open({message:"Other transaction on going",description:"please check wallet or refresh the page",style:Sl});return}try{Tl(!0),await hs(ps,us,os),Tl(!1)}catch{Tl(!1)}};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`${is*1e3-Jo<=0?"hidden":""} space-y-4 text-[white] text-xs`,children:[jsxRuntimeExports.jsxs("div",{className:"flex items-start",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:$l,alt:us,className:"w-4"}),jsxRuntimeExports.jsx("p",{className:`${Lo?"text-[black] text-xs pl-1":"text-[#FFFFFFCC] text-xs pl-1"}`,children:us})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center text-[#777879] ml-1",children:[os,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${rs==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:rs})]})]}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:`${Lo?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"}`,children:ds.includes("Buy")?"Buy":"Sell"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${Lo?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"}`,children:[$o," ",Ao]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${Lo?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"}`,children:[mo.toLocaleString()," ",fo]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${Lo?"text-[black] text-xs":"text-[#FFFFFFCC] text-xs"}`,children:[Yo," ",jsxRuntimeExports.jsx("span",{className:"text-[0.65rem] text-[#777879]",children:"Minutes"})]})}),io?jsxRuntimeExports.jsx("div",{className:"w-full flex items-center justify-end",children:Go&&_l?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:`${Lo?"text-[#B42318] bg-[#FEF3F2] border-[#FDA29B]":"text-[#FF5555] border-[#FF4D5433]"} h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`}):jsxRuntimeExports.jsx("button",{className:`${Lo?"text-[#B42318] bg-[#FEF3F2] border-[#FDA29B]":"text-[#FF5555] border-[#FF4D5433]"} h-8 text-xs cursor-pointer rounded-lg border-[0.063rem] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:Pl,children:"Cancel"})}):jsxRuntimeExports.jsx("div",{className:"w-full flex items-center"})]})})},mobileHeadings$1=["Market","Side","Pay","Receive","Time till execution"],OpenOrder=({executeCancel:Fn})=>{const{isDarkMode:Mn,updateIsWalletConnectVisible:rs,isFetchingData:is}=useStore(),{openOrders:os}=useStore(),{isConnected:as}=useAccount(),us=(fo,mo)=>jsxRuntimeExports.jsx(OrderInfo,{id:fo.id,balance:fo.balance,direction:fo.direction,nextSettlementTime:fo.nextSettlementTime,option_type:fo.option_type,symbol:fo.symbol,token:fo.token,name:fo.name,can_cancel:fo.can_cancel,executeCancel:Fn,in_symbol:fo.in_symbol,in_vaule:fo.in_vaule,out_symbol:fo.out_symbol,out_vaule:fo.out_vaule},`${fo.token}-${fo.option_type}-${mo}`),ds=os&&Object.values(os).some(fo=>fo.CALL.length>0||fo.PUT.length>0),hs=()=>jsxRuntimeExports.jsx("div",{className:"flex justify-center items-center h-12",children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"})}),ps=()=>jsxRuntimeExports.jsxs("div",{className:`${Mn?"bg-[#F2F9F9] border-[#E3E8EF]":"bg-[#111213] text-[#A5A5A6] border-[rgba(245,247,250,0.06)]"} border-b-[0.063rem] flex justify-between p-[0.5rem_2rem_0.5rem_0.8rem] text-[0.625rem]`,children:[jsxRuntimeExports.jsx("div",{className:"w-[25%] flex items-center",children:jsxRuntimeExports.jsx("span",{children:"Market"})}),jsxRuntimeExports.jsx("div",{className:"w-[25%] flex items-center",children:jsxRuntimeExports.jsx("span",{children:"Side"})}),jsxRuntimeExports.jsx("div",{className:"w-[25%] flex items-center",children:jsxRuntimeExports.jsx("span",{children:"Pay"})}),jsxRuntimeExports.jsx("div",{className:"w-[25%] flex items-center",children:jsxRuntimeExports.jsx("span",{children:"Receive"})}),jsxRuntimeExports.jsx("div",{className:"w-[15%] flex items-center",children:jsxRuntimeExports.jsx("span",{children:"Time till execution"})}),jsxRuntimeExports.jsx("div",{className:"w-[10%] flex items-center"})]}),io=()=>jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center h-12 rounded-b-2xl ${Mn?"bg-[#F2F9F9]":"bg-[#17181A80] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsx("span",{className:"text-xs",children:as?"No open orders":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("span",{className:"text-[#2ED3B7] cursor-pointer font-bold",onClick:()=>rs(!0),children:["Connect Wallet"," "]}),"to view open orders"]})})});return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(ps,{}),is?jsxRuntimeExports.jsx(hs,{}):ds?Object.entries(os).map(([fo,mo])=>jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("div",{children:mo.CALL.length>0&&mo.CALL.map((Ao,$o)=>us(Ao,$o))}),jsxRuntimeExports.jsx("div",{className:"",children:mo.PUT.length>0&&mo.PUT.map((Ao,$o)=>us(Ao,$o))})]},fo)):jsxRuntimeExports.jsx(io,{})]})},MobileOpenOrder=({executeCancel:Fn})=>{var Ao,$o;const{isDarkMode:Mn,updateIsWalletConnectVisible:rs,isFetchingData:is}=useStore(),{openOrders:os}=useStore(),as=os?($o=(Ao=Object.values(os)[0])==null?void 0:Ao.CALL[0])==null?void 0:$o.nextSettlementTime:0,[us,ds]=reactExports.useState(new Date().getTime()),{isConnected:hs}=useAccount(),ps=os&&Object.values(os).some(Lo=>Lo.CALL.length>0||Lo.PUT.length>0);reactExports.useEffect(()=>{const Lo=setInterval(()=>{const Go=new Date().getTime();ds(Go)},1e3);return()=>clearInterval(Lo)},[as]);const io=()=>jsxRuntimeExports.jsx("div",{className:"flex justify-center items-center h-12",children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"})}),fo=(Lo,Go)=>jsxRuntimeExports.jsx(MobileOrderInfo,{id:Lo.id,balance:Lo.balance,direction:Lo.direction,nextSettlementTime:Lo.nextSettlementTime,option_type:Lo.option_type,symbol:Lo.symbol,token:Lo.token,name:Lo.name,can_cancel:Lo.can_cancel,executeCancel:Fn,in_symbol:Lo.in_symbol,in_vaule:Lo.in_vaule,out_symbol:Lo.out_symbol,out_vaule:Lo.out_vaule},`${Lo.token}-${Lo.option_type}-${Go}`),mo=()=>jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center h-12 rounded-2xl mt-4 mx-2 ${Mn?"bg-[#F2F9F9]":"bg-[#17181A80] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsx("span",{className:"text-xs",children:hs?"No open orders":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("span",{className:"text-[#2ED3B7] cursor-pointer font-bold",onClick:()=>rs(!0),children:["Connect Wallet"," "]}),"to view open orders"]})})});return is?io():os===null||!os&&!is&&!ps?mo():jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ps?jsxRuntimeExports.jsx("div",{className:"p-2",children:Object.entries(os).map(([Lo,Go])=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Go.CALL.length>0&&jsxRuntimeExports.jsx("div",{className:`my-4 rounded-2xl p-4 ${Number(as)*1e3-us<=0?"hidden":""} ${Mn?"bg-[#F2F9F9]":"bg-[#17181A] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsxs("div",{className:"flex items-start gap-2 justify-between text-[0.625rem]",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-5",children:[mobileHeadings$1.map((Yo,Wo)=>jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:Yo})},Wo)),jsxRuntimeExports.jsx("div",{className:"flex justify-start"})]}),Go.CALL.map((Yo,Wo)=>fo(Yo,Wo))]})},Lo),Go.PUT.length>0&&jsxRuntimeExports.jsx("div",{className:`my-4 rounded-2xl p-4 ${Number(as)*1e3-us<=0?"hidden":""} ${Mn?"bg-[#F2F9F9]":"bg-[#17181A] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsxs("div",{className:"flex items-start gap-2 justify-between text-[0.625rem]",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-5",children:[mobileHeadings$1.map((Yo,Wo)=>jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:Yo})},Wo)),jsxRuntimeExports.jsx("div",{className:"flex justify-start"})]}),Go.PUT.map((Yo,Wo)=>fo(Yo,Wo))]})},Lo)]}))}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:mo()})})},TradeInfo=Fn=>{const{isDarkMode:Mn,isSelectedChain:rs}=useStore(),{name:is,option_type:os,symbol:as,timestamp_number:us,token:ds,transaction_type:hs,value:ps,transaction_hash:io}=Fn,fo=new Date(parseInt(us)*1e3).toLocaleTimeString(),mo=new Date(parseInt(us)*1e3).toLocaleDateString(),Ao=TOKEN_LOGO[ds],$o=hs.includes("Long")?"Long":"Short",Lo=is,Go=`${CHAIN_PARAMS_CONFIG[rs].explorer_link}/tx/${io}`;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"border-[#E3E8EF]":"border-[rgba(245,247,250,0.06)]"} py-5 flex justify-between gap-2 px-8 border-b-[0.063rem] last:border-0 last:rounded-b-[1rem]`,children:[jsxRuntimeExports.jsxs("div",{className:"w-[20%] flex flex-col justify-center items-start",children:[jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:fo}),jsxRuntimeExports.jsx("div",{className:"text-[0.65rem] text-[#777879]",children:mo})]}),jsxRuntimeExports.jsxs("div",{className:"w-[20%] flex flex-col justify-center items-start",children:[jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("img",{src:Ao,alt:ds,className:"w-4"}),jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:ds})]}),jsxRuntimeExports.jsx("div",{className:"text-[0.625rem] flex pt-1",children:jsxRuntimeExports.jsxs("div",{className:"text-[#777879]",children:[os,jsxRuntimeExports.jsx("span",{className:" px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${$o==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:$o})]})})]}),jsxRuntimeExports.jsx("div",{className:"w-[20%] items-center flex text-xs",children:jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:Lo})}),jsxRuntimeExports.jsxs("div",{className:"w-[20%] justify-center items-start flex flex-col",children:[jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:ps}),jsxRuntimeExports.jsx("div",{className:"text-[0.65rem] text-[#777879]",children:as})]}),jsxRuntimeExports.jsx("div",{className:"w-[20%] flex items-center justify-start",children:jsxRuntimeExports.jsxs("a",{className:"text-[#2ED3B7] text-xs underline",href:Go,target:"_blank",children:[io.slice(0,8),"..."]})})]})})},MobileTradeInfo=Fn=>{const{isDarkMode:Mn,isSelectedChain:rs}=useStore(),{name:is,option_type:os,symbol:as,timestamp_number:us,token:ds,transaction_type:hs,value:ps,transaction_hash:io}=Fn,fo=new Date(parseInt(us)*1e3).toLocaleTimeString(),mo=new Date(parseInt(us)*1e3).toLocaleDateString(),Ao=TOKEN_LOGO[ds],$o=hs.includes("Long")?"Long":"Short",Lo=is,Go=`${CHAIN_PARAMS_CONFIG[rs].explorer_link}/tx/${io}`;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"space-y-4 text-[white] text-xs",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-start",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:Ao,alt:ds,className:"w-4"}),jsxRuntimeExports.jsx("p",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:ds})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center text-[#777879] ml-1",children:[os,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${$o==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:$o})]})]}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:Lo})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:[ps," ",as]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("a",{className:"text-[#2ED3B7] underline",href:Go,target:"_blank",children:[io.slice(0,8),"..."]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:[fo," ",jsxRuntimeExports.jsx("span",{className:"text-[0.65rem] text-[#777879]",children:mo})]})})]})})},headings=["Time","Market","Side","Amount","TX hash"],mobileHeadings=["Market","Side","Amount","TX hash","Time"],Trades=()=>{const{isDarkMode:Fn,updateIsWalletConnectVisible:Mn,isFetchingData:rs}=useStore(),{trades:is}=useStore(),{isConnected:os}=useAccount();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:`${Fn?"bg-[#F2F9F9] border-[#E3E8EF]":"bg-[#111213] text-[#A5A5A6] border-[rgba(245,247,250,0.06)]"} flex justify-between border-b-[0.063rem] p-[0.5rem_2rem_0.5rem_2rem] gap-2 text-[0.625rem]`,children:headings.map((as,us)=>jsxRuntimeExports.jsx("div",{className:"w-[20%] flex justify-start",children:jsxRuntimeExports.jsx("span",{children:as})},us))}),rs?jsxRuntimeExports.jsx("div",{className:"w-full flex items-center justify-center my-4",children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-[2.2rem] h-[1.2rem] flex justify-center items-center"})}):is==null?void 0:is.map((as,us)=>jsxRuntimeExports.jsx(TradeInfo,{name:as.name,option_type:as.option_type,symbol:as.symbol,timestamp_number:as.timestamp_number,token:as.token,transaction_type:as.transaction_type,value:as.value,transaction_hash:as.transaction_hash},us)),((is==null?void 0:is.length)===0||!is)&&!rs&&jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center h-12 rounded-b-[1rem] ${Fn?"bg-[#F2F9F9]":"bg-[#17181A80] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsx("span",{className:"text-xs",children:os?"No trade history":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("span",{className:"text-[#2ED3B7] cursor-pointer font-bold",onClick:()=>Mn(!0),children:["Connect Wallet"," "]}),"to view trades"]})})})]})},MobileTrades=()=>{const{isDarkMode:Fn,updateIsWalletConnectVisible:Mn,isFetchingData:rs}=useStore(),{trades:is}=useStore(),{isConnected:os}=useAccount();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[rs?jsxRuntimeExports.jsx("div",{className:"w-full flex items-center justify-center mt-4",children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-[2.2rem] h-[1.2rem] flex justify-center items-center"})}):jsxRuntimeExports.jsx("div",{className:"px-2",children:is==null?void 0:is.map((as,us)=>jsxRuntimeExports.jsx("div",{className:`my-4 rounded-2xl p-4 ${Fn?"bg-[#F2F9F9]":"bg-[#17181A] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsxs("div",{className:"flex items-end gap-2 justify-between text-[0.625rem]",children:[jsxRuntimeExports.jsx("div",{className:"space-y-5",children:mobileHeadings.map((ds,hs)=>jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:ds})},hs))}),jsxRuntimeExports.jsx(MobileTradeInfo,{name:as.name,option_type:as.option_type,symbol:as.symbol,timestamp_number:as.timestamp_number,token:as.token,transaction_type:as.transaction_type,value:as.value,transaction_hash:as.transaction_hash})]})},us))}),((is==null?void 0:is.length)===0||!is)&&!rs&&jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center h-12 rounded-2xl mt-4 mx-2 ${Fn?"bg-[#F2F9F9]":"bg-[#17181A80] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsx("span",{className:"text-xs",children:os?"No Trade History":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("span",{className:"text-[#2ED3B7] cursor-pointer font-bold",onClick:()=>Mn(!0),children:["Connect Wallet"," "]}),"to view trades"]})})})]})},TotalWithdrawInfo=Fn=>{const{isDarkMode:Mn,isLoader:rs}=useStore(),{notificationStyle:is}=useStyles(),[os,as]=reactExports.useState(!1),{exitTime:us,token:ds,option_type:hs,direction:ps,Balance:io,vault_id:fo,executeClaim:mo}=Fn,Ao=new Date(us).toLocaleTimeString(),$o=new Date(us).toLocaleDateString(),Lo=TOKEN_LOGO[ds],Go=async()=>{if(rs){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:is});return}as(!0),await mo(fo,ds,hs),as(!1)};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"flex justify-center sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen px-2 my-2",children:jsxRuntimeExports.jsx("div",{className:`${Mn?"bg-[#EFF7F8]":" bg-[#1D1E20]"} rounded-2xl sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen  py-5`,children:jsxRuntimeExports.jsxs("div",{className:" flex px-4 gap-10",children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-[25%]",children:[jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:Ao}),jsxRuntimeExports.jsx("div",{className:"text-[0.65rem] text-[#777879]",children:$o})]}),jsxRuntimeExports.jsxs("div",{className:"w-[25%] flex flex-col justify-center",children:[jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("img",{src:Lo,alt:ds,className:"w-4"}),jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:ds})]}),jsxRuntimeExports.jsxs("div",{className:"text-[0.625rem] flex",children:[jsxRuntimeExports.jsxs("div",{className:"text-[#777879]",children:[hs," ",jsxRuntimeExports.jsx("span",{className:" pl-1",children:" •"})]}),jsxRuntimeExports.jsxs("div",{className:`${ps==="Long"?"text-[#12B76A]":"text-[#F04438]"}  pl-1 `,children:[" ",ps]})]})]}),jsxRuntimeExports.jsx("div",{className:"w-[25%] flex text-xs items-center",children:jsxRuntimeExports.jsxs("div",{className:`text-xs ${Mn?"text-[black]":"text-[#FFFFFFCC]"}`,children:["$",io]})}),jsxRuntimeExports.jsxs("div",{className:"w-[25%] flex justify-end items-center",children:[rs&&os?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"}):jsxRuntimeExports.jsx("button",{className:`${Mn?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:Go,children:"Withdraw USDC"}),jsxRuntimeExports.jsx("img",{src:Menu,alt:"menu",className:" w-4 h-4 ml-2 mt-2.5 hidden"})]})]})})})})},MobileTotalWithdrawInfo=Fn=>{const{isDarkMode:Mn,isLoader:rs}=useStore(),{notificationStyle:is}=useStyles(),[os,as]=reactExports.useState(!1),{exitTime:us,token:ds,option_type:hs,direction:ps,Balance:io,vault_id:fo,executeClaim:mo}=Fn,Ao=new Date(us).toLocaleTimeString(),$o=new Date(us).toLocaleDateString(),Lo=TOKEN_LOGO[ds],Go=async()=>{if(rs){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:is});return}as(!0),await mo(fo,ds,hs),as(!1)};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`w-full flex items-start justify-between mb-4 p-4 rounded-2xl ${Mn?"bg-[white]":"bg-[#111213]"}`,children:[jsxRuntimeExports.jsxs("div",{className:"space-y-5 items-start text-xs text-[#777879]",children:[jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Time"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Market"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Current Balance"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start"})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-4 items-start text-[white] text-xs",children:[jsxRuntimeExports.jsx("div",{className:"flex items-start justify-end",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:[Ao," ",jsxRuntimeExports.jsx("span",{className:"text-[0.65rem] text-[#777879]",children:$o})]})}),jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-end",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:Lo,alt:ds,className:"w-4"}),jsxRuntimeExports.jsx("p",{className:`text-xs pl-1 ${Mn?"text-[black]":"text-[#FFFFFFCC]"}`,children:ds})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center text-[#777879] ml-1",children:[hs,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${ps==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:ps})]})]}),jsxRuntimeExports.jsx("div",{className:"flex items-start justify-end",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",io]})}),jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-end",children:[rs&&os?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"}):jsxRuntimeExports.jsx("button",{className:`${Mn?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:Go,children:"Withdraw USDC"}),jsxRuntimeExports.jsx("img",{src:Menu,alt:"menu",className:" w-4 h-4 ml-2 mt-2.5 hidden"})]})]})]})})},TotalWithdraw=Fn=>{const[Mn,rs]=reactExports.useState(!1),[is,os]=reactExports.useState(!1),as=()=>{rs(!Mn)},{isDarkMode:us,isLoader:ds}=useStore(),{claims:hs}=Fn,ps=hs.reduce((Ao,$o)=>Ao+parseFloat($o.Balance),0),io=TOKEN_LOGO[hs[0].token],{notificationStyle:fo}=useStyles(),mo=()=>{if(ds){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:fo});return}os(!0),hs.map(Ao=>{Fn.executeClaim(Ao.vault_id,Ao.token,Ao.option_type)}),os(!1)};return jsxRuntimeExports.jsx("div",{className:"flex justify-center sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen px-4 my-2",children:jsxRuntimeExports.jsxs("div",{className:`${us?"bg-[#effdf9]":"bg-[#111213]"} rounded-2xl sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen ${Mn?"pt-5":"py-5"}`,children:[jsxRuntimeExports.jsxs("div",{className:" flex justify-between gap-10 px-4",children:[jsxRuntimeExports.jsx("div",{className:"flex w-[25%] justify-start items-center",children:jsxRuntimeExports.jsx("div",{className:`${us?"text-[black]":"text-[#FFFFFFCC]"} flex justify-center items-center align-middle ml-2 text-xs`,children:"Total"})}),jsxRuntimeExports.jsx("div",{className:" w-[25%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col ",children:[jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("img",{src:io,alt:hs[0].token,className:"w-4"}),jsxRuntimeExports.jsx("div",{className:` text-xs pl-1 ${us?"text-[black]":"text-[#FFFFFFCC]"}`,children:hs[0].token})]}),jsxRuntimeExports.jsx("div",{className:"text-[0.625rem] flex pt-1",children:jsxRuntimeExports.jsxs("div",{className:"text-[#777879]",children:[hs[0].option_type,jsxRuntimeExports.jsx("span",{className:" px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${hs[0].direction==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:hs[0].direction})]})})]})}),jsxRuntimeExports.jsx("div",{className:"flex w-[25%] justify-start items-center",children:jsxRuntimeExports.jsxs("div",{className:`${us?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",ps.toFixed(2)]})}),jsxRuntimeExports.jsxs("div",{className:" flex justify-end gap-4 items-center w-[25%]",children:[ds&&is?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"}):jsxRuntimeExports.jsxs("button",{className:`${us?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:mo,children:["Withdraw All (",hs.length,")"]}),jsxRuntimeExports.jsx("img",{onClick:as,src:Mn?us?GreenArrowUp:Updropdown:us?GreenArrowDown:DownDropdown,alt:"Dropdown",className:"w-4 h-4 cursor-pointer"})]})]}),Mn&&jsxRuntimeExports.jsx("div",{className:"mt-6",children:hs==null?void 0:hs.map((Ao,$o)=>jsxRuntimeExports.jsx(TotalWithdrawInfo,{exitTime:Ao.exitTime,token:Ao.token,option_type:Ao.option_type,direction:Ao.direction,Balance:Ao.Balance,vault_id:Ao.vault_id,executeClaim:Fn.executeClaim},$o))})]})})},MobileTotalWithdraw=Fn=>{const[Mn,rs]=reactExports.useState(!1),[is,os]=reactExports.useState(!1),as=()=>{rs(!Mn)},{isDarkMode:us,isLoader:ds}=useStore(),{claims:hs}=Fn,ps=hs.reduce((Ao,$o)=>Ao+parseFloat($o.Balance),0),io=TOKEN_LOGO[hs[0].token],{notificationStyle:fo}=useStyles(),mo=()=>{if(ds){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:fo});return}os(!0),hs.map(Ao=>{Fn.executeClaim(Ao.vault_id,Ao.token,Ao.option_type)}),os(!1)};return jsxRuntimeExports.jsx("div",{className:`rounded-2xl ${us?"bg-[#F2F9F9]":"bg-[#17181A] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-start gap-2 justify-between text-[0.625rem]",children:[jsxRuntimeExports.jsxs("div",{className:"w-full flex items-start justify-between p-4",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-5 items-start text-xs text-[#777879]",children:[jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Market"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Current Balance"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start"})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-5",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-end justify-end",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:io,alt:hs[0].token,className:"w-4"}),jsxRuntimeExports.jsx("p",{className:`${us?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:hs[0].token})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center text-[#777879] ml-1",children:[hs[0].option_type,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${hs[0].direction==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:hs[0].direction})]})]}),jsxRuntimeExports.jsx("div",{className:"flex justify-end items-center",children:jsxRuntimeExports.jsxs("div",{className:`${us?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:["$",ps.toFixed(2)]})}),jsxRuntimeExports.jsxs("div",{className:"flex justify-end gap-4 items-center",children:[ds&&is?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"}):jsxRuntimeExports.jsxs("button",{className:`${us?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:mo,children:["Withdraw All (",hs.length,")"]}),jsxRuntimeExports.jsx("img",{onClick:as,src:Mn?us?GreenArrowUp:Updropdown:us?GreenArrowDown:DownDropdown,alt:"Dropdown",className:"w-4 h-4 cursor-pointer"})]})]})]}),Mn&&jsxRuntimeExports.jsx("div",{className:"p-2 w-full",children:hs==null?void 0:hs.map((Ao,$o)=>jsxRuntimeExports.jsx(MobileTotalWithdrawInfo,{exitTime:Ao.exitTime,token:Ao.token,option_type:Ao.option_type,direction:Ao.direction,Balance:Ao.Balance,vault_id:Ao.vault_id,executeClaim:Fn.executeClaim},$o))})]})})},WithdrawInfo=Fn=>{const{isDarkMode:Mn,isLoader:rs}=useStore(),{notificationStyle:is}=useStyles(),[os,as]=reactExports.useState(!1),{exitTime:us,token:ds,option_type:hs,direction:ps,Balance:io,vault_id:fo,executeClaim:mo}=Fn,Ao=new Date(us).toLocaleTimeString(),$o=new Date(us).toLocaleDateString(),Lo=TOKEN_LOGO[ds],Go=async()=>{if(rs){staticMethods.error({message:"Other transaction on going",description:"please check wallet or refresh the page",style:is});return}as(!0),await mo(fo,ds,hs),as(!1)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[" ",jsxRuntimeExports.jsx("div",{className:"flex justify-center sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen px-4 my-2",children:jsxRuntimeExports.jsx("div",{className:`${Mn?"bg-[#effdf9]":"bg-[#111213]"} rounded-2xl sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen px-4 py-5`,children:jsxRuntimeExports.jsxs("div",{className:" flex justify-between gap-10",children:[jsxRuntimeExports.jsx("div",{className:"flex w-[25%] justify-start items-center",children:jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} flex justify-center items-center align-middle text-xs`,children:jsxRuntimeExports.jsxs("div",{className:"  flex flex-col pt-2",children:[jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:Ao}),jsxRuntimeExports.jsx("div",{className:"text-[0.65rem] text-[#777879]",children:$o})]})})}),jsxRuntimeExports.jsx("div",{className:" w-[25%] flex justify-start items-center align-middle",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col ",children:[jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("img",{src:Lo,alt:ds,className:"w-4"}),jsxRuntimeExports.jsx("div",{className:`text-xs pl-1 ${Mn?"text-[black]":"text-[#FFFFFFCC]"}`,children:ds})]}),jsxRuntimeExports.jsx("div",{className:"text-[0.625rem] flex pt-1",children:jsxRuntimeExports.jsxs("div",{className:"text-[#777879]",children:[hs,jsxRuntimeExports.jsx("span",{className:" px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${ps==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:ps})]})})]})}),jsxRuntimeExports.jsx("div",{className:"flex w-[25%] justify-start items-center",children:jsxRuntimeExports.jsxs("div",{className:`text-xs ${Mn?"text-[black]":"text-[#FFFFFFCC] "} `,children:["$",io]})}),jsxRuntimeExports.jsx("div",{className:" flex justify-end gap-4 items-center w-[25%]",children:rs&&os?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"}):jsxRuntimeExports.jsx("button",{className:`${Mn?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:Go,children:"Withdraw"})})]})})})]})},MobileWithdrawInfo=Fn=>{const{isDarkMode:Mn,isLoader:rs}=useStore(),[is,os]=reactExports.useState(!1),{exitTime:as,token:us,option_type:ds,direction:hs,Balance:ps,vault_id:io,executeClaim:fo}=Fn,mo=new Date(as).toLocaleTimeString(),Ao=new Date(as).toLocaleDateString(),$o=TOKEN_LOGO[us],Lo=async()=>{rs||(os(!0),await fo(io,us,hs),os(!1))};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`flex items-start justify-between p-4 rounded-2xl text-xs ${Mn?"bg-[#F2F9F9]":"bg-[#17181A] text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsxs("div",{className:"space-y-5 items-start text-[#777879]",children:[jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Time"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Market"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start",children:jsxRuntimeExports.jsx("span",{children:"Current Balance"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start"})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("div",{className:"flex items-start justify-end",children:jsxRuntimeExports.jsx("div",{className:`text-xs ${Mn?"text-[black]":"text-[#FFFFFFCC]"} flex justify-center items-center align-middle`,children:jsxRuntimeExports.jsx("div",{className:"flex flex-row",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs`,children:[mo," ",jsxRuntimeExports.jsx("span",{className:"text-[0.65rem] text-[#777879]",children:Ao})]})})})}),jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-end",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:$o,alt:us,className:"w-4"}),jsxRuntimeExports.jsx("p",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC]"} text-xs pl-1`,children:us})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center text-[#777879] ml-1",children:[ds,jsxRuntimeExports.jsx("span",{className:"px-1",children:"•"}),jsxRuntimeExports.jsx("span",{className:`${hs==="Long"?"text-[#12B76A]":"text-[#F04438]"}`,children:hs})]})]}),jsxRuntimeExports.jsx("div",{className:"flex items-start justify-end",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[black]":"text-[#FFFFFFCC] "} text-xs`,children:["$",ps]})}),jsxRuntimeExports.jsx("div",{className:"flex items-start justify-end",children:rs&&is?jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"}):jsxRuntimeExports.jsx("button",{className:`${Mn?"bg-[#FCFDFE]":"bg-[#17181A]"} h-8 text-xs rounded-lg border-[0.063rem] border-[#2ED3B7] text-[#2ED3B7] font-extrabold p-[0.5rem_1rem_0.5rem_1rem] flex justify-center items-center`,onClick:Lo,children:"Withdraw"})})]})]})})},Withdraw=({executeClaim:Fn})=>{const{isDarkMode:Mn,updateIsWalletConnectVisible:rs,isFetchingData:is}=useStore(),{isConnected:os}=useAccount(),{withdrawable:as}=useStore(),[us,ds]=reactExports.useState(!1);reactExports.useEffect(()=>{ds(as?Object.values(as).some(mo=>Object.values(mo).some(Ao=>{var $o,Lo;return((($o=Ao==null?void 0:Ao.longClaims)==null?void 0:$o.length)??0)>0||(((Lo=Ao==null?void 0:Ao.shortClaims)==null?void 0:Lo.length)??0)>0})):!1)},[as]);const hs=fo=>Array.isArray(fo)?fo.length>1?jsxRuntimeExports.jsx(TotalWithdraw,{claims:fo,executeClaim:Fn}):fo.length===1?jsxRuntimeExports.jsx(WithdrawInfo,{exitTime:fo[0].exitTime,token:fo[0].token,option_type:fo[0].option_type,direction:fo[0].direction,Balance:fo[0].Balance,vault_id:fo[0].vault_id,executeClaim:Fn}):null:null,ps=()=>jsxRuntimeExports.jsxs("div",{className:`${Mn?"bg-[#F2F9F9] border-[#E3E8EF]":"bg-[#111213] text-[#A5A5A6] border-[rgba(245,247,250,0.06)]"} border-b-[0.063rem] flex p-[0.5rem_2rem_0.5rem_2rem] text-[0.625rem] sxl:w-full xl:w-full bxl:w-full xxl:w-full lg:w-screen md:w-screen sm:w-screen xd:w-screen gap-10`,children:[jsxRuntimeExports.jsx("div",{className:"flex justify-start w-[25%]",children:jsxRuntimeExports.jsx("span",{children:"Time"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start w-[25%]",children:jsxRuntimeExports.jsx("span",{children:"Market"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start w-[25%]",children:jsxRuntimeExports.jsx("span",{children:"Current Balance"})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start w-[25%]",children:jsxRuntimeExports.jsx("span",{})})]}),io=()=>is?jsxRuntimeExports.jsx("div",{className:"flex justify-center items-center h-12",children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"})}):os?us?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Object.entries(as).map(([fo,mo])=>jsxRuntimeExports.jsx("div",{children:mo&&typeof mo=="object"?Object.entries(mo).map(([Ao,$o])=>jsxRuntimeExports.jsx("div",{children:$o&&typeof $o=="object"?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[hs($o.longClaims||[]),hs($o.shortClaims||[])]}):jsxRuntimeExports.jsx("p",{children:"Invalid option"})},Ao)):jsxRuntimeExports.jsx("p",{children:"Invalid token"})},fo))}):jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center h-12 rounded-b-2xl ${Mn?"bg-[#F2F9F9]":"bg-[#17181A80] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsx("span",{className:"text-xs",children:"No withdraw available"})}):jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center h-12 rounded-b-2xl ${Mn?"bg-[#F2F9F9]":"bg-[#17181A80] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsxs("span",{className:"text-xs",children:[jsxRuntimeExports.jsxs("span",{className:"text-[#2ED3B7] cursor-pointer font-bold",onClick:()=>rs(!0),children:["Connect Wallet"," "]}),"to view withdraws"]})});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ps(),io()]})},MobileWithdraw=({executeClaim:Fn})=>{const{isDarkMode:Mn,updateIsWalletConnectVisible:rs,isFetchingData:is}=useStore(),{isConnected:os}=useAccount(),{withdrawable:as}=useStore(),[us,ds]=reactExports.useState(!1);reactExports.useEffect(()=>{if(as===null){ds(!1);return}const io=as&&Object.values(as).some(fo=>Object.values(fo).some(mo=>{var Ao,$o;return(((Ao=mo==null?void 0:mo.longClaims)==null?void 0:Ao.length)??0)>0||((($o=mo==null?void 0:mo.shortClaims)==null?void 0:$o.length)??0)>0}));ds(io||!1)},[as]);const hs=(io,fo)=>fo?Object.entries(fo).map(([mo,Ao])=>{const{longClaims:$o,shortClaims:Lo}=Ao;return jsxRuntimeExports.jsxs("div",{className:"p-2 space-y-4",children:[jsxRuntimeExports.jsx("div",{className:`rounded-2xl ${Mn?"bg-[#F2F9F9]":"bg-[#17181A] text-[#A5A5A6]"}`,children:ps($o,io,"long")}),jsxRuntimeExports.jsx("div",{children:ps(Lo,io,"short")})]},`${io}-${mo}`)}):null,ps=(io,fo,mo)=>{if(!Array.isArray(io)||io.length===0)return null;if(io.length>1)return jsxRuntimeExports.jsx(MobileTotalWithdraw,{claims:io,executeClaim:Ao=>Fn(Ao,fo,mo)});{const Ao=io[0];return jsxRuntimeExports.jsx(MobileWithdrawInfo,{exitTime:Ao.exitTime,token:Ao.token,option_type:Ao.option_type,direction:Ao.direction,Balance:Ao.Balance,vault_id:Ao.vault_id,executeClaim:()=>Fn(Ao.vault_id,fo,Ao.option_type)})}};return jsxRuntimeExports.jsx("div",{className:"w-full",children:as!==null&&!is&&us?as&&Object.entries(as).map(([io,fo])=>hs(io,fo)):is?jsxRuntimeExports.jsx("div",{className:"flex justify-center items-center h-12",children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"})}):jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center h-12 rounded-2xl mt-4 mx-2 ${Mn?"bg-[#F2F9F9]":"bg-[#17181A80] text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsx("span",{className:"text-xs",children:os?"No withdraw available":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("span",{className:"text-[#2ED3B7] cursor-pointer font-bold",onClick:()=>rs(!0),children:["Connect Wallet"," "]}),"to view withdraws"]})})})})},WelcomeBanner="/assets/WelcomeBanner-C-V6LU2D.svg",GuidePopup=()=>{const{isDarkMode:Fn,setIsGuideOpen:Mn,setCurrentGuideStep:rs,isGuideDontShowChecked:is,setIsGuideDontShowChecked:os}=useStore(),as=()=>{rs(1)};return reactExports.useEffect(()=>{localStorage.setItem("guideDontShow",String(is))},[is]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"fixed z-[4] inset-0 h-full w-[full] backdrop-blur-[0.5rem] flex flex-row justify-center font-inter  items-center",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[560px] bxl:w-[560px] xl:w-[560px] sxl:w-[560px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 rounded-2xl ${Fn?"bg-white border-[rgba(245,247,250,0.06)] backdrop-blur-[54.36563491821289px]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)] backdrop-blur-[54.36563491821289px]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`relative items-cente rounded-t-2xl ${Fn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("img",{src:WelcomeBanner,alt:"WelcomeBanner",className:"rounded-t-2xl"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer absolute top-5 right-6",onClick:()=>Mn(!1),children:Fn?jsxRuntimeExports.jsx("img",{src:close,alt:"WrongBlack",className:" w-3 h-3"}):jsxRuntimeExports.jsx("img",{src:close,alt:"close",className:" w-3 h-3"})})]}),jsxRuntimeExports.jsxs("div",{className:`p-4 flex flex-col gap-2 w-full ${Fn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal ${Fn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"} mb-2`,children:[jsxRuntimeExports.jsx("p",{children:"KanaLabs Operps combines the simplicity of spot trading with the market's highest dynamic leverage. Enjoy fast trades with the potential for high gains and straight returns in as little as 5 minutes, with no risk of order book liquidity!"}),jsxRuntimeExports.jsxs("p",{className:"mt-2 flex flex-col",children:["We feature and reward the best trades on our Twitter everyday, follow"," ",jsxRuntimeExports.jsxs("div",{className:" flex",children:[jsxRuntimeExports.jsx("a",{href:"https://x.com/kanalabs",target:"_blank",className:"text-[#2ED3B7] underline",children:"https://x.com/kanalabs"})," ",jsxRuntimeExports.jsx("span",{className:" pl-1",children:"and"})]}),jsxRuntimeExports.jsxs("div",{className:"flex",children:[jsxRuntimeExports.jsx("a",{href:"https://x.com/ethosx_finance",target:"_blank",className:"text-[#2ED3B7] underline",children:"https://x.com/ethosx_finance"}),jsxRuntimeExports.jsx("span",{className:"pl-1",children:"to be eligible!"})]})]})]}),jsxRuntimeExports.jsx("div",{className:"",children:jsxRuntimeExports.jsx("div",{className:"w-full outline-none ",onClick:as,children:jsxRuntimeExports.jsx("div",{className:`${Fn?"buy-button-light":"buy-button"}`,children:jsxRuntimeExports.jsx("div",{className:`cursor-pointer text-base font-bold text-center ${Fn?"buy-button-inner-light text-[#107569]":"buy-button-inner text-[#2ED3B7]"}`,children:"Start guided tour"})})})})]}),jsxRuntimeExports.jsx("div",{className:"border-t border-white/10",children:jsxRuntimeExports.jsx("div",{className:" flex gap-2 p-4",children:jsxRuntimeExports.jsxs("div",{className:"  py-1 flex flex-row justify-start items-center  gap-2",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"cursor-pointer",id:"mycheck_box",checked:is,onClick:()=>os(!is)}),jsxRuntimeExports.jsx("label",{htmlFor:"mycheck_box",className:`${Fn?"text-base font-normal text-[rgba(0,0,0,0.80)] flex flex-row justify-start items-center":"text-base font-normal text-[#D2D2D2] flex flex-row justify-start items-center"} cursor-pointer `,children:"Don’t show this again"})]})})})]})})})};function calculateBestPopupPosition(Fn,Mn,rs,is){const os=window.innerWidth,as=window.innerHeight,us=["left","right","top","bottom"];for(const ds of us){let hs,ps;switch(ds){case"left":hs=Fn.top+Fn.height/2-rs/2,ps=Fn.left-Mn-is;break;case"right":hs=Fn.top+Fn.height/2-rs/2,ps=Fn.right+is;break;case"top":hs=Fn.top-rs-is,ps=Fn.left+Fn.width/2-Mn/2;break;case"bottom":hs=Fn.bottom+is,ps=Fn.left+Fn.width/2-Mn/2;break}if(hs>=0&&hs+rs<=as&&ps>=0&&ps+Mn<=os)return{top:hs,left:ps,position:ds}}return{top:Math.max(0,Math.min(Fn.bottom+is,as-rs)),left:Math.max(0,Math.min(Fn.left+Fn.width/2-Mn/2,os-Mn)),position:"bottom"}}const Guide1=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const ps="element-id-for-guide-1";rs(ps);const io=()=>{const fo=document.getElementById(ps);if(fo){const mo=fo.getBoundingClientRect(),Ao=calculateBestPopupPosition(mo,432,300,20);hs(Ao)}};return io(),window.addEventListener("scroll",io),window.addEventListener("resize",io),()=>{rs(null),window.removeEventListener("scroll",io),window.removeEventListener("resize",io)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`font-inter text-sm font-bold ${Mn?"text-[#000000]":"text-[white]"}`,children:"Long vs Short OPerps"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsxs("div",{className:`p-6 flex flex-col w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:[jsxRuntimeExports.jsx("div",{className:`text-sm font-normal ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:"On OPerps, you can engage yourself in two different types of trading."}),jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`py-2 px-4 rounded-lg mb-2 ${Mn?"bg-[#fff]":"bg-[#111213]"}`,children:[jsxRuntimeExports.jsx("h1",{className:`${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#fff]"} text-sm mb-2`,children:"Long OPerps - exponentially leveraged trading"}),jsxRuntimeExports.jsx("p",{className:"text-xs",children:"Long OPerps is aimed for traders who want to make massive profits in a short period of time based on their views on market movement due to high Leverage (magnifier), paying Premium (fees) to do it."}),jsxRuntimeExports.jsx("p",{className:"text-xs mt-2",children:"There are two types - Long Call OPerps and Long Put OPerps."})]}),jsxRuntimeExports.jsxs("div",{className:`bg-[#111213] py-2 px-4 rounded-lg ${Mn?"bg-[#fff]":"bg-[#111213]"}`,children:[jsxRuntimeExports.jsx("h1",{className:`${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#fff]"} text-sm mb-2`,children:"Short OPerps - more passive premium earning."}),jsxRuntimeExports.jsxs("p",{className:"text-xs",children:["Short OPerps are perfect for traders seeking a hands-off approach to generating returns. By providing liquidity to short pools, you can passively earn a"," ",jsxRuntimeExports.jsx("b",{children:"50% premium every cycle, which occurs every 5 mins (Arb) or 2 hours (BSC)."})]}),jsxRuntimeExports.jsx("p",{className:"text-xs mt-2",children:"There are two types - Short Call OPerps and Short Put OPerps."})]})]})]}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===0?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Next"})]})]})}):null},Guide2=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const ps="element-id-for-guide-2";rs(ps);const io=()=>{const fo=document.getElementById(ps);if(fo){const mo=fo.getBoundingClientRect(),Ao=calculateBestPopupPosition(mo,432,300,20);hs(Ao)}};return io(),window.addEventListener("scroll",io),window.addEventListener("resize",io),()=>{rs(null),window.removeEventListener("scroll",io),window.removeEventListener("resize",io)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`font-inter text-sm font-bold ${Mn?"text-[#000000]":"text-[white]"}`,children:"Distribution"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsx("div",{className:`p-6 flex flex-col w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:jsxRuntimeExports.jsx("div",{className:`text-sm font-normal ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:"Here you can see the next cycle’s distribution between Long and Short OPerps pools. Also, this is how the leverage is calculated."})}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===1?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Next"})]})]})}):null},Guide3=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const ps="element-id-for-guide-3";rs(ps);const io=()=>{const fo=document.getElementById(ps);if(fo){const mo=fo.getBoundingClientRect(),Ao=calculateBestPopupPosition(mo,432,300,20);hs(Ao)}};return io(),window.addEventListener("scroll",io),window.addEventListener("resize",io),()=>{rs(null),window.removeEventListener("scroll",io),window.removeEventListener("resize",io)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`font-inter text-sm font-bold ${Mn?" text-[#000000]":"text-[white]"}`,children:"Call vs Put OPerps"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsxs("div",{className:`p-6 flex flex-col w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:[jsxRuntimeExports.jsx("div",{className:`text-sm font-normal ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:"There are two main types of options: Call and Put."}),jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsxs("p",{className:"text-sm my-2",children:[jsxRuntimeExports.jsx("span",{className:"font-extrabold",children:"Long Calls:"})," You are making a prediction on market movement by buying a Long CALL if you think the price will go UP."]}),jsxRuntimeExports.jsxs("p",{className:"text-sm",children:[jsxRuntimeExports.jsx("span",{className:"font-extrabold",children:"Long Puts:"})," You are making a prediction on market movement by buying a Long PUT if you think the price will go DOWN."]})]})]}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===2?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Next"})]})]})}):null},Guide4=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const ps="element-id-for-guide-3";rs(ps);const io=()=>{const fo=document.getElementById(ps);if(fo){const mo=fo.getBoundingClientRect(),Ao=calculateBestPopupPosition(mo,432,300,20);hs(Ao)}};return io(),window.addEventListener("scroll",io),window.addEventListener("resize",io),()=>{rs(null),window.removeEventListener("scroll",io),window.removeEventListener("resize",io)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?" text-[#000000] font-inter text-sm font-bold":"text-[white] font-inter text-sm font-bold"}`,children:"Short Call OPerps vs Short Put OPerps"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsx("div",{className:`p-6 w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal space-y-2 ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsxs("p",{children:[jsxRuntimeExports.jsx("b",{children:"Short Call OPerps:"})," Short OPerps are perfect for traders seeking a hands-off approach to generating returns during falling markets."]}),jsxRuntimeExports.jsxs("p",{children:[jsxRuntimeExports.jsx("b",{children:"Short Put OPerps:"})," Short OPerps are perfect for traders seeking a hands-off approach to generating returns during rising markets."]})]})}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===3?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Next"})]})]})}):null},Guide5=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const ps="element-id-for-guide-5";rs(ps);const io=()=>{const fo=document.getElementById(ps);if(fo){const mo=fo.getBoundingClientRect(),Ao=calculateBestPopupPosition(mo,432,300,20);hs(Ao)}};return io(),window.addEventListener("scroll",io),window.addEventListener("resize",io),()=>{rs(null),window.removeEventListener("scroll",io),window.removeEventListener("resize",io)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?" text-[#000000] font-inter text-sm font-bold":"text-[white] font-inter text-sm font-bold"}`,children:"Settlement cycles are key!"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsx("div",{className:`p-6 flex flex-col w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:jsxRuntimeExports.jsxs("ul",{className:`list-disc text-sm font-normal space-y-2 ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsx("li",{children:"Wins/losses determined every 5 min (ARB) or 2 hours (BSC) based on market moves."}),jsxRuntimeExports.jsx("li",{children:"Unlike other protocols, you can only enter/exit before each cycle."}),jsxRuntimeExports.jsx("li",{children:"Watch the timer closely! Exit trades at least 30 seconds before the cycle ends to avoid rollover."})]})}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===4?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Next"})]})]})}):null},Guide6=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const ps="element-id-for-guide-6";rs(ps);const io=()=>{const fo=document.getElementById(ps);if(fo){const mo=fo.getBoundingClientRect(),Ao=calculateBestPopupPosition(mo,432,300,20);hs(Ao)}};return io(),window.addEventListener("scroll",io),window.addEventListener("resize",io),()=>{rs(null),window.removeEventListener("scroll",io),window.removeEventListener("resize",io)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?" text-[#000000] font-inter text-sm font-bold":"text-[white] font-inter text-sm font-bold"}`,children:"Leverage: Boost your profits, not your risk!"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsx("div",{className:`p-6 flex flex-col w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal space-y-2 ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsx("p",{children:"Leverage multiplies your potential profits, but doesn't increase your max loss (always 50%)."}),jsxRuntimeExports.jsx("p",{children:"Think of it as a profit amplifier, not a risk one."}),jsxRuntimeExports.jsx("p",{children:"Leverage adjusts every 5 min (ARB) or 2 hours (BSC) based on trading activity."})]})}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===5?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Next"})]})]})}):null},Guide7=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const ps="element-id-for-guide-7";rs(ps);const io=()=>{const fo=document.getElementById(ps);if(fo){const mo=fo.getBoundingClientRect(),Ao=window.innerWidth<1050,$o=432,Lo=300,Go=20;if(Ao)hs({top:Math.max(0,mo.top-Lo-Go),left:Math.max(0,Math.min(mo.left+mo.width/2-$o/2,window.innerWidth-$o)),position:"top"});else{const Yo=calculateBestPopupPosition(mo,$o,Lo,Go);hs(Yo)}}};return io(),window.addEventListener("scroll",io),window.addEventListener("resize",io),()=>{rs(null),window.removeEventListener("scroll",io),window.removeEventListener("resize",io)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3,maxHeight:"80vh",overflowY:"auto"},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?" text-[#000000] font-inter text-sm font-bold":"text-[white] font-inter text-sm font-bold"}`,children:"Premium"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsx("div",{className:`p-6 flex flex-col w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal space-y-2 ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsx("p",{children:"With Long OPerps (Calls & Puts), pay a fixed fee called Premium to enter a trade. And this premium is paid to short OPerp holders for providing liquidity. Hence, passively earning a 50% premium every cycle."}),jsxRuntimeExports.jsx("p",{children:"Leverage amplifies your profits if the market moves in your favor. Even better, the risk is capped! No matter how much the price swings against you, the most you can lose in a single settlement cycle is 50% of your initial investment."})]})}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===6?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Next"})]})]})}):null},Guide8=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const ps="element-id-for-guide-8";rs(ps);const io=()=>{const fo=document.getElementById(ps);if(fo){const mo=fo.getBoundingClientRect(),Ao=calculateBestPopupPosition(mo,432,300,20);hs(Ao)}};return io(),window.addEventListener("scroll",io),window.addEventListener("resize",io),()=>{rs(null),window.removeEventListener("scroll",io),window.removeEventListener("resize",io)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?" text-[#000000] font-inter text-sm font-bold":"text-[white] font-inter text-sm font-bold"}`,children:"PnL"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsx("div",{className:`p-6 flex flex-col w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsx("p",{children:"PnL stands for Profit and Loss. It's basically a scorecard to see if you made or lost money on an investment."}),jsxRuntimeExports.jsx("p",{children:"For example:"}),jsxRuntimeExports.jsx("p",{children:"Imagine you buy a baseball card for $10. You then sell it for $15. Your PNL would be +$5 (profit)."})]})}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===7?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Next"})]})]})}):null},Guide9=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const ps="element-id-for-guide-9";rs(ps);const io=()=>{const fo=document.getElementById(ps);if(fo){const mo=fo.getBoundingClientRect(),Ao=calculateBestPopupPosition(mo,432,300,20);hs(Ao)}};return io(),window.addEventListener("scroll",io),window.addEventListener("resize",io),()=>{rs(null),window.removeEventListener("scroll",io),window.removeEventListener("resize",io)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?" text-[#000000] font-inter text-sm font-bold":"text-[white] font-inter text-sm font-bold"}`,children:"Wallet"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsx("div",{className:`p-6 w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:[jsxRuntimeExports.jsx("p",{children:"To start trading you need to connect your crypto wallet."}),jsxRuntimeExports.jsxs("ol",{className:"mt-2 space-y-2",children:[jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("b",{children:"1. Testnet:"})," If trying on testnet, then please use the faucet to get testnet USDC."]}),jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("b",{children:"2. Mainnet:"}),jsxRuntimeExports.jsxs("ol",{className:"ml-4 space-y-1 mt-1",children:[jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("b",{children:"a. BSC:"})," You will need two things to trade on Operps - BSC native tokens and USDC on BNB."]}),jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("b",{children:"b. ARB:"})," You will need two things to trade on Operps - ETH on arb and USDC on ARB."]})]})]})]})]})}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===8?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Next"})]})]})}):null},Guide10=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const io=window.innerWidth<1050?"element-id-for-guide-10-small":"element-id-for-guide-10";rs(io);const fo=()=>{const mo=document.getElementById(io);if(mo){const Ao=mo.getBoundingClientRect(),$o=calculateBestPopupPosition(Ao,432,300,20);hs($o)}};return fo(),window.addEventListener("scroll",fo),window.addEventListener("resize",fo),()=>{rs(null),window.removeEventListener("scroll",fo),window.removeEventListener("resize",fo)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?" text-[#000000] font-inter text-sm font-bold":"text-[white] font-inter text-sm font-bold"}`,children:"Chain"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsx("div",{className:`p-6 flex flex-col w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:jsxRuntimeExports.jsx("div",{className:`text-sm font-normal ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsx("p",{children:"Choose your preferable blockchain: Arbitrum for 5-min trading cycles and Binance Smart Chain (BSC) for 2-hour trading cycles."})})}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===9?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Next"})]})]})}):null},Guide11=({targetRect:Fn})=>{const{isDarkMode:Mn,setTargetElementId:rs,prevGuideStep:is,nextGuideStep:os,setIsGuideOpen:as,totalGuideSteps:us}=useStore(),[ds,hs]=reactExports.useState(null);return reactExports.useEffect(()=>{const ps="element-id-for-guide-11";rs(ps);const io=()=>{const fo=document.getElementById(ps);if(fo){const mo=fo.getBoundingClientRect(),Ao=calculateBestPopupPosition(mo,432,300,20);hs(Ao)}};return io(),window.addEventListener("scroll",io),window.addEventListener("resize",io),()=>{rs(null),window.removeEventListener("scroll",io),window.removeEventListener("resize",io)}},[rs]),ds?jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:ds.top,left:ds.left,zIndex:1e3},className:"font-inter",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[432px] bxl:w-[432px] xl:w-[432px] sxl:w-[432px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 backdrop-blur-[54.36563491821289px] rounded-2xl ${Mn?"bg-white border-[rgba(245,247,250,0.06)]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-2xl px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?" text-[#000000] font-inter text-sm font-bold":"text-[white] font-inter text-sm font-bold"}`,children:"Buy"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer",onClick:()=>as(!1),children:jsxRuntimeExports.jsx("img",{src:`${Mn?WrongBlack:close}`,alt:"Close",className:"w-4"})})]}),jsxRuntimeExports.jsx("div",{className:`p-6 flex flex-col w-full gap-2 ${Mn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:jsxRuntimeExports.jsx("div",{className:`text-sm font-normal ${Mn?"text-[rgba(0,0,0,0.80)]":"text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsxs("p",{children:["Buy (Enter) before a cycle starts and Sell (Exit) after 5 minutes or ",jsxRuntimeExports.jsx("b",{children:"2-hour"})," to lock in your profits. Think of it as a series of quick 5-minute/",jsxRuntimeExports.jsx("b",{children:"2-hour trades"}),", it's all about quick decisions!"]})})}),jsxRuntimeExports.jsxs("div",{className:`flex items-center justify-between border-t border-[#FFFFFF1A] rounded-b-2xl p-4 ${Mn?"bg-[#fff]":"bg-[#0c1212]"}`,children:[jsxRuntimeExports.jsx("div",{className:`border w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 bg-transparent ${Mn?"text-[#107569] border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7]"}`,onClick:is,children:"Back"}),jsxRuntimeExports.jsx("div",{className:"flex gap-1",children:[...Array(us-2)].map((ps,io)=>jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${io===10?"bg-[#2ED3B7]":"bg-[#4A4B4D]"}`},io))}),jsxRuntimeExports.jsx("div",{className:`w-fit cursor-pointer text-sm font-extrabold text-center rounded-lg py-2 px-4 ${Mn?"text-[#fff] bg-[#107569]":"text-[#17181A] bg-[#2ED3B7]"}`,onClick:os,children:"Finish"})]})]})}):null},Restart="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJ1SURBVHgB3VVdktJAEO7pZNF9sApvwKOuwIYbsC+Wu09yAriBcALCCZATiCfAKms3li/iCRIIpb7JDeTBB/Yn3c5MQkyAQJbap/2qYJJMz3zd0z1fAzwWiDxGJXdUfGYYdcFmCYCLctmCKPD+wp03rzUWuUheuE6pgNS6IRz+qp3PV5Mns6+WwUFfGtWzNmCG4W0AveS6daD6UwSA2NVjhFeTq7bJgRsTMH8HooH89fSo3pWXAloFE36XfaebRWJu+1iZOR8EQ0u/EA+Qrm1vy7FYP50S3bItmZrSW7sy/VL0q28663b6uKqTS1tForwkExkJbHXuCNzwKudj2AMZRR1BjHS+iDvT04v3yXlMU2IzJJATAs/yECjMpB1Jh8IdRf9kdmntIIFSOHLHK7/24B6YaYd4oJ4Nxn56W0gcV/hlDgF9TBqtV10WLPdbkczlH+393fL5Ko+biWcZzYowQgFIDTbsgVc7W1R8Z6wqMjCe1OWnTzEJFnBIN5S5WM1DTgjiicyLvLjR0a9IvJf6KGx4EPAizIJShshJeHCIaHMR36s4JzppxtJlwZ5fuWjAgWAUpyoOJBFX50YJCxBvLSmIcACUBv7XueUmiaoMBhir58A47sIBOEIpMaD1bJiUoVQkgTA6oRG3y65Th3ug7H6uCxRNvd6AXnIuRfJD3XKpPXrC5FFeIkWA5tFIvxD0omqNsbVpVf0rKXDinXre1S/CZnbcVZGHBDyQ4thet8vsjFXfseUQ50bli4kmMvSFvLZFgXiaamZS76bltPruJVFI9otMI9m8EM32LkHN1eN1SZtPLSK2Vj0etZBej70cPf7x4B93QxAMr5EarQAAAABJRU5ErkJggg==",TryOperps="/assets/TryOperpsbanner-BcabhItc.svg",GuideEnd=()=>{const{isDarkMode:Fn,restartGuide:Mn,setIsGuideOpen:rs,isGuideDontShowChecked:is,setIsGuideDontShowChecked:os}=useStore();return reactExports.useEffect(()=>{localStorage.setItem("guideDontShow",String(is))},[is]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"fixed z-[4] inset-0 h-full w-[full] backdrop-blur-[0.5rem] flex flex-row justify-center font-inter items-center",children:jsxRuntimeExports.jsxs("div",{className:`xxl:w-[560px] bxl:w-[560px] xl:w-[560px] sxl:w-[560px] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto border-2 rounded-2xl ${Fn?"bg-white border-[rgba(245,247,250,0.06)] backdrop-blur-[54.36563491821289px]":"bg-gradient-to-tr from-[rgba(245,247,250,0.06)] to-[rgba(245,247,250,0.00)] border-[rgba(245,247,250,0.06)] backdrop-blur-[54.36563491821289px]"}`,children:[jsxRuntimeExports.jsxs("div",{className:` relative flex flex-row justify-between items-center rounded-t-2xl ${Fn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("img",{src:TryOperps,alt:"TryOperps",className:" rounded-t-2xl"}),jsxRuntimeExports.jsx("div",{className:"cursor-pointer absolute top-[26px] right-[26px]",onClick:()=>rs(!1),children:Fn?jsxRuntimeExports.jsx("img",{src:WrongBlack,alt:"WrongBlack",className:"w-[0.75rem] h-3"}):jsxRuntimeExports.jsx("img",{src:close,alt:"close",className:"w-[0.75rem] h-3"})})]}),jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-2 w-full p-6 ${Fn?"bg-[#E4F2F3]":"bg-[#1D1E20]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`text-sm font-normal ${Fn?"text-[rgba(0,0,0,0.80)]":"text-[rgba(255,255,255,0.80)]"} mb-2`,children:[jsxRuntimeExports.jsx("p",{children:"Want to get a feel for options trading? Try out our test network to see how it works and practice your skills in a risk-free environment!"}),jsxRuntimeExports.jsx("p",{className:"mt-4",children:"Still have questions? Visit our gitbook for more information or find the walkthrough again in the “Help” button in bottom right corner."})]}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsxs("div",{className:"w-full flex items-center justify-around outline-none gap-4",children:[jsxRuntimeExports.jsx("a",{className:`w-full ${Fn?"buy-button-light":"buy-button"}`,href:"https://testnet-operps.kanalabs.io/",children:jsxRuntimeExports.jsx("div",{className:`cursor-pointer text-base font-bold text-center ${Fn?"buy-button-inner-light text-[#107569]":"buy-button-inner text-[#2ED3B7]"}`,children:"Trade Testnet"})}),jsxRuntimeExports.jsx("a",{className:`w-full ${Fn?"buy-button-light":"buy-button"}`,href:"https://operps.kanalabs.io/",children:jsxRuntimeExports.jsx("div",{className:`cursor-pointer text-base font-bold text-center ${Fn?"buy-button-inner-light text-[#107569]":"buy-button-inner text-[#2ED3B7]"}`,children:"Trade Mainnet"})})]})}),jsxRuntimeExports.jsxs("div",{className:`pt-5 pb-2 mx-auto w-fit cursor-pointer text-base font-bold text-center flex ${Fn?"text-[#107569]":"text-[#2ED3B7]"}`,onClick:Mn,children:[jsxRuntimeExports.jsx("img",{src:Restart,alt:"Restart"}),jsxRuntimeExports.jsx("span",{className:" pl-1",children:"Restart the guided walkthrough"})]})]}),jsxRuntimeExports.jsx("div",{className:"border-t border-white/10",children:jsxRuntimeExports.jsx("div",{className:" flex gap-2 p-4",children:jsxRuntimeExports.jsxs("div",{className:"  py-1 flex flex-row justify-start items-center  gap-2",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"cursor-pointer ",id:"mycheck_box",checked:is,onClick:()=>os(!is)}),jsxRuntimeExports.jsx("label",{htmlFor:"mycheck_box",className:`text-base font-normal flex flex-row justify-start items-center ${Fn?"text-[rgba(0,0,0,0.80)]":"text-[#D2D2D2]"} cursor-pointer `,children:"Don’t show this again"})]})})})]})})})},GuideOverlay=()=>{const{targetElementId:Fn,isGuideOpen:Mn,targetRect:rs,setTargetRect:is}=useStore(os=>os);return reactExports.useEffect(()=>{const os=()=>{if(Fn&&Mn){const as=document.getElementById(Fn);if(as){const us=as.getBoundingClientRect();is(us),as.scrollIntoView({behavior:"smooth",block:"center"})}}else is(null)};return os(),window.addEventListener("scroll",os),window.addEventListener("resize",os),()=>{window.removeEventListener("scroll",os),window.removeEventListener("resize",os)}},[Fn,Mn]),!Mn||!rs?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,height:rs.top,backdropFilter:"blur(0.5rem)",zIndex:999,pointerEvents:"none"}}),jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:rs.bottom,left:0,right:0,bottom:0,backdropFilter:"blur(0.5rem)",zIndex:999,pointerEvents:"none"}}),jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:rs.top,left:0,width:rs.left,height:rs.height,backdropFilter:"blur(0.5rem)",zIndex:999,pointerEvents:"none"}}),jsxRuntimeExports.jsx("div",{style:{position:"fixed",top:rs.top,left:rs.right,right:0,height:rs.height,backdropFilter:"blur(0.5rem)",zIndex:999,pointerEvents:"none"}})]})},GuideWrapper=()=>{const{isGuideOpen:Fn,currentGuideStep:Mn,nextGuideStep:rs,prevGuideStep:is,setIsGuideOpen:os,setTargetElementId:as,targetRect:us}=useStore(hs=>hs);if(!Fn)return null;const ds=()=>{switch(Mn){case 0:return jsxRuntimeExports.jsx(GuidePopup,{});case 1:return jsxRuntimeExports.jsx(Guide1,{targetRect:us});case 2:return jsxRuntimeExports.jsx(Guide2,{targetRect:us});case 3:return jsxRuntimeExports.jsx(Guide3,{targetRect:us});case 4:return jsxRuntimeExports.jsx(Guide4,{targetRect:us});case 5:return jsxRuntimeExports.jsx(Guide5,{targetRect:us});case 6:return jsxRuntimeExports.jsx(Guide6,{targetRect:us});case 7:return jsxRuntimeExports.jsx(Guide7,{targetRect:us});case 8:return jsxRuntimeExports.jsx(Guide8,{targetRect:us});case 9:return jsxRuntimeExports.jsx(Guide9,{targetRect:us});case 10:return jsxRuntimeExports.jsx(Guide10,{targetRect:us});case 11:return jsxRuntimeExports.jsx(Guide11,{targetRect:us});case 12:return jsxRuntimeExports.jsx(GuideEnd,{});default:return null}};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(GuideOverlay,{}),jsxRuntimeExports.jsx("div",{className:"guide-wrapper",children:ds()})]})},IconBuy="data:image/svg+xml,%3csvg%20width='14'%20height='15'%20viewBox='0%200%2014%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.66667%204.33482C5.78413%204.00091%206.01598%203.71934%206.32116%203.53998C6.62633%203.36063%206.98513%203.29507%207.33401%203.35491C7.68289%203.41475%207.99934%203.59614%208.2273%203.86694C8.45526%204.13774%208.58002%204.48048%208.57949%204.83445C8.57949%205.83371%207.08061%206.33333%207.08061%206.33333M7.09994%208.33333H7.1066M3.66667%2011V12.557C3.66667%2012.9122%203.66667%2013.0898%203.73949%2013.1811C3.80282%2013.2604%203.89885%2013.3066%204.00036%2013.3065C4.11708%2013.3063%204.25578%2013.1954%204.53317%2012.9735L6.12348%2011.7012C6.44834%2011.4413%206.61078%2011.3114%206.79166%2011.219C6.95213%2011.137%207.12295%2011.0771%207.29948%2011.0408C7.49845%2011%207.70646%2011%208.1225%2011H9.8C10.9201%2011%2011.4802%2011%2011.908%2010.782C12.2843%2010.5903%2012.5903%2010.2843%2012.782%209.90798C13%209.48016%2013%208.9201%2013%207.8V4.2C13%203.07989%2013%202.51984%2012.782%202.09202C12.5903%201.71569%2012.2843%201.40973%2011.908%201.21799C11.4802%201%2010.9201%201%209.8%201H4.2C3.0799%201%202.51984%201%202.09202%201.21799C1.71569%201.40973%201.40973%201.71569%201.21799%202.09202C1%202.51984%201%203.07989%201%204.2V8.33333C1%208.95331%201%209.2633%201.06815%209.51764C1.25308%2010.2078%201.79218%2010.7469%202.48236%2010.9319C2.7367%2011%203.04669%2011%203.66667%2011Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",RedArrow="data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.2487%203.33331V12.6666M8.2487%2012.6666L12.9154%207.99998M8.2487%2012.6666L3.58203%207.99998'%20stroke='%23F04438'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",GreenArrow="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.7513%2013.1667L8.7513%203.83335M8.7513%203.83335L4.08464%208.50002M8.7513%203.83335L13.418%208.50002'%20stroke='%2312B76A'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",infocircle="data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.5026%2010.6668V8.00016M8.5026%205.3335H8.50927M15.1693%208.00016C15.1693%2011.6821%2012.1845%2014.6668%208.5026%2014.6668C4.82071%2014.6668%201.83594%2011.6821%201.83594%208.00016C1.83594%204.31826%204.82071%201.3335%208.5026%201.3335C12.1845%201.3335%2015.1693%204.31826%2015.1693%208.00016Z'%20stroke='%23A5A5A6'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",arbitrum$1=defineChain({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}}}),arbitrumSepolia=defineChain({id:421614,name:"Arbitrum Sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://sepolia.arbiscan.io",apiUrl:"https://api-sepolia.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:81930}},testnet:!0}),bsc=defineChain({id:56,name:"BNB Smart Chain",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://rpc.ankr.com/bsc"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),bscTestnet=defineChain({id:97,name:"Binance Smart Chain Testnet",nativeCurrency:{decimals:18,name:"BNB",symbol:"tBNB"},rpcUrls:{default:{http:["https://data-seed-prebsc-1-s1.bnbchain.org:8545"]}},blockExplorers:{default:{name:"BscScan",url:"https://testnet.bscscan.com",apiUrl:"https://api-testnet.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:17422483}},testnet:!0}),mainnet=defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},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}}});async function getWalletConnectCaipNetworks(Fn){var is;if(!Fn)throw new Error("networkControllerClient:getApprovedCaipNetworks - connector is undefined");const Mn=await(Fn==null?void 0:Fn.getProvider());return{supportsAllNetworks:!1,approvedCaipNetworkIds:WcHelpersUtil.getChainsFromNamespaces((is=Mn==null?void 0:Mn.session)==null?void 0:is.namespaces)}}function getEmailCaipNetworks(){return{supportsAllNetworks:!0,approvedCaipNetworkIds:PresetsUtil.WalletConnectRpcChainIds.map(Fn=>`${ConstantsUtil$1.EIP155}:${Fn}`)}}function requireCaipAddress(Fn){if(!Fn)throw new Error("No CAIP address provided");const Mn=Fn.split(":")[2];if(!Mn)throw new Error("Invalid CAIP address");return Mn}function parseWalletCapabilities(Fn){try{return JSON.parse(Fn)}catch{throw new Error("Error parsing wallet capabilities")}}var COMPRESSED$1="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 FENCED=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),NSM_MAX=4;function decode_arithmetic(Fn){let Mn=0;function rs(){return Fn[Mn++]<<8|Fn[Mn++]}let is=rs(),os=1,as=[0,1];for(let _l=1;_l<is;_l++)as.push(os+=rs());let us=rs(),ds=Mn;Mn+=us;let hs=0,ps=0;function io(){return hs==0&&(ps=ps<<8|Fn[Mn++],hs=8),ps>>--hs&1}const fo=31,mo=2**fo,Ao=mo>>>1,$o=Ao>>1,Lo=mo-1;let Go=0;for(let _l=0;_l<fo;_l++)Go=Go<<1|io();let Yo=[],Wo=0,Jo=mo;for(;;){let _l=Math.floor(((Go-Wo+1)*os-1)/Jo),Tl=0,Sl=is;for(;Sl-Tl>1;){let Dl=Tl+Sl>>>1;_l<as[Dl]?Sl=Dl:Tl=Dl}if(Tl==0)break;Yo.push(Tl);let $l=Wo+Math.floor(Jo*as[Tl]/os),Pl=Wo+Math.floor(Jo*as[Tl+1]/os)-1;for(;!(($l^Pl)&Ao);)Go=Go<<1&Lo|io(),$l=$l<<1&Lo,Pl=Pl<<1&Lo|1;for(;$l&~Pl&$o;)Go=Go&Ao|Go<<1&Lo>>>1|io(),$l=$l<<1^Ao,Pl=(Pl^Ao)<<1|Ao|1;Wo=$l,Jo=1+Pl-$l}let xl=is-4;return Yo.map(_l=>{switch(_l-xl){case 3:return xl+65792+(Fn[ds++]<<16|Fn[ds++]<<8|Fn[ds++]);case 2:return xl+256+(Fn[ds++]<<8|Fn[ds++]);case 1:return xl+Fn[ds++];default:return _l-1}})}function read_payload(Fn){let Mn=0;return()=>Fn[Mn++]}function read_compressed_payload(Fn){return read_payload(decode_arithmetic(unsafe_atob(Fn)))}function unsafe_atob(Fn){let Mn=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((os,as)=>Mn[os.charCodeAt(0)]=as);let rs=Fn.length,is=new Uint8Array(6*rs>>3);for(let os=0,as=0,us=0,ds=0;os<rs;os++)ds=ds<<6|Mn[Fn.charCodeAt(os)],us+=6,us>=8&&(is[as++]=ds>>(us-=8));return is}function signed(Fn){return Fn&1?~Fn>>1:Fn>>1}function read_deltas(Fn,Mn){let rs=Array(Fn);for(let is=0,os=0;is<Fn;is++)rs[is]=os+=signed(Mn());return rs}function read_sorted(Fn,Mn=0){let rs=[];for(;;){let is=Fn(),os=Fn();if(!os)break;Mn+=is;for(let as=0;as<os;as++)rs.push(Mn+as);Mn+=os+1}return rs}function read_sorted_arrays(Fn){return read_array_while(()=>{let Mn=read_sorted(Fn);if(Mn.length)return Mn})}function read_mapped(Fn){let Mn=[];for(;;){let rs=Fn();if(rs==0)break;Mn.push(read_linear_table(rs,Fn))}for(;;){let rs=Fn()-1;if(rs<0)break;Mn.push(read_replacement_table(rs,Fn))}return Mn.flat()}function read_array_while(Fn){let Mn=[];for(;;){let rs=Fn(Mn.length);if(!rs)break;Mn.push(rs)}return Mn}function read_transposed(Fn,Mn,rs){let is=Array(Fn).fill().map(()=>[]);for(let os=0;os<Mn;os++)read_deltas(Fn,rs).forEach((as,us)=>is[us].push(as));return is}function read_linear_table(Fn,Mn){let rs=1+Mn(),is=Mn(),os=read_array_while(Mn);return read_transposed(os.length,1+Fn,Mn).flatMap((us,ds)=>{let[hs,...ps]=us;return Array(os[ds]).fill().map((io,fo)=>{let mo=fo*is;return[hs+fo*rs,ps.map(Ao=>Ao+mo)]})})}function read_replacement_table(Fn,Mn){let rs=1+Mn();return read_transposed(rs,1+Fn,Mn).map(os=>[os[0],os.slice(1)])}function read_trie(Fn){let Mn=[],rs=read_sorted(Fn);return os(is([]),[]),Mn;function is(as){let us=Fn(),ds=read_array_while(()=>{let hs=read_sorted(Fn).map(ps=>rs[ps]);if(hs.length)return is(hs)});return{S:us,B:ds,Q:as}}function os({S:as,B:us},ds,hs){if(!(as&4&&hs===ds[ds.length-1])){as&2&&(hs=ds[ds.length-1]),as&1&&Mn.push(ds);for(let ps of us)for(let io of ps.Q)os(ps,[...ds,io],hs)}}}function hex_cp(Fn){return Fn.toString(16).toUpperCase().padStart(2,"0")}function quote_cp(Fn){return`{${hex_cp(Fn)}}`}function explode_cp(Fn){let Mn=[];for(let rs=0,is=Fn.length;rs<is;){let os=Fn.codePointAt(rs);rs+=os<65536?1:2,Mn.push(os)}return Mn}function str_from_cps(Fn){let rs=Fn.length;if(rs<4096)return String.fromCodePoint(...Fn);let is=[];for(let os=0;os<rs;)is.push(String.fromCodePoint(...Fn.slice(os,os+=4096)));return is.join("")}function compare_arrays(Fn,Mn){let rs=Fn.length,is=rs-Mn.length;for(let os=0;is==0&&os<rs;os++)is=Fn[os]-Mn[os];return is}var COMPRESSED="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 S0=44032,L0=4352,V0=4449,T0=4519,L_COUNT=19,V_COUNT=21,T_COUNT=28,N_COUNT=V_COUNT*T_COUNT,S_COUNT=L_COUNT*N_COUNT,S1=S0+S_COUNT,L1=L0+L_COUNT,V1=V0+V_COUNT,T1=T0+T_COUNT;function unpack_cc(Fn){return Fn>>24&255}function unpack_cp(Fn){return Fn&16777215}let SHIFTED_RANK,EXCLUSIONS,DECOMP,RECOMP;function init$1(){let Fn=read_compressed_payload(COMPRESSED);SHIFTED_RANK=new Map(read_sorted_arrays(Fn).flatMap((Mn,rs)=>Mn.map(is=>[is,rs+1<<24]))),EXCLUSIONS=new Set(read_sorted(Fn)),DECOMP=new Map,RECOMP=new Map;for(let[Mn,rs]of read_mapped(Fn)){if(!EXCLUSIONS.has(Mn)&&rs.length==2){let[is,os]=rs,as=RECOMP.get(is);as||(as=new Map,RECOMP.set(is,as)),as.set(os,Mn)}DECOMP.set(Mn,rs.reverse())}}function is_hangul(Fn){return Fn>=S0&&Fn<S1}function compose_pair(Fn,Mn){if(Fn>=L0&&Fn<L1&&Mn>=V0&&Mn<V1)return S0+(Fn-L0)*N_COUNT+(Mn-V0)*T_COUNT;if(is_hangul(Fn)&&Mn>T0&&Mn<T1&&(Fn-S0)%T_COUNT==0)return Fn+(Mn-T0);{let rs=RECOMP.get(Fn);return rs&&(rs=rs.get(Mn),rs)?rs:-1}}function decomposed(Fn){SHIFTED_RANK||init$1();let Mn=[],rs=[],is=!1;function os(as){let us=SHIFTED_RANK.get(as);us&&(is=!0,as|=us),Mn.push(as)}for(let as of Fn)for(;;){if(as<128)Mn.push(as);else if(is_hangul(as)){let us=as-S0,ds=us/N_COUNT|0,hs=us%N_COUNT/T_COUNT|0,ps=us%T_COUNT;os(L0+ds),os(V0+hs),ps>0&&os(T0+ps)}else{let us=DECOMP.get(as);us?rs.push(...us):os(as)}if(!rs.length)break;as=rs.pop()}if(is&&Mn.length>1){let as=unpack_cc(Mn[0]);for(let us=1;us<Mn.length;us++){let ds=unpack_cc(Mn[us]);if(ds==0||as<=ds){as=ds;continue}let hs=us-1;for(;;){let ps=Mn[hs+1];if(Mn[hs+1]=Mn[hs],Mn[hs]=ps,!hs||(as=unpack_cc(Mn[--hs]),as<=ds))break}as=unpack_cc(Mn[us])}}return Mn}function composed_from_decomposed(Fn){let Mn=[],rs=[],is=-1,os=0;for(let as of Fn){let us=unpack_cc(as),ds=unpack_cp(as);if(is==-1)us==0?is=ds:Mn.push(ds);else if(os>0&&os>=us)us==0?(Mn.push(is,...rs),rs.length=0,is=ds):rs.push(ds),os=us;else{let hs=compose_pair(is,ds);hs>=0?is=hs:os==0&&us==0?(Mn.push(is),is=ds):(rs.push(ds),os=us)}}return is>=0&&Mn.push(is,...rs),Mn}function nfd(Fn){return decomposed(Fn).map(unpack_cp)}function nfc(Fn){return composed_from_decomposed(decomposed(Fn))}const HYPHEN=45,STOP_CH=".",FE0F=65039,UNIQUE_PH=1,Array_from=Fn=>Array.from(Fn);function group_has_cp(Fn,Mn){return Fn.P.has(Mn)||Fn.Q.has(Mn)}class Emoji extends Array{get is_emoji(){return!0}}let MAPPED,IGNORED,CM,NSM,ESCAPE,GROUPS,WHOLE_VALID,WHOLE_MAP,VALID,EMOJI_LIST,EMOJI_ROOT;function init(){if(MAPPED)return;let Fn=read_compressed_payload(COMPRESSED$1);const Mn=()=>read_sorted(Fn),rs=()=>new Set(Mn());MAPPED=new Map(read_mapped(Fn)),IGNORED=rs(),CM=Mn(),NSM=new Set(Mn().map(io=>CM[io])),CM=new Set(CM),ESCAPE=rs(),rs();let is=read_sorted_arrays(Fn),os=Fn();const as=()=>new Set(Mn().flatMap(io=>is[io]).concat(Mn()));GROUPS=read_array_while(io=>{let fo=read_array_while(Fn).map(mo=>mo+96);if(fo.length){let mo=io>=os;fo[0]-=32,fo=str_from_cps(fo),mo&&(fo=`Restricted[${fo}]`);let Ao=as(),$o=as(),Lo=!Fn();return{N:fo,P:Ao,Q:$o,M:Lo,R:mo}}}),WHOLE_VALID=rs(),WHOLE_MAP=new Map;let us=Mn().concat(Array_from(WHOLE_VALID)).sort((io,fo)=>io-fo);us.forEach((io,fo)=>{let mo=Fn(),Ao=us[fo]=mo?us[fo-mo]:{V:[],M:new Map};Ao.V.push(io),WHOLE_VALID.has(io)||WHOLE_MAP.set(io,Ao)});for(let{V:io,M:fo}of new Set(WHOLE_MAP.values())){let mo=[];for(let $o of io){let Lo=GROUPS.filter(Yo=>group_has_cp(Yo,$o)),Go=mo.find(({G:Yo})=>Lo.some(Wo=>Yo.has(Wo)));Go||(Go={G:new Set,V:[]},mo.push(Go)),Go.V.push($o),Lo.forEach(Yo=>Go.G.add(Yo))}let Ao=mo.flatMap($o=>Array_from($o.G));for(let{G:$o,V:Lo}of mo){let Go=new Set(Ao.filter(Yo=>!$o.has(Yo)));for(let Yo of Lo)fo.set(Yo,Go)}}let ds=new Set,hs=new Set;const ps=io=>ds.has(io)?hs.add(io):ds.add(io);for(let io of GROUPS){for(let fo of io.P)ps(fo);for(let fo of io.Q)ps(fo)}for(let io of ds)!WHOLE_MAP.has(io)&&!hs.has(io)&&WHOLE_MAP.set(io,UNIQUE_PH);VALID=new Set(Array_from(ds).concat(Array_from(nfd(ds)))),EMOJI_LIST=read_trie(Fn).map(io=>Emoji.from(io)).sort(compare_arrays),EMOJI_ROOT=new Map;for(let io of EMOJI_LIST){let fo=[EMOJI_ROOT];for(let mo of io){let Ao=fo.map($o=>{let Lo=$o.get(mo);return Lo||(Lo=new Map,$o.set(mo,Lo)),Lo});mo===FE0F?fo.push(...Ao):fo=Ao}for(let mo of fo)mo.V=io}}function quoted_cp(Fn){return(should_escape(Fn)?"":`${bidi_qq(safe_str_from_cps([Fn]))} `)+quote_cp(Fn)}function bidi_qq(Fn){return`"${Fn}"‎`}function check_label_extension(Fn){if(Fn.length>=4&&Fn[2]==HYPHEN&&Fn[3]==HYPHEN)throw new Error(`invalid label extension: "${str_from_cps(Fn.slice(0,4))}"`)}function check_leading_underscore(Fn){for(let rs=Fn.lastIndexOf(95);rs>0;)if(Fn[--rs]!==95)throw new Error("underscore allowed only at start")}function check_fenced(Fn){let Mn=Fn[0],rs=FENCED.get(Mn);if(rs)throw error_placement(`leading ${rs}`);let is=Fn.length,os=-1;for(let as=1;as<is;as++){Mn=Fn[as];let us=FENCED.get(Mn);if(us){if(os==as)throw error_placement(`${rs} + ${us}`);os=as+1,rs=us}}if(os==is)throw error_placement(`trailing ${rs}`)}function safe_str_from_cps(Fn,Mn=quote_cp){let rs=[];is_combining_mark(Fn[0])&&rs.push("◌");let is=0,os=Fn.length;for(let as=0;as<os;as++){let us=Fn[as];should_escape(us)&&(rs.push(str_from_cps(Fn.slice(is,as))),rs.push(Mn(us)),is=as+1)}return rs.push(str_from_cps(Fn.slice(is,os))),rs.join("")}function is_combining_mark(Fn){return init(),CM.has(Fn)}function should_escape(Fn){return init(),ESCAPE.has(Fn)}function ens_normalize(Fn){return flatten(split(Fn,nfc,filter_fe0f))}function split(Fn,Mn,rs){if(!Fn)return[];init();let is=0;return Fn.split(STOP_CH).map(os=>{let as=explode_cp(os),us={input:as,offset:is};is+=as.length+1;try{let ds=us.tokens=tokens_from_str(as,Mn,rs),hs=ds.length,ps;if(!hs)throw new Error("empty label");let io=us.output=ds.flat();if(check_leading_underscore(io),!(us.emoji=hs>1||ds[0].is_emoji)&&io.every(mo=>mo<128))check_label_extension(io),ps="ASCII";else{let mo=ds.flatMap(Ao=>Ao.is_emoji?[]:Ao);if(!mo.length)ps="Emoji";else{if(CM.has(io[0]))throw error_placement("leading combining mark");for(let Lo=1;Lo<hs;Lo++){let Go=ds[Lo];if(!Go.is_emoji&&CM.has(Go[0]))throw error_placement(`emoji + combining mark: "${str_from_cps(ds[Lo-1])} + ${safe_str_from_cps([Go[0]])}"`)}check_fenced(io);let Ao=Array_from(new Set(mo)),[$o]=determine_group(Ao);check_group($o,mo),check_whole($o,Ao),ps=$o.N}}us.type=ps}catch(ds){us.error=ds}return us})}function check_whole(Fn,Mn){let rs,is=[];for(let os of Mn){let as=WHOLE_MAP.get(os);if(as===UNIQUE_PH)return;if(as){let us=as.M.get(os);if(rs=rs?rs.filter(ds=>us.has(ds)):Array_from(us),!rs.length)return}else is.push(os)}if(rs){for(let os of rs)if(is.every(as=>group_has_cp(os,as)))throw new Error(`whole-script confusable: ${Fn.N}/${os.N}`)}}function determine_group(Fn){let Mn=GROUPS;for(let rs of Fn){let is=Mn.filter(os=>group_has_cp(os,rs));if(!is.length)throw GROUPS.some(os=>group_has_cp(os,rs))?error_group_member(Mn[0],rs):error_disallowed(rs);if(Mn=is,is.length==1)break}return Mn}function flatten(Fn){return Fn.map(({input:Mn,error:rs,output:is})=>{if(rs){let os=rs.message;throw new Error(Fn.length==1?os:`Invalid label ${bidi_qq(safe_str_from_cps(Mn))}: ${os}`)}return str_from_cps(is)}).join(STOP_CH)}function error_disallowed(Fn){return new Error(`disallowed character: ${quoted_cp(Fn)}`)}function error_group_member(Fn,Mn){let rs=quoted_cp(Mn),is=GROUPS.find(os=>os.P.has(Mn));return is&&(rs=`${is.N} ${rs}`),new Error(`illegal mixture: ${Fn.N} + ${rs}`)}function error_placement(Fn){return new Error(`illegal placement: ${Fn}`)}function check_group(Fn,Mn){for(let rs of Mn)if(!group_has_cp(Fn,rs))throw error_group_member(Fn,rs);if(Fn.M){let rs=nfd(Mn);for(let is=1,os=rs.length;is<os;is++)if(NSM.has(rs[is])){let as=is+1;for(let us;as<os&&NSM.has(us=rs[as]);as++)for(let ds=is;ds<as;ds++)if(rs[ds]==us)throw new Error(`duplicate non-spacing marks: ${quoted_cp(us)}`);if(as-is>NSM_MAX)throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(rs.slice(is-1,as)))} (${as-is}/${NSM_MAX})`);is=as}}}function tokens_from_str(Fn,Mn,rs){let is=[],os=[];for(Fn=Fn.slice().reverse();Fn.length;){let as=consume_emoji_reversed(Fn);if(as)os.length&&(is.push(Mn(os)),os=[]),is.push(rs(as));else{let us=Fn.pop();if(VALID.has(us))os.push(us);else{let ds=MAPPED.get(us);if(ds)os.push(...ds);else if(!IGNORED.has(us))throw error_disallowed(us)}}}return os.length&&is.push(Mn(os)),is}function filter_fe0f(Fn){return Fn.filter(Mn=>Mn!=FE0F)}function consume_emoji_reversed(Fn,Mn){let rs=EMOJI_ROOT,is,os=Fn.length;for(;os&&(rs=rs.get(Fn[--os]),!!rs);){let{V:as}=rs;as&&(is=as,Fn.length=os)}return is}function normalize(Fn){return ens_normalize(Fn)}walletConnect.type="walletConnect";function walletConnect(Fn,Mn,rs){const is=Fn.isNewChainsStale??!0;let os,as,us,ds,hs,ps,io,fo;return mo=>({id:"walletConnect",name:"WalletConnect",type:walletConnect.type,async setup(){const Ao=await this.getProvider().catch(()=>null);Ao&&(hs||(hs=this.onConnect.bind(this),Ao.on("connect",hs)),io||(io=this.onSessionDelete.bind(this),Ao.on("session_delete",io)))},async connect({...Ao}={}){try{const $o=await this.getProvider();if(!$o)throw new ProviderNotFoundError;ps||(ps=this.onDisplayUri,$o.on("display_uri",ps));const Lo=await this.isChainsStale();if($o.session&&Lo&&await $o.disconnect(),!$o.session||Lo){const Wo=WcHelpersUtil.createNamespaces(rs);await $o.connect({optionalNamespaces:Wo,..."pairingTopic"in Ao?{pairingTopic:Ao.pairingTopic}:{}}),this.setRequestedChainsIds(rs.map(Jo=>Number(Jo.id)))}const Go=(await $o.enable()).map(Wo=>getAddress$1(Wo)),Yo=await this.getChainId();return ps&&($o.removeListener("display_uri",ps),ps=void 0),hs&&($o.removeListener("connect",hs),hs=void 0),us||(us=this.onAccountsChanged.bind(this),$o.on("accountsChanged",us)),ds||(ds=this.onChainChanged.bind(this),$o.on("chainChanged",ds)),fo||(fo=this.onDisconnect.bind(this),$o.on("disconnect",fo)),io||(io=this.onSessionDelete.bind(this),$o.on("session_delete",io)),{accounts:Go,chainId:Yo}}catch($o){throw/(user rejected|connection request reset)/i.test($o==null?void 0:$o.message)?new UserRejectedRequestError($o):$o}},async disconnect(){const Ao=await this.getProvider();try{await(Ao==null?void 0:Ao.disconnect())}catch($o){if(!/No matching key/i.test($o.message))throw $o}finally{ds&&(Ao==null||Ao.removeListener("chainChanged",ds),ds=void 0),fo&&(Ao==null||Ao.removeListener("disconnect",fo),fo=void 0),hs||(hs=this.onConnect.bind(this),Ao==null||Ao.on("connect",hs)),us&&(Ao==null||Ao.removeListener("accountsChanged",us),us=void 0),io&&(Ao==null||Ao.removeListener("session_delete",io),io=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var Go,Yo,Wo;const Ao=await this.getProvider();if(!((Go=Ao==null?void 0:Ao.session)!=null&&Go.namespaces))return[];const $o=(Wo=(Yo=Ao==null?void 0:Ao.session)==null?void 0:Yo.namespaces.eip155)==null?void 0:Wo.accounts;return($o==null?void 0:$o.map(Jo=>Jo.split(":")[2]))??[]},async getProvider({chainId:Ao}={}){var Go,Yo,Wo;async function $o(){var _l;if(!rs.map(Tl=>Number(Tl.id)).length)return;const xl=(_l=Mn.universalAdapter)==null?void 0:_l.getWalletConnectProvider();if(!xl)throw new Error("Provider not found");return xl}os||(as||(as=$o()),os=await as,os==null||os.events.setMaxListeners(Number.POSITIVE_INFINITY));const Lo=(Go=Mn.getCaipNetwork())==null?void 0:Go.id;if(Ao&&Lo!==Ao){const Jo=StorageUtil.getStoredActiveCaipNetwork();Jo&&Jo.chainNamespace===ConstantsUtil$3.CHAIN.EVM?await((Yo=this.switchChain)==null?void 0:Yo.call(this,{chainId:Number(Jo.id)})):await((Wo=this.switchChain)==null?void 0:Wo.call(this,{chainId:Ao}))}return os},async getChainId(){var Yo,Wo,Jo,xl;const Ao=(Yo=Mn.getCaipNetwork())==null?void 0:Yo.id;if(Ao)return Ao;const Lo=(xl=(Jo=(Wo=(await this.getProvider()).session)==null?void 0:Wo.namespaces.eip155)==null?void 0:Jo.chains)==null?void 0:xl[0],Go=rs.find(_l=>_l.id===Lo);return Go==null?void 0:Go.id},async isAuthorized(){try{const[Ao,$o]=await Promise.all([this.getAccounts(),this.getProvider()]);return Ao.length?await this.isChainsStale()&&$o.session?(await $o.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:Ao,chainId:$o}){var Yo,Wo;const Lo=await this.getProvider();if(!Lo)throw new ProviderNotFoundError;const Go=rs.find(Jo=>Jo.id===$o);if(!Go)throw new SwitchChainError(new ChainNotConfiguredError);try{Go!=null&&Go.caipNetworkId&&Lo.setDefaultChain(Go==null?void 0:Go.caipNetworkId),await Lo.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex($o)}]}),mo.emitter.emit("change",{chainId:Number($o)});const Jo=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...Jo,$o]),{...Go,id:Go.id}}catch(Jo){const xl=Jo;if(/(?:user rejected)/iu.test(xl.message))throw new UserRejectedRequestError(xl);try{let _l;Ao!=null&&Ao.blockExplorerUrls?_l=Ao.blockExplorerUrls:_l=(Yo=Go.blockExplorers)!=null&&Yo.default.url?[(Wo=Go.blockExplorers)==null?void 0:Wo.default.url]:[];const Tl={blockExplorerUrls:_l,chainId:numberToHex($o),chainName:Go.name,iconUrls:Ao==null?void 0:Ao.iconUrls,nativeCurrency:Go.nativeCurrency,rpcUrls:Go.rpcUrls.default.http};await Lo.request({method:"wallet_addEthereumChain",params:[Tl]});const Sl=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...Sl,$o]),{...Go,id:Go.id}}catch(_l){throw new UserRejectedRequestError(_l)}}},onAccountsChanged(Ao){Ao.length===0?this.onDisconnect():mo.emitter.emit("change",{accounts:Ao.map($o=>getAddress$1($o))})},onChainChanged(Ao){const $o=Number(Ao);mo.emitter.emit("change",{chainId:$o})},async onConnect(Ao){const $o=Number(Ao.chainId),Lo=await this.getAccounts();mo.emitter.emit("connect",{accounts:Lo,chainId:$o})},async onDisconnect(Ao){this.setRequestedChainsIds([]),mo.emitter.emit("disconnect");const $o=await this.getProvider();us&&($o.removeListener("accountsChanged",us),us=void 0),ds&&($o.removeListener("chainChanged",ds),ds=void 0),fo&&($o.removeListener("disconnect",fo),fo=void 0),io&&($o.removeListener("session_delete",io),io=void 0),hs||(hs=this.onConnect.bind(this),$o.on("connect",hs))},onDisplayUri(Ao){mo.emitter.emit("message",{type:"display_uri",data:Ao})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var Lo,Go,Yo;if(!((Lo=os==null?void 0:os.session)!=null&&Lo.namespaces))return[];const Ao=(Yo=(Go=os==null?void 0:os.session)==null?void 0:Go.namespaces.eip155)==null?void 0:Yo.accounts;return(Ao==null?void 0:Ao.map(Wo=>Number.parseInt(Wo.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var $o;const Ao=await(($o=mo.storage)==null?void 0:$o.getItem(this.requestedChainsStorageKey))??[];return[...new Set(Ao)]},async isChainsStale(){if(!is)return!1;const Ao=mo.chains.map(Go=>Go.id),$o=this.getNamespaceChainsIds();if($o.length&&!$o.some(Go=>Ao.includes(Go)))return!1;const Lo=await this.getRequestedChainsIds();return!Ao.every(Go=>Lo.includes(Number(Go)))},async setRequestedChainsIds(Ao){var $o;await(($o=mo.storage)==null?void 0:$o.setItem(this.requestedChainsStorageKey,Ao))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}coinbaseWallet.type="coinbaseWallet";function coinbaseWallet(Fn={}){return Fn.version==="3"||Fn.headlessMode?version3(Fn):version4(Fn)}function version4(Fn){let Mn,rs,is,os,as;return us=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:coinbaseWallet.type,async connect({chainId:ds}={}){try{const hs=await this.getProvider(),ps=(await hs.request({method:"eth_requestAccounts"})).map(fo=>getAddress$1(fo));is||(is=this.onAccountsChanged.bind(this),hs.on("accountsChanged",is)),os||(os=this.onChainChanged.bind(this),hs.on("chainChanged",os)),as||(as=this.onDisconnect.bind(this),hs.on("disconnect",as));let io=await this.getChainId();if(ds&&io!==ds){const fo=await this.switchChain({chainId:ds}).catch(mo=>{if(mo.code===UserRejectedRequestError.code)throw mo;return{id:io}});io=(fo==null?void 0:fo.id)??io}return{accounts:ps,chainId:io}}catch(hs){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(hs.message)?new UserRejectedRequestError(hs):hs}},async disconnect(){var hs;const ds=await this.getProvider();is&&(ds.removeListener("accountsChanged",is),is=void 0),os&&(ds.removeListener("chainChanged",os),os=void 0),as&&(ds.removeListener("disconnect",as),as=void 0),ds.disconnect(),(hs=ds.close)==null||hs.call(ds)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(hs=>getAddress$1(hs))},async getChainId(){const hs=await(await this.getProvider()).request({method:"eth_chainId"});return Number(hs)},async getProvider(){if(!rs){const ds=await(async()=>{const{default:hs}=await __vitePreload(async()=>{const{default:ps}=await import("./index-BFeC9daR.js").then(io=>io.i);return{default:ps}},__vite__mapDeps([0,1]));return typeof hs!="function"&&typeof hs.default=="function"?hs.default:hs})();Mn=new ds({...Fn,appChainIds:us.chains.map(hs=>hs.id)}),rs=Mn.makeWeb3Provider({...Fn,options:Fn.preference??"all"})}return rs},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:ds,chainId:hs}){var fo,mo,Ao,$o;const ps=us.chains.find(Lo=>Lo.id===hs);if(!ps)throw new SwitchChainError(new ChainNotConfiguredError);const io=await this.getProvider();try{return await io.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(ps.id)}]}),ps}catch(Lo){if(Lo.code===4902)try{let Go;ds!=null&&ds.blockExplorerUrls?Go=ds.blockExplorerUrls:Go=(fo=ps.blockExplorers)!=null&&fo.default.url?[(mo=ps.blockExplorers)==null?void 0:mo.default.url]:[];let Yo;(Ao=ds==null?void 0:ds.rpcUrls)!=null&&Ao.length?Yo=ds.rpcUrls:Yo=[(($o=ps.rpcUrls.default)==null?void 0:$o.http[0])??""];const Wo={blockExplorerUrls:Go,chainId:numberToHex(hs),chainName:(ds==null?void 0:ds.chainName)??ps.name,iconUrls:ds==null?void 0:ds.iconUrls,nativeCurrency:(ds==null?void 0:ds.nativeCurrency)??ps.nativeCurrency,rpcUrls:Yo};return await io.request({method:"wallet_addEthereumChain",params:[Wo]}),ps}catch(Go){throw new UserRejectedRequestError(Go)}throw new SwitchChainError(Lo)}},onAccountsChanged(ds){ds.length===0?this.onDisconnect():us.emitter.emit("change",{accounts:ds.map(hs=>getAddress$1(hs))})},onChainChanged(ds){const hs=Number(ds);us.emitter.emit("change",{chainId:hs})},async onDisconnect(ds){us.emitter.emit("disconnect");const hs=await this.getProvider();is&&(hs.removeListener("accountsChanged",is),is=void 0),os&&(hs.removeListener("chainChanged",os),os=void 0),as&&(hs.removeListener("disconnect",as),as=void 0)}})}function version3(Fn){let rs,is,os,as,us;return ds=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:coinbaseWallet.type,async connect({chainId:hs}={}){try{const ps=await this.getProvider(),io=(await ps.request({method:"eth_requestAccounts"})).map(mo=>getAddress$1(mo));os||(os=this.onAccountsChanged.bind(this),ps.on("accountsChanged",os)),as||(as=this.onChainChanged.bind(this),ps.on("chainChanged",as)),us||(us=this.onDisconnect.bind(this),ps.on("disconnect",us));let fo=await this.getChainId();if(hs&&fo!==hs){const mo=await this.switchChain({chainId:hs}).catch(Ao=>{if(Ao.code===UserRejectedRequestError.code)throw Ao;return{id:fo}});fo=(mo==null?void 0:mo.id)??fo}return{accounts:io,chainId:fo}}catch(ps){throw/(user closed modal|accounts received is empty|user denied account)/i.test(ps.message)?new UserRejectedRequestError(ps):ps}},async disconnect(){const hs=await this.getProvider();os&&(hs.removeListener("accountsChanged",os),os=void 0),as&&(hs.removeListener("chainChanged",as),as=void 0),us&&(hs.removeListener("disconnect",us),us=void 0),hs.disconnect(),hs.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(ps=>getAddress$1(ps))},async getChainId(){const ps=await(await this.getProvider()).request({method:"eth_chainId"});return Number(ps)},async getProvider(){var hs;if(!is){const ps=await(async()=>{const{default:$o}=await __vitePreload(async()=>{const{default:Lo}=await import("./index-CIwyOTPG.js").then(Go=>Go.i);return{default:Lo}},__vite__mapDeps([2,1]));return typeof $o!="function"&&typeof $o.default=="function"?$o.default:$o})();rs=new ps({...Fn,reloadOnDisconnect:!1});const io=(hs=rs.walletExtension)==null?void 0:hs.getChainId(),fo=ds.chains.find($o=>Fn.chainId?$o.id===Fn.chainId:$o.id===io)||ds.chains[0],mo=Fn.chainId||(fo==null?void 0:fo.id),Ao=Fn.jsonRpcUrl||(fo==null?void 0:fo.rpcUrls.default.http[0]);is=rs.makeWeb3Provider(Ao,mo)}return is},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:hs,chainId:ps}){var mo,Ao,$o,Lo;const io=ds.chains.find(Go=>Go.id===ps);if(!io)throw new SwitchChainError(new ChainNotConfiguredError);const fo=await this.getProvider();try{return await fo.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(io.id)}]}),io}catch(Go){if(Go.code===4902)try{let Yo;hs!=null&&hs.blockExplorerUrls?Yo=hs.blockExplorerUrls:Yo=(mo=io.blockExplorers)!=null&&mo.default.url?[(Ao=io.blockExplorers)==null?void 0:Ao.default.url]:[];let Wo;($o=hs==null?void 0:hs.rpcUrls)!=null&&$o.length?Wo=hs.rpcUrls:Wo=[((Lo=io.rpcUrls.default)==null?void 0:Lo.http[0])??""];const Jo={blockExplorerUrls:Yo,chainId:numberToHex(ps),chainName:(hs==null?void 0:hs.chainName)??io.name,iconUrls:hs==null?void 0:hs.iconUrls,nativeCurrency:(hs==null?void 0:hs.nativeCurrency)??io.nativeCurrency,rpcUrls:Wo};return await fo.request({method:"wallet_addEthereumChain",params:[Jo]}),io}catch(Yo){throw new UserRejectedRequestError(Yo)}throw new SwitchChainError(Go)}},onAccountsChanged(hs){hs.length===0?this.onDisconnect():ds.emitter.emit("change",{accounts:hs.map(ps=>getAddress$1(ps))})},onChainChanged(hs){const ps=Number(hs);ds.emitter.emit("change",{chainId:ps})},async onDisconnect(hs){ds.emitter.emit("disconnect");const ps=await this.getProvider();os&&(ps.removeListener("accountsChanged",os),os=void 0),as&&(ps.removeListener("chainChanged",as),as=void 0),us&&(ps.removeListener("disconnect",us),us=void 0)}})}metaMask.type="metaMask";function metaMask(Fn={}){let Mn,rs,is,os,as,us,ds,hs;return ps=>({id:"metaMaskSDK",name:"MetaMask",type:metaMask.type,async setup(){const io=await this.getProvider();io&&!us&&(us=this.onConnect.bind(this),io.on("connect",us))},async connect({chainId:io,isReconnecting:fo}={}){const mo=await this.getProvider();ds||(ds=this.onDisplayUri,mo.on("display_uri",ds));let Ao=[];fo&&(Ao=await this.getAccounts().catch(()=>[]));try{let $o,Lo;Ao!=null&&Ao.length||(Fn.connectAndSign||Fn.connectWith?(Fn.connectAndSign?$o=await Mn.connectAndSign({msg:Fn.connectAndSign}):Fn.connectWith&&(Lo=await Mn.connectWith({method:Fn.connectWith.method,params:Fn.connectWith.params})),Ao=await this.getAccounts()):Ao=(await Mn.connect()).map(Wo=>getAddress$1(Wo)));let Go=await this.getChainId();if(io&&Go!==io){const Yo=await this.switchChain({chainId:io}).catch(Wo=>{if(Wo.code===UserRejectedRequestError.code)throw Wo;return{id:Go}});Go=(Yo==null?void 0:Yo.id)??Go}return ds&&(mo.removeListener("display_uri",ds),ds=void 0),$o?mo.emit("connectAndSign",{accounts:Ao,chainId:Go,signResponse:$o}):Lo&&mo.emit("connectWith",{accounts:Ao,chainId:Go,connectWithResponse:Lo}),us&&(mo.removeListener("connect",us),us=void 0),os||(os=this.onAccountsChanged.bind(this),mo.on("accountsChanged",os)),as||(as=this.onChainChanged.bind(this),mo.on("chainChanged",as)),hs||(hs=this.onDisconnect.bind(this),mo.on("disconnect",hs)),{accounts:Ao,chainId:Go}}catch($o){const Lo=$o;throw Lo.code===UserRejectedRequestError.code?new UserRejectedRequestError(Lo):Lo.code===ResourceUnavailableRpcError.code?new ResourceUnavailableRpcError(Lo):Lo}},async disconnect(){const io=await this.getProvider();os&&(io.removeListener("accountsChanged",os),os=void 0),as&&(io.removeListener("chainChanged",as),as=void 0),hs&&(io.removeListener("disconnect",hs),hs=void 0),us||(us=this.onConnect.bind(this),io.on("connect",us)),await Mn.terminate()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(mo=>getAddress$1(mo))},async getChainId(){const io=await this.getProvider(),fo=io.getChainId()||await(io==null?void 0:io.request({method:"eth_chainId"}));return Number(fo)},async getProvider(){async function io(){const fo=await(async()=>{const{default:mo}=await __vitePreload(async()=>{const{default:Ao}=await import("./metamask-sdk-C3GM94Ow.js").then($o=>$o.m);return{default:Ao}},[]);return typeof mo!="function"&&typeof mo.default=="function"?mo.default:mo})();return Mn=new fo({_source:"wagmi",forceDeleteProvider:!1,forceInjectProvider:!1,injectProvider:!1,...Fn,readonlyRPCMap:Object.fromEntries(ps.chains.map(mo=>{const[Ao]=extractRpcUrls({chain:mo,transports:ps.transports});return[mo.id,Ao]})),dappMetadata:Fn.dappMetadata??(typeof window<"u"?{url:window.location.origin}:{name:"wagmi"}),useDeeplink:Fn.useDeeplink??!0}),await Mn.init(),Mn.getProvider()}return rs||(is||(is=io()),rs=await is),rs},async isAuthorized(){try{return!!(await withRetry(()=>withTimeout(()=>this.getAccounts(),{timeout:200}),{delay:201,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:io,chainId:fo}){var $o,Lo,Go,Yo;const mo=await this.getProvider(),Ao=ps.chains.find(Wo=>Wo.id===fo);if(!Ao)throw new SwitchChainError(new ChainNotConfiguredError);try{return await Promise.all([mo.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(fo)}]}).then(async()=>{await this.getChainId()===fo&&ps.emitter.emit("change",{chainId:fo})}),new Promise(Wo=>{const Jo=xl=>{"chainId"in xl&&xl.chainId===fo&&(ps.emitter.off("change",Jo),Wo())};ps.emitter.on("change",Jo)})]),Ao}catch(Wo){const Jo=Wo;if(Jo.code===4902||((Lo=($o=Jo==null?void 0:Jo.data)==null?void 0:$o.originalError)==null?void 0:Lo.code)===4902)try{const{default:xl,..._l}=Ao.blockExplorers??{};let Tl;io!=null&&io.blockExplorerUrls?Tl=io.blockExplorerUrls:xl&&(Tl=[xl.url,...Object.values(_l).map(Dl=>Dl.url)]);let Sl;(Go=io==null?void 0:io.rpcUrls)!=null&&Go.length?Sl=io.rpcUrls:Sl=[((Yo=Ao.rpcUrls.default)==null?void 0:Yo.http[0])??""];const $l={blockExplorerUrls:Tl,chainId:numberToHex(fo),chainName:(io==null?void 0:io.chainName)??Ao.name,iconUrls:io==null?void 0:io.iconUrls,nativeCurrency:(io==null?void 0:io.nativeCurrency)??Ao.nativeCurrency,rpcUrls:Sl};if(await mo.request({method:"wallet_addEthereumChain",params:[$l]}),hexToNumber(await mo.request({method:"eth_chainId"}))!==fo)throw new UserRejectedRequestError(new Error("User rejected switch after adding network."));return Ao}catch(xl){throw new UserRejectedRequestError(xl)}throw Jo.code===UserRejectedRequestError.code?new UserRejectedRequestError(Jo):new SwitchChainError(Jo)}},async onAccountsChanged(io){if(io.length===0)if(Mn.isExtensionActive())this.onDisconnect();else return;else if(ps.emitter.listenerCount("connect")){const fo=(await this.getChainId()).toString();this.onConnect({chainId:fo})}else ps.emitter.emit("change",{accounts:io.map(fo=>getAddress$1(fo))})},onChainChanged(io){const fo=Number(io);ps.emitter.emit("change",{chainId:fo})},async onConnect(io){const fo=await this.getAccounts();if(fo.length===0)return;const mo=Number(io.chainId);ps.emitter.emit("connect",{accounts:fo,chainId:mo});const Ao=await this.getProvider();us&&(Ao.removeListener("connect",us),us=void 0),os||(os=this.onAccountsChanged.bind(this),Ao.on("accountsChanged",os)),as||(as=this.onChainChanged.bind(this),Ao.on("chainChanged",as)),hs||(hs=this.onDisconnect.bind(this),Ao.on("disconnect",hs))},async onDisconnect(io){const fo=await this.getProvider();io&&io.code===1013&&fo&&(await this.getAccounts()).length||(ps.emitter.emit("disconnect"),os||(os=this.onAccountsChanged.bind(this),fo.on("accountsChanged",os)),as&&(fo.removeListener("chainChanged",as),as=void 0),hs&&(fo.removeListener("disconnect",hs),hs=void 0),us||(us=this.onConnect.bind(this),fo.on("connect",us)))},onDisplayUri(io){ps.emitter.emit("message",{type:"display_uri",data:io})}})}class W3mFrameProviderSingleton{constructor(){}static getInstance({projectId:Mn,chainId:rs,onTimeout:is}){return W3mFrameProviderSingleton.instance||(W3mFrameProviderSingleton.instance=new W3mFrameProvider({projectId:Mn,chainId:rs,onTimeout:is})),W3mFrameProviderSingleton.instance}}function authConnector(Fn){let Mn=null;function rs(is){return NetworkUtil.parseEvmChainId(is)||1}return is=>({id:ConstantsUtil$1.AUTH_CONNECTOR_ID,name:"AppKit Auth",type:"w3mAuth",chain:ConstantsUtil$3.CHAIN.EVM,async connect(os={}){const as=await this.getProvider();let us=os.chainId;if(os.isReconnecting&&(us=as.getLastUsedChainId(),!us))throw new Error("ChainId not found in provider");const{address:ds,chainId:hs}=await as.connect({chainId:us});Mn=ds,await as.getSmartAccountEnabledNetworks();const ps=rs(hs);return{accounts:[Mn],account:Mn,chainId:ps,chain:{id:ps,unsuported:!1}}},async disconnect(){await(await this.getProvider()).disconnect()},getAccounts(){return Mn?(is.emitter.emit("change",{accounts:[Mn]}),Promise.resolve([Mn])):Promise.resolve([])},async getProvider(){return this.provider||(this.provider=W3mFrameProviderSingleton.getInstance({projectId:Fn.options.projectId,onTimeout:()=>{AlertController.open(ErrorUtil.ALERT_ERRORS.INVALID_APP_CONFIGURATION_SOCIALS,"error")}})),Promise.resolve(this.provider)},async getChainId(){const os=await this.getProvider(),{chainId:as}=await os.getChainId();return rs(as)},async isAuthorized(){const os=await this.getProvider(),{isConnected:as}=await os.isConnected();return as},async switchChain({chainId:os}){try{const as=is.chains.find(hs=>hs.id===os);if(!as)throw new SwitchChainError(new Error("chain not found on connector."));const ds=await(await this.getProvider()).connect({chainId:os});return is.emitter.emit("change",{chainId:Number(os),accounts:[ds.address]}),as}catch(as){throw as instanceof Error?new SwitchChainError(as):as}},onAccountsChanged(os){os.length===0?this.onDisconnect():is.emitter.emit("change",{accounts:os.map(getAddress$1)})},onChainChanged(os){const as=Number(os);is.emitter.emit("change",{chainId:as})},async onDisconnect(os){await(await this.getProvider()).disconnect()}})}const OPTIONAL_METHODS=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions"];class WagmiAdapter{constructor(Mn){var as,us;if(this.appKit=void 0,this.options=void 0,this.chainNamespace=ConstantsUtil$3.CHAIN.EVM,this.defaultCaipNetwork=void 0,this.tokens=HelpersUtil.getCaipTokens((as=this.options)==null?void 0:as.tokens),this.siweControllerClient=(us=this.options)==null?void 0:us.siweConfig,this.adapterType="wagmi",!Mn.projectId)throw new Error(ErrorUtil.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED.shortMessage);this.caipNetworks=CaipNetworksUtil.extendCaipNetworks(Mn.networks,{projectId:Mn.projectId,customNetworkImageUrls:{}}),this.wagmiChains=this.caipNetworks.filter(ds=>ds.chainNamespace===ConstantsUtil$3.CHAIN.EVM);const rs=this.wagmiChains.map(ds=>[ds.id,CaipNetworksUtil.getViemTransport(ds)]);Object.entries(Mn.transports??{}).forEach(([ds,hs])=>{const ps=rs.findIndex(([io])=>io===Number(ds));ps===-1?rs.push([Number(ds),hs]):rs[ps]=[Number(ds),hs]});const is=Object.fromEntries(rs),os=[...Mn.connectors??[]];this.wagmiConfig=createConfig({...Mn,chains:this.wagmiChains,transports:is,connectors:os})}setCustomConnectors(Mn,rs){var us,ds,hs,ps,io,fo,mo;const is=[];Mn.enableWalletConnect!==!1&&is.push(walletConnect(Mn,rs,this.caipNetworks)),Mn.enableInjected!==!1&&is.push(injected({shimDisconnect:!0})),Mn.enableCoinbase!==!1&&is.push(coinbaseWallet({version:"4",appName:((us=Mn.metadata)==null?void 0:us.name)??"Unknown",appLogoUrl:((ds=Mn.metadata)==null?void 0:ds.icons[0])??"Unknown",preference:Mn.coinbasePreference??"all"}));const os=((hs=Mn.features)==null?void 0:hs.email)===void 0?ConstantsUtil$2.DEFAULT_FEATURES.email:(ps=Mn.features)==null?void 0:ps.email,as=(io=Mn.features)!=null&&io.socials?((mo=(fo=Mn.features)==null?void 0:fo.socials)==null?void 0:mo.length)>0:ConstantsUtil$2.DEFAULT_FEATURES.socials;(os||as)&&is.push(authConnector({chains:this.wagmiChains,options:{projectId:Mn.projectId}})),is.forEach(Ao=>{const $o=this.wagmiConfig._internal.connectors.setup(Ao);this.wagmiConfig._internal.connectors.setState(Lo=>[...Lo,$o])})}construct(Mn,rs){var is,os,as,us;if(this.appKit=Mn,this.options=rs,this.defaultCaipNetwork=rs.defaultNetwork||((is=rs.networks)==null?void 0:is[0]),this.tokens=HelpersUtil.getCaipTokens(rs.tokens),this.setCustomConnectors(rs,Mn),!this.wagmiConfig)throw new Error("appkit:wagmiConfig - is undefined");this.networkControllerClient={switchCaipNetwork:async ds=>{const hs=ds==null?void 0:ds.id;hs&&this.wagmiConfig&&await switchChain(this.wagmiConfig,{chainId:hs})},getApprovedCaipNetworksData:async()=>{if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");return new Promise(ds=>{var io,fo;const ps=new Map(this.wagmiConfig.state.connections).get(this.wagmiConfig.state.current||"");if(((io=ps==null?void 0:ps.connector)==null?void 0:io.id)===ConstantsUtil$1.AUTH_CONNECTOR_ID)ds(getEmailCaipNetworks());else if(((fo=ps==null?void 0:ps.connector)==null?void 0:fo.id)===ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID){const mo=this.wagmiConfig.connectors.find(Ao=>Ao.id===ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID);ds(getWalletConnectCaipNetworks(mo))}ds({approvedCaipNetworkIds:[],supportsAllNetworks:!0})})}},this.connectionControllerClient={connectWalletConnect:async()=>{var Lo,Go,Yo,Wo,Jo,xl,_l,Tl,Sl,$l,Pl;if(!this.wagmiConfig)throw new Error("connectionControllerClient:getWalletConnectUri - wagmiConfig is undefined");const ds=this.wagmiConfig.connectors.find(Dl=>Dl.id===ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID);if(!ds)throw new Error("connectionControllerClient:getWalletConnectUri - connector is undefined");const hs=await ds.getProvider(),ps=await((Yo=(Go=(Lo=this.options)==null?void 0:Lo.siweConfig)==null?void 0:Go.getMessageParams)==null?void 0:Yo.call(Go)),io=(xl=(Jo=(Wo=this.options)==null?void 0:Wo.siweConfig)==null?void 0:Jo.options)==null?void 0:xl.enabled,fo=typeof(hs==null?void 0:hs.authenticate)=="function",mo=ps&&Object.keys(ps||{}).length>0,Ao=(_l=this.options)==null?void 0:_l.siweConfig;if(io&&fo&&mo&&Ao){await ds.setRequestedChainsIds(ps.chains);const{SIWEController:Dl,getDidChainId:Ol,getDidAddress:Rl}=await __vitePreload(async()=>{const{SIWEController:Qo,getDidChainId:El,getDidAddress:Xo}=await import("./index-Bt9bEBgv.js");return{SIWEController:Qo,getDidChainId:El,getDidAddress:Xo}},[]),Vo=(Tl=this.caipNetworks)==null?void 0:Tl.filter(Qo=>Qo.chainNamespace==="eip155").map(Qo=>Qo.caipNetworkId);ps.chains=(Sl=this.caipNetworks)==null?void 0:Sl.filter(Qo=>Qo.chainNamespace==="eip155").map(Qo=>Qo.id);const jo=await hs.authenticate({nonce:await Ao.getNonce(),methods:[...OPTIONAL_METHODS],...ps,chains:Vo}),Ho=($l=jo==null?void 0:jo.auths)==null?void 0:$l[0];if(Ho){const{p:Qo,s:El}=Ho,Xo=Ol(Qo.iss),Al=Rl(Qo.iss);Al&&Xo&&Dl.setSession({address:Al,chainId:parseInt(Xo,10)});try{const wl=hs.client.formatAuthMessage({request:Qo,iss:Qo.iss});await Dl.verifyMessage({message:wl,signature:El.s,cacao:Ho})}catch(wl){throw console.error("Error verifying message",wl),await hs.disconnect().catch(console.error),await Dl.signOut().catch(console.error),wl}}}const $o=(Pl=this.appKit)==null?void 0:Pl.getCaipNetworkId();await connect(this.wagmiConfig,{connector:ds,chainId:$o})},connectExternal:async({id:ds,provider:hs,info:ps})=>{var mo,Ao,$o;if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");const io=this.wagmiConfig.connectors.find(Lo=>Lo.id===ds);if(!io)throw new Error("connectionControllerClient:connectExternal - connector is undefined");(mo=this.appKit)==null||mo.setClientId(null),hs&&ps&&io.id===ConstantsUtil$1.EIP6963_CONNECTOR_ID&&((Ao=io.setEip6963Wallet)==null||Ao.call(io,{provider:hs,info:ps}));const fo=($o=this.appKit)==null?void 0:$o.getCaipNetworkId();await connect(this.wagmiConfig,{connector:io,chainId:fo})},checkInstalled:ds=>{var ps;const hs=(ps=this.appKit)==null?void 0:ps.getConnectors().find(io=>io.type==="INJECTED");return ds?hs&&window!=null&&window.ethereum?ds.some(io=>{var fo;return!!((fo=window.ethereum)!=null&&fo[String(io)])}):!1:!!window.ethereum},disconnect:async()=>{var ds,hs,ps,io,fo;if(await disconnect$1(this.wagmiConfig),(ps=(hs=(ds=this.options)==null?void 0:ds.siweConfig)==null?void 0:hs.options)!=null&&ps.signOutOnDisconnect){const{SIWEController:mo}=await __vitePreload(async()=>{const{SIWEController:Ao}=await import("./index-Bt9bEBgv.js");return{SIWEController:Ao}},[]);await mo.signOut()}SafeLocalStorage.removeItem(SafeLocalStorageKeys.WALLET_ID),SafeLocalStorage.removeItem(SafeLocalStorageKeys.CONNECTED_CONNECTOR),SafeLocalStorage.removeItem(SafeLocalStorageKeys.WALLET_NAME),(io=this.appKit)==null||io.setClientId(null),this.syncAccount({address:void 0,chainId:void 0,connector:void 0,addresses:void 0,status:"disconnected"}),(fo=this.appKit)==null||fo.resetAccount("solana")},signMessage:async ds=>{var io;const hs=((io=this.appKit)==null?void 0:io.getCaipAddress())||"",ps=requireCaipAddress(hs);return signMessage(this.wagmiConfig,{message:ds,account:ps})},estimateGas:async ds=>{if(ds.chainNamespace&&ds.chainNamespace!=="eip155")throw new Error(`Invalid chain namespace - Expected eip155, got ${ds.chainNamespace}`);try{return await estimateGas(this.wagmiConfig,{account:ds.address,to:ds.to,data:ds.data,type:"legacy"})}catch{return BigInt(0)}},getCapabilities:async ds=>{var mo,Ao;if(!this.wagmiConfig)throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");const ps=getConnections(this.wagmiConfig)[0];if(!(ps!=null&&ps.connector))throw new Error("connectionControllerClient:getCapabilities - connector is undefined");const io=await ps.connector.getProvider();if(!io)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");const fo=(Ao=(mo=io.session)==null?void 0:mo.sessionProperties)==null?void 0:Ao.capabilities;if(fo){const Lo=parseWalletCapabilities(fo)[ds];if(Lo)return Lo}return await io.request({method:"wallet_getCapabilities",params:[ds]})},grantPermissions:async ds=>{if(!this.wagmiConfig)throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");const ps=getConnections(this.wagmiConfig)[0];if(!(ps!=null&&ps.connector))throw new Error("connectionControllerClient:grantPermissions - connector is undefined");const io=await ps.connector.getProvider();if(!io)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return io.request({method:"wallet_grantPermissions",params:ds})},revokePermissions:async ds=>{if(!this.wagmiConfig)throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");const ps=getConnections(this.wagmiConfig)[0];if(!(ps!=null&&ps.connector))throw new Error("connectionControllerClient:revokePermissions - connector is undefined");const io=await ps.connector.getProvider();if(!io)throw new Error("connectionControllerClient:revokePermissions - provider is undefined");return io.request({method:"wallet_revokePermissions",params:[ds]})},sendTransaction:async ds=>{if(ds.chainNamespace&&ds.chainNamespace!=="eip155")throw new Error(`Invalid chain namespace - Expected eip155, got ${ds.chainNamespace}`);const{chainId:hs}=getAccount(this.wagmiConfig),ps={account:ds.address,to:ds.to,value:ds.value,gas:ds.gas,gasPrice:ds.gasPrice,data:ds.data,chainId:hs,type:"legacy"};await prepareTransactionRequest(this.wagmiConfig,ps);const io=await sendTransaction(this.wagmiConfig,ps);return await waitForTransactionReceipt(this.wagmiConfig,{hash:io,timeout:25e3}),io},writeContract:async ds=>{var mo,Ao,$o;const hs=((mo=this.appKit)==null?void 0:mo.getCaipAddress())||"",ps=requireCaipAddress(hs),io=(Ao=this.appKit)==null?void 0:Ao.getCaipNetworkId();if(!io)throw new Error("networkControllerClient:writeContract - chainId is undefined");return await writeContract(this.wagmiConfig,{chain:($o=this.wagmiChains)==null?void 0:$o[io],chainId:io,address:ds.tokenAddress,account:ps,abi:ds.abi,functionName:ds.method,args:[ds.receiverAddress,ds.tokenAmount]})},getEnsAddress:async ds=>{var hs,ps;try{if(!this.wagmiConfig)throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");const io=(hs=this.appKit)==null?void 0:hs.getCaipNetworkId();let fo=!1,mo=!1;return isReownName(ds)&&(mo=await((ps=this.appKit)==null?void 0:ps.resolveReownName(ds))||!1),io===1&&(fo=await getEnsAddress(this.wagmiConfig,{name:normalize(ds),chainId:io})),fo||mo||!1}catch{return!1}},getEnsAvatar:async ds=>{var io;const hs=(io=this.appKit)==null?void 0:io.getCaipNetworkId();return hs!==mainnet.id?!1:await getEnsAvatar(this.wagmiConfig,{name:normalize(ds),chainId:hs})||!1},parseUnits:parseUnits$1,formatUnits:formatUnits$1},ChainController.state.chains.set(this.chainNamespace,{chainNamespace:this.chainNamespace,connectionControllerClient:this.connectionControllerClient,networkControllerClient:this.networkControllerClient,adapterType:this.adapterType,caipNetworks:this.caipNetworks}),this.syncConnectors(this.wagmiConfig.connectors),this.syncAuthConnector((os=this.wagmiConfig)==null?void 0:os.connectors.find(ds=>ds.id===ConstantsUtil$1.AUTH_CONNECTOR_ID)),this.syncRequestedNetworks(this.caipNetworks),watchConnectors(this.wagmiConfig,{onChange:ds=>{this.syncConnectors(ds),this.syncAuthConnector(ds.find(hs=>hs.id===ConstantsUtil$1.AUTH_CONNECTOR_ID))}}),watchAccount(this.wagmiConfig,{onChange:ds=>{this.syncAccount(ds)}}),(as=this.appKit)==null||as.setEIP6963Enabled(rs.enableEIP6963!==!1),(us=this.appKit)==null||us.subscribeShouldUpdateToAddress(ds=>{var hs;if(ds){const io=(hs=getConnections(this.wagmiConfig)[0])==null?void 0:hs.connector;io&&switchAccount(this.wagmiConfig,{connector:io}).then(fo=>this.syncAccount({address:ds,isConnected:!0,addresses:fo.accounts,connector:io,chainId:fo.chainId,status:"connected"}))}})}subscribeState(Mn){var rs;return(rs=this.appKit)==null?void 0:rs.subscribeState(is=>Mn({...is,selectedNetworkId:is.selectedNetworkId?Number(NetworkUtil.caipNetworkIdToNumber(is.selectedNetworkId)):void 0}))}syncRequestedNetworks(Mn){Array.from(new Set(Mn.map(is=>is.chainNamespace))).filter(is=>!!is).forEach(is=>{var os;(os=this.appKit)==null||os.setRequestedCaipNetworks(Mn.filter(as=>as.chainNamespace===is),is)})}async syncAccount({address:Mn,chainId:rs,connector:is,addresses:os,status:as}){var ds,hs,ps,io,fo,mo,Ao,$o,Lo,Go,Yo,Wo,Jo,xl,_l,Tl,Sl,$l;const us=(is==null?void 0:is.id)===ConstantsUtil$1.AUTH_CONNECTOR_ID;if(as==="disconnected"){(ds=this.appKit)==null||ds.resetAccount(this.chainNamespace),(hs=this.appKit)==null||hs.resetWcConnection(),(ps=this.appKit)==null||ps.resetNetwork(this.chainNamespace),(io=this.appKit)==null||io.setAllAccounts([],this.chainNamespace),(fo=this.appKit)==null||fo.setStatus(as,this.chainNamespace),(mo=this.appKit)==null||mo.setLoading(!1),SafeLocalStorage.removeItem(SafeLocalStorageKeys.WALLET_ID),us&&await is.disconnect();return}if(this.wagmiConfig&&is)if(is.name==="WalletConnect"&&is.getProvider&&Mn){const Pl=(Ao=this.appKit)==null?void 0:Ao.getCaipNetwork(),Dl=rs||(Pl==null?void 0:Pl.id),Ol=await is.getProvider(),Rl=(($o=Ol==null?void 0:Ol.session)==null?void 0:$o.namespaces)||{},Vo=Rl?Object.keys(Rl):[],jo=(Lo=this.appKit)==null?void 0:Lo.getPreferredAccountType();Vo.forEach(Ho=>{var Xo,Al,wl,yl;const Qo=Ho,El=(Xo=Rl==null?void 0:Rl[Ho])==null?void 0:Xo.accounts[0];ProviderUtil.setProvider(Qo,Ol),ProviderUtil.setProviderId(Qo,"walletConnect"),(Al=this.appKit)==null||Al.setPreferredAccountType(jo,Qo),(wl=this.appKit)==null||wl.setCaipAddress(El,Qo),(yl=this.appKit)==null||yl.setStatus(as,Qo)}),((Yo=(Go=this.appKit)==null?void 0:Go.getCaipNetwork())==null?void 0:Yo.chainNamespace)!==ConstantsUtil$3.CHAIN.SOLANA&&Dl&&(this.syncNetwork(Mn,Dl,!0),await Promise.all([this.syncProfile(Mn,Dl),this.syncBalance(Mn,Dl),this.syncConnectedWalletInfo(is),(Wo=this.appKit)==null?void 0:Wo.setApprovedCaipNetworksData(this.chainNamespace)]))}else if(as==="connected"&&Mn&&rs){ProviderUtil.setProvider(this.chainNamespace,await is.getProvider()),ProviderUtil.setProviderId(this.chainNamespace,is.id);const Pl=`eip155:${rs}:${Mn}`;this.syncNetwork(Mn,rs,!0),await Promise.all([this.syncProfile(Mn,rs),this.syncBalance(Mn,rs),this.syncConnectedWalletInfo(is),(Jo=this.appKit)==null?void 0:Jo.setApprovedCaipNetworksData(this.chainNamespace)]),(xl=this.appKit)==null||xl.setLoading(!1),(_l=this.appKit)==null||_l.setCaipAddress(Pl,this.chainNamespace),(Tl=this.appKit)==null||Tl.setStatus("connected",this.chainNamespace),!us&&(os!=null&&os.length)&&((Sl=this.appKit)==null||Sl.setAllAccounts(os.map(Dl=>({address:Dl,type:"eoa"})),this.chainNamespace))}else as==="reconnecting"&&(($l=this.appKit)==null||$l.setLoading(!0))}syncNetwork(Mn,rs,is){var as,us,ds,hs,ps;const os=this.caipNetworks.find(io=>io.id===rs);if(os&&rs&&((as=this.appKit)==null||as.setCaipNetwork(os),is&&Mn&&rs)){const io=`eip155:${rs}:${Mn}`;if((us=this.appKit)==null||us.setCaipAddress(io,this.chainNamespace),(ds=os==null?void 0:os.blockExplorers)!=null&&ds.default.url){const fo=`${os.blockExplorers.default.url}/address/${Mn}`;(hs=this.appKit)==null||hs.setAddressExplorerUrl(fo,this.chainNamespace)}else(ps=this.appKit)==null||ps.setAddressExplorerUrl(void 0,this.chainNamespace)}}async syncReownName(Mn){var rs,is,os;if(!this.appKit)throw new Error("syncReownName - appKit is undefined");try{const as=await this.appKit.getReownName(Mn);if(as[0]){const us=as[0];(rs=this.appKit)==null||rs.setProfileName(us.name,this.chainNamespace)}else(is=this.appKit)==null||is.setProfileName(null,this.chainNamespace)}catch{(os=this.appKit)==null||os.setProfileName(null,this.chainNamespace)}}async syncProfile(Mn,rs){var is,os,as,us,ds,hs;if(!this.appKit)throw new Error("syncProfile - appKit is undefined");try{const{name:ps,avatar:io}=await this.appKit.fetchIdentity({address:Mn});(is=this.appKit)==null||is.setProfileName(ps,this.chainNamespace),(os=this.appKit)==null||os.setProfileImage(io,this.chainNamespace),ps||await this.syncReownName(Mn)}catch{if(rs===mainnet.id){const ps=await getEnsName(this.wagmiConfig,{address:Mn,chainId:rs});if(ps){(as=this.appKit)==null||as.setProfileName(ps,this.chainNamespace);const io=await getEnsAvatar(this.wagmiConfig,{name:ps,chainId:rs});io&&((us=this.appKit)==null||us.setProfileImage(io,this.chainNamespace))}else await this.syncReownName(Mn),(ds=this.appKit)==null||ds.setProfileImage(null,this.chainNamespace)}else await this.syncReownName(Mn),(hs=this.appKit)==null||hs.setProfileImage(null,this.chainNamespace)}}async syncBalance(Mn,rs){var os,as,us,ds,hs;const is=this.caipNetworks.find(ps=>ps.id===rs);if(is&&this.wagmiConfig){const ps=await getBalance(this.wagmiConfig,{address:Mn,chainId:rs,token:(us=(as=(os=this.options)==null?void 0:os.tokens)==null?void 0:as[is.caipNetworkId])==null?void 0:us.address});(ds=this.appKit)==null||ds.setBalance(ps.formatted,ps.symbol,this.chainNamespace);return}(hs=this.appKit)==null||hs.setBalance(void 0,void 0,this.chainNamespace)}async syncConnectedWalletInfo(Mn){var rs,is,os,as;if(!Mn)throw Error("syncConnectedWalletInfo - connector is undefined");if(Mn.id===ConstantsUtil$1.WALLET_CONNECT_CONNECTOR_ID&&Mn.getProvider){const us=await Mn.getProvider();us.session&&((is=this.appKit)==null||is.setConnectedWalletInfo({...us.session.peer.metadata,name:us.session.peer.metadata.name,icon:(rs=us.session.peer.metadata.icons)==null?void 0:rs[0]},this.chainNamespace))}else{const us=(os=this.appKit)==null?void 0:os.getConnectors().find(ds=>ds.id===Mn.id);(as=this.appKit)==null||as.setConnectedWalletInfo({name:Mn.name,icon:Mn.icon||this.appKit.getConnectorImage(us)},this.chainNamespace)}}syncConnectors(Mn){var us;const rs=Mn.map(ds=>({...ds,chain:this.chainNamespace})),is=new Set,os=rs.filter(ds=>{const hs=is.has(ds.id);return is.add(ds.id),!hs}),as=[];os.forEach(({id:ds,name:hs,type:ps,icon:io})=>{var mo,Ao;ConstantsUtil$1.AUTH_CONNECTOR_ID===ds||as.push({id:ds,explorerId:PresetsUtil.ConnectorExplorerIds[ds],imageUrl:((Ao=(mo=this.options)==null?void 0:mo.connectorImages)==null?void 0:Ao[ds])??io,name:PresetsUtil.ConnectorNamesMap[ds]??hs,imageId:PresetsUtil.ConnectorImageIds[ds],type:PresetsUtil.ConnectorTypesMap[ps]??"EXTERNAL",info:{rdns:ds},chain:this.chainNamespace})}),(us=this.appKit)==null||us.setConnectors(as)}async syncAuthConnector(Mn){var is;const rs=Mn;if(rs){const os=await rs.getProvider();(is=this.appKit)==null||is.addConnector({id:ConstantsUtil$1.AUTH_CONNECTOR_ID,type:"AUTH",name:"w3mAuth",provider:os,chain:this.chainNamespace}),this.initAuthConnectorListeners(Mn)}}async initAuthConnectorListeners(Mn){Mn&&(await this.listenAuthConnector(Mn),await this.listenModal(Mn))}async listenAuthConnector(Mn,rs=!1){var is,os;if(rs||typeof window<"u"&&Mn){(is=this.appKit)==null||is.setLoading(!0);const as=await Mn.getProvider(),us=as.getLoginEmailUsed();(os=this.appKit)==null||os.setLoading(us),as.onRpcRequest(ds=>{var hs,ps;W3mFrameHelpers.checkIfRequestExists(ds)?W3mFrameHelpers.checkIfRequestIsSafe(ds)||(hs=this.appKit)==null||hs.handleUnsafeRPCRequest():((ps=this.appKit)==null||ps.open(),console.error(W3mFrameRpcConstants.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:ds.method}),setTimeout(()=>{var io;(io=this.appKit)==null||io.showErrorMessage(W3mFrameRpcConstants.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),as.rejectRpcRequests())}),as.onRpcError(()=>{var hs,ps,io,fo;((hs=this.appKit)==null?void 0:hs.isOpen())&&((ps=this.appKit)!=null&&ps.isTransactionStackEmpty()?(io=this.appKit)==null||io.close():(fo=this.appKit)==null||fo.popTransactionStack(!0))}),as.onRpcSuccess((ds,hs)=>{var io,fo,mo;W3mFrameHelpers.checkIfRequestIsSafe(hs)||((io=this.appKit)!=null&&io.isTransactionStackEmpty()?(fo=this.appKit)==null||fo.close():(mo=this.appKit)==null||mo.popTransactionStack())}),as.onNotConnected(()=>{var io,fo,mo;const ds=(io=this.appKit)==null?void 0:io.getIsConnectedState(),ps=SafeLocalStorage.getItem(SafeLocalStorageKeys.CONNECTED_CONNECTOR)==="AUTH";!ds&&ps&&((fo=this.appKit)==null||fo.setCaipAddress(void 0,this.chainNamespace),(mo=this.appKit)==null||mo.setLoading(!1))}),as.onConnect(ds=>{var ps,io,fo,mo,Ao;const hs=`eip155:${ds.chainId}:${ds.address}`;(ps=this.appKit)==null||ps.setCaipAddress(hs,this.chainNamespace),(io=this.appKit)==null||io.setSmartAccountDeployed(!!ds.smartAccountDeployed,this.chainNamespace),(fo=this.appKit)==null||fo.setPreferredAccountType(ds.preferredAccountType,this.chainNamespace),(mo=this.appKit)==null||mo.setAllAccounts(ds.accounts||[{address:ds.address,type:ds.preferredAccountType||"eoa"}],this.chainNamespace),StorageUtil.setConnectedConnector("AUTH"),(Ao=this.appKit)==null||Ao.setLoading(!1)}),as.onGetSmartAccountEnabledNetworks(ds=>{var hs;(hs=this.appKit)==null||hs.setSmartAccountEnabledNetworks(ds,this.chainNamespace)}),as.onSetPreferredAccount(({address:ds,type:hs})=>{var ps;ds&&((ps=this.appKit)==null||ps.setPreferredAccountType(hs,this.chainNamespace),this.wagmiConfig&&reconnect(this.wagmiConfig,{connectors:[Mn]}))})}}async listenModal(Mn){const rs=await Mn.getProvider();this.subscribeState(is=>{is.open||rs.rejectRpcRequests()})}}const projectId="b8d15d96157934a210eb13769a539caa",networks=[arbitrum$1,arbitrumSepolia,bsc,bscTestnet],connectors=[];connectors.push(metaMask());const wagmiAdapter=new WagmiAdapter({networks,connectors,projectId,multiInjectedProviderDiscovery:!1});createAppKit({adapters:[wagmiAdapter],networks:[arbitrum$1,arbitrumSepolia,bsc,bscTestnet],projectId,features:{email:!1,onramp:!0,swaps:!1,socials:!1},featuredWalletIds:["e7c4d26541a7fd84dbdfa9922d3ad21e936e13a7a0e44385d44f006139e44d3b","5864e2ced7c293ed18ac35e0db085c09ed567d67346ccb6f58a0327a75137489","c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96"],includeWalletIds:["e7c4d26541a7fd84dbdfa9922d3ad21e936e13a7a0e44385d44f006139e44d3b","5864e2ced7c293ed18ac35e0db085c09ed567d67346ccb6f58a0327a75137489","c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96"],allWallets:"HIDE"});const wagmiConfig=wagmiAdapter.wagmiConfig;function clientToSigner(Fn){var ds,hs;const{account:Mn,chain:rs,transport:is}=Fn,os={chainId:rs.id,name:rs.name,ensAddress:(hs=(ds=rs.contracts)==null?void 0:ds.ensRegistry)==null?void 0:hs.address};return new Web3Provider(is,os).getSigner(Mn.address)}async function getEthersSigner(Fn,{chainId:Mn}={}){const rs=await getConnectorClient(Fn,{chainId:Mn});return clientToSigner(rs)}const useData=()=>{const{isSelectedChain:Fn,multiMarketPnlData:Mn,multiMarketBalanceData:rs,updateIsFetchingData:is,updateOpenOrders:os,updatePositions:as,updateWithdrawable:us,updateTrades:ds,setUsdcBalance:hs,setMultiMarketOpenOrders:ps,setMultiMarketPositionData:io,setMultiMarketBalanceData:fo,setMultiMarketWithdrawalData:mo,setMultiMarketPnlData:Ao}=useStore(),Lo=CHAIN_PARAMS_CONFIG[Fn].provider,Go=async(Wo,Jo)=>{try{const Sl=await new Contract(CHAIN_PARAMS_CONFIG[Fn].info_aggregator_address,ABI.InfoAggregator,Lo).getMultiMarketBalances(Wo,Jo);var xl=formatUnits(Sl.settlement_token_balance.toString(),CHAIN_PARAMS_CONFIG[Fn].settlement_token_decimals);xl=truncateDecimals(xl,6);const $l=Sl.multi_market_token_balances,Pl=CHAIN_PARAMS_CONFIG[Fn].settlement_token_decimals;var _l={};return Jo.forEach(function(Dl,Ol){_l[Dl]={};var Rl=formatUnits($l[Ol].long_call_token_balance.toString(),Pl);Rl=truncateDecimals(Rl,6);var Vo=formatUnits($l[Ol].short_call_token_balance.toString(),Pl);Vo=truncateDecimals(Vo,6),_l[Dl].CALL={longToken:Number(Rl),shortToken:Number(Vo)},Rl=formatUnits($l[Ol].long_put_token_balance.toString(),Pl),Rl=truncateDecimals(Rl,6),Vo=formatUnits($l[Ol].short_put_token_balance.toString(),Pl),Vo=truncateDecimals(Vo,6),_l[Dl].PUT={longToken:Number(Rl),shortToken:Number(Vo)}}),hs(Number(xl)),fo(_l),_l}catch(Tl){console.log("Error fetching multi market balances:",Tl)}return rs};return{fetchData:async(Wo,Jo)=>{try{if(is(!0),Wo){const _l=CHAIN_PARAMS_CONFIG[Fn].provider,Tl=[async()=>{const jo=await Go(Wo,Object.keys(CHOOSE_OPTION_TYPE[Fn]));return fo(jo),jo},async()=>{const jo=await getMultiMarketOpenOrders(Wo,_l,Mn,Fn);return ps(jo),os(jo),jo},async()=>await getMultiMarketActiveClaims(Wo,Fn),async()=>await getMultiMarketCurrentPnL(Fn),async()=>{const jo=await getMultiMarketHistory(Wo,_l,Fn);return ds(jo),jo},async()=>{const jo=await getMultiMarketWithdrawals(Wo,Fn);return mo(jo),us(jo),jo}],[Sl,$l,Pl,Dl,Ol,Rl]=await Promise.all(Tl.map(jo=>jo())),Vo=await getMultiMarketPositionData(Pl,Sl,Dl,Fn);io(Vo),as(Vo),Ao(Dl)}else ps(null),ds(null),hs(0);is(!1)}catch(xl){console.error("Error fetching data:",xl),is(!1)}}}},useOrder=()=>{const{isDarkMode:Fn,isMode:Mn,updateDashboardInputValue:rs,updateIsLoader:is,selectedCrypto:os,isSelectedChain:as,usdcBalance:us,setUsdcBalance:ds,multiMarketOpenOrders:hs,multiMarketPositionData:ps,multiMarketBalanceData:io,setMultiMarketBalanceData:fo}=useStore(),Ao=CHAIN_PARAMS_CONFIG[as].provider,{address:$o,chain:Lo}=useAccount(),{watchAsset:Go}=useWatchAsset(),[Yo,Wo]=reactExports.useState(""),[Jo,xl]=reactExports.useState(!1),[_l,Tl]=reactExports.useState(0),[Sl,$l]=reactExports.useState(0),Pl={backgroundColor:Fn?"#fff":"#111213",color:"#0E9384"},{fetchData:Dl}=useData(),Ol=async wl=>{var Hl,Yl,Ll;const yl=new Interface(["event Transfer(address indexed from, address indexed to, uint256 value)"]),Bl=wl.logs.filter(Zl=>Zl.topics[0]===yl.getEventTopic("Transfer"))[0].address,Gl=(Yl=(Hl=CHOOSE_OPTION_TYPE[as])==null?void 0:Hl[os])==null?void 0:Yl[Mn];let Nl;switch(Bl){case Gl.LongToken:Nl=`L${Mn[0].toUpperCase()}O_${os.toUpperCase()}`;break;case Gl.ShortToken:Nl=`S${Mn[0].toUpperCase()}O_${os.toUpperCase()}`;break;default:return!1}if((await fetchTokenAddedData($o,as,Nl)).length>0)return!1;let Vl=!1;try{Go({type:"ERC20",options:{address:Bl,symbol:Nl,decimals:(Ll=CHAIN_PARAMS_CONFIG[as])==null?void 0:Ll.settlement_token_decimals}}),await insertTokenAddedData($o,as,Nl)}catch(Zl){Zl.code===4001&&staticMethods.error({message:"Wallet Error",description:"User rejected the request.",style:Pl})}return console.log("success:",Vl),Vl},Rl=async(wl,yl)=>{try{const Nl=await new Contract(CHAIN_PARAMS_CONFIG[as].info_aggregator_address,ABI.InfoAggregator,Ao).getMultiMarketBalances(wl,yl);var Il=formatUnits(Nl.settlement_token_balance.toString(),CHAIN_PARAMS_CONFIG[as].settlement_token_decimals);Il=truncateDecimals(Il,6);const zl=Nl.multi_market_token_balances,Vl=CHAIN_PARAMS_CONFIG[as].settlement_token_decimals;var Bl={};return yl.forEach(function(Hl,Yl){Bl[Hl]={};var Ll=formatUnits(zl[Yl].long_call_token_balance.toString(),Vl);Ll=truncateDecimals(Ll,6);var Zl=formatUnits(zl[Yl].short_call_token_balance.toString(),Vl);Zl=truncateDecimals(Zl,6),Bl[Hl].CALL={longToken:Number(Ll),shortToken:Number(Zl)},Ll=formatUnits(zl[Yl].long_put_token_balance.toString(),Vl),Ll=truncateDecimals(Ll,6),Zl=formatUnits(zl[Yl].short_put_token_balance.toString(),Vl),Zl=truncateDecimals(Zl,6),Bl[Hl].PUT={longToken:Number(Ll),shortToken:Number(Zl)}}),ds(Number(Il)),fo(Bl),Bl}catch(Gl){console.log("Error fetching multi market balances:",Gl)}return io},Vo=async wl=>{if(!window.ethereum){console.error("Ethereum object not found!.");return}const yl=networkConfigs[wl];yl?await window.ethereum.request({method:"wallet_addEthereumChain",params:[yl]}):(staticMethods.error({message:"Error",description:"No configuration found for chainId!"}),console.error(`No configuration found for chainId: ${wl}`))},jo=async(wl,yl,Il,Bl)=>{let Gl=0,Nl="",zl="";switch(wl){case"buyLong":us!==void 0&&us!==0?Gl=us:Gl=0,console.log("usdcBalance",us,Gl),Nl="USDC";break;case"buyShort":us!==void 0&&us!==0?Gl=us:Gl=0,Nl="USDC";break;case"sellLong":io!=null&&io!==void 0&&io[Il]!==void 0&&io[Il][Bl]!==void 0&&io[Il][Bl].longToken!==void 0?Gl=io[Il][Bl].longToken:Gl=0,Nl="longToken",zl="LONG";break;case"sellShort":io!=null&&io!==void 0&&io[Il]!==void 0&&io[Il][Bl]!==void 0&&io[Il][Bl].shortToken!==void 0?Gl=io[Il][Bl].shortToken:Gl=0,Nl="shortToken",zl="SHORT";break}return!wl.includes("sell")&&(Gl==null||Gl===0||Gl<Number(yl))?(staticMethods.error({message:"Balance Error",style:Pl,description:jsxRuntimeExports.jsxs("div",{children:["Insufficient ",Nl," balance. Click here to get ",Nl," through Kana Swap.",jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("a",{href:"https://app.kanalabs.io",target:"_blank",children:jsxRuntimeExports.jsx("u",{children:"Click Here"})})})]})}),{error:!0,data:null}):Gl==null||Gl===0||Gl<Number(yl)?(staticMethods.error({message:"Balance Error",style:Pl,description:jsxRuntimeExports.jsxs("div",{children:["You don't have enough ",zl," tokens to sell. Please check your balance and try again."]})}),{error:!0,data:null}):{error:!1,data:null}},Ho=async wl=>{try{const Nl=await new Contract(CHAIN_PARAMS_CONFIG[as].info_aggregator_address,ABI.InfoAggregator,Ao).getAllBalances(wl,os,Mn);var yl=formatUnits(Nl.long_token_balance.toString(),CHAIN_PARAMS_CONFIG[as].settlement_token_decimals);yl=truncateDecimals(yl,6);var Il=formatUnits(Nl.short_token_balance.toString(),CHAIN_PARAMS_CONFIG[as].settlement_token_decimals);Il=truncateDecimals(Il,6);var Bl=formatUnits(Nl.settlement_token_balance.toString(),CHAIN_PARAMS_CONFIG[as].settlement_token_decimals);return Bl=truncateDecimals(Bl,6),Tl(Number(yl)),$l(Number(Il)),console.log("Setting usdcBalance to ",Bl),ds(Number(Bl)),{longToken:Number(yl),shortToken:Number(Il)}}catch(Gl){console.log("Error updating balances:",Gl)}return{longToken:Number(_l),shortToken:Number(Sl)}};return{getMultiMarketBalanceData:Rl,fetchData:Dl,handleOnAddNetwork:Vo,checkSufficientBalance:jo,updatedBalance:Ho,executeOrder:async(wl,yl,Il,Bl,Gl,Nl,zl)=>{try{if(Bl<=0&&wl.includes("buy"))return;const Yl=ps!==null&&Nl in ps&&zl in ps[Nl]?ps[Nl][zl]:null,Ll=hs!==null&&Nl in hs&&zl in hs[Nl]?hs[Nl][zl]:[],Zl=await getLongShortHoldings(Yl,Ll);var Vl=0,Hl=0;if(!Gl){const dp=await jo(wl,Bl,Nl,zl);if(dp.error){console.error("isSwapable returned an error:",dp);return}}Wo(wl),is(!0),xl(!0);const wu={buyLong:"Buy Long OPerps",sellLong:"Sell Long OPerps",buyShort:"Buy Short OPerps",sellShort:"Sell Short OPerps"}[wl];if(!wu)return;if(Lo.id!=as){await Vo(as),is(!1),xl(!1),staticMethods.info({message:"Connected to "+CHAIN_PARAMS_CONFIG[as].name+" Chain. Please proceed with the transaction now",style:Pl});return}staticMethods.info({message:"The transaction is currently in process. Please wait for 15-20 seconds.",style:Pl});const yu=await getEthersSigner(wagmiConfig),rp=await executeOpenOrder(wl,Bl,yu,as,Nl,zl);if((rp==null?void 0:rp.status)===1){const dp=CHAIN_PARAMS_CONFIG[as].explorer_link;staticMethods.success({message:`${wu} Order Placed Successfully, Check Open Orders`,style:Pl,description:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("a",{className:"text-purple-700 underline hover:underline hover:text-purple-500",href:`${dp}/tx/${rp==null?void 0:rp.transactionHash}`,target:"_blank",rel:"noreferrer",children:"View transaction"})})})}),is(!1),xl(!1),rs(""),wl==="sellLong"&&Zl.long-Bl<=.01||wl==="sellShort"&&Zl.short-Bl<=.01?Hl=1:Hl=0,console.log("Calling writeTransaction on FE utils/helper for trx_hash:",rp.transactionHash);const up=await Ho($o);wl==="sellLong"?Vl=yl*Bl/(Bl+(up!=null&&up.longToken?up.longToken:0)):wl==="sellShort"?Vl=yl*Bl/(Bl+(up!=null&&up.shortToken?up.shortToken:0)):Vl=0,await writeTransactionRow(rp,Hl,Vl,as,Nl,zl),await Dl($o,!1),await insertUserLimitationData(as,$o,rp==null?void 0:rp.transactionHash)}}catch(Yl){is(!1),xl(!1),rs(""),console.log("Error executing order:",Yl),Yl==="ACTION_REJECTED"?staticMethods.error({message:"Wallet Error",description:"User Rejected the request.",style:Pl}):staticMethods.error({message:"Error executing order",description:"Please report this error to the support team."+Yl,style:Pl})}finally{Wo("")}},executeCancel:async(wl,yl,Il)=>{try{if(wl){if(is(!0),Lo.id!=as){await Vo(as),is(!1),staticMethods.info({message:"Connected to "+CHAIN_PARAMS_CONFIG[as].name+" Chain. Please proceed with the transaction now",style:Pl});return}staticMethods.info({message:"The transaction is currently in process. Please wait for 15-20 seconds.",style:Pl});const Bl=await getEthersSigner(wagmiConfig),Gl=await executeCancelOrder(wl,Bl,as,yl,Il);if((Gl==null?void 0:Gl.status)===1){const Nl=CHAIN_PARAMS_CONFIG[as].explorer_link;staticMethods.success({message:"Order Cancelled Successfully.",style:Pl,description:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("a",{className:"text-purple-700 underline hover:underline hover:text-purple-500",href:`${Nl}/tx/${Gl==null?void 0:Gl.transactionHash}`,target:"_blank",rel:"noreferrer",children:"View transaction"})})})}),await writeTransactionRow(Gl,0,0,as,yl,Il),await Dl($o,!1)}}}catch(Bl){console.log("Error executing order:",Bl),Bl==="ACTION_REJECTED"?staticMethods.error({message:"Wallet Error",description:"User Rejected the request.",style:Pl}):staticMethods.error({message:"Error executing order",description:"please report this error to the support team."+Bl,style:Pl})}finally{is(!1)}},executeClaim:async(wl,yl,Il)=>{try{if(wl){if(is(!0),Lo.id!=as){await Vo(as),is(!1),staticMethods.info({message:"Connected to "+CHAIN_PARAMS_CONFIG[as].name+" Chain. Please claim now",style:Pl});return}staticMethods.info({message:"The transaction is currently in process. Please wait for 15-20 seconds.",style:Pl});const Bl=await getEthersSigner(wagmiConfig),Gl=await executeClaimOrder(wl,Bl,as,yl,Il);if((Gl==null?void 0:Gl.status)===1){const Nl=CHAIN_PARAMS_CONFIG[as].explorer_link;staticMethods.success({message:"Claimed Successfully.",style:Pl,description:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("a",{className:"text-purple-700 underline hover:underline hover:text-purple-500",href:`${Nl}/tx/${Gl==null?void 0:Gl.transactionHash}`,target:"_blank",rel:"noreferrer",children:"View transaction"})})})}),await Dl($o,!0),await Ol(Gl),await Dl($o,!0)}}}catch(Bl){console.log("Error executing order:",Bl),Bl==="ACTION_REJECTED"?staticMethods.error({message:"Wallet Error",description:"User Rejected the request.",style:Pl}):staticMethods.error({message:"Error executing order",description:"Please report this error to the support team."+Bl,style:Pl})}finally{is(!1)}},executeInvaultSell:async(wl,yl,Il,Bl,Gl,Nl,zl)=>{try{if(Gl<=0&&yl.includes("buy"))return;if(wl){is(!0),staticMethods.info({message:"Please note it will require 2 transaction approvals in your wallet",style:Pl});var Vl;if(Lo.id!==as){await Vo(as),is(!1),staticMethods.info({message:"Connected to "+CHAIN_PARAMS_CONFIG[as].name+" Chain. Please claim now",style:Pl});return}const Hl=await getEthersSigner(wagmiConfig);if(Vl=await executeClaimOrder(wl,Hl,as,Nl,zl),(Vl==null?void 0:Vl.status)===1){staticMethods.info({message:"Waiting for 2nd transaction approval",style:Pl});const Yl=ps!==null&&Nl in ps&&zl in ps[Nl]?ps[Nl][zl]:null,Ll=hs!==null&&Nl in hs&&zl in hs[Nl]?hs[Nl][zl]:[],Zl=await getLongShortHoldings(Yl,Ll),Xl=Gl*Il/Bl;let wu=0;Wo(yl),is(!0),xl(!0);const rp={buyLong:"Buy Long OPerps",sellLong:"Sell Long OPerps",buyShort:"Buy Short OPerps",sellShort:"Sell Short OPerps"}[yl];if(!rp)return;if(Lo.id!==as){await Vo(as),is(!1),xl(!1),staticMethods.info({message:"Connected to "+CHAIN_PARAMS_CONFIG[as].name+" Chain. Please proceed with the transaction now"});return}const dp=await getEthersSigner(wagmiConfig),up=await executeOpenOrder(yl,Gl,dp,as,Nl,zl);if((up==null?void 0:up.status)===1){const wp=CHAIN_PARAMS_CONFIG[as].explorer_link;staticMethods.success({message:`${rp} Order Placed Successfully, Check Open Orders`,style:Pl,description:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("a",{className:"text-purple-700 underline hover:underline hover:text-purple-500",href:`${wp}/tx/${up==null?void 0:up.transactionHash}`,target:"_blank",rel:"noreferrer",children:"View transaction"})})})}),is(!1),xl(!1),rs(""),(yl==="sellLong"&&Zl.long-Gl<=.01||yl==="sellShort"&&Zl.short-Gl<=.01)&&(wu=1),console.log("Calling writeTransaction on FE utils/helper for trx_hash:",up.transactionHash),await writeTransactionRow(up,wu,Xl,as,Nl,zl),await Dl($o,!1),await insertUserLimitationData(as,$o,up==null?void 0:up.transactionHash)}}}}catch(Hl){console.log("Error executing order:",Hl),Hl==="ACTION_REJECTED"?staticMethods.error({message:"Wallet Error",description:"User Rejected the request.",style:Pl}):staticMethods.error({message:"Error executing order",description:"Please report this error to the support team."+Hl,style:Pl})}finally{is(!1),Wo("")}},isOrderType:Yo,isBuySellLoader:Jo}},BuySell=()=>{const{isDarkMode:Fn,isMode:Mn,setIsMode:rs,updateIsWalletConnectVisible:is,updateIsCalculateVisible:os,dashboardInputValue:as,updateDashboardInputValue:us,isLoader:ds,updateIsCalculateVisibleShort:hs,selectedCrypto:ps,isSelectedChain:io,setCallModeSet:fo,setPutModeSet:mo,setIsItLongSwitchChart:Ao,selectedTabIndex:$o,setSelectedTabIndex:Lo,timing:Go,apy:Yo}=useStore(),{executeOrder:Wo,isOrderType:Jo,isBuySellLoader:xl}=useOrder(),{tooltipStyle:_l}=useStyles(),Tl=reactExports.useRef(null),Sl=reactExports.useRef(null),$l=reactExports.useRef(null),Pl=reactExports.useRef(null),Dl=reactExports.useRef(null),Ol=reactExports.useRef(null),Rl=reactExports.useRef(null),Vo=reactExports.useRef(null),{t:jo}=useTranslation(),Ho=Xl=>{Xl===0?Ao(!0):Xl===1&&Ao(!1)},{address:Qo,isConnected:El}=useAccount(),[Xo,Al]=reactExports.useState(0),[wl,yl]=reactExports.useState(0),[Il,Bl]=reactExports.useState(0),[Gl,Nl]=reactExports.useState(null),Vl=CHAIN_PARAMS_CONFIG[io].provider,Hl=Xl=>{var yu,rp;let wu=Xl.target.value;if(/^[0-9\.]*$/gm.test(wu)&&(wu.match(/[\.,]/gm)&&wu.match(/^[0-9]{0,9}(\.|,)?[0-9]{0,6}$/gm)||!wu.match(/[\.,]/gm)&&wu.match(/^[0-9]{0,9}$/gm)&&(!wu.match(/\./gm)||((yu=wu.match(/\./gm))==null?void 0:yu.length)<=1)&&(!wu.match(/,/gm)||((rp=wu.match(/,/gm))==null?void 0:rp.length)<=1))){const dp=wu.replace(/\.+/gm,".").replace(/,+/gm,",").replace(/^0+/gm,"0").replace(/^\./,"0.");us(dp)}};reactExports.useEffect(()=>{(async()=>{try{El?await Ll(Qo):(Al(0),yl(0),Bl(0))}catch(wu){console.error("Error in the useEffect updateBalance:",wu)}})()},[Qo,El,io,ps,Mn]);const Yl=Xl=>{Xl==="long"?os(!0):hs(!0)},Ll=async Xl=>{try{const up=await new Contract(CHAIN_PARAMS_CONFIG[io].info_aggregator_address,ABI.InfoAggregator,Vl).getAllBalances(Xl,ps,Mn);var wu=formatUnits(up.long_token_balance.toString(),CHAIN_PARAMS_CONFIG[io].settlement_token_decimals);wu=truncateDecimals(wu,6);var yu=formatUnits(up.short_token_balance.toString(),CHAIN_PARAMS_CONFIG[io].settlement_token_decimals);yu=truncateDecimals(yu,6);var rp=formatUnits(up.settlement_token_balance.toString(),CHAIN_PARAMS_CONFIG[io].settlement_token_decimals);return rp=truncateDecimals(rp,6),Al(Number(wu)),yl(Number(yu)),Bl(Number(rp)),{longToken:Number(wu),shortToken:Number(yu)}}catch(dp){console.log("Error updating balances:",dp)}return{longToken:Number(Xo),shortToken:Number(wl)}},Zl=Xl=>{const wu=Xl===OPTIONS.CALL;fo(wu),mo(!wu),rs(Xl)};for(const[Xl,wu]of Object.entries(CHOOSE_OPTION_TYPE))for(const yu of Object.keys(wu));return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Tabs,{selectedIndex:$o,onSelect:Xl=>{Lo(Xl),Ho(Xl)},className:"!w-full",children:[jsxRuntimeExports.jsxs(TabList,{className:`flex justify-around rounded-t-2xl cursor-pointer backdrop-blur-0 transition-all ease-in-out duration-500 w-full ${Fn?"bg-[#eff7f8] h-14 border-b border-[#eff7f8]":"bg-[#0f1012] h-14 border-none outline-none"} h-[72px]`,id:"element-id-for-guide-1",children:[jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-[#364152] social_web_login_light":"text-white social_web_login"} w-full flex flex-col justify-center items-center gap-1 outline-none hover:rounded-tl-2xl border-b-[0.063rem] border-[rgba(255,255,255,0.10)]`,children:jsxRuntimeExports.jsxs(Tooltip$1,{placement:"top",title:Mn===OPTIONS.CALL?"Enables traders to profit in rising markets through leveraged trades":"Enables traders to profit in falling markets through leveraged trades",arrow:!1,overlayInnerStyle:_l,children:[jsxRuntimeExports.jsxs("span",{className:"w-full flex items-center justify-center",children:["Long ",Mn," OPerps"]}),jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-center items-center text-center  ${Fn?"text-[#777879] ":"text-[#A5A5A6] "} text-[0.625rem] font-normal`,ref:Rl,children:["Profitable if ",ps," price ",Mn===OPTIONS.CALL?"rises":"falls",jsxRuntimeExports.jsx("img",{src:Mn===OPTIONS.CALL?GreenArrow:RedArrow,alt:""})]})]})}),jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-[#364152] social_web_login_1_light":"text-white social_web_login_1"} flex flex-col justify-center items-center gap-1 border-[0.063rem] border-[rgba(255,255,255,0.10)] w-full  hover:rounded-tr-2xl outline-none`,children:jsxRuntimeExports.jsxs(Tooltip$1,{placement:"top",title:Mn===OPTIONS.CALL?"Enables passive traders to generate yield in neutral or falling markets":"Enables passive traders to generate yield in neutral or rising markets",arrow:!1,overlayInnerStyle:_l,children:[jsxRuntimeExports.jsxs("span",{className:"w-full flex items-center justify-center",children:["Short ",Mn," OPerps"]}),jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-center text-center items-center text-[0.625rem] font-normal ${Fn?"text-[#777879]":"text-[#A5A5A6]"}`,ref:Vo,children:["Profitable if ",ps," price ",Mn===OPTIONS.CALL?"falls":"rises",jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx("img",{src:Mn===OPTIONS.CALL?RedArrow:GreenArrow,alt:""})})]})]})})]}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"!border-[#0000001a] text-[#777879]":"!border-[#ffffff1a] text-[#A5A5A6]"} text-base font-normal rounded-lg !border mt-4 mx-4 xxl:!hidden bxl:!hidden xl:!hidden sxl:!hidden lg:!flex md:!flex sm:!flex xd:!flex flex-row justify-start items-center`,id:"element-id-for-guide-3",children:[jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Call OPerps include Long Call Operps and Short Call OPerps",arrow:!1,overlayInnerStyle:_l,className:"w-full text-center",children:jsxRuntimeExports.jsx("div",{onClick:()=>Zl(OPTIONS.CALL),className:`cursor-pointer p-[0.5rem_1rem] rounded-[0.45rem] font-bold ${Mn==="CALL"?` ${Fn?" bg-[#0E9384] text-[#FFF] ":" text-[#FFF] bg-[#107569] "}`:""} `,children:"Call"})}),jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Put OPerps include Long Put Operps and Short Put OPerps",arrow:!1,overlayInnerStyle:_l,className:"w-full text-center",children:jsxRuntimeExports.jsx("div",{onClick:()=>Zl(OPTIONS.PUT),className:`cursor-pointer p-[0.5rem_1rem] rounded-[0.45rem] font-bold ${Mn==="PUT"?` ${Fn?" bg-[#0E9384] text-[#FFF] ":" text-[#FFF] bg-[#107569] "}`:""} `,children:"Put"})})]}),jsxRuntimeExports.jsx("div",{className:"flex justify-start items-start w-full px-4 pt-4 h-auto font-manorope",children:jsxRuntimeExports.jsxs(TabPanel,{className:"w-full",children:[jsxRuntimeExports.jsxs("span",{id:"element-id-for-guide-11",children:[jsxRuntimeExports.jsx("div",{className:`w-full h-auto rounded-2xl border-1 p-4 ${Fn?"border-[#E3E8EF] bg-[#EFF7F8]":"border-[rgba(255,255,255,0.10)] bg-[#1D1E20]"}`,children:jsxRuntimeExports.jsx("div",{className:`leading-8 text-sm font-normal ${Fn?"text-[#777879]":"text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsxs("ul",{children:[jsxRuntimeExports.jsx("li",{ref:$l,className:"flex justify-between",children:jsxRuntimeExports.jsxs("div",{className:"flex text-sm",children:["Long ",Mn," OPerps Token",jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Tokens represent options position.",arrow:!1,overlayInnerStyle:_l,children:jsxRuntimeExports.jsx("img",{src:Fn?instructiondark:instruction,alt:"",className:"ml-[0.35rem] w-[0.9rem] items-center text-center"})})]})}),jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx("input",{id:"long-switch-token-amount",className:`${Fn?"text-[#364152] border-[#E3E8EF] bg-[#FCFDFE]":"border-[rgba(255,255,255,0.10)] bg-[#0C0C0D]"} w-full text-[1.2rem] text-left outline-none border rounded-lg px-4 py-2 mt-3`,type:"text",placeholder:"0",min:"0",autoFocus:!0,autoComplete:"off",onWheel:Xl=>Xl.currentTarget.blur(),onKeyDown:Xl=>["e","E","+","-"].includes(Xl.key)&&Xl.preventDefault(),onPaste:preventPasteNegativeNumber,value:as,onChange:Hl,ref:Tl})}),jsxRuntimeExports.jsx("li",{className:"flex mt-2 mb-4",children:jsxRuntimeExports.jsxs("div",{className:"text-[#2ED3B7] font-extrabold flex gap-2 text-xs cursor-pointer",onClick:()=>{Yl("long")},children:[jsxRuntimeExports.jsx("img",{src:IconBuy,alt:"IconBuy",className:"w-4"}),"Not sure how much to buy?"]})}),jsxRuntimeExports.jsxs("li",{ref:Pl,className:"flex justify-between text-sm mb-2 text-[#777879]",children:[jsxRuntimeExports.jsx("div",{children:"USDC Balance"}),jsxRuntimeExports.jsxs("div",{children:[Il===0||Il===void 0?0:Number(Il.toFixed(2)).toLocaleString("en-US")," ","USDC"]})]}),jsxRuntimeExports.jsxs("li",{ref:Dl,className:"flex justify-between text-sm text-[#777879]",children:[jsxRuntimeExports.jsxs("div",{children:["Long ",Mn," OPerps Balance"]}),jsxRuntimeExports.jsxs("div",{children:[Xo===0||Xo===void 0?0:Xo.toLocaleString("en-US")," L",Mn==OPTIONS.CALL?"C":"P","O"]})]})]})})}),jsxRuntimeExports.jsx("div",{className:"flex justify-between mt-5 w-full",children:El?jsxRuntimeExports.jsxs("div",{className:"flex justify-between w-full",children:[jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your investments are automatically rolled over to the next cycle (perpetually) unless you sell your holdings",arrow:!1,overlayInnerStyle:_l,className:" text-[1.1rem]",children:jsxRuntimeExports.jsx("button",{className:`w-1/2 ${Fn?"buy-button-light-blue hover:shadow-custom_hover":"buy-button-blue"} ${ds?"cursor-not-allowed":""}`,onClick:()=>Wo("buyLong",0,0,Number(as),!1,ps,Mn),disabled:ds,children:jsxRuntimeExports.jsx("div",{className:`${Fn?"buy-button-inner-light":"buy-button-inner"} ${ds?"cursor-not-allowed":""}`,ref:Ol,children:xl&&Jo==="buyLong"?jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center ${ds?"cursor-not-allowed":""}`,children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"})}):jsxRuntimeExports.jsx("span",{className:`font-bold ${Fn?"button-text-light-blue":"button-text-blue"}`,children:jo("buy")})})})}),jsxRuntimeExports.jsx("div",{className:"flex justify-between mr-2"}),jsxRuntimeExports.jsx("button",{className:`w-1/2 ${Fn?"buy-button-light  hover:shadow-custom_hover":"buy-button hover:!bg-[#1f2122]"} ${ds?"cursor-not-allowed":""}`,onClick:()=>{var Xl;return Wo("sellLong",Gl==null?void 0:Gl.inWalletLongItem["Invested Amount"],(Xl=Gl==null?void 0:Gl.inWalletLongItem)==null?void 0:Xl.onChainBalance,Number(as),!1,ps,Mn)},disabled:ds,children:jsxRuntimeExports.jsx("div",{className:`${Fn?"buy-button-inner-light":"buy-button-inner"} ${ds?"cursor-not-allowed":""}`,children:xl&&Jo==="sellLong"?jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center ${ds?"cursor-not-allowed":""}`,children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"})}):jsxRuntimeExports.jsx("span",{className:`font-bold ${Fn?"button-text-light":"button-text"}`,children:jo("sell")})})})]}):jsxRuntimeExports.jsx("div",{className:"w-full",children:jsxRuntimeExports.jsx("button",{className:`w-full ${Fn?"buy-button-light hover:shadow-custom_hover":"buy-button"}`,onClick:()=>{is(!0)},ref:Sl,children:jsxRuntimeExports.jsx("div",{className:`${Fn?"buy-button-inner-light":"buy-button-inner"}`,children:jsxRuntimeExports.jsx("span",{className:`font-bold ${Fn?"button-text-light text-[#2ED3B7]":"button-text text-[#2ED3B7]"}`,children:jo("connect_wallet")})})})})})]}),jsxRuntimeExports.jsxs("div",{className:`w-full h-auto rounded-2xl mt-3 ${Fn?"bg-[#F2F9F9]":"bg-[#0000004D]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-sm text-[#364152]":"text-sm text-[#ffffffcc]"} p-4 gap-2 flex justify-between font-normal`,children:[jsxRuntimeExports.jsxs("div",{className:`${Fn?"!bg-[#E4F2F3]  shadow-md":"!bg-[#1D1E20]"}  text-[#A5A5A6] text-sm rounded-lg w-full`,children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-between p-2",children:[jsxRuntimeExports.jsx("div",{className:"text-sm",children:"Next Cycle Max Profit"}),jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Indicates the maximum profit a Long Call/Put trader can receive. This is based on leverage and price movement",arrow:!1,overlayInnerStyle:_l,children:jsxRuntimeExports.jsx("img",{src:infocircle,alt:"instruction",className:"pl-2 cursor-pointer"})})]}),jsxRuntimeExports.jsx("div",{className:"flex",children:jsxRuntimeExports.jsxs("div",{className:"text-sm font-extrabold pl-2 !text-[#12B76A] pb-2",children:[Math.floor(Go.nextLeverage*2.5*100/100)-CHAIN_PARAMS_CONFIG[io].premium_per_cycle*100,"%"]})})]}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"!bg-[#E4F2F3]  shadow-md":"!bg-[#1D1E20]"}  text-[#A5A5A6] text-sm rounded-lg w-full`,id:"element-id-for-guide-7",children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-between p-2",children:[jsxRuntimeExports.jsxs("div",{className:"text-sm",children:["Next Cycle Max Loss ",jsxRuntimeExports.jsx("span",{className:"text-[0.65rem]",children:" (Premium)"})]}),jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Indicates the maximum loss a Long Call/Put trader can have. Please note. This is limited to the fee that Short OPerp liquidity providers receive from the Long OPerp traders",arrow:!1,overlayInnerStyle:_l,children:jsxRuntimeExports.jsx("img",{src:infocircle,alt:"instruction",className:"pl-2 cursor-pointer"})})]}),jsxRuntimeExports.jsx("div",{className:"flex ",children:jsxRuntimeExports.jsxs("div",{className:"text-sm font-extrabold pl-2 pb-2 text-[#F04438]",children:[CHAIN_PARAMS_CONFIG[io].premium_per_cycle*100,"%"," "]})})]})]}),jsxRuntimeExports.jsxs("ul",{className:"p-4 gap-2",id:"element-id-for-guide-2",children:[jsxRuntimeExports.jsxs("li",{ref:$l,className:"flex justify-between gap-4 text-sm",children:[jsxRuntimeExports.jsxs("div",{className:"flex text-[#A5A5A6]",children:["Expected Leverage"," ",jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Indicates the expected leverage in the next cycle. Please note. the Expected leverage will change based on new traders in the next cycle",arrow:!1,overlayInnerStyle:_l,children:jsxRuntimeExports.jsx("img",{src:Fn?instructiondark:instruction,alt:"",className:"ml-[0.35rem] w-[0.9rem] items-center text-center"})})]}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-black":"!text-[#FFFFFFCC]"} text-right font-extrabold flex gap-2`,children:[Go.nextLeverage>=50?Go.nextLeverage.toFixed():Go.nextLeverage,"x"]})]}),jsxRuntimeExports.jsxs("li",{ref:$l,className:"flex justify-between gap-4 pt-2 text-sm",children:[jsxRuntimeExports.jsxs("div",{className:"flex text-[#A5A5A6]",children:["Expected Distribution"," ",jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Indicates the number of Long OPerps tradervs vs Short OPerps Liqudity providers",arrow:!1,overlayInnerStyle:_l,children:jsxRuntimeExports.jsx("img",{src:Fn?instructiondark:instruction,alt:"",className:"ml-[0.35rem] w-[0.9rem] items-center text-center"})})]}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-black":"!text-[#FFFFFFCC]"} text-right font-extrabold flex gap-2`,children:[Go?formatNumber$1(Go.nextCyclelongTokenSupply):"0.00"," L",Mn==OPTIONS.CALL?"C":"P","O :"," ",Go?formatNumber$1(Go.nextCycleshortTokenSupply):"0.00"," S",Mn==OPTIONS.CALL?"C":"P","O"]})]})]})]})]})}),jsxRuntimeExports.jsx("div",{className:"flex justify-start items-start w-full px-4 pb-3 h-auto",children:jsxRuntimeExports.jsxs(TabPanel,{className:"w-full",children:[io&&Number(io)===DEFAULT_CHAIN_ID?jsxRuntimeExports.jsx("div",{className:"text-[#0E9384] text-[0.856rem] font-extrabold font-manrope  cursor-not-allowed'}"}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),jsxRuntimeExports.jsxs("span",{id:"element-id-for-guide-11",children:[jsxRuntimeExports.jsx("div",{className:`${Fn?"border-[#E3E8EF] bg-[#F2F9F9]":"border-[rgba(255,255,255,0.10)] bg-[#1D1E20]"} p-4 w-full h-auto rounded-2xl border-1`,children:jsxRuntimeExports.jsx("div",{className:`text-sm leading-8 font-normal ${Fn?"text-[#777879]":"text-[#A5A5A6]"}`,children:jsxRuntimeExports.jsxs("ul",{children:[jsxRuntimeExports.jsxs("li",{ref:$l,className:"flex justify-between",children:[jsxRuntimeExports.jsxs("div",{className:"flex text-sm",children:["Short ",Mn," OPerps Token",jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Tokens represent options position.",arrow:!1,overlayInnerStyle:_l,children:jsxRuntimeExports.jsx("img",{src:Fn?instructiondark:instruction,alt:"",className:"ml-[0.35rem] w-[0.9rem] items-center text-center"})})]}),jsxRuntimeExports.jsx("div",{className:"text-right text-[#2ED3B7] font-extrabold flex gap-2 text-xs cursor-pointer",onClick:()=>{Yl("short")}})]}),jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx("input",{id:"long-switch-token-amount",className:`${Fn?"text-[#364152] border-[#E3E8EF] bg-[#FCFDFE]":"border-[rgba(255,255,255,0.10)] bg-[#0C0C0D]"} w-full text-[1.2rem] text-left outline-none border rounded-lg px-4 py-2 mt-3`,type:"text",placeholder:"0",min:"0",autoFocus:!0,autoComplete:"off",onWheel:Xl=>Xl.currentTarget.blur(),onKeyDown:Xl=>["e","E","+","-"].includes(Xl.key)&&Xl.preventDefault(),onPaste:preventPasteNegativeNumber,value:as,onChange:Hl,ref:Tl})}),jsxRuntimeExports.jsx("li",{className:"flex mt-2 mb-4",children:jsxRuntimeExports.jsxs("div",{className:"text-[#2ED3B7] font-extrabold flex gap-2 text-xs cursor-pointer",onClick:()=>{Yl("long")},children:[jsxRuntimeExports.jsx("img",{src:IconBuy,alt:"IconBuy",className:"w-4"}),"Not sure how much to buy?"]})}),jsxRuntimeExports.jsxs("li",{ref:Pl,className:"flex justify-between text-sm mb-2 text-[#777879]",children:[jsxRuntimeExports.jsx("div",{children:"USDC Balance"}),jsxRuntimeExports.jsxs("div",{children:[Il===0||Il===void 0?0:Number(Il.toFixed(2)).toLocaleString("en-US")," ","USDC"]})]}),jsxRuntimeExports.jsxs("li",{ref:Dl,className:"flex justify-between text-sm text-[#777879]",children:[jsxRuntimeExports.jsxs("div",{children:["Short ",Mn," OPerps Balance"]}),jsxRuntimeExports.jsxs("div",{children:[wl===0||wl===void 0?0:wl.toLocaleString("en-US")," S",Mn==OPTIONS.CALL?"C":"P","O"]})]})]})})}),jsxRuntimeExports.jsx("div",{className:"flex justify-between mt-5 w-full",children:El?jsxRuntimeExports.jsxs("div",{className:"flex justify-between w-full",children:[jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Your investments are automatically rolled over to the next cycle (perpetually) unless you sell your holdings",arrow:!1,overlayInnerStyle:_l,className:" text-[1.1rem]",children:jsxRuntimeExports.jsx("button",{className:`w-1/2 ${Fn?"buy-button-light-blue hover:shadow-custom_hover":"buy-button-blue"} ${ds?"cursor-not-allowed":""}`,onClick:()=>Wo("buyShort",0,0,Number(as),!1,ps,Mn),disabled:ds,children:jsxRuntimeExports.jsx("div",{className:`${Fn?"buy-button-inner-light":"buy-button-inner"} ${ds?"cursor-not-allowed":""}`,ref:Ol,children:xl&&Jo==="buyShort"?jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center ${ds?"cursor-not-allowed":""}`,children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"})}):jsxRuntimeExports.jsx("span",{className:`font-bold ${Fn?"button-text-light-blue":"button-text-blue"}`,children:jo("buy")})})})}),jsxRuntimeExports.jsx("div",{className:"flex justify-between mr-2"}),jsxRuntimeExports.jsx("button",{className:`w-1/2 ${Fn?"buy-button-light  hover:shadow-custom_hover":"buy-button hover:!bg-[#1f2122]"} ${ds?"cursor-not-allowed":""}`,onClick:()=>{var Xl;return Wo("sellShort",Gl==null?void 0:Gl.inWalletShortItem["Invested Amount"],(Xl=Gl==null?void 0:Gl.inWalletShortItem)==null?void 0:Xl.onChainBalance,Number(as),!1,ps,Mn)},disabled:ds,children:jsxRuntimeExports.jsx("div",{className:`${Fn?"buy-button-inner-light":"buy-button-inner"} ${ds?"cursor-not-allowed":""}`,children:xl&&Jo==="sellShort"?jsxRuntimeExports.jsx("div",{className:`flex justify-center items-center ${ds?"cursor-not-allowed":""}`,children:jsxRuntimeExports.jsx(LottiePlayer,{loop:!0,animationData:kanaloader,play:!0,className:"w-10 h-6 flex justify-center items-center"})}):jsxRuntimeExports.jsx("span",{className:`font-bold ${Fn?"button-text-light":"button-text"}`,children:jo("sell")})})})]}):jsxRuntimeExports.jsx("div",{className:"w-full",children:jsxRuntimeExports.jsx("button",{className:`w-full ${Fn?"buy-button-light hover:shadow-custom_hover":"buy-button"}`,onClick:()=>{is(!0)},ref:Sl,children:jsxRuntimeExports.jsx("div",{className:`${Fn?"buy-button-inner-light":"buy-button-inner"}`,children:jsxRuntimeExports.jsx("span",{className:`font-bold ${Fn?"button-text-light":"button-text"}`,children:jo("connect_wallet")})})})})})]}),jsxRuntimeExports.jsxs("div",{className:`w-full h-auto rounded-2xl mt-3 ${Fn?"bg-[#F2F9F9]":"bg-[#0000004D]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-[#364152]":"text-[#ffffffcc]"} p-4 gap-2 flex justify-between font-normal text-sm`,id:"element-id-for-guide-7",children:[jsxRuntimeExports.jsxs("div",{className:`${Fn?"!bg-[#EFF7F8] shadow-md":"!bg-[#1D1E20]"} h-16 text-[#A5A5A6] text-sm rounded-lg w-[50%]`,children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-between p-2",children:[jsxRuntimeExports.jsx("div",{className:"text-sm",children:"Last Day APY"}),jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Indicates the yield received by liquidity providers as of yesterday and extrapolated for the year",arrow:!1,overlayInnerStyle:_l,children:jsxRuntimeExports.jsx("img",{src:infocircle,alt:"instruction",className:"pl-2 cursor-pointer"})})]}),jsxRuntimeExports.jsx("div",{className:"flex px-2.5",children:jsxRuntimeExports.jsxs("div",{className:`${Go&&parseFloat(Yo.shortLastDayAPY)<0?"text-[#F04438]":"text-[#12B76A]"} font-extrabold text-sm`,children:[Yo.shortLastDayAPY,"%"]})})]}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"!bg-[#EFF7F8] shadow-md":"!bg-[#1D1E20]"} h-16 text-[#A5A5A6] text-sm rounded-lg w-[50%]`,children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-between p-2",children:[jsxRuntimeExports.jsx("div",{className:"text-sm",children:"Last Week APY"}),jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Indicates the yield received by liquidity providers last week and extrapolated for the year",arrow:!1,overlayInnerStyle:_l,children:jsxRuntimeExports.jsx("img",{src:infocircle,alt:"instruction",className:"pl-2 cursor-pointer"})})]}),jsxRuntimeExports.jsx("div",{className:"flex px-2.5",children:jsxRuntimeExports.jsxs("div",{className:`${Go&&parseFloat(Yo.shortLastWeekAPY)<0?"text-[#F04438]":"text-[#12B76A]"} font-extrabold text-sm`,children:[Yo.shortLastWeekAPY,"%"]})})]})]}),jsxRuntimeExports.jsxs("ul",{className:"p-4 gap-2",id:"element-id-for-guide-2",children:[jsxRuntimeExports.jsxs("li",{ref:$l,className:"flex justify-between gap-4 text-sm",children:[jsxRuntimeExports.jsxs("div",{className:"flex text-[#A5A5A6]",children:["TVL"," ",jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Indicates the Short OPerp liquidity expected to be in the next cycle. This number divided by the Long OPerp supply is how the leverage is calculated",arrow:!1,overlayInnerStyle:_l,children:jsxRuntimeExports.jsx("img",{src:infocircle,alt:"instruction",className:"pl-2 cursor-pointer"})})]}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-black":"!text-[#FFFFFFCC]"} text-right font-extrabold flex gap-2`,children:[Go?formatNumber$1(Go.nextCycleshortTokenSupply):"0.00"," USDC"]})]}),jsxRuntimeExports.jsxs("li",{ref:$l,className:"flex justify-between gap-4 text-sm pt-2",children:[jsxRuntimeExports.jsxs("div",{className:"flex text-[#A5A5A6]",children:["Minimum Lock-in",jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Indicates the minimum amount of time you need to keep your amount invested",arrow:!1,overlayInnerStyle:_l,children:jsxRuntimeExports.jsx("img",{src:infocircle,alt:"instruction",className:"pl-2 cursor-pointer"})})]}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-black":"!text-[#FFFFFFCC]"} text-right font-extrabold flex gap-2`,children:[CHAIN_PARAMS_CONFIG[io].cycle_duration," min"]})]})]})]})]})})]})})};/*!
 * @kurkle/color v0.3.2
 * https://github.com/kurkle/color#readme
 * (c) 2023 Jukka Kurkela
 * Released under the MIT License
 */function round(Fn){return Fn+.5|0}const lim=(Fn,Mn,rs)=>Math.max(Math.min(Fn,rs),Mn);function p2b(Fn){return lim(round(Fn*2.55),0,255)}function n2b(Fn){return lim(round(Fn*255),0,255)}function b2n(Fn){return lim(round(Fn/2.55)/100,0,1)}function n2p(Fn){return lim(round(Fn*100),0,100)}const map$1={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},hex=[..."0123456789ABCDEF"],h1=Fn=>hex[Fn&15],h2=Fn=>hex[(Fn&240)>>4]+hex[Fn&15],eq=Fn=>(Fn&240)>>4===(Fn&15),isShort=Fn=>eq(Fn.r)&&eq(Fn.g)&&eq(Fn.b)&&eq(Fn.a);function hexParse(Fn){var Mn=Fn.length,rs;return Fn[0]==="#"&&(Mn===4||Mn===5?rs={r:255&map$1[Fn[1]]*17,g:255&map$1[Fn[2]]*17,b:255&map$1[Fn[3]]*17,a:Mn===5?map$1[Fn[4]]*17:255}:(Mn===7||Mn===9)&&(rs={r:map$1[Fn[1]]<<4|map$1[Fn[2]],g:map$1[Fn[3]]<<4|map$1[Fn[4]],b:map$1[Fn[5]]<<4|map$1[Fn[6]],a:Mn===9?map$1[Fn[7]]<<4|map$1[Fn[8]]:255})),rs}const alpha=(Fn,Mn)=>Fn<255?Mn(Fn):"";function hexString(Fn){var Mn=isShort(Fn)?h1:h2;return Fn?"#"+Mn(Fn.r)+Mn(Fn.g)+Mn(Fn.b)+alpha(Fn.a,Mn):void 0}const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(Fn,Mn,rs){const is=Mn*Math.min(rs,1-rs),os=(as,us=(as+Fn/30)%12)=>rs-is*Math.max(Math.min(us-3,9-us,1),-1);return[os(0),os(8),os(4)]}function hsv2rgbn(Fn,Mn,rs){const is=(os,as=(os+Fn/60)%6)=>rs-rs*Mn*Math.max(Math.min(as,4-as,1),0);return[is(5),is(3),is(1)]}function hwb2rgbn(Fn,Mn,rs){const is=hsl2rgbn(Fn,1,.5);let os;for(Mn+rs>1&&(os=1/(Mn+rs),Mn*=os,rs*=os),os=0;os<3;os++)is[os]*=1-Mn-rs,is[os]+=Mn;return is}function hueValue(Fn,Mn,rs,is,os){return Fn===os?(Mn-rs)/is+(Mn<rs?6:0):Mn===os?(rs-Fn)/is+2:(Fn-Mn)/is+4}function rgb2hsl(Fn){const rs=Fn.r/255,is=Fn.g/255,os=Fn.b/255,as=Math.max(rs,is,os),us=Math.min(rs,is,os),ds=(as+us)/2;let hs,ps,io;return as!==us&&(io=as-us,ps=ds>.5?io/(2-as-us):io/(as+us),hs=hueValue(rs,is,os,io,as),hs=hs*60+.5),[hs|0,ps||0,ds]}function calln(Fn,Mn,rs,is){return(Array.isArray(Mn)?Fn(Mn[0],Mn[1],Mn[2]):Fn(Mn,rs,is)).map(n2b)}function hsl2rgb(Fn,Mn,rs){return calln(hsl2rgbn,Fn,Mn,rs)}function hwb2rgb(Fn,Mn,rs){return calln(hwb2rgbn,Fn,Mn,rs)}function hsv2rgb(Fn,Mn,rs){return calln(hsv2rgbn,Fn,Mn,rs)}function hue(Fn){return(Fn%360+360)%360}function hueParse(Fn){const Mn=HUE_RE.exec(Fn);let rs=255,is;if(!Mn)return;Mn[5]!==is&&(rs=Mn[6]?p2b(+Mn[5]):n2b(+Mn[5]));const os=hue(+Mn[2]),as=+Mn[3]/100,us=+Mn[4]/100;return Mn[1]==="hwb"?is=hwb2rgb(os,as,us):Mn[1]==="hsv"?is=hsv2rgb(os,as,us):is=hsl2rgb(os,as,us),{r:is[0],g:is[1],b:is[2],a:rs}}function rotate(Fn,Mn){var rs=rgb2hsl(Fn);rs[0]=hue(rs[0]+Mn),rs=hsl2rgb(rs),Fn.r=rs[0],Fn.g=rs[1],Fn.b=rs[2]}function hslString(Fn){if(!Fn)return;const Mn=rgb2hsl(Fn),rs=Mn[0],is=n2p(Mn[1]),os=n2p(Mn[2]);return Fn.a<255?`hsla(${rs}, ${is}%, ${os}%, ${b2n(Fn.a)})`:`hsl(${rs}, ${is}%, ${os}%)`}const map={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},names$1={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function unpack(){const Fn={},Mn=Object.keys(names$1),rs=Object.keys(map);let is,os,as,us,ds;for(is=0;is<Mn.length;is++){for(us=ds=Mn[is],os=0;os<rs.length;os++)as=rs[os],ds=ds.replace(as,map[as]);as=parseInt(names$1[us],16),Fn[ds]=[as>>16&255,as>>8&255,as&255]}return Fn}let names;function nameParse(Fn){names||(names=unpack(),names.transparent=[0,0,0,0]);const Mn=names[Fn.toLowerCase()];return Mn&&{r:Mn[0],g:Mn[1],b:Mn[2],a:Mn.length===4?Mn[3]:255}}const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(Fn){const Mn=RGB_RE.exec(Fn);let rs=255,is,os,as;if(Mn){if(Mn[7]!==is){const us=+Mn[7];rs=Mn[8]?p2b(us):lim(us*255,0,255)}return is=+Mn[1],os=+Mn[3],as=+Mn[5],is=255&(Mn[2]?p2b(is):lim(is,0,255)),os=255&(Mn[4]?p2b(os):lim(os,0,255)),as=255&(Mn[6]?p2b(as):lim(as,0,255)),{r:is,g:os,b:as,a:rs}}}function rgbString(Fn){return Fn&&(Fn.a<255?`rgba(${Fn.r}, ${Fn.g}, ${Fn.b}, ${b2n(Fn.a)})`:`rgb(${Fn.r}, ${Fn.g}, ${Fn.b})`)}const to=Fn=>Fn<=.0031308?Fn*12.92:Math.pow(Fn,1/2.4)*1.055-.055,from=Fn=>Fn<=.04045?Fn/12.92:Math.pow((Fn+.055)/1.055,2.4);function interpolate$1(Fn,Mn,rs){const is=from(b2n(Fn.r)),os=from(b2n(Fn.g)),as=from(b2n(Fn.b));return{r:n2b(to(is+rs*(from(b2n(Mn.r))-is))),g:n2b(to(os+rs*(from(b2n(Mn.g))-os))),b:n2b(to(as+rs*(from(b2n(Mn.b))-as))),a:Fn.a+rs*(Mn.a-Fn.a)}}function modHSL(Fn,Mn,rs){if(Fn){let is=rgb2hsl(Fn);is[Mn]=Math.max(0,Math.min(is[Mn]+is[Mn]*rs,Mn===0?360:1)),is=hsl2rgb(is),Fn.r=is[0],Fn.g=is[1],Fn.b=is[2]}}function clone$1(Fn,Mn){return Fn&&Object.assign(Mn||{},Fn)}function fromObject(Fn){var Mn={r:0,g:0,b:0,a:255};return Array.isArray(Fn)?Fn.length>=3&&(Mn={r:Fn[0],g:Fn[1],b:Fn[2],a:255},Fn.length>3&&(Mn.a=n2b(Fn[3]))):(Mn=clone$1(Fn,{r:0,g:0,b:0,a:1}),Mn.a=n2b(Mn.a)),Mn}function functionParse(Fn){return Fn.charAt(0)==="r"?rgbParse(Fn):hueParse(Fn)}class Color{constructor(Mn){if(Mn instanceof Color)return Mn;const rs=typeof Mn;let is;rs==="object"?is=fromObject(Mn):rs==="string"&&(is=hexParse(Mn)||nameParse(Mn)||functionParse(Mn)),this._rgb=is,this._valid=!!is}get valid(){return this._valid}get rgb(){var Mn=clone$1(this._rgb);return Mn&&(Mn.a=b2n(Mn.a)),Mn}set rgb(Mn){this._rgb=fromObject(Mn)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(Mn,rs){if(Mn){const is=this.rgb,os=Mn.rgb;let as;const us=rs===as?.5:rs,ds=2*us-1,hs=is.a-os.a,ps=((ds*hs===-1?ds:(ds+hs)/(1+ds*hs))+1)/2;as=1-ps,is.r=255&ps*is.r+as*os.r+.5,is.g=255&ps*is.g+as*os.g+.5,is.b=255&ps*is.b+as*os.b+.5,is.a=us*is.a+(1-us)*os.a,this.rgb=is}return this}interpolate(Mn,rs){return Mn&&(this._rgb=interpolate$1(this._rgb,Mn._rgb,rs)),this}clone(){return new Color(this.rgb)}alpha(Mn){return this._rgb.a=n2b(Mn),this}clearer(Mn){const rs=this._rgb;return rs.a*=1-Mn,this}greyscale(){const Mn=this._rgb,rs=round(Mn.r*.3+Mn.g*.59+Mn.b*.11);return Mn.r=Mn.g=Mn.b=rs,this}opaquer(Mn){const rs=this._rgb;return rs.a*=1+Mn,this}negate(){const Mn=this._rgb;return Mn.r=255-Mn.r,Mn.g=255-Mn.g,Mn.b=255-Mn.b,this}lighten(Mn){return modHSL(this._rgb,2,Mn),this}darken(Mn){return modHSL(this._rgb,2,-Mn),this}saturate(Mn){return modHSL(this._rgb,1,Mn),this}desaturate(Mn){return modHSL(this._rgb,1,-Mn),this}rotate(Mn){return rotate(this._rgb,Mn),this}}/*!
 * Chart.js v4.4.3
 * https://www.chartjs.org
 * (c) 2024 Chart.js Contributors
 * Released under the MIT License
 */function noop$2(){}const uid=(()=>{let Fn=0;return()=>Fn++})();function isNullOrUndef(Fn){return Fn===null||typeof Fn>"u"}function isArray(Fn){if(Array.isArray&&Array.isArray(Fn))return!0;const Mn=Object.prototype.toString.call(Fn);return Mn.slice(0,7)==="[object"&&Mn.slice(-6)==="Array]"}function isObject$1(Fn){return Fn!==null&&Object.prototype.toString.call(Fn)==="[object Object]"}function isNumberFinite(Fn){return(typeof Fn=="number"||Fn instanceof Number)&&isFinite(+Fn)}function finiteOrDefault(Fn,Mn){return isNumberFinite(Fn)?Fn:Mn}function valueOrDefault(Fn,Mn){return typeof Fn>"u"?Mn:Fn}const toDimension=(Fn,Mn)=>typeof Fn=="string"&&Fn.endsWith("%")?parseFloat(Fn)/100*Mn:+Fn;function callback(Fn,Mn,rs){if(Fn&&typeof Fn.call=="function")return Fn.apply(rs,Mn)}function each(Fn,Mn,rs,is){let os,as,us;if(isArray(Fn))for(as=Fn.length,os=0;os<as;os++)Mn.call(rs,Fn[os],os);else if(isObject$1(Fn))for(us=Object.keys(Fn),as=us.length,os=0;os<as;os++)Mn.call(rs,Fn[us[os]],us[os])}function _elementsEqual(Fn,Mn){let rs,is,os,as;if(!Fn||!Mn||Fn.length!==Mn.length)return!1;for(rs=0,is=Fn.length;rs<is;++rs)if(os=Fn[rs],as=Mn[rs],os.datasetIndex!==as.datasetIndex||os.index!==as.index)return!1;return!0}function clone(Fn){if(isArray(Fn))return Fn.map(clone);if(isObject$1(Fn)){const Mn=Object.create(null),rs=Object.keys(Fn),is=rs.length;let os=0;for(;os<is;++os)Mn[rs[os]]=clone(Fn[rs[os]]);return Mn}return Fn}function isValidKey(Fn){return["__proto__","prototype","constructor"].indexOf(Fn)===-1}function _merger(Fn,Mn,rs,is){if(!isValidKey(Fn))return;const os=Mn[Fn],as=rs[Fn];isObject$1(os)&&isObject$1(as)?merge(os,as,is):Mn[Fn]=clone(as)}function merge(Fn,Mn,rs){const is=isArray(Mn)?Mn:[Mn],os=is.length;if(!isObject$1(Fn))return Fn;rs=rs||{};const as=rs.merger||_merger;let us;for(let ds=0;ds<os;++ds){if(us=is[ds],!isObject$1(us))continue;const hs=Object.keys(us);for(let ps=0,io=hs.length;ps<io;++ps)as(hs[ps],Fn,us,rs)}return Fn}function mergeIf(Fn,Mn){return merge(Fn,Mn,{merger:_mergerIf})}function _mergerIf(Fn,Mn,rs){if(!isValidKey(Fn))return;const is=Mn[Fn],os=rs[Fn];isObject$1(is)&&isObject$1(os)?mergeIf(is,os):Object.prototype.hasOwnProperty.call(Mn,Fn)||(Mn[Fn]=clone(os))}const keyResolvers={"":Fn=>Fn,x:Fn=>Fn.x,y:Fn=>Fn.y};function _splitKey(Fn){const Mn=Fn.split("."),rs=[];let is="";for(const os of Mn)is+=os,is.endsWith("\\")?is=is.slice(0,-1)+".":(rs.push(is),is="");return rs}function _getKeyResolver(Fn){const Mn=_splitKey(Fn);return rs=>{for(const is of Mn){if(is==="")break;rs=rs&&rs[is]}return rs}}function resolveObjectKey(Fn,Mn){return(keyResolvers[Mn]||(keyResolvers[Mn]=_getKeyResolver(Mn)))(Fn)}function _capitalize(Fn){return Fn.charAt(0).toUpperCase()+Fn.slice(1)}const defined=Fn=>typeof Fn<"u",isFunction=Fn=>typeof Fn=="function",setsEqual=(Fn,Mn)=>{if(Fn.size!==Mn.size)return!1;for(const rs of Fn)if(!Mn.has(rs))return!1;return!0};function _isClickEvent(Fn){return Fn.type==="mouseup"||Fn.type==="click"||Fn.type==="contextmenu"}const PI=Math.PI,TAU=2*PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=PI*2/3,log10=Math.log10,sign=Math.sign;function almostEquals(Fn,Mn,rs){return Math.abs(Fn-Mn)<rs}function niceNum(Fn){const Mn=Math.round(Fn);Fn=almostEquals(Fn,Mn,Fn/1e3)?Mn:Fn;const rs=Math.pow(10,Math.floor(log10(Fn))),is=Fn/rs;return(is<=1?1:is<=2?2:is<=5?5:10)*rs}function _factorize(Fn){const Mn=[],rs=Math.sqrt(Fn);let is;for(is=1;is<rs;is++)Fn%is===0&&(Mn.push(is),Mn.push(Fn/is));return rs===(rs|0)&&Mn.push(rs),Mn.sort((os,as)=>os-as).pop(),Mn}function isNumber(Fn){return!isNaN(parseFloat(Fn))&&isFinite(Fn)}function almostWhole(Fn,Mn){const rs=Math.round(Fn);return rs-Mn<=Fn&&rs+Mn>=Fn}function _setMinAndMaxByKey(Fn,Mn,rs){let is,os,as;for(is=0,os=Fn.length;is<os;is++)as=Fn[is][rs],isNaN(as)||(Mn.min=Math.min(Mn.min,as),Mn.max=Math.max(Mn.max,as))}function toRadians(Fn){return Fn*(PI/180)}function toDegrees(Fn){return Fn*(180/PI)}function _decimalPlaces(Fn){if(!isNumberFinite(Fn))return;let Mn=1,rs=0;for(;Math.round(Fn*Mn)/Mn!==Fn;)Mn*=10,rs++;return rs}function getAngleFromPoint(Fn,Mn){const rs=Mn.x-Fn.x,is=Mn.y-Fn.y,os=Math.sqrt(rs*rs+is*is);let as=Math.atan2(is,rs);return as<-.5*PI&&(as+=TAU),{angle:as,distance:os}}function distanceBetweenPoints(Fn,Mn){return Math.sqrt(Math.pow(Mn.x-Fn.x,2)+Math.pow(Mn.y-Fn.y,2))}function _normalizeAngle(Fn){return(Fn%TAU+TAU)%TAU}function _angleBetween(Fn,Mn,rs,is){const os=_normalizeAngle(Fn),as=_normalizeAngle(Mn),us=_normalizeAngle(rs),ds=_normalizeAngle(as-os),hs=_normalizeAngle(us-os),ps=_normalizeAngle(os-as),io=_normalizeAngle(os-us);return os===as||os===us||is&&as===us||ds>hs&&ps<io}function _limitValue(Fn,Mn,rs){return Math.max(Mn,Math.min(rs,Fn))}function _int16Range(Fn){return _limitValue(Fn,-32768,32767)}function _isBetween(Fn,Mn,rs,is=1e-6){return Fn>=Math.min(Mn,rs)-is&&Fn<=Math.max(Mn,rs)+is}function _lookup(Fn,Mn,rs){rs=rs||(us=>Fn[us]<Mn);let is=Fn.length-1,os=0,as;for(;is-os>1;)as=os+is>>1,rs(as)?os=as:is=as;return{lo:os,hi:is}}const _lookupByKey=(Fn,Mn,rs,is)=>_lookup(Fn,rs,is?os=>{const as=Fn[os][Mn];return as<rs||as===rs&&Fn[os+1][Mn]===rs}:os=>Fn[os][Mn]<rs),_rlookupByKey=(Fn,Mn,rs)=>_lookup(Fn,rs,is=>Fn[is][Mn]>=rs);function _filterBetween(Fn,Mn,rs){let is=0,os=Fn.length;for(;is<os&&Fn[is]<Mn;)is++;for(;os>is&&Fn[os-1]>rs;)os--;return is>0||os<Fn.length?Fn.slice(is,os):Fn}const arrayEvents=["push","pop","shift","splice","unshift"];function listenArrayEvents(Fn,Mn){if(Fn._chartjs){Fn._chartjs.listeners.push(Mn);return}Object.defineProperty(Fn,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[Mn]}}),arrayEvents.forEach(rs=>{const is="_onData"+_capitalize(rs),os=Fn[rs];Object.defineProperty(Fn,rs,{configurable:!0,enumerable:!1,value(...as){const us=os.apply(this,as);return Fn._chartjs.listeners.forEach(ds=>{typeof ds[is]=="function"&&ds[is](...as)}),us}})})}function unlistenArrayEvents(Fn,Mn){const rs=Fn._chartjs;if(!rs)return;const is=rs.listeners,os=is.indexOf(Mn);os!==-1&&is.splice(os,1),!(is.length>0)&&(arrayEvents.forEach(as=>{delete Fn[as]}),delete Fn._chartjs)}function _arrayUnique(Fn){const Mn=new Set(Fn);return Mn.size===Fn.length?Fn:Array.from(Mn)}const requestAnimFrame=function(){return typeof window>"u"?function(Fn){return Fn()}:window.requestAnimationFrame}();function throttled(Fn,Mn){let rs=[],is=!1;return function(...os){rs=os,is||(is=!0,requestAnimFrame.call(window,()=>{is=!1,Fn.apply(Mn,rs)}))}}function debounce$1(Fn,Mn){let rs;return function(...is){return Mn?(clearTimeout(rs),rs=setTimeout(Fn,Mn,is)):Fn.apply(this,is),Mn}}const _toLeftRightCenter=Fn=>Fn==="start"?"left":Fn==="end"?"right":"center",_alignStartEnd=(Fn,Mn,rs)=>Fn==="start"?Mn:Fn==="end"?rs:(Mn+rs)/2,_textX=(Fn,Mn,rs,is)=>Fn===(is?"left":"right")?rs:Fn==="center"?(Mn+rs)/2:Mn,atEdge=Fn=>Fn===0||Fn===1,elasticIn=(Fn,Mn,rs)=>-(Math.pow(2,10*(Fn-=1))*Math.sin((Fn-Mn)*TAU/rs)),elasticOut=(Fn,Mn,rs)=>Math.pow(2,-10*Fn)*Math.sin((Fn-Mn)*TAU/rs)+1,effects={linear:Fn=>Fn,easeInQuad:Fn=>Fn*Fn,easeOutQuad:Fn=>-Fn*(Fn-2),easeInOutQuad:Fn=>(Fn/=.5)<1?.5*Fn*Fn:-.5*(--Fn*(Fn-2)-1),easeInCubic:Fn=>Fn*Fn*Fn,easeOutCubic:Fn=>(Fn-=1)*Fn*Fn+1,easeInOutCubic:Fn=>(Fn/=.5)<1?.5*Fn*Fn*Fn:.5*((Fn-=2)*Fn*Fn+2),easeInQuart:Fn=>Fn*Fn*Fn*Fn,easeOutQuart:Fn=>-((Fn-=1)*Fn*Fn*Fn-1),easeInOutQuart:Fn=>(Fn/=.5)<1?.5*Fn*Fn*Fn*Fn:-.5*((Fn-=2)*Fn*Fn*Fn-2),easeInQuint:Fn=>Fn*Fn*Fn*Fn*Fn,easeOutQuint:Fn=>(Fn-=1)*Fn*Fn*Fn*Fn+1,easeInOutQuint:Fn=>(Fn/=.5)<1?.5*Fn*Fn*Fn*Fn*Fn:.5*((Fn-=2)*Fn*Fn*Fn*Fn+2),easeInSine:Fn=>-Math.cos(Fn*HALF_PI)+1,easeOutSine:Fn=>Math.sin(Fn*HALF_PI),easeInOutSine:Fn=>-.5*(Math.cos(PI*Fn)-1),easeInExpo:Fn=>Fn===0?0:Math.pow(2,10*(Fn-1)),easeOutExpo:Fn=>Fn===1?1:-Math.pow(2,-10*Fn)+1,easeInOutExpo:Fn=>atEdge(Fn)?Fn:Fn<.5?.5*Math.pow(2,10*(Fn*2-1)):.5*(-Math.pow(2,-10*(Fn*2-1))+2),easeInCirc:Fn=>Fn>=1?Fn:-(Math.sqrt(1-Fn*Fn)-1),easeOutCirc:Fn=>Math.sqrt(1-(Fn-=1)*Fn),easeInOutCirc:Fn=>(Fn/=.5)<1?-.5*(Math.sqrt(1-Fn*Fn)-1):.5*(Math.sqrt(1-(Fn-=2)*Fn)+1),easeInElastic:Fn=>atEdge(Fn)?Fn:elasticIn(Fn,.075,.3),easeOutElastic:Fn=>atEdge(Fn)?Fn:elasticOut(Fn,.075,.3),easeInOutElastic(Fn){return atEdge(Fn)?Fn:Fn<.5?.5*elasticIn(Fn*2,.1125,.45):.5+.5*elasticOut(Fn*2-1,.1125,.45)},easeInBack(Fn){return Fn*Fn*((1.70158+1)*Fn-1.70158)},easeOutBack(Fn){return(Fn-=1)*Fn*((1.70158+1)*Fn+1.70158)+1},easeInOutBack(Fn){let Mn=1.70158;return(Fn/=.5)<1?.5*(Fn*Fn*(((Mn*=1.525)+1)*Fn-Mn)):.5*((Fn-=2)*Fn*(((Mn*=1.525)+1)*Fn+Mn)+2)},easeInBounce:Fn=>1-effects.easeOutBounce(1-Fn),easeOutBounce(Fn){return Fn<1/2.75?7.5625*Fn*Fn:Fn<2/2.75?7.5625*(Fn-=1.5/2.75)*Fn+.75:Fn<2.5/2.75?7.5625*(Fn-=2.25/2.75)*Fn+.9375:7.5625*(Fn-=2.625/2.75)*Fn+.984375},easeInOutBounce:Fn=>Fn<.5?effects.easeInBounce(Fn*2)*.5:effects.easeOutBounce(Fn*2-1)*.5+.5};function isPatternOrGradient(Fn){if(Fn&&typeof Fn=="object"){const Mn=Fn.toString();return Mn==="[object CanvasPattern]"||Mn==="[object CanvasGradient]"}return!1}function color(Fn){return isPatternOrGradient(Fn)?Fn:new Color(Fn)}function getHoverColor(Fn){return isPatternOrGradient(Fn)?Fn:new Color(Fn).saturate(.5).darken(.1).hexString()}const numbers=["x","y","borderWidth","radius","tension"],colors=["color","borderColor","backgroundColor"];function applyAnimationsDefaults(Fn){Fn.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),Fn.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:Mn=>Mn!=="onProgress"&&Mn!=="onComplete"&&Mn!=="fn"}),Fn.set("animations",{colors:{type:"color",properties:colors},numbers:{type:"number",properties:numbers}}),Fn.describe("animations",{_fallback:"animation"}),Fn.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:Mn=>Mn|0}}}})}function applyLayoutsDefaults(Fn){Fn.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const intlCache=new Map;function getNumberFormat(Fn,Mn){Mn=Mn||{};const rs=Fn+JSON.stringify(Mn);let is=intlCache.get(rs);return is||(is=new Intl.NumberFormat(Fn,Mn),intlCache.set(rs,is)),is}function formatNumber(Fn,Mn,rs){return getNumberFormat(Mn,rs).format(Fn)}const formatters={values(Fn){return isArray(Fn)?Fn:""+Fn},numeric(Fn,Mn,rs){if(Fn===0)return"0";const is=this.chart.options.locale;let os,as=Fn;if(rs.length>1){const ps=Math.max(Math.abs(rs[0].value),Math.abs(rs[rs.length-1].value));(ps<1e-4||ps>1e15)&&(os="scientific"),as=calculateDelta(Fn,rs)}const us=log10(Math.abs(as)),ds=isNaN(us)?1:Math.max(Math.min(-1*Math.floor(us),20),0),hs={notation:os,minimumFractionDigits:ds,maximumFractionDigits:ds};return Object.assign(hs,this.options.ticks.format),formatNumber(Fn,is,hs)},logarithmic(Fn,Mn,rs){if(Fn===0)return"0";const is=rs[Mn].significand||Fn/Math.pow(10,Math.floor(log10(Fn)));return[1,2,3,5,10,15].includes(is)||Mn>.8*rs.length?formatters.numeric.call(this,Fn,Mn,rs):""}};function calculateDelta(Fn,Mn){let rs=Mn.length>3?Mn[2].value-Mn[1].value:Mn[1].value-Mn[0].value;return Math.abs(rs)>=1&&Fn!==Math.floor(Fn)&&(rs=Fn-Math.floor(Fn)),rs}var Ticks={formatters};function applyScaleDefaults(Fn){Fn.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(Mn,rs)=>rs.lineWidth,tickColor:(Mn,rs)=>rs.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),Fn.route("scale.ticks","color","","color"),Fn.route("scale.grid","color","","borderColor"),Fn.route("scale.border","color","","borderColor"),Fn.route("scale.title","color","","color"),Fn.describe("scale",{_fallback:!1,_scriptable:Mn=>!Mn.startsWith("before")&&!Mn.startsWith("after")&&Mn!=="callback"&&Mn!=="parser",_indexable:Mn=>Mn!=="borderDash"&&Mn!=="tickBorderDash"&&Mn!=="dash"}),Fn.describe("scales",{_fallback:"scale"}),Fn.describe("scale.ticks",{_scriptable:Mn=>Mn!=="backdropPadding"&&Mn!=="callback",_indexable:Mn=>Mn!=="backdropPadding"})}const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(Fn,Mn){if(!Mn)return Fn;const rs=Mn.split(".");for(let is=0,os=rs.length;is<os;++is){const as=rs[is];Fn=Fn[as]||(Fn[as]=Object.create(null))}return Fn}function set(Fn,Mn,rs){return typeof Mn=="string"?merge(getScope$1(Fn,Mn),rs):merge(getScope$1(Fn,""),Mn)}class Defaults{constructor(Mn,rs){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=is=>is.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(is,os)=>getHoverColor(os.backgroundColor),this.hoverBorderColor=(is,os)=>getHoverColor(os.borderColor),this.hoverColor=(is,os)=>getHoverColor(os.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(Mn),this.apply(rs)}set(Mn,rs){return set(this,Mn,rs)}get(Mn){return getScope$1(this,Mn)}describe(Mn,rs){return set(descriptors,Mn,rs)}override(Mn,rs){return set(overrides,Mn,rs)}route(Mn,rs,is,os){const as=getScope$1(this,Mn),us=getScope$1(this,is),ds="_"+rs;Object.defineProperties(as,{[ds]:{value:as[rs],writable:!0},[rs]:{enumerable:!0,get(){const hs=this[ds],ps=us[os];return isObject$1(hs)?Object.assign({},ps,hs):valueOrDefault(hs,ps)},set(hs){this[ds]=hs}}})}apply(Mn){Mn.forEach(rs=>rs(this))}}var defaults=new Defaults({_scriptable:Fn=>!Fn.startsWith("on"),_indexable:Fn=>Fn!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[applyAnimationsDefaults,applyLayoutsDefaults,applyScaleDefaults]);function toFontString(Fn){return!Fn||isNullOrUndef(Fn.size)||isNullOrUndef(Fn.family)?null:(Fn.style?Fn.style+" ":"")+(Fn.weight?Fn.weight+" ":"")+Fn.size+"px "+Fn.family}function _measureText(Fn,Mn,rs,is,os){let as=Mn[os];return as||(as=Mn[os]=Fn.measureText(os).width,rs.push(os)),as>is&&(is=as),is}function _longestText(Fn,Mn,rs,is){is=is||{};let os=is.data=is.data||{},as=is.garbageCollect=is.garbageCollect||[];is.font!==Mn&&(os=is.data={},as=is.garbageCollect=[],is.font=Mn),Fn.save(),Fn.font=Mn;let us=0;const ds=rs.length;let hs,ps,io,fo,mo;for(hs=0;hs<ds;hs++)if(fo=rs[hs],fo!=null&&!isArray(fo))us=_measureText(Fn,os,as,us,fo);else if(isArray(fo))for(ps=0,io=fo.length;ps<io;ps++)mo=fo[ps],mo!=null&&!isArray(mo)&&(us=_measureText(Fn,os,as,us,mo));Fn.restore();const Ao=as.length/2;if(Ao>rs.length){for(hs=0;hs<Ao;hs++)delete os[as[hs]];as.splice(0,Ao)}return us}function _alignPixel(Fn,Mn,rs){const is=Fn.currentDevicePixelRatio,os=rs!==0?Math.max(rs/2,.5):0;return Math.round((Mn-os)*is)/is+os}function clearCanvas(Fn,Mn){!Mn&&!Fn||(Mn=Mn||Fn.getContext("2d"),Mn.save(),Mn.resetTransform(),Mn.clearRect(0,0,Fn.width,Fn.height),Mn.restore())}function drawPoint(Fn,Mn,rs,is){drawPointLegend(Fn,Mn,rs,is,null)}function drawPointLegend(Fn,Mn,rs,is,os){let as,us,ds,hs,ps,io,fo,mo;const Ao=Mn.pointStyle,$o=Mn.rotation,Lo=Mn.radius;let Go=($o||0)*RAD_PER_DEG;if(Ao&&typeof Ao=="object"&&(as=Ao.toString(),as==="[object HTMLImageElement]"||as==="[object HTMLCanvasElement]")){Fn.save(),Fn.translate(rs,is),Fn.rotate(Go),Fn.drawImage(Ao,-Ao.width/2,-Ao.height/2,Ao.width,Ao.height),Fn.restore();return}if(!(isNaN(Lo)||Lo<=0)){switch(Fn.beginPath(),Ao){default:os?Fn.ellipse(rs,is,os/2,Lo,0,0,TAU):Fn.arc(rs,is,Lo,0,TAU),Fn.closePath();break;case"triangle":io=os?os/2:Lo,Fn.moveTo(rs+Math.sin(Go)*io,is-Math.cos(Go)*Lo),Go+=TWO_THIRDS_PI,Fn.lineTo(rs+Math.sin(Go)*io,is-Math.cos(Go)*Lo),Go+=TWO_THIRDS_PI,Fn.lineTo(rs+Math.sin(Go)*io,is-Math.cos(Go)*Lo),Fn.closePath();break;case"rectRounded":ps=Lo*.516,hs=Lo-ps,us=Math.cos(Go+QUARTER_PI)*hs,fo=Math.cos(Go+QUARTER_PI)*(os?os/2-ps:hs),ds=Math.sin(Go+QUARTER_PI)*hs,mo=Math.sin(Go+QUARTER_PI)*(os?os/2-ps:hs),Fn.arc(rs-fo,is-ds,ps,Go-PI,Go-HALF_PI),Fn.arc(rs+mo,is-us,ps,Go-HALF_PI,Go),Fn.arc(rs+fo,is+ds,ps,Go,Go+HALF_PI),Fn.arc(rs-mo,is+us,ps,Go+HALF_PI,Go+PI),Fn.closePath();break;case"rect":if(!$o){hs=Math.SQRT1_2*Lo,io=os?os/2:hs,Fn.rect(rs-io,is-hs,2*io,2*hs);break}Go+=QUARTER_PI;case"rectRot":fo=Math.cos(Go)*(os?os/2:Lo),us=Math.cos(Go)*Lo,ds=Math.sin(Go)*Lo,mo=Math.sin(Go)*(os?os/2:Lo),Fn.moveTo(rs-fo,is-ds),Fn.lineTo(rs+mo,is-us),Fn.lineTo(rs+fo,is+ds),Fn.lineTo(rs-mo,is+us),Fn.closePath();break;case"crossRot":Go+=QUARTER_PI;case"cross":fo=Math.cos(Go)*(os?os/2:Lo),us=Math.cos(Go)*Lo,ds=Math.sin(Go)*Lo,mo=Math.sin(Go)*(os?os/2:Lo),Fn.moveTo(rs-fo,is-ds),Fn.lineTo(rs+fo,is+ds),Fn.moveTo(rs+mo,is-us),Fn.lineTo(rs-mo,is+us);break;case"star":fo=Math.cos(Go)*(os?os/2:Lo),us=Math.cos(Go)*Lo,ds=Math.sin(Go)*Lo,mo=Math.sin(Go)*(os?os/2:Lo),Fn.moveTo(rs-fo,is-ds),Fn.lineTo(rs+fo,is+ds),Fn.moveTo(rs+mo,is-us),Fn.lineTo(rs-mo,is+us),Go+=QUARTER_PI,fo=Math.cos(Go)*(os?os/2:Lo),us=Math.cos(Go)*Lo,ds=Math.sin(Go)*Lo,mo=Math.sin(Go)*(os?os/2:Lo),Fn.moveTo(rs-fo,is-ds),Fn.lineTo(rs+fo,is+ds),Fn.moveTo(rs+mo,is-us),Fn.lineTo(rs-mo,is+us);break;case"line":us=os?os/2:Math.cos(Go)*Lo,ds=Math.sin(Go)*Lo,Fn.moveTo(rs-us,is-ds),Fn.lineTo(rs+us,is+ds);break;case"dash":Fn.moveTo(rs,is),Fn.lineTo(rs+Math.cos(Go)*(os?os/2:Lo),is+Math.sin(Go)*Lo);break;case!1:Fn.closePath();break}Fn.fill(),Mn.borderWidth>0&&Fn.stroke()}}function _isPointInArea(Fn,Mn,rs){return rs=rs||.5,!Mn||Fn&&Fn.x>Mn.left-rs&&Fn.x<Mn.right+rs&&Fn.y>Mn.top-rs&&Fn.y<Mn.bottom+rs}function clipArea(Fn,Mn){Fn.save(),Fn.beginPath(),Fn.rect(Mn.left,Mn.top,Mn.right-Mn.left,Mn.bottom-Mn.top),Fn.clip()}function unclipArea(Fn){Fn.restore()}function setRenderOpts(Fn,Mn){Mn.translation&&Fn.translate(Mn.translation[0],Mn.translation[1]),isNullOrUndef(Mn.rotation)||Fn.rotate(Mn.rotation),Mn.color&&(Fn.fillStyle=Mn.color),Mn.textAlign&&(Fn.textAlign=Mn.textAlign),Mn.textBaseline&&(Fn.textBaseline=Mn.textBaseline)}function decorateText(Fn,Mn,rs,is,os){if(os.strikethrough||os.underline){const as=Fn.measureText(is),us=Mn-as.actualBoundingBoxLeft,ds=Mn+as.actualBoundingBoxRight,hs=rs-as.actualBoundingBoxAscent,ps=rs+as.actualBoundingBoxDescent,io=os.strikethrough?(hs+ps)/2:ps;Fn.strokeStyle=Fn.fillStyle,Fn.beginPath(),Fn.lineWidth=os.decorationWidth||2,Fn.moveTo(us,io),Fn.lineTo(ds,io),Fn.stroke()}}function drawBackdrop(Fn,Mn){const rs=Fn.fillStyle;Fn.fillStyle=Mn.color,Fn.fillRect(Mn.left,Mn.top,Mn.width,Mn.height),Fn.fillStyle=rs}function renderText(Fn,Mn,rs,is,os,as={}){const us=isArray(Mn)?Mn:[Mn],ds=as.strokeWidth>0&&as.strokeColor!=="";let hs,ps;for(Fn.save(),Fn.font=os.string,setRenderOpts(Fn,as),hs=0;hs<us.length;++hs)ps=us[hs],as.backdrop&&drawBackdrop(Fn,as.backdrop),ds&&(as.strokeColor&&(Fn.strokeStyle=as.strokeColor),isNullOrUndef(as.strokeWidth)||(Fn.lineWidth=as.strokeWidth),Fn.strokeText(ps,rs,is,as.maxWidth)),Fn.fillText(ps,rs,is,as.maxWidth),decorateText(Fn,rs,is,ps,as),is+=Number(os.lineHeight);Fn.restore()}function addRoundedRectPath(Fn,Mn){const{x:rs,y:is,w:os,h:as,radius:us}=Mn;Fn.arc(rs+us.topLeft,is+us.topLeft,us.topLeft,1.5*PI,PI,!0),Fn.lineTo(rs,is+as-us.bottomLeft),Fn.arc(rs+us.bottomLeft,is+as-us.bottomLeft,us.bottomLeft,PI,HALF_PI,!0),Fn.lineTo(rs+os-us.bottomRight,is+as),Fn.arc(rs+os-us.bottomRight,is+as-us.bottomRight,us.bottomRight,HALF_PI,0,!0),Fn.lineTo(rs+os,is+us.topRight),Fn.arc(rs+os-us.topRight,is+us.topRight,us.topRight,0,-HALF_PI,!0),Fn.lineTo(rs+us.topLeft,is)}const LINE_HEIGHT=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,FONT_STYLE=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function toLineHeight(Fn,Mn){const rs=(""+Fn).match(LINE_HEIGHT);if(!rs||rs[1]==="normal")return Mn*1.2;switch(Fn=+rs[2],rs[3]){case"px":return Fn;case"%":Fn/=100;break}return Mn*Fn}const numberOrZero=Fn=>+Fn||0;function _readValueToProps(Fn,Mn){const rs={},is=isObject$1(Mn),os=is?Object.keys(Mn):Mn,as=isObject$1(Fn)?is?us=>valueOrDefault(Fn[us],Fn[Mn[us]]):us=>Fn[us]:()=>Fn;for(const us of os)rs[us]=numberOrZero(as(us));return rs}function toTRBL(Fn){return _readValueToProps(Fn,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(Fn){return _readValueToProps(Fn,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(Fn){const Mn=toTRBL(Fn);return Mn.width=Mn.left+Mn.right,Mn.height=Mn.top+Mn.bottom,Mn}function toFont(Fn,Mn){Fn=Fn||{},Mn=Mn||defaults.font;let rs=valueOrDefault(Fn.size,Mn.size);typeof rs=="string"&&(rs=parseInt(rs,10));let is=valueOrDefault(Fn.style,Mn.style);is&&!(""+is).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+is+'"'),is=void 0);const os={family:valueOrDefault(Fn.family,Mn.family),lineHeight:toLineHeight(valueOrDefault(Fn.lineHeight,Mn.lineHeight),rs),size:rs,style:is,weight:valueOrDefault(Fn.weight,Mn.weight),string:""};return os.string=toFontString(os),os}function resolve(Fn,Mn,rs,is){let os,as,us;for(os=0,as=Fn.length;os<as;++os)if(us=Fn[os],us!==void 0&&us!==void 0)return us}function _addGrace(Fn,Mn,rs){const{min:is,max:os}=Fn,as=toDimension(Mn,(os-is)/2),us=(ds,hs)=>rs&&ds===0?0:ds+hs;return{min:us(is,-Math.abs(as)),max:us(os,as)}}function createContext(Fn,Mn){return Object.assign(Object.create(Fn),Mn)}function _createResolver(Fn,Mn=[""],rs,is,os=()=>Fn[0]){const as=rs||Fn;typeof is>"u"&&(is=_resolve("_fallback",Fn));const us={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:Fn,_rootScopes:as,_fallback:is,_getTarget:os,override:ds=>_createResolver([ds,...Fn],Mn,as,is)};return new Proxy(us,{deleteProperty(ds,hs){return delete ds[hs],delete ds._keys,delete Fn[0][hs],!0},get(ds,hs){return _cached(ds,hs,()=>_resolveWithPrefixes(hs,Mn,Fn,ds))},getOwnPropertyDescriptor(ds,hs){return Reflect.getOwnPropertyDescriptor(ds._scopes[0],hs)},getPrototypeOf(){return Reflect.getPrototypeOf(Fn[0])},has(ds,hs){return getKeysFromAllScopes(ds).includes(hs)},ownKeys(ds){return getKeysFromAllScopes(ds)},set(ds,hs,ps){const io=ds._storage||(ds._storage=os());return ds[hs]=io[hs]=ps,delete ds._keys,!0}})}function _attachContext(Fn,Mn,rs,is){const os={_cacheable:!1,_proxy:Fn,_context:Mn,_subProxy:rs,_stack:new Set,_descriptors:_descriptors(Fn,is),setContext:as=>_attachContext(Fn,as,rs,is),override:as=>_attachContext(Fn.override(as),Mn,rs,is)};return new Proxy(os,{deleteProperty(as,us){return delete as[us],delete Fn[us],!0},get(as,us,ds){return _cached(as,us,()=>_resolveWithContext(as,us,ds))},getOwnPropertyDescriptor(as,us){return as._descriptors.allKeys?Reflect.has(Fn,us)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(Fn,us)},getPrototypeOf(){return Reflect.getPrototypeOf(Fn)},has(as,us){return Reflect.has(Fn,us)},ownKeys(){return Reflect.ownKeys(Fn)},set(as,us,ds){return Fn[us]=ds,delete as[us],!0}})}function _descriptors(Fn,Mn={scriptable:!0,indexable:!0}){const{_scriptable:rs=Mn.scriptable,_indexable:is=Mn.indexable,_allKeys:os=Mn.allKeys}=Fn;return{allKeys:os,scriptable:rs,indexable:is,isScriptable:isFunction(rs)?rs:()=>rs,isIndexable:isFunction(is)?is:()=>is}}const readKey=(Fn,Mn)=>Fn?Fn+_capitalize(Mn):Mn,needsSubResolver=(Fn,Mn)=>isObject$1(Mn)&&Fn!=="adapters"&&(Object.getPrototypeOf(Mn)===null||Mn.constructor===Object);function _cached(Fn,Mn,rs){if(Object.prototype.hasOwnProperty.call(Fn,Mn)||Mn==="constructor")return Fn[Mn];const is=rs();return Fn[Mn]=is,is}function _resolveWithContext(Fn,Mn,rs){const{_proxy:is,_context:os,_subProxy:as,_descriptors:us}=Fn;let ds=is[Mn];return isFunction(ds)&&us.isScriptable(Mn)&&(ds=_resolveScriptable(Mn,ds,Fn,rs)),isArray(ds)&&ds.length&&(ds=_resolveArray(Mn,ds,Fn,us.isIndexable)),needsSubResolver(Mn,ds)&&(ds=_attachContext(ds,os,as&&as[Mn],us)),ds}function _resolveScriptable(Fn,Mn,rs,is){const{_proxy:os,_context:as,_subProxy:us,_stack:ds}=rs;if(ds.has(Fn))throw new Error("Recursion detected: "+Array.from(ds).join("->")+"->"+Fn);ds.add(Fn);let hs=Mn(as,us||is);return ds.delete(Fn),needsSubResolver(Fn,hs)&&(hs=createSubResolver(os._scopes,os,Fn,hs)),hs}function _resolveArray(Fn,Mn,rs,is){const{_proxy:os,_context:as,_subProxy:us,_descriptors:ds}=rs;if(typeof as.index<"u"&&is(Fn))return Mn[as.index%Mn.length];if(isObject$1(Mn[0])){const hs=Mn,ps=os._scopes.filter(io=>io!==hs);Mn=[];for(const io of hs){const fo=createSubResolver(ps,os,Fn,io);Mn.push(_attachContext(fo,as,us&&us[Fn],ds))}}return Mn}function resolveFallback(Fn,Mn,rs){return isFunction(Fn)?Fn(Mn,rs):Fn}const getScope=(Fn,Mn)=>Fn===!0?Mn:typeof Fn=="string"?resolveObjectKey(Mn,Fn):void 0;function addScopes(Fn,Mn,rs,is,os){for(const as of Mn){const us=getScope(rs,as);if(us){Fn.add(us);const ds=resolveFallback(us._fallback,rs,os);if(typeof ds<"u"&&ds!==rs&&ds!==is)return ds}else if(us===!1&&typeof is<"u"&&rs!==is)return null}return!1}function createSubResolver(Fn,Mn,rs,is){const os=Mn._rootScopes,as=resolveFallback(Mn._fallback,rs,is),us=[...Fn,...os],ds=new Set;ds.add(is);let hs=addScopesFromKey(ds,us,rs,as||rs,is);return hs===null||typeof as<"u"&&as!==rs&&(hs=addScopesFromKey(ds,us,as,hs,is),hs===null)?!1:_createResolver(Array.from(ds),[""],os,as,()=>subGetTarget(Mn,rs,is))}function addScopesFromKey(Fn,Mn,rs,is,os){for(;rs;)rs=addScopes(Fn,Mn,rs,is,os);return rs}function subGetTarget(Fn,Mn,rs){const is=Fn._getTarget();Mn in is||(is[Mn]={});const os=is[Mn];return isArray(os)&&isObject$1(rs)?rs:os||{}}function _resolveWithPrefixes(Fn,Mn,rs,is){let os;for(const as of Mn)if(os=_resolve(readKey(as,Fn),rs),typeof os<"u")return needsSubResolver(Fn,os)?createSubResolver(rs,is,Fn,os):os}function _resolve(Fn,Mn){for(const rs of Mn){if(!rs)continue;const is=rs[Fn];if(typeof is<"u")return is}}function getKeysFromAllScopes(Fn){let Mn=Fn._keys;return Mn||(Mn=Fn._keys=resolveKeysFromAllScopes(Fn._scopes)),Mn}function resolveKeysFromAllScopes(Fn){const Mn=new Set;for(const rs of Fn)for(const is of Object.keys(rs).filter(os=>!os.startsWith("_")))Mn.add(is);return Array.from(Mn)}function _isDomSupported(){return typeof window<"u"&&typeof document<"u"}function _getParentNode(Fn){let Mn=Fn.parentNode;return Mn&&Mn.toString()==="[object ShadowRoot]"&&(Mn=Mn.host),Mn}function parseMaxStyle(Fn,Mn,rs){let is;return typeof Fn=="string"?(is=parseInt(Fn,10),Fn.indexOf("%")!==-1&&(is=is/100*Mn.parentNode[rs])):is=Fn,is}const getComputedStyle$1=Fn=>Fn.ownerDocument.defaultView.getComputedStyle(Fn,null);function getStyle(Fn,Mn){return getComputedStyle$1(Fn).getPropertyValue(Mn)}const positions=["top","right","bottom","left"];function getPositionedStyle(Fn,Mn,rs){const is={};rs=rs?"-"+rs:"";for(let os=0;os<4;os++){const as=positions[os];is[as]=parseFloat(Fn[Mn+"-"+as+rs])||0}return is.width=is.left+is.right,is.height=is.top+is.bottom,is}const useOffsetPos=(Fn,Mn,rs)=>(Fn>0||Mn>0)&&(!rs||!rs.shadowRoot);function getCanvasPosition(Fn,Mn){const rs=Fn.touches,is=rs&&rs.length?rs[0]:Fn,{offsetX:os,offsetY:as}=is;let us=!1,ds,hs;if(useOffsetPos(os,as,Fn.target))ds=os,hs=as;else{const ps=Mn.getBoundingClientRect();ds=is.clientX-ps.left,hs=is.clientY-ps.top,us=!0}return{x:ds,y:hs,box:us}}function getRelativePosition(Fn,Mn){if("native"in Fn)return Fn;const{canvas:rs,currentDevicePixelRatio:is}=Mn,os=getComputedStyle$1(rs),as=os.boxSizing==="border-box",us=getPositionedStyle(os,"padding"),ds=getPositionedStyle(os,"border","width"),{x:hs,y:ps,box:io}=getCanvasPosition(Fn,rs),fo=us.left+(io&&ds.left),mo=us.top+(io&&ds.top);let{width:Ao,height:$o}=Mn;return as&&(Ao-=us.width+ds.width,$o-=us.height+ds.height),{x:Math.round((hs-fo)/Ao*rs.width/is),y:Math.round((ps-mo)/$o*rs.height/is)}}function getContainerSize(Fn,Mn,rs){let is,os;if(Mn===void 0||rs===void 0){const as=Fn&&_getParentNode(Fn);if(!as)Mn=Fn.clientWidth,rs=Fn.clientHeight;else{const us=as.getBoundingClientRect(),ds=getComputedStyle$1(as),hs=getPositionedStyle(ds,"border","width"),ps=getPositionedStyle(ds,"padding");Mn=us.width-ps.width-hs.width,rs=us.height-ps.height-hs.height,is=parseMaxStyle(ds.maxWidth,as,"clientWidth"),os=parseMaxStyle(ds.maxHeight,as,"clientHeight")}}return{width:Mn,height:rs,maxWidth:is||INFINITY,maxHeight:os||INFINITY}}const round1=Fn=>Math.round(Fn*10)/10;function getMaximumSize(Fn,Mn,rs,is){const os=getComputedStyle$1(Fn),as=getPositionedStyle(os,"margin"),us=parseMaxStyle(os.maxWidth,Fn,"clientWidth")||INFINITY,ds=parseMaxStyle(os.maxHeight,Fn,"clientHeight")||INFINITY,hs=getContainerSize(Fn,Mn,rs);let{width:ps,height:io}=hs;if(os.boxSizing==="content-box"){const mo=getPositionedStyle(os,"border","width"),Ao=getPositionedStyle(os,"padding");ps-=Ao.width+mo.width,io-=Ao.height+mo.height}return ps=Math.max(0,ps-as.width),io=Math.max(0,is?ps/is:io-as.height),ps=round1(Math.min(ps,us,hs.maxWidth)),io=round1(Math.min(io,ds,hs.maxHeight)),ps&&!io&&(io=round1(ps/2)),(Mn!==void 0||rs!==void 0)&&is&&hs.height&&io>hs.height&&(io=hs.height,ps=round1(Math.floor(io*is))),{width:ps,height:io}}function retinaScale(Fn,Mn,rs){const is=Mn||1,os=Math.floor(Fn.height*is),as=Math.floor(Fn.width*is);Fn.height=Math.floor(Fn.height),Fn.width=Math.floor(Fn.width);const us=Fn.canvas;return us.style&&(rs||!us.style.height&&!us.style.width)&&(us.style.height=`${Fn.height}px`,us.style.width=`${Fn.width}px`),Fn.currentDevicePixelRatio!==is||us.height!==os||us.width!==as?(Fn.currentDevicePixelRatio=is,us.height=os,us.width=as,Fn.ctx.setTransform(is,0,0,is,0,0),!0):!1}const supportsEventListenerOptions=function(){let Fn=!1;try{const Mn={get passive(){return Fn=!0,!1}};_isDomSupported()&&(window.addEventListener("test",null,Mn),window.removeEventListener("test",null,Mn))}catch{}return Fn}();function readUsedSize(Fn,Mn){const rs=getStyle(Fn,Mn),is=rs&&rs.match(/^(\d+)(\.\d+)?px$/);return is?+is[1]:void 0}const getRightToLeftAdapter=function(Fn,Mn){return{x(rs){return Fn+Fn+Mn-rs},setWidth(rs){Mn=rs},textAlign(rs){return rs==="center"?rs:rs==="right"?"left":"right"},xPlus(rs,is){return rs-is},leftForLtr(rs,is){return rs-is}}},getLeftToRightAdapter=function(){return{x(Fn){return Fn},setWidth(Fn){},textAlign(Fn){return Fn},xPlus(Fn,Mn){return Fn+Mn},leftForLtr(Fn,Mn){return Fn}}};function getRtlAdapter(Fn,Mn,rs){return Fn?getRightToLeftAdapter(Mn,rs):getLeftToRightAdapter()}function overrideTextDirection(Fn,Mn){let rs,is;(Mn==="ltr"||Mn==="rtl")&&(rs=Fn.canvas.style,is=[rs.getPropertyValue("direction"),rs.getPropertyPriority("direction")],rs.setProperty("direction",Mn,"important"),Fn.prevTextDirection=is)}function restoreTextDirection(Fn,Mn){Mn!==void 0&&(delete Fn.prevTextDirection,Fn.canvas.style.setProperty("direction",Mn[0],Mn[1]))}/*!
 * Chart.js v4.4.3
 * https://www.chartjs.org
 * (c) 2024 Chart.js Contributors
 * Released under the MIT License
 */class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(Mn,rs,is,os){const as=rs.listeners[os],us=rs.duration;as.forEach(ds=>ds({chart:Mn,initial:rs.initial,numSteps:us,currentStep:Math.min(is-rs.start,us)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(Mn=Date.now()){let rs=0;this._charts.forEach((is,os)=>{if(!is.running||!is.items.length)return;const as=is.items;let us=as.length-1,ds=!1,hs;for(;us>=0;--us)hs=as[us],hs._active?(hs._total>is.duration&&(is.duration=hs._total),hs.tick(Mn),ds=!0):(as[us]=as[as.length-1],as.pop());ds&&(os.draw(),this._notify(os,is,Mn,"progress")),as.length||(is.running=!1,this._notify(os,is,Mn,"complete"),is.initial=!1),rs+=as.length}),this._lastDate=Mn,rs===0&&(this._running=!1)}_getAnims(Mn){const rs=this._charts;let is=rs.get(Mn);return is||(is={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},rs.set(Mn,is)),is}listen(Mn,rs,is){this._getAnims(Mn).listeners[rs].push(is)}add(Mn,rs){!rs||!rs.length||this._getAnims(Mn).items.push(...rs)}has(Mn){return this._getAnims(Mn).items.length>0}start(Mn){const rs=this._charts.get(Mn);rs&&(rs.running=!0,rs.start=Date.now(),rs.duration=rs.items.reduce((is,os)=>Math.max(is,os._duration),0),this._refresh())}running(Mn){if(!this._running)return!1;const rs=this._charts.get(Mn);return!(!rs||!rs.running||!rs.items.length)}stop(Mn){const rs=this._charts.get(Mn);if(!rs||!rs.items.length)return;const is=rs.items;let os=is.length-1;for(;os>=0;--os)is[os].cancel();rs.items=[],this._notify(Mn,rs,Date.now(),"complete")}remove(Mn){return this._charts.delete(Mn)}}var animator=new Animator;const transparent="transparent",interpolators={boolean(Fn,Mn,rs){return rs>.5?Mn:Fn},color(Fn,Mn,rs){const is=color(Fn||transparent),os=is.valid&&color(Mn||transparent);return os&&os.valid?os.mix(is,rs).hexString():Mn},number(Fn,Mn,rs){return Fn+(Mn-Fn)*rs}};class Animation{constructor(Mn,rs,is,os){const as=rs[is];os=resolve([Mn.to,os,as,Mn.from]);const us=resolve([Mn.from,as,os]);this._active=!0,this._fn=Mn.fn||interpolators[Mn.type||typeof us],this._easing=effects[Mn.easing]||effects.linear,this._start=Math.floor(Date.now()+(Mn.delay||0)),this._duration=this._total=Math.floor(Mn.duration),this._loop=!!Mn.loop,this._target=rs,this._prop=is,this._from=us,this._to=os,this._promises=void 0}active(){return this._active}update(Mn,rs,is){if(this._active){this._notify(!1);const os=this._target[this._prop],as=is-this._start,us=this._duration-as;this._start=is,this._duration=Math.floor(Math.max(us,Mn.duration)),this._total+=as,this._loop=!!Mn.loop,this._to=resolve([Mn.to,rs,os,Mn.from]),this._from=resolve([Mn.from,os,rs])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(Mn){const rs=Mn-this._start,is=this._duration,os=this._prop,as=this._from,us=this._loop,ds=this._to;let hs;if(this._active=as!==ds&&(us||rs<is),!this._active){this._target[os]=ds,this._notify(!0);return}if(rs<0){this._target[os]=as;return}hs=rs/is%2,hs=us&&hs>1?2-hs:hs,hs=this._easing(Math.min(1,Math.max(0,hs))),this._target[os]=this._fn(as,ds,hs)}wait(){const Mn=this._promises||(this._promises=[]);return new Promise((rs,is)=>{Mn.push({res:rs,rej:is})})}_notify(Mn){const rs=Mn?"res":"rej",is=this._promises||[];for(let os=0;os<is.length;os++)is[os][rs]()}}class Animations{constructor(Mn,rs){this._chart=Mn,this._properties=new Map,this.configure(rs)}configure(Mn){if(!isObject$1(Mn))return;const rs=Object.keys(defaults.animation),is=this._properties;Object.getOwnPropertyNames(Mn).forEach(os=>{const as=Mn[os];if(!isObject$1(as))return;const us={};for(const ds of rs)us[ds]=as[ds];(isArray(as.properties)&&as.properties||[os]).forEach(ds=>{(ds===os||!is.has(ds))&&is.set(ds,us)})})}_animateOptions(Mn,rs){const is=rs.options,os=resolveTargetOptions(Mn,is);if(!os)return[];const as=this._createAnimations(os,is);return is.$shared&&awaitAll(Mn.options.$animations,is).then(()=>{Mn.options=is},()=>{}),as}_createAnimations(Mn,rs){const is=this._properties,os=[],as=Mn.$animations||(Mn.$animations={}),us=Object.keys(rs),ds=Date.now();let hs;for(hs=us.length-1;hs>=0;--hs){const ps=us[hs];if(ps.charAt(0)==="$")continue;if(ps==="options"){os.push(...this._animateOptions(Mn,rs));continue}const io=rs[ps];let fo=as[ps];const mo=is.get(ps);if(fo)if(mo&&fo.active()){fo.update(mo,io,ds);continue}else fo.cancel();if(!mo||!mo.duration){Mn[ps]=io;continue}as[ps]=fo=new Animation(mo,Mn,ps,io),os.push(fo)}return os}update(Mn,rs){if(this._properties.size===0){Object.assign(Mn,rs);return}const is=this._createAnimations(Mn,rs);if(is.length)return animator.add(this._chart,is),!0}}function awaitAll(Fn,Mn){const rs=[],is=Object.keys(Mn);for(let os=0;os<is.length;os++){const as=Fn[is[os]];as&&as.active()&&rs.push(as.wait())}return Promise.all(rs)}function resolveTargetOptions(Fn,Mn){if(!Mn)return;let rs=Fn.options;if(!rs){Fn.options=Mn;return}return rs.$shared&&(Fn.options=rs=Object.assign({},rs,{$shared:!1,$animations:{}})),rs}function scaleClip(Fn,Mn){const rs=Fn&&Fn.options||{},is=rs.reverse,os=rs.min===void 0?Mn:0,as=rs.max===void 0?Mn:0;return{start:is?as:os,end:is?os:as}}function defaultClip(Fn,Mn,rs){if(rs===!1)return!1;const is=scaleClip(Fn,rs),os=scaleClip(Mn,rs);return{top:os.end,right:is.end,bottom:os.start,left:is.start}}function toClip(Fn){let Mn,rs,is,os;return isObject$1(Fn)?(Mn=Fn.top,rs=Fn.right,is=Fn.bottom,os=Fn.left):Mn=rs=is=os=Fn,{top:Mn,right:rs,bottom:is,left:os,disabled:Fn===!1}}function getSortedDatasetIndices(Fn,Mn){const rs=[],is=Fn._getSortedDatasetMetas(Mn);let os,as;for(os=0,as=is.length;os<as;++os)rs.push(is[os].index);return rs}function applyStack(Fn,Mn,rs,is={}){const os=Fn.keys,as=is.mode==="single";let us,ds,hs,ps;if(Mn!==null){for(us=0,ds=os.length;us<ds;++us){if(hs=+os[us],hs===rs){if(is.all)continue;break}ps=Fn.values[hs],isNumberFinite(ps)&&(as||Mn===0||sign(Mn)===sign(ps))&&(Mn+=ps)}return Mn}}function convertObjectDataToArray(Fn,Mn){const{iScale:rs,vScale:is}=Mn,os=rs.axis==="x"?"x":"y",as=is.axis==="x"?"x":"y",us=Object.keys(Fn),ds=new Array(us.length);let hs,ps,io;for(hs=0,ps=us.length;hs<ps;++hs)io=us[hs],ds[hs]={[os]:io,[as]:Fn[io]};return ds}function isStacked(Fn,Mn){const rs=Fn&&Fn.options.stacked;return rs||rs===void 0&&Mn.stack!==void 0}function getStackKey(Fn,Mn,rs){return`${Fn.id}.${Mn.id}.${rs.stack||rs.type}`}function getUserBounds(Fn){const{min:Mn,max:rs,minDefined:is,maxDefined:os}=Fn.getUserBounds();return{min:is?Mn:Number.NEGATIVE_INFINITY,max:os?rs:Number.POSITIVE_INFINITY}}function getOrCreateStack(Fn,Mn,rs){const is=Fn[Mn]||(Fn[Mn]={});return is[rs]||(is[rs]={})}function getLastIndexInStack(Fn,Mn,rs,is){for(const os of Mn.getMatchingVisibleMetas(is).reverse()){const as=Fn[os.index];if(rs&&as>0||!rs&&as<0)return os.index}return null}function updateStacks(Fn,Mn){const{chart:rs,_cachedMeta:is}=Fn,os=rs._stacks||(rs._stacks={}),{iScale:as,vScale:us,index:ds}=is,hs=as.axis,ps=us.axis,io=getStackKey(as,us,is),fo=Mn.length;let mo;for(let Ao=0;Ao<fo;++Ao){const $o=Mn[Ao],{[hs]:Lo,[ps]:Go}=$o,Yo=$o._stacks||($o._stacks={});mo=Yo[ps]=getOrCreateStack(os,io,Lo),mo[ds]=Go,mo._top=getLastIndexInStack(mo,us,!0,is.type),mo._bottom=getLastIndexInStack(mo,us,!1,is.type);const Wo=mo._visualValues||(mo._visualValues={});Wo[ds]=Go}}function getFirstScaleId(Fn,Mn){const rs=Fn.scales;return Object.keys(rs).filter(is=>rs[is].axis===Mn).shift()}function createDatasetContext(Fn,Mn){return createContext(Fn,{active:!1,dataset:void 0,datasetIndex:Mn,index:Mn,mode:"default",type:"dataset"})}function createDataContext(Fn,Mn,rs){return createContext(Fn,{active:!1,dataIndex:Mn,parsed:void 0,raw:void 0,element:rs,index:Mn,mode:"default",type:"data"})}function clearStacks(Fn,Mn){const rs=Fn.controller.index,is=Fn.vScale&&Fn.vScale.axis;if(is){Mn=Mn||Fn._parsed;for(const os of Mn){const as=os._stacks;if(!as||as[is]===void 0||as[is][rs]===void 0)return;delete as[is][rs],as[is]._visualValues!==void 0&&as[is]._visualValues[rs]!==void 0&&delete as[is]._visualValues[rs]}}}const isDirectUpdateMode=Fn=>Fn==="reset"||Fn==="none",cloneIfNotShared=(Fn,Mn)=>Mn?Fn:Object.assign({},Fn),createStack=(Fn,Mn,rs)=>Fn&&!Mn.hidden&&Mn._stacked&&{keys:getSortedDatasetIndices(rs,!0),values:null};class DatasetController{constructor(Mn,rs){this.chart=Mn,this._ctx=Mn.ctx,this.index=rs,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const Mn=this._cachedMeta;this.configure(),this.linkScales(),Mn._stacked=isStacked(Mn.vScale,Mn),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(Mn){this.index!==Mn&&clearStacks(this._cachedMeta),this.index=Mn}linkScales(){const Mn=this.chart,rs=this._cachedMeta,is=this.getDataset(),os=(fo,mo,Ao,$o)=>fo==="x"?mo:fo==="r"?$o:Ao,as=rs.xAxisID=valueOrDefault(is.xAxisID,getFirstScaleId(Mn,"x")),us=rs.yAxisID=valueOrDefault(is.yAxisID,getFirstScaleId(Mn,"y")),ds=rs.rAxisID=valueOrDefault(is.rAxisID,getFirstScaleId(Mn,"r")),hs=rs.indexAxis,ps=rs.iAxisID=os(hs,as,us,ds),io=rs.vAxisID=os(hs,us,as,ds);rs.xScale=this.getScaleForId(as),rs.yScale=this.getScaleForId(us),rs.rScale=this.getScaleForId(ds),rs.iScale=this.getScaleForId(ps),rs.vScale=this.getScaleForId(io)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(Mn){return this.chart.scales[Mn]}_getOtherScale(Mn){const rs=this._cachedMeta;return Mn===rs.iScale?rs.vScale:rs.iScale}reset(){this._update("reset")}_destroy(){const Mn=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),Mn._stacked&&clearStacks(Mn)}_dataCheck(){const Mn=this.getDataset(),rs=Mn.data||(Mn.data=[]),is=this._data;if(isObject$1(rs)){const os=this._cachedMeta;this._data=convertObjectDataToArray(rs,os)}else if(is!==rs){if(is){unlistenArrayEvents(is,this);const os=this._cachedMeta;clearStacks(os),os._parsed=[]}rs&&Object.isExtensible(rs)&&listenArrayEvents(rs,this),this._syncList=[],this._data=rs}}addElements(){const Mn=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(Mn.dataset=new this.datasetElementType)}buildOrUpdateElements(Mn){const rs=this._cachedMeta,is=this.getDataset();let os=!1;this._dataCheck();const as=rs._stacked;rs._stacked=isStacked(rs.vScale,rs),rs.stack!==is.stack&&(os=!0,clearStacks(rs),rs.stack=is.stack),this._resyncElements(Mn),(os||as!==rs._stacked)&&updateStacks(this,rs._parsed)}configure(){const Mn=this.chart.config,rs=Mn.datasetScopeKeys(this._type),is=Mn.getOptionScopes(this.getDataset(),rs,!0);this.options=Mn.createResolver(is,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(Mn,rs){const{_cachedMeta:is,_data:os}=this,{iScale:as,_stacked:us}=is,ds=as.axis;let hs=Mn===0&&rs===os.length?!0:is._sorted,ps=Mn>0&&is._parsed[Mn-1],io,fo,mo;if(this._parsing===!1)is._parsed=os,is._sorted=!0,mo=os;else{isArray(os[Mn])?mo=this.parseArrayData(is,os,Mn,rs):isObject$1(os[Mn])?mo=this.parseObjectData(is,os,Mn,rs):mo=this.parsePrimitiveData(is,os,Mn,rs);const Ao=()=>fo[ds]===null||ps&&fo[ds]<ps[ds];for(io=0;io<rs;++io)is._parsed[io+Mn]=fo=mo[io],hs&&(Ao()&&(hs=!1),ps=fo);is._sorted=hs}us&&updateStacks(this,mo)}parsePrimitiveData(Mn,rs,is,os){const{iScale:as,vScale:us}=Mn,ds=as.axis,hs=us.axis,ps=as.getLabels(),io=as===us,fo=new Array(os);let mo,Ao,$o;for(mo=0,Ao=os;mo<Ao;++mo)$o=mo+is,fo[mo]={[ds]:io||as.parse(ps[$o],$o),[hs]:us.parse(rs[$o],$o)};return fo}parseArrayData(Mn,rs,is,os){const{xScale:as,yScale:us}=Mn,ds=new Array(os);let hs,ps,io,fo;for(hs=0,ps=os;hs<ps;++hs)io=hs+is,fo=rs[io],ds[hs]={x:as.parse(fo[0],io),y:us.parse(fo[1],io)};return ds}parseObjectData(Mn,rs,is,os){const{xScale:as,yScale:us}=Mn,{xAxisKey:ds="x",yAxisKey:hs="y"}=this._parsing,ps=new Array(os);let io,fo,mo,Ao;for(io=0,fo=os;io<fo;++io)mo=io+is,Ao=rs[mo],ps[io]={x:as.parse(resolveObjectKey(Ao,ds),mo),y:us.parse(resolveObjectKey(Ao,hs),mo)};return ps}getParsed(Mn){return this._cachedMeta._parsed[Mn]}getDataElement(Mn){return this._cachedMeta.data[Mn]}applyStack(Mn,rs,is){const os=this.chart,as=this._cachedMeta,us=rs[Mn.axis],ds={keys:getSortedDatasetIndices(os,!0),values:rs._stacks[Mn.axis]._visualValues};return applyStack(ds,us,as.index,{mode:is})}updateRangeFromParsed(Mn,rs,is,os){const as=is[rs.axis];let us=as===null?NaN:as;const ds=os&&is._stacks[rs.axis];os&&ds&&(os.values=ds,us=applyStack(os,as,this._cachedMeta.index)),Mn.min=Math.min(Mn.min,us),Mn.max=Math.max(Mn.max,us)}getMinMax(Mn,rs){const is=this._cachedMeta,os=is._parsed,as=is._sorted&&Mn===is.iScale,us=os.length,ds=this._getOtherScale(Mn),hs=createStack(rs,is,this.chart),ps={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:io,max:fo}=getUserBounds(ds);let mo,Ao;function $o(){Ao=os[mo];const Lo=Ao[ds.axis];return!isNumberFinite(Ao[Mn.axis])||io>Lo||fo<Lo}for(mo=0;mo<us&&!(!$o()&&(this.updateRangeFromParsed(ps,Mn,Ao,hs),as));++mo);if(as){for(mo=us-1;mo>=0;--mo)if(!$o()){this.updateRangeFromParsed(ps,Mn,Ao,hs);break}}return ps}getAllParsedValues(Mn){const rs=this._cachedMeta._parsed,is=[];let os,as,us;for(os=0,as=rs.length;os<as;++os)us=rs[os][Mn.axis],isNumberFinite(us)&&is.push(us);return is}getMaxOverflow(){return!1}getLabelAndValue(Mn){const rs=this._cachedMeta,is=rs.iScale,os=rs.vScale,as=this.getParsed(Mn);return{label:is?""+is.getLabelForValue(as[is.axis]):"",value:os?""+os.getLabelForValue(as[os.axis]):""}}_update(Mn){const rs=this._cachedMeta;this.update(Mn||"default"),rs._clip=toClip(valueOrDefault(this.options.clip,defaultClip(rs.xScale,rs.yScale,this.getMaxOverflow())))}update(Mn){}draw(){const Mn=this._ctx,rs=this.chart,is=this._cachedMeta,os=is.data||[],as=rs.chartArea,us=[],ds=this._drawStart||0,hs=this._drawCount||os.length-ds,ps=this.options.drawActiveElementsOnTop;let io;for(is.dataset&&is.dataset.draw(Mn,as,ds,hs),io=ds;io<ds+hs;++io){const fo=os[io];fo.hidden||(fo.active&&ps?us.push(fo):fo.draw(Mn,as))}for(io=0;io<us.length;++io)us[io].draw(Mn,as)}getStyle(Mn,rs){const is=rs?"active":"default";return Mn===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(is):this.resolveDataElementOptions(Mn||0,is)}getContext(Mn,rs,is){const os=this.getDataset();let as;if(Mn>=0&&Mn<this._cachedMeta.data.length){const us=this._cachedMeta.data[Mn];as=us.$context||(us.$context=createDataContext(this.getContext(),Mn,us)),as.parsed=this.getParsed(Mn),as.raw=os.data[Mn],as.index=as.dataIndex=Mn}else as=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),as.dataset=os,as.index=as.datasetIndex=this.index;return as.active=!!rs,as.mode=is,as}resolveDatasetElementOptions(Mn){return this._resolveElementOptions(this.datasetElementType.id,Mn)}resolveDataElementOptions(Mn,rs){return this._resolveElementOptions(this.dataElementType.id,rs,Mn)}_resolveElementOptions(Mn,rs="default",is){const os=rs==="active",as=this._cachedDataOpts,us=Mn+"-"+rs,ds=as[us],hs=this.enableOptionSharing&&defined(is);if(ds)return cloneIfNotShared(ds,hs);const ps=this.chart.config,io=ps.datasetElementScopeKeys(this._type,Mn),fo=os?[`${Mn}Hover`,"hover",Mn,""]:[Mn,""],mo=ps.getOptionScopes(this.getDataset(),io),Ao=Object.keys(defaults.elements[Mn]),$o=()=>this.getContext(is,os,rs),Lo=ps.resolveNamedOptions(mo,Ao,$o,fo);return Lo.$shared&&(Lo.$shared=hs,as[us]=Object.freeze(cloneIfNotShared(Lo,hs))),Lo}_resolveAnimations(Mn,rs,is){const os=this.chart,as=this._cachedDataOpts,us=`animation-${rs}`,ds=as[us];if(ds)return ds;let hs;if(os.options.animation!==!1){const io=this.chart.config,fo=io.datasetAnimationScopeKeys(this._type,rs),mo=io.getOptionScopes(this.getDataset(),fo);hs=io.createResolver(mo,this.getContext(Mn,is,rs))}const ps=new Animations(os,hs&&hs.animations);return hs&&hs._cacheable&&(as[us]=Object.freeze(ps)),ps}getSharedOptions(Mn){if(Mn.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},Mn))}includeOptions(Mn,rs){return!rs||isDirectUpdateMode(Mn)||this.chart._animationsDisabled}_getSharedOptions(Mn,rs){const is=this.resolveDataElementOptions(Mn,rs),os=this._sharedOptions,as=this.getSharedOptions(is),us=this.includeOptions(rs,as)||as!==os;return this.updateSharedOptions(as,rs,is),{sharedOptions:as,includeOptions:us}}updateElement(Mn,rs,is,os){isDirectUpdateMode(os)?Object.assign(Mn,is):this._resolveAnimations(rs,os).update(Mn,is)}updateSharedOptions(Mn,rs,is){Mn&&!isDirectUpdateMode(rs)&&this._resolveAnimations(void 0,rs).update(Mn,is)}_setStyle(Mn,rs,is,os){Mn.active=os;const as=this.getStyle(rs,os);this._resolveAnimations(rs,is,os).update(Mn,{options:!os&&this.getSharedOptions(as)||as})}removeHoverStyle(Mn,rs,is){this._setStyle(Mn,is,"active",!1)}setHoverStyle(Mn,rs,is){this._setStyle(Mn,is,"active",!0)}_removeDatasetHoverStyle(){const Mn=this._cachedMeta.dataset;Mn&&this._setStyle(Mn,void 0,"active",!1)}_setDatasetHoverStyle(){const Mn=this._cachedMeta.dataset;Mn&&this._setStyle(Mn,void 0,"active",!0)}_resyncElements(Mn){const rs=this._data,is=this._cachedMeta.data;for(const[ds,hs,ps]of this._syncList)this[ds](hs,ps);this._syncList=[];const os=is.length,as=rs.length,us=Math.min(as,os);us&&this.parse(0,us),as>os?this._insertElements(os,as-os,Mn):as<os&&this._removeElements(as,os-as)}_insertElements(Mn,rs,is=!0){const os=this._cachedMeta,as=os.data,us=Mn+rs;let ds;const hs=ps=>{for(ps.length+=rs,ds=ps.length-1;ds>=us;ds--)ps[ds]=ps[ds-rs]};for(hs(as),ds=Mn;ds<us;++ds)as[ds]=new this.dataElementType;this._parsing&&hs(os._parsed),this.parse(Mn,rs),is&&this.updateElements(as,Mn,rs,"reset")}updateElements(Mn,rs,is,os){}_removeElements(Mn,rs){const is=this._cachedMeta;if(this._parsing){const os=is._parsed.splice(Mn,rs);is._stacked&&clearStacks(is,os)}is.data.splice(Mn,rs)}_sync(Mn){if(this._parsing)this._syncList.push(Mn);else{const[rs,is,os]=Mn;this[rs](is,os)}this.chart._dataChanges.push([this.index,...Mn])}_onDataPush(){const Mn=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-Mn,Mn])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(Mn,rs){rs&&this._sync(["_removeElements",Mn,rs]);const is=arguments.length-2;is&&this._sync(["_insertElements",Mn,is])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}_m(DatasetController,"defaults",{}),_m(DatasetController,"datasetElementType",null),_m(DatasetController,"dataElementType",null);function getAllScaleValues(Fn,Mn){if(!Fn._cache.$bar){const rs=Fn.getMatchingVisibleMetas(Mn);let is=[];for(let os=0,as=rs.length;os<as;os++)is=is.concat(rs[os].controller.getAllParsedValues(Fn));Fn._cache.$bar=_arrayUnique(is.sort((os,as)=>os-as))}return Fn._cache.$bar}function computeMinSampleSize(Fn){const Mn=Fn.iScale,rs=getAllScaleValues(Mn,Fn.type);let is=Mn._length,os,as,us,ds;const hs=()=>{us===32767||us===-32768||(defined(ds)&&(is=Math.min(is,Math.abs(us-ds)||is)),ds=us)};for(os=0,as=rs.length;os<as;++os)us=Mn.getPixelForValue(rs[os]),hs();for(ds=void 0,os=0,as=Mn.ticks.length;os<as;++os)us=Mn.getPixelForTick(os),hs();return is}function computeFitCategoryTraits(Fn,Mn,rs,is){const os=rs.barThickness;let as,us;return isNullOrUndef(os)?(as=Mn.min*rs.categoryPercentage,us=rs.barPercentage):(as=os*is,us=1),{chunk:as/is,ratio:us,start:Mn.pixels[Fn]-as/2}}function computeFlexCategoryTraits(Fn,Mn,rs,is){const os=Mn.pixels,as=os[Fn];let us=Fn>0?os[Fn-1]:null,ds=Fn<os.length-1?os[Fn+1]:null;const hs=rs.categoryPercentage;us===null&&(us=as-(ds===null?Mn.end-Mn.start:ds-as)),ds===null&&(ds=as+as-us);const ps=as-(as-Math.min(us,ds))/2*hs;return{chunk:Math.abs(ds-us)/2*hs/is,ratio:rs.barPercentage,start:ps}}function parseFloatBar(Fn,Mn,rs,is){const os=rs.parse(Fn[0],is),as=rs.parse(Fn[1],is),us=Math.min(os,as),ds=Math.max(os,as);let hs=us,ps=ds;Math.abs(us)>Math.abs(ds)&&(hs=ds,ps=us),Mn[rs.axis]=ps,Mn._custom={barStart:hs,barEnd:ps,start:os,end:as,min:us,max:ds}}function parseValue(Fn,Mn,rs,is){return isArray(Fn)?parseFloatBar(Fn,Mn,rs,is):Mn[rs.axis]=rs.parse(Fn,is),Mn}function parseArrayOrPrimitive(Fn,Mn,rs,is){const os=Fn.iScale,as=Fn.vScale,us=os.getLabels(),ds=os===as,hs=[];let ps,io,fo,mo;for(ps=rs,io=rs+is;ps<io;++ps)mo=Mn[ps],fo={},fo[os.axis]=ds||os.parse(us[ps],ps),hs.push(parseValue(mo,fo,as,ps));return hs}function isFloatBar(Fn){return Fn&&Fn.barStart!==void 0&&Fn.barEnd!==void 0}function barSign(Fn,Mn,rs){return Fn!==0?sign(Fn):(Mn.isHorizontal()?1:-1)*(Mn.min>=rs?1:-1)}function borderProps(Fn){let Mn,rs,is,os,as;return Fn.horizontal?(Mn=Fn.base>Fn.x,rs="left",is="right"):(Mn=Fn.base<Fn.y,rs="bottom",is="top"),Mn?(os="end",as="start"):(os="start",as="end"),{start:rs,end:is,reverse:Mn,top:os,bottom:as}}function setBorderSkipped(Fn,Mn,rs,is){let os=Mn.borderSkipped;const as={};if(!os){Fn.borderSkipped=as;return}if(os===!0){Fn.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:us,end:ds,reverse:hs,top:ps,bottom:io}=borderProps(Fn);os==="middle"&&rs&&(Fn.enableBorderRadius=!0,(rs._top||0)===is?os=ps:(rs._bottom||0)===is?os=io:(as[parseEdge(io,us,ds,hs)]=!0,os=ps)),as[parseEdge(os,us,ds,hs)]=!0,Fn.borderSkipped=as}function parseEdge(Fn,Mn,rs,is){return is?(Fn=swap(Fn,Mn,rs),Fn=startEnd(Fn,rs,Mn)):Fn=startEnd(Fn,Mn,rs),Fn}function swap(Fn,Mn,rs){return Fn===Mn?rs:Fn===rs?Mn:Fn}function startEnd(Fn,Mn,rs){return Fn==="start"?Mn:Fn==="end"?rs:Fn}function setInflateAmount(Fn,{inflateAmount:Mn},rs){Fn.inflateAmount=Mn==="auto"?rs===1?.33:0:Mn}class BarController extends DatasetController{parsePrimitiveData(Mn,rs,is,os){return parseArrayOrPrimitive(Mn,rs,is,os)}parseArrayData(Mn,rs,is,os){return parseArrayOrPrimitive(Mn,rs,is,os)}parseObjectData(Mn,rs,is,os){const{iScale:as,vScale:us}=Mn,{xAxisKey:ds="x",yAxisKey:hs="y"}=this._parsing,ps=as.axis==="x"?ds:hs,io=us.axis==="x"?ds:hs,fo=[];let mo,Ao,$o,Lo;for(mo=is,Ao=is+os;mo<Ao;++mo)Lo=rs[mo],$o={},$o[as.axis]=as.parse(resolveObjectKey(Lo,ps),mo),fo.push(parseValue(resolveObjectKey(Lo,io),$o,us,mo));return fo}updateRangeFromParsed(Mn,rs,is,os){super.updateRangeFromParsed(Mn,rs,is,os);const as=is._custom;as&&rs===this._cachedMeta.vScale&&(Mn.min=Math.min(Mn.min,as.min),Mn.max=Math.max(Mn.max,as.max))}getMaxOverflow(){return 0}getLabelAndValue(Mn){const rs=this._cachedMeta,{iScale:is,vScale:os}=rs,as=this.getParsed(Mn),us=as._custom,ds=isFloatBar(us)?"["+us.start+", "+us.end+"]":""+os.getLabelForValue(as[os.axis]);return{label:""+is.getLabelForValue(as[is.axis]),value:ds}}initialize(){this.enableOptionSharing=!0,super.initialize();const Mn=this._cachedMeta;Mn.stack=this.getDataset().stack}update(Mn){const rs=this._cachedMeta;this.updateElements(rs.data,0,rs.data.length,Mn)}updateElements(Mn,rs,is,os){const as=os==="reset",{index:us,_cachedMeta:{vScale:ds}}=this,hs=ds.getBasePixel(),ps=ds.isHorizontal(),io=this._getRuler(),{sharedOptions:fo,includeOptions:mo}=this._getSharedOptions(rs,os);for(let Ao=rs;Ao<rs+is;Ao++){const $o=this.getParsed(Ao),Lo=as||isNullOrUndef($o[ds.axis])?{base:hs,head:hs}:this._calculateBarValuePixels(Ao),Go=this._calculateBarIndexPixels(Ao,io),Yo=($o._stacks||{})[ds.axis],Wo={horizontal:ps,base:Lo.base,enableBorderRadius:!Yo||isFloatBar($o._custom)||us===Yo._top||us===Yo._bottom,x:ps?Lo.head:Go.center,y:ps?Go.center:Lo.head,height:ps?Go.size:Math.abs(Lo.size),width:ps?Math.abs(Lo.size):Go.size};mo&&(Wo.options=fo||this.resolveDataElementOptions(Ao,Mn[Ao].active?"active":os));const Jo=Wo.options||Mn[Ao].options;setBorderSkipped(Wo,Jo,Yo,us),setInflateAmount(Wo,Jo,io.ratio),this.updateElement(Mn[Ao],Ao,Wo,os)}}_getStacks(Mn,rs){const{iScale:is}=this._cachedMeta,os=is.getMatchingVisibleMetas(this._type).filter(hs=>hs.controller.options.grouped),as=is.options.stacked,us=[],ds=hs=>{const ps=hs.controller.getParsed(rs),io=ps&&ps[hs.vScale.axis];if(isNullOrUndef(io)||isNaN(io))return!0};for(const hs of os)if(!(rs!==void 0&&ds(hs))&&((as===!1||us.indexOf(hs.stack)===-1||as===void 0&&hs.stack===void 0)&&us.push(hs.stack),hs.index===Mn))break;return us.length||us.push(void 0),us}_getStackCount(Mn){return this._getStacks(void 0,Mn).length}_getStackIndex(Mn,rs,is){const os=this._getStacks(Mn,is),as=rs!==void 0?os.indexOf(rs):-1;return as===-1?os.length-1:as}_getRuler(){const Mn=this.options,rs=this._cachedMeta,is=rs.iScale,os=[];let as,us;for(as=0,us=rs.data.length;as<us;++as)os.push(is.getPixelForValue(this.getParsed(as)[is.axis],as));const ds=Mn.barThickness;return{min:ds||computeMinSampleSize(rs),pixels:os,start:is._startPixel,end:is._endPixel,stackCount:this._getStackCount(),scale:is,grouped:Mn.grouped,ratio:ds?1:Mn.categoryPercentage*Mn.barPercentage}}_calculateBarValuePixels(Mn){const{_cachedMeta:{vScale:rs,_stacked:is,index:os},options:{base:as,minBarLength:us}}=this,ds=as||0,hs=this.getParsed(Mn),ps=hs._custom,io=isFloatBar(ps);let fo=hs[rs.axis],mo=0,Ao=is?this.applyStack(rs,hs,is):fo,$o,Lo;Ao!==fo&&(mo=Ao-fo,Ao=fo),io&&(fo=ps.barStart,Ao=ps.barEnd-ps.barStart,fo!==0&&sign(fo)!==sign(ps.barEnd)&&(mo=0),mo+=fo);const Go=!isNullOrUndef(as)&&!io?as:mo;let Yo=rs.getPixelForValue(Go);if(this.chart.getDataVisibility(Mn)?$o=rs.getPixelForValue(mo+Ao):$o=Yo,Lo=$o-Yo,Math.abs(Lo)<us){Lo=barSign(Lo,rs,ds)*us,fo===ds&&(Yo-=Lo/2);const Wo=rs.getPixelForDecimal(0),Jo=rs.getPixelForDecimal(1),xl=Math.min(Wo,Jo),_l=Math.max(Wo,Jo);Yo=Math.max(Math.min(Yo,_l),xl),$o=Yo+Lo,is&&!io&&(hs._stacks[rs.axis]._visualValues[os]=rs.getValueForPixel($o)-rs.getValueForPixel(Yo))}if(Yo===rs.getPixelForValue(ds)){const Wo=sign(Lo)*rs.getLineWidthForValue(ds)/2;Yo+=Wo,Lo-=Wo}return{size:Lo,base:Yo,head:$o,center:$o+Lo/2}}_calculateBarIndexPixels(Mn,rs){const is=rs.scale,os=this.options,as=os.skipNull,us=valueOrDefault(os.maxBarThickness,1/0);let ds,hs;if(rs.grouped){const ps=as?this._getStackCount(Mn):rs.stackCount,io=os.barThickness==="flex"?computeFlexCategoryTraits(Mn,rs,os,ps):computeFitCategoryTraits(Mn,rs,os,ps),fo=this._getStackIndex(this.index,this._cachedMeta.stack,as?Mn:void 0);ds=io.start+io.chunk*fo+io.chunk/2,hs=Math.min(us,io.chunk*io.ratio)}else ds=is.getPixelForValue(this.getParsed(Mn)[is.axis],Mn),hs=Math.min(us,rs.min*rs.ratio);return{base:ds-hs/2,head:ds+hs/2,center:ds,size:hs}}draw(){const Mn=this._cachedMeta,rs=Mn.vScale,is=Mn.data,os=is.length;let as=0;for(;as<os;++as)this.getParsed(as)[rs.axis]!==null&&!is[as].hidden&&is[as].draw(this._ctx)}}_m(BarController,"id","bar"),_m(BarController,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),_m(BarController,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapterBase{constructor(Mn){_m(this,"options");this.options=Mn||{}}static override(Mn){Object.assign(DateAdapterBase.prototype,Mn)}init(){}formats(){return abstract()}parse(){return abstract()}format(){return abstract()}add(){return abstract()}diff(){return abstract()}startOf(){return abstract()}endOf(){return abstract()}}var adapters={_date:DateAdapterBase};function binarySearch(Fn,Mn,rs,is){const{controller:os,data:as,_sorted:us}=Fn,ds=os._cachedMeta.iScale;if(ds&&Mn===ds.axis&&Mn!=="r"&&us&&as.length){const hs=ds._reversePixels?_rlookupByKey:_lookupByKey;if(is){if(os._sharedOptions){const ps=as[0],io=typeof ps.getRange=="function"&&ps.getRange(Mn);if(io){const fo=hs(as,Mn,rs-io),mo=hs(as,Mn,rs+io);return{lo:fo.lo,hi:mo.hi}}}}else return hs(as,Mn,rs)}return{lo:0,hi:as.length-1}}function evaluateInteractionItems(Fn,Mn,rs,is,os){const as=Fn.getSortedVisibleDatasetMetas(),us=rs[Mn];for(let ds=0,hs=as.length;ds<hs;++ds){const{index:ps,data:io}=as[ds],{lo:fo,hi:mo}=binarySearch(as[ds],Mn,us,os);for(let Ao=fo;Ao<=mo;++Ao){const $o=io[Ao];$o.skip||is($o,ps,Ao)}}}function getDistanceMetricForAxis(Fn){const Mn=Fn.indexOf("x")!==-1,rs=Fn.indexOf("y")!==-1;return function(is,os){const as=Mn?Math.abs(is.x-os.x):0,us=rs?Math.abs(is.y-os.y):0;return Math.sqrt(Math.pow(as,2)+Math.pow(us,2))}}function getIntersectItems(Fn,Mn,rs,is,os){const as=[];return!os&&!Fn.isPointInArea(Mn)||evaluateInteractionItems(Fn,rs,Mn,function(ds,hs,ps){!os&&!_isPointInArea(ds,Fn.chartArea,0)||ds.inRange(Mn.x,Mn.y,is)&&as.push({element:ds,datasetIndex:hs,index:ps})},!0),as}function getNearestRadialItems(Fn,Mn,rs,is){let os=[];function as(us,ds,hs){const{startAngle:ps,endAngle:io}=us.getProps(["startAngle","endAngle"],is),{angle:fo}=getAngleFromPoint(us,{x:Mn.x,y:Mn.y});_angleBetween(fo,ps,io)&&os.push({element:us,datasetIndex:ds,index:hs})}return evaluateInteractionItems(Fn,rs,Mn,as),os}function getNearestCartesianItems(Fn,Mn,rs,is,os,as){let us=[];const ds=getDistanceMetricForAxis(rs);let hs=Number.POSITIVE_INFINITY;function ps(io,fo,mo){const Ao=io.inRange(Mn.x,Mn.y,os);if(is&&!Ao)return;const $o=io.getCenterPoint(os);if(!(!!as||Fn.isPointInArea($o))&&!Ao)return;const Go=ds(Mn,$o);Go<hs?(us=[{element:io,datasetIndex:fo,index:mo}],hs=Go):Go===hs&&us.push({element:io,datasetIndex:fo,index:mo})}return evaluateInteractionItems(Fn,rs,Mn,ps),us}function getNearestItems(Fn,Mn,rs,is,os,as){return!as&&!Fn.isPointInArea(Mn)?[]:rs==="r"&&!is?getNearestRadialItems(Fn,Mn,rs,os):getNearestCartesianItems(Fn,Mn,rs,is,os,as)}function getAxisItems(Fn,Mn,rs,is,os){const as=[],us=rs==="x"?"inXRange":"inYRange";let ds=!1;return evaluateInteractionItems(Fn,rs,Mn,(hs,ps,io)=>{hs[us](Mn[rs],os)&&(as.push({element:hs,datasetIndex:ps,index:io}),ds=ds||hs.inRange(Mn.x,Mn.y,os))}),is&&!ds?[]:as}var Interaction={evaluateInteractionItems,modes:{index(Fn,Mn,rs,is){const os=getRelativePosition(Mn,Fn),as=rs.axis||"x",us=rs.includeInvisible||!1,ds=rs.intersect?getIntersectItems(Fn,os,as,is,us):getNearestItems(Fn,os,as,!1,is,us),hs=[];return ds.length?(Fn.getSortedVisibleDatasetMetas().forEach(ps=>{const io=ds[0].index,fo=ps.data[io];fo&&!fo.skip&&hs.push({element:fo,datasetIndex:ps.index,index:io})}),hs):[]},dataset(Fn,Mn,rs,is){const os=getRelativePosition(Mn,Fn),as=rs.axis||"xy",us=rs.includeInvisible||!1;let ds=rs.intersect?getIntersectItems(Fn,os,as,is,us):getNearestItems(Fn,os,as,!1,is,us);if(ds.length>0){const hs=ds[0].datasetIndex,ps=Fn.getDatasetMeta(hs).data;ds=[];for(let io=0;io<ps.length;++io)ds.push({element:ps[io],datasetIndex:hs,index:io})}return ds},point(Fn,Mn,rs,is){const os=getRelativePosition(Mn,Fn),as=rs.axis||"xy",us=rs.includeInvisible||!1;return getIntersectItems(Fn,os,as,is,us)},nearest(Fn,Mn,rs,is){const os=getRelativePosition(Mn,Fn),as=rs.axis||"xy",us=rs.includeInvisible||!1;return getNearestItems(Fn,os,as,rs.intersect,is,us)},x(Fn,Mn,rs,is){const os=getRelativePosition(Mn,Fn);return getAxisItems(Fn,os,"x",rs.intersect,is)},y(Fn,Mn,rs,is){const os=getRelativePosition(Mn,Fn);return getAxisItems(Fn,os,"y",rs.intersect,is)}}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(Fn,Mn){return Fn.filter(rs=>rs.pos===Mn)}function filterDynamicPositionByAxis(Fn,Mn){return Fn.filter(rs=>STATIC_POSITIONS.indexOf(rs.pos)===-1&&rs.box.axis===Mn)}function sortByWeight(Fn,Mn){return Fn.sort((rs,is)=>{const os=Mn?is:rs,as=Mn?rs:is;return os.weight===as.weight?os.index-as.index:os.weight-as.weight})}function wrapBoxes(Fn){const Mn=[];let rs,is,os,as,us,ds;for(rs=0,is=(Fn||[]).length;rs<is;++rs)os=Fn[rs],{position:as,options:{stack:us,stackWeight:ds=1}}=os,Mn.push({index:rs,box:os,pos:as,horizontal:os.isHorizontal(),weight:os.weight,stack:us&&as+us,stackWeight:ds});return Mn}function buildStacks(Fn){const Mn={};for(const rs of Fn){const{stack:is,pos:os,stackWeight:as}=rs;if(!is||!STATIC_POSITIONS.includes(os))continue;const us=Mn[is]||(Mn[is]={count:0,placed:0,weight:0,size:0});us.count++,us.weight+=as}return Mn}function setLayoutDims(Fn,Mn){const rs=buildStacks(Fn),{vBoxMaxWidth:is,hBoxMaxHeight:os}=Mn;let as,us,ds;for(as=0,us=Fn.length;as<us;++as){ds=Fn[as];const{fullSize:hs}=ds.box,ps=rs[ds.stack],io=ps&&ds.stackWeight/ps.weight;ds.horizontal?(ds.width=io?io*is:hs&&Mn.availableWidth,ds.height=os):(ds.width=is,ds.height=io?io*os:hs&&Mn.availableHeight)}return rs}function buildLayoutBoxes(Fn){const Mn=wrapBoxes(Fn),rs=sortByWeight(Mn.filter(ps=>ps.box.fullSize),!0),is=sortByWeight(filterByPosition(Mn,"left"),!0),os=sortByWeight(filterByPosition(Mn,"right")),as=sortByWeight(filterByPosition(Mn,"top"),!0),us=sortByWeight(filterByPosition(Mn,"bottom")),ds=filterDynamicPositionByAxis(Mn,"x"),hs=filterDynamicPositionByAxis(Mn,"y");return{fullSize:rs,leftAndTop:is.concat(as),rightAndBottom:os.concat(hs).concat(us).concat(ds),chartArea:filterByPosition(Mn,"chartArea"),vertical:is.concat(os).concat(hs),horizontal:as.concat(us).concat(ds)}}function getCombinedMax(Fn,Mn,rs,is){return Math.max(Fn[rs],Mn[rs])+Math.max(Fn[is],Mn[is])}function updateMaxPadding(Fn,Mn){Fn.top=Math.max(Fn.top,Mn.top),Fn.left=Math.max(Fn.left,Mn.left),Fn.bottom=Math.max(Fn.bottom,Mn.bottom),Fn.right=Math.max(Fn.right,Mn.right)}function updateDims(Fn,Mn,rs,is){const{pos:os,box:as}=rs,us=Fn.maxPadding;if(!isObject$1(os)){rs.size&&(Fn[os]-=rs.size);const fo=is[rs.stack]||{size:0,count:1};fo.size=Math.max(fo.size,rs.horizontal?as.height:as.width),rs.size=fo.size/fo.count,Fn[os]+=rs.size}as.getPadding&&updateMaxPadding(us,as.getPadding());const ds=Math.max(0,Mn.outerWidth-getCombinedMax(us,Fn,"left","right")),hs=Math.max(0,Mn.outerHeight-getCombinedMax(us,Fn,"top","bottom")),ps=ds!==Fn.w,io=hs!==Fn.h;return Fn.w=ds,Fn.h=hs,rs.horizontal?{same:ps,other:io}:{same:io,other:ps}}function handleMaxPadding(Fn){const Mn=Fn.maxPadding;function rs(is){const os=Math.max(Mn[is]-Fn[is],0);return Fn[is]+=os,os}Fn.y+=rs("top"),Fn.x+=rs("left"),rs("right"),rs("bottom")}function getMargins(Fn,Mn){const rs=Mn.maxPadding;function is(os){const as={left:0,top:0,right:0,bottom:0};return os.forEach(us=>{as[us]=Math.max(Mn[us],rs[us])}),as}return is(Fn?["left","right"]:["top","bottom"])}function fitBoxes(Fn,Mn,rs,is){const os=[];let as,us,ds,hs,ps,io;for(as=0,us=Fn.length,ps=0;as<us;++as){ds=Fn[as],hs=ds.box,hs.update(ds.width||Mn.w,ds.height||Mn.h,getMargins(ds.horizontal,Mn));const{same:fo,other:mo}=updateDims(Mn,rs,ds,is);ps|=fo&&os.length,io=io||mo,hs.fullSize||os.push(ds)}return ps&&fitBoxes(os,Mn,rs,is)||io}function setBoxDims(Fn,Mn,rs,is,os){Fn.top=rs,Fn.left=Mn,Fn.right=Mn+is,Fn.bottom=rs+os,Fn.width=is,Fn.height=os}function placeBoxes(Fn,Mn,rs,is){const os=rs.padding;let{x:as,y:us}=Mn;for(const ds of Fn){const hs=ds.box,ps=is[ds.stack]||{count:1,placed:0,weight:1},io=ds.stackWeight/ps.weight||1;if(ds.horizontal){const fo=Mn.w*io,mo=ps.size||hs.height;defined(ps.start)&&(us=ps.start),hs.fullSize?setBoxDims(hs,os.left,us,rs.outerWidth-os.right-os.left,mo):setBoxDims(hs,Mn.left+ps.placed,us,fo,mo),ps.start=us,ps.placed+=fo,us=hs.bottom}else{const fo=Mn.h*io,mo=ps.size||hs.width;defined(ps.start)&&(as=ps.start),hs.fullSize?setBoxDims(hs,as,os.top,mo,rs.outerHeight-os.bottom-os.top):setBoxDims(hs,as,Mn.top+ps.placed,mo,fo),ps.start=as,ps.placed+=fo,as=hs.right}}Mn.x=as,Mn.y=us}var layouts={addBox(Fn,Mn){Fn.boxes||(Fn.boxes=[]),Mn.fullSize=Mn.fullSize||!1,Mn.position=Mn.position||"top",Mn.weight=Mn.weight||0,Mn._layers=Mn._layers||function(){return[{z:0,draw(rs){Mn.draw(rs)}}]},Fn.boxes.push(Mn)},removeBox(Fn,Mn){const rs=Fn.boxes?Fn.boxes.indexOf(Mn):-1;rs!==-1&&Fn.boxes.splice(rs,1)},configure(Fn,Mn,rs){Mn.fullSize=rs.fullSize,Mn.position=rs.position,Mn.weight=rs.weight},update(Fn,Mn,rs,is){if(!Fn)return;const os=toPadding(Fn.options.layout.padding),as=Math.max(Mn-os.width,0),us=Math.max(rs-os.height,0),ds=buildLayoutBoxes(Fn.boxes),hs=ds.vertical,ps=ds.horizontal;each(Fn.boxes,Lo=>{typeof Lo.beforeLayout=="function"&&Lo.beforeLayout()});const io=hs.reduce((Lo,Go)=>Go.box.options&&Go.box.options.display===!1?Lo:Lo+1,0)||1,fo=Object.freeze({outerWidth:Mn,outerHeight:rs,padding:os,availableWidth:as,availableHeight:us,vBoxMaxWidth:as/2/io,hBoxMaxHeight:us/2}),mo=Object.assign({},os);updateMaxPadding(mo,toPadding(is));const Ao=Object.assign({maxPadding:mo,w:as,h:us,x:os.left,y:os.top},os),$o=setLayoutDims(hs.concat(ps),fo);fitBoxes(ds.fullSize,Ao,fo,$o),fitBoxes(hs,Ao,fo,$o),fitBoxes(ps,Ao,fo,$o)&&fitBoxes(hs,Ao,fo,$o),handleMaxPadding(Ao),placeBoxes(ds.leftAndTop,Ao,fo,$o),Ao.x+=Ao.w,Ao.y+=Ao.h,placeBoxes(ds.rightAndBottom,Ao,fo,$o),Fn.chartArea={left:Ao.left,top:Ao.top,right:Ao.left+Ao.w,bottom:Ao.top+Ao.h,height:Ao.h,width:Ao.w},each(ds.chartArea,Lo=>{const Go=Lo.box;Object.assign(Go,Fn.chartArea),Go.update(Ao.w,Ao.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(Mn,rs){}releaseContext(Mn){return!1}addEventListener(Mn,rs,is){}removeEventListener(Mn,rs,is){}getDevicePixelRatio(){return 1}getMaximumSize(Mn,rs,is,os){return rs=Math.max(0,rs||Mn.width),is=is||Mn.height,{width:rs,height:Math.max(0,os?Math.floor(rs/os):is)}}isAttached(Mn){return!0}updateConfig(Mn){}}class BasicPlatform extends BasePlatform{acquireContext(Mn){return Mn&&Mn.getContext&&Mn.getContext("2d")||null}updateConfig(Mn){Mn.options.animation=!1}}const EXPANDO_KEY="$chartjs",EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=Fn=>Fn===null||Fn==="";function initCanvas(Fn,Mn){const rs=Fn.style,is=Fn.getAttribute("height"),os=Fn.getAttribute("width");if(Fn[EXPANDO_KEY]={initial:{height:is,width:os,style:{display:rs.display,height:rs.height,width:rs.width}}},rs.display=rs.display||"block",rs.boxSizing=rs.boxSizing||"border-box",isNullOrEmpty(os)){const as=readUsedSize(Fn,"width");as!==void 0&&(Fn.width=as)}if(isNullOrEmpty(is))if(Fn.style.height==="")Fn.height=Fn.width/(Mn||2);else{const as=readUsedSize(Fn,"height");as!==void 0&&(Fn.height=as)}return Fn}const eventListenerOptions=supportsEventListenerOptions?{passive:!0}:!1;function addListener(Fn,Mn,rs){Fn&&Fn.addEventListener(Mn,rs,eventListenerOptions)}function removeListener(Fn,Mn,rs){Fn&&Fn.canvas&&Fn.canvas.removeEventListener(Mn,rs,eventListenerOptions)}function fromNativeEvent(Fn,Mn){const rs=EVENT_TYPES[Fn.type]||Fn.type,{x:is,y:os}=getRelativePosition(Fn,Mn);return{type:rs,chart:Mn,native:Fn,x:is!==void 0?is:null,y:os!==void 0?os:null}}function nodeListContains(Fn,Mn){for(const rs of Fn)if(rs===Mn||rs.contains(Mn))return!0}function createAttachObserver(Fn,Mn,rs){const is=Fn.canvas,os=new MutationObserver(as=>{let us=!1;for(const ds of as)us=us||nodeListContains(ds.addedNodes,is),us=us&&!nodeListContains(ds.removedNodes,is);us&&rs()});return os.observe(document,{childList:!0,subtree:!0}),os}function createDetachObserver(Fn,Mn,rs){const is=Fn.canvas,os=new MutationObserver(as=>{let us=!1;for(const ds of as)us=us||nodeListContains(ds.removedNodes,is),us=us&&!nodeListContains(ds.addedNodes,is);us&&rs()});return os.observe(document,{childList:!0,subtree:!0}),os}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const Fn=window.devicePixelRatio;Fn!==oldDevicePixelRatio&&(oldDevicePixelRatio=Fn,drpListeningCharts.forEach((Mn,rs)=>{rs.currentDevicePixelRatio!==Fn&&Mn()}))}function listenDevicePixelRatioChanges(Fn,Mn){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(Fn,Mn)}function unlistenDevicePixelRatioChanges(Fn){drpListeningCharts.delete(Fn),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(Fn,Mn,rs){const is=Fn.canvas,os=is&&_getParentNode(is);if(!os)return;const as=throttled((ds,hs)=>{const ps=os.clientWidth;rs(ds,hs),ps<os.clientWidth&&rs()},window),us=new ResizeObserver(ds=>{const hs=ds[0],ps=hs.contentRect.width,io=hs.contentRect.height;ps===0&&io===0||as(ps,io)});return us.observe(os),listenDevicePixelRatioChanges(Fn,as),us}function releaseObserver(Fn,Mn,rs){rs&&rs.disconnect(),Mn==="resize"&&unlistenDevicePixelRatioChanges(Fn)}function createProxyAndListen(Fn,Mn,rs){const is=Fn.canvas,os=throttled(as=>{Fn.ctx!==null&&rs(fromNativeEvent(as,Fn))},Fn);return addListener(is,Mn,os),os}class DomPlatform extends BasePlatform{acquireContext(Mn,rs){const is=Mn&&Mn.getContext&&Mn.getContext("2d");return is&&is.canvas===Mn?(initCanvas(Mn,rs),is):null}releaseContext(Mn){const rs=Mn.canvas;if(!rs[EXPANDO_KEY])return!1;const is=rs[EXPANDO_KEY].initial;["height","width"].forEach(as=>{const us=is[as];isNullOrUndef(us)?rs.removeAttribute(as):rs.setAttribute(as,us)});const os=is.style||{};return Object.keys(os).forEach(as=>{rs.style[as]=os[as]}),rs.width=rs.width,delete rs[EXPANDO_KEY],!0}addEventListener(Mn,rs,is){this.removeEventListener(Mn,rs);const os=Mn.$proxies||(Mn.$proxies={}),us={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[rs]||createProxyAndListen;os[rs]=us(Mn,rs,is)}removeEventListener(Mn,rs){const is=Mn.$proxies||(Mn.$proxies={}),os=is[rs];if(!os)return;({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[rs]||removeListener)(Mn,rs,os),is[rs]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(Mn,rs,is,os){return getMaximumSize(Mn,rs,is,os)}isAttached(Mn){const rs=Mn&&_getParentNode(Mn);return!!(rs&&rs.isConnected)}}function _detectPlatform(Fn){return!_isDomSupported()||typeof OffscreenCanvas<"u"&&Fn instanceof OffscreenCanvas?BasicPlatform:DomPlatform}var Ox;let Element$1=(Ox=class{constructor(){_m(this,"x");_m(this,"y");_m(this,"active",!1);_m(this,"options");_m(this,"$animations")}tooltipPosition(Mn){const{x:rs,y:is}=this.getProps(["x","y"],Mn);return{x:rs,y:is}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(Mn,rs){const is=this.$animations;if(!rs||!is)return this;const os={};return Mn.forEach(as=>{os[as]=is[as]&&is[as].active()?is[as]._to:this[as]}),os}},_m(Ox,"defaults",{}),_m(Ox,"defaultRoutes"),Ox);function autoSkip(Fn,Mn){const rs=Fn.options.ticks,is=determineMaxTicks(Fn),os=Math.min(rs.maxTicksLimit||is,is),as=rs.major.enabled?getMajorIndices(Mn):[],us=as.length,ds=as[0],hs=as[us-1],ps=[];if(us>os)return skipMajors(Mn,ps,as,us/os),ps;const io=calculateSpacing(as,Mn,os);if(us>0){let fo,mo;const Ao=us>1?Math.round((hs-ds)/(us-1)):null;for(skip(Mn,ps,io,isNullOrUndef(Ao)?0:ds-Ao,ds),fo=0,mo=us-1;fo<mo;fo++)skip(Mn,ps,io,as[fo],as[fo+1]);return skip(Mn,ps,io,hs,isNullOrUndef(Ao)?Mn.length:hs+Ao),ps}return skip(Mn,ps,io),ps}function determineMaxTicks(Fn){const Mn=Fn.options.offset,rs=Fn._tickSize(),is=Fn._length/rs+(Mn?0:1),os=Fn._maxLength/rs;return Math.floor(Math.min(is,os))}function calculateSpacing(Fn,Mn,rs){const is=getEvenSpacing(Fn),os=Mn.length/rs;if(!is)return Math.max(os,1);const as=_factorize(is);for(let us=0,ds=as.length-1;us<ds;us++){const hs=as[us];if(hs>os)return hs}return Math.max(os,1)}function getMajorIndices(Fn){const Mn=[];let rs,is;for(rs=0,is=Fn.length;rs<is;rs++)Fn[rs].major&&Mn.push(rs);return Mn}function skipMajors(Fn,Mn,rs,is){let os=0,as=rs[0],us;for(is=Math.ceil(is),us=0;us<Fn.length;us++)us===as&&(Mn.push(Fn[us]),os++,as=rs[os*is])}function skip(Fn,Mn,rs,is,os){const as=valueOrDefault(is,0),us=Math.min(valueOrDefault(os,Fn.length),Fn.length);let ds=0,hs,ps,io;for(rs=Math.ceil(rs),os&&(hs=os-is,rs=hs/Math.floor(hs/rs)),io=as;io<0;)ds++,io=Math.round(as+ds*rs);for(ps=Math.max(as,0);ps<us;ps++)ps===io&&(Mn.push(Fn[ps]),ds++,io=Math.round(as+ds*rs))}function getEvenSpacing(Fn){const Mn=Fn.length;let rs,is;if(Mn<2)return!1;for(is=Fn[0],rs=1;rs<Mn;++rs)if(Fn[rs]-Fn[rs-1]!==is)return!1;return is}const reverseAlign=Fn=>Fn==="left"?"right":Fn==="right"?"left":Fn,offsetFromEdge=(Fn,Mn,rs)=>Mn==="top"||Mn==="left"?Fn[Mn]+rs:Fn[Mn]-rs,getTicksLimit=(Fn,Mn)=>Math.min(Mn||Fn,Fn);function sample(Fn,Mn){const rs=[],is=Fn.length/Mn,os=Fn.length;let as=0;for(;as<os;as+=is)rs.push(Fn[Math.floor(as)]);return rs}function getPixelForGridLine(Fn,Mn,rs){const is=Fn.ticks.length,os=Math.min(Mn,is-1),as=Fn._startPixel,us=Fn._endPixel,ds=1e-6;let hs=Fn.getPixelForTick(os),ps;if(!(rs&&(is===1?ps=Math.max(hs-as,us-hs):Mn===0?ps=(Fn.getPixelForTick(1)-hs)/2:ps=(hs-Fn.getPixelForTick(os-1))/2,hs+=os<Mn?ps:-ps,hs<as-ds||hs>us+ds)))return hs}function garbageCollect(Fn,Mn){each(Fn,rs=>{const is=rs.gc,os=is.length/2;let as;if(os>Mn){for(as=0;as<os;++as)delete rs.data[is[as]];is.splice(0,os)}})}function getTickMarkLength(Fn){return Fn.drawTicks?Fn.tickLength:0}function getTitleHeight(Fn,Mn){if(!Fn.display)return 0;const rs=toFont(Fn.font,Mn),is=toPadding(Fn.padding);return(isArray(Fn.text)?Fn.text.length:1)*rs.lineHeight+is.height}function createScaleContext(Fn,Mn){return createContext(Fn,{scale:Mn,type:"scale"})}function createTickContext(Fn,Mn,rs){return createContext(Fn,{tick:rs,index:Mn,type:"tick"})}function titleAlign(Fn,Mn,rs){let is=_toLeftRightCenter(Fn);return(rs&&Mn!=="right"||!rs&&Mn==="right")&&(is=reverseAlign(is)),is}function titleArgs(Fn,Mn,rs,is){const{top:os,left:as,bottom:us,right:ds,chart:hs}=Fn,{chartArea:ps,scales:io}=hs;let fo=0,mo,Ao,$o;const Lo=us-os,Go=ds-as;if(Fn.isHorizontal()){if(Ao=_alignStartEnd(is,as,ds),isObject$1(rs)){const Yo=Object.keys(rs)[0],Wo=rs[Yo];$o=io[Yo].getPixelForValue(Wo)+Lo-Mn}else rs==="center"?$o=(ps.bottom+ps.top)/2+Lo-Mn:$o=offsetFromEdge(Fn,rs,Mn);mo=ds-as}else{if(isObject$1(rs)){const Yo=Object.keys(rs)[0],Wo=rs[Yo];Ao=io[Yo].getPixelForValue(Wo)-Go+Mn}else rs==="center"?Ao=(ps.left+ps.right)/2-Go+Mn:Ao=offsetFromEdge(Fn,rs,Mn);$o=_alignStartEnd(is,us,os),fo=rs==="left"?-HALF_PI:HALF_PI}return{titleX:Ao,titleY:$o,maxWidth:mo,rotation:fo}}class Scale extends Element$1{constructor(Mn){super(),this.id=Mn.id,this.type=Mn.type,this.options=void 0,this.ctx=Mn.ctx,this.chart=Mn.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(Mn){this.options=Mn.setContext(this.getContext()),this.axis=Mn.axis,this._userMin=this.parse(Mn.min),this._userMax=this.parse(Mn.max),this._suggestedMin=this.parse(Mn.suggestedMin),this._suggestedMax=this.parse(Mn.suggestedMax)}parse(Mn,rs){return Mn}getUserBounds(){let{_userMin:Mn,_userMax:rs,_suggestedMin:is,_suggestedMax:os}=this;return Mn=finiteOrDefault(Mn,Number.POSITIVE_INFINITY),rs=finiteOrDefault(rs,Number.NEGATIVE_INFINITY),is=finiteOrDefault(is,Number.POSITIVE_INFINITY),os=finiteOrDefault(os,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(Mn,is),max:finiteOrDefault(rs,os),minDefined:isNumberFinite(Mn),maxDefined:isNumberFinite(rs)}}getMinMax(Mn){let{min:rs,max:is,minDefined:os,maxDefined:as}=this.getUserBounds(),us;if(os&&as)return{min:rs,max:is};const ds=this.getMatchingVisibleMetas();for(let hs=0,ps=ds.length;hs<ps;++hs)us=ds[hs].controller.getMinMax(this,Mn),os||(rs=Math.min(rs,us.min)),as||(is=Math.max(is,us.max));return rs=as&&rs>is?is:rs,is=os&&rs>is?rs:is,{min:finiteOrDefault(rs,finiteOrDefault(is,rs)),max:finiteOrDefault(is,finiteOrDefault(rs,is))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const Mn=this.chart.data;return this.options.labels||(this.isHorizontal()?Mn.xLabels:Mn.yLabels)||Mn.labels||[]}getLabelItems(Mn=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(Mn))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(Mn,rs,is){const{beginAtZero:os,grace:as,ticks:us}=this.options,ds=us.sampleSize;this.beforeUpdate(),this.maxWidth=Mn,this.maxHeight=rs,this._margins=is=Object.assign({left:0,right:0,top:0,bottom:0},is),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+is.left+is.right:this.height+is.top+is.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,as,os),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const hs=ds<this.ticks.length;this._convertTicksToLabels(hs?sample(this.ticks,ds):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),us.display&&(us.autoSkip||us.source==="auto")&&(this.ticks=autoSkip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),hs&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let Mn=this.options.reverse,rs,is;this.isHorizontal()?(rs=this.left,is=this.right):(rs=this.top,is=this.bottom,Mn=!Mn),this._startPixel=rs,this._endPixel=is,this._reversePixels=Mn,this._length=is-rs,this._alignToPixels=this.options.alignToPixels}afterUpdate(){callback(this.options.afterUpdate,[this])}beforeSetDimensions(){callback(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){callback(this.options.afterSetDimensions,[this])}_callHooks(Mn){this.chart.notifyPlugins(Mn,this.getContext()),callback(this.options[Mn],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(Mn){const rs=this.options.ticks;let is,os,as;for(is=0,os=Mn.length;is<os;is++)as=Mn[is],as.label=callback(rs.callback,[as.value,is,Mn],this)}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const Mn=this.options,rs=Mn.ticks,is=getTicksLimit(this.ticks.length,Mn.ticks.maxTicksLimit),os=rs.minRotation||0,as=rs.maxRotation;let us=os,ds,hs,ps;if(!this._isVisible()||!rs.display||os>=as||is<=1||!this.isHorizontal()){this.labelRotation=os;return}const io=this._getLabelSizes(),fo=io.widest.width,mo=io.highest.height,Ao=_limitValue(this.chart.width-fo,0,this.maxWidth);ds=Mn.offset?this.maxWidth/is:Ao/(is-1),fo+6>ds&&(ds=Ao/(is-(Mn.offset?.5:1)),hs=this.maxHeight-getTickMarkLength(Mn.grid)-rs.padding-getTitleHeight(Mn.title,this.chart.options.font),ps=Math.sqrt(fo*fo+mo*mo),us=toDegrees(Math.min(Math.asin(_limitValue((io.highest.height+6)/ds,-1,1)),Math.asin(_limitValue(hs/ps,-1,1))-Math.asin(_limitValue(mo/ps,-1,1)))),us=Math.max(os,Math.min(as,us))),this.labelRotation=us}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const Mn={width:0,height:0},{chart:rs,options:{ticks:is,title:os,grid:as}}=this,us=this._isVisible(),ds=this.isHorizontal();if(us){const hs=getTitleHeight(os,rs.options.font);if(ds?(Mn.width=this.maxWidth,Mn.height=getTickMarkLength(as)+hs):(Mn.height=this.maxHeight,Mn.width=getTickMarkLength(as)+hs),is.display&&this.ticks.length){const{first:ps,last:io,widest:fo,highest:mo}=this._getLabelSizes(),Ao=is.padding*2,$o=toRadians(this.labelRotation),Lo=Math.cos($o),Go=Math.sin($o);if(ds){const Yo=is.mirror?0:Go*fo.width+Lo*mo.height;Mn.height=Math.min(this.maxHeight,Mn.height+Yo+Ao)}else{const Yo=is.mirror?0:Lo*fo.width+Go*mo.height;Mn.width=Math.min(this.maxWidth,Mn.width+Yo+Ao)}this._calculatePadding(ps,io,Go,Lo)}}this._handleMargins(),ds?(this.width=this._length=rs.width-this._margins.left-this._margins.right,this.height=Mn.height):(this.width=Mn.width,this.height=this._length=rs.height-this._margins.top-this._margins.bottom)}_calculatePadding(Mn,rs,is,os){const{ticks:{align:as,padding:us},position:ds}=this.options,hs=this.labelRotation!==0,ps=ds!=="top"&&this.axis==="x";if(this.isHorizontal()){const io=this.getPixelForTick(0)-this.left,fo=this.right-this.getPixelForTick(this.ticks.length-1);let mo=0,Ao=0;hs?ps?(mo=os*Mn.width,Ao=is*rs.height):(mo=is*Mn.height,Ao=os*rs.width):as==="start"?Ao=rs.width:as==="end"?mo=Mn.width:as!=="inner"&&(mo=Mn.width/2,Ao=rs.width/2),this.paddingLeft=Math.max((mo-io+us)*this.width/(this.width-io),0),this.paddingRight=Math.max((Ao-fo+us)*this.width/(this.width-fo),0)}else{let io=rs.height/2,fo=Mn.height/2;as==="start"?(io=0,fo=Mn.height):as==="end"&&(io=rs.height,fo=0),this.paddingTop=io+us,this.paddingBottom=fo+us}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis:Mn,position:rs}=this.options;return rs==="top"||rs==="bottom"||Mn==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(Mn){this.beforeTickToLabelConversion(),this.generateTickLabels(Mn);let rs,is;for(rs=0,is=Mn.length;rs<is;rs++)isNullOrUndef(Mn[rs].label)&&(Mn.splice(rs,1),is--,rs--);this.afterTickToLabelConversion()}_getLabelSizes(){let Mn=this._labelSizes;if(!Mn){const rs=this.options.ticks.sampleSize;let is=this.ticks;rs<is.length&&(is=sample(is,rs)),this._labelSizes=Mn=this._computeLabelSizes(is,is.length,this.options.ticks.maxTicksLimit)}return Mn}_computeLabelSizes(Mn,rs,is){const{ctx:os,_longestTextCache:as}=this,us=[],ds=[],hs=Math.floor(rs/getTicksLimit(rs,is));let ps=0,io=0,fo,mo,Ao,$o,Lo,Go,Yo,Wo,Jo,xl,_l;for(fo=0;fo<rs;fo+=hs){if($o=Mn[fo].label,Lo=this._resolveTickFontOptions(fo),os.font=Go=Lo.string,Yo=as[Go]=as[Go]||{data:{},gc:[]},Wo=Lo.lineHeight,Jo=xl=0,!isNullOrUndef($o)&&!isArray($o))Jo=_measureText(os,Yo.data,Yo.gc,Jo,$o),xl=Wo;else if(isArray($o))for(mo=0,Ao=$o.length;mo<Ao;++mo)_l=$o[mo],!isNullOrUndef(_l)&&!isArray(_l)&&(Jo=_measureText(os,Yo.data,Yo.gc,Jo,_l),xl+=Wo);us.push(Jo),ds.push(xl),ps=Math.max(Jo,ps),io=Math.max(xl,io)}garbageCollect(as,rs);const Tl=us.indexOf(ps),Sl=ds.indexOf(io),$l=Pl=>({width:us[Pl]||0,height:ds[Pl]||0});return{first:$l(0),last:$l(rs-1),widest:$l(Tl),highest:$l(Sl),widths:us,heights:ds}}getLabelForValue(Mn){return Mn}getPixelForValue(Mn,rs){return NaN}getValueForPixel(Mn){}getPixelForTick(Mn){const rs=this.ticks;return Mn<0||Mn>rs.length-1?null:this.getPixelForValue(rs[Mn].value)}getPixelForDecimal(Mn){this._reversePixels&&(Mn=1-Mn);const rs=this._startPixel+Mn*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,rs,0):rs)}getDecimalForPixel(Mn){const rs=(Mn-this._startPixel)/this._length;return this._reversePixels?1-rs:rs}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:Mn,max:rs}=this;return Mn<0&&rs<0?rs:Mn>0&&rs>0?Mn:0}getContext(Mn){const rs=this.ticks||[];if(Mn>=0&&Mn<rs.length){const is=rs[Mn];return is.$context||(is.$context=createTickContext(this.getContext(),Mn,is))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){const Mn=this.options.ticks,rs=toRadians(this.labelRotation),is=Math.abs(Math.cos(rs)),os=Math.abs(Math.sin(rs)),as=this._getLabelSizes(),us=Mn.autoSkipPadding||0,ds=as?as.widest.width+us:0,hs=as?as.highest.height+us:0;return this.isHorizontal()?hs*is>ds*os?ds/is:hs/os:hs*os<ds*is?hs/is:ds/os}_isVisible(){const Mn=this.options.display;return Mn!=="auto"?!!Mn:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(Mn){const rs=this.axis,is=this.chart,os=this.options,{grid:as,position:us,border:ds}=os,hs=as.offset,ps=this.isHorizontal(),fo=this.ticks.length+(hs?1:0),mo=getTickMarkLength(as),Ao=[],$o=ds.setContext(this.getContext()),Lo=$o.display?$o.width:0,Go=Lo/2,Yo=function(Qo){return _alignPixel(is,Qo,Lo)};let Wo,Jo,xl,_l,Tl,Sl,$l,Pl,Dl,Ol,Rl,Vo;if(us==="top")Wo=Yo(this.bottom),Sl=this.bottom-mo,Pl=Wo-Go,Ol=Yo(Mn.top)+Go,Vo=Mn.bottom;else if(us==="bottom")Wo=Yo(this.top),Ol=Mn.top,Vo=Yo(Mn.bottom)-Go,Sl=Wo+Go,Pl=this.top+mo;else if(us==="left")Wo=Yo(this.right),Tl=this.right-mo,$l=Wo-Go,Dl=Yo(Mn.left)+Go,Rl=Mn.right;else if(us==="right")Wo=Yo(this.left),Dl=Mn.left,Rl=Yo(Mn.right)-Go,Tl=Wo+Go,$l=this.left+mo;else if(rs==="x"){if(us==="center")Wo=Yo((Mn.top+Mn.bottom)/2+.5);else if(isObject$1(us)){const Qo=Object.keys(us)[0],El=us[Qo];Wo=Yo(this.chart.scales[Qo].getPixelForValue(El))}Ol=Mn.top,Vo=Mn.bottom,Sl=Wo+Go,Pl=Sl+mo}else if(rs==="y"){if(us==="center")Wo=Yo((Mn.left+Mn.right)/2);else if(isObject$1(us)){const Qo=Object.keys(us)[0],El=us[Qo];Wo=Yo(this.chart.scales[Qo].getPixelForValue(El))}Tl=Wo-Go,$l=Tl-mo,Dl=Mn.left,Rl=Mn.right}const jo=valueOrDefault(os.ticks.maxTicksLimit,fo),Ho=Math.max(1,Math.ceil(fo/jo));for(Jo=0;Jo<fo;Jo+=Ho){const Qo=this.getContext(Jo),El=as.setContext(Qo),Xo=ds.setContext(Qo),Al=El.lineWidth,wl=El.color,yl=Xo.dash||[],Il=Xo.dashOffset,Bl=El.tickWidth,Gl=El.tickColor,Nl=El.tickBorderDash||[],zl=El.tickBorderDashOffset;xl=getPixelForGridLine(this,Jo,hs),xl!==void 0&&(_l=_alignPixel(is,xl,Al),ps?Tl=$l=Dl=Rl=_l:Sl=Pl=Ol=Vo=_l,Ao.push({tx1:Tl,ty1:Sl,tx2:$l,ty2:Pl,x1:Dl,y1:Ol,x2:Rl,y2:Vo,width:Al,color:wl,borderDash:yl,borderDashOffset:Il,tickWidth:Bl,tickColor:Gl,tickBorderDash:Nl,tickBorderDashOffset:zl}))}return this._ticksLength=fo,this._borderValue=Wo,Ao}_computeLabelItems(Mn){const rs=this.axis,is=this.options,{position:os,ticks:as}=is,us=this.isHorizontal(),ds=this.ticks,{align:hs,crossAlign:ps,padding:io,mirror:fo}=as,mo=getTickMarkLength(is.grid),Ao=mo+io,$o=fo?-io:Ao,Lo=-toRadians(this.labelRotation),Go=[];let Yo,Wo,Jo,xl,_l,Tl,Sl,$l,Pl,Dl,Ol,Rl,Vo="middle";if(os==="top")Tl=this.bottom-$o,Sl=this._getXAxisLabelAlignment();else if(os==="bottom")Tl=this.top+$o,Sl=this._getXAxisLabelAlignment();else if(os==="left"){const Ho=this._getYAxisLabelAlignment(mo);Sl=Ho.textAlign,_l=Ho.x}else if(os==="right"){const Ho=this._getYAxisLabelAlignment(mo);Sl=Ho.textAlign,_l=Ho.x}else if(rs==="x"){if(os==="center")Tl=(Mn.top+Mn.bottom)/2+Ao;else if(isObject$1(os)){const Ho=Object.keys(os)[0],Qo=os[Ho];Tl=this.chart.scales[Ho].getPixelForValue(Qo)+Ao}Sl=this._getXAxisLabelAlignment()}else if(rs==="y"){if(os==="center")_l=(Mn.left+Mn.right)/2-Ao;else if(isObject$1(os)){const Ho=Object.keys(os)[0],Qo=os[Ho];_l=this.chart.scales[Ho].getPixelForValue(Qo)}Sl=this._getYAxisLabelAlignment(mo).textAlign}rs==="y"&&(hs==="start"?Vo="top":hs==="end"&&(Vo="bottom"));const jo=this._getLabelSizes();for(Yo=0,Wo=ds.length;Yo<Wo;++Yo){Jo=ds[Yo],xl=Jo.label;const Ho=as.setContext(this.getContext(Yo));$l=this.getPixelForTick(Yo)+as.labelOffset,Pl=this._resolveTickFontOptions(Yo),Dl=Pl.lineHeight,Ol=isArray(xl)?xl.length:1;const Qo=Ol/2,El=Ho.color,Xo=Ho.textStrokeColor,Al=Ho.textStrokeWidth;let wl=Sl;us?(_l=$l,Sl==="inner"&&(Yo===Wo-1?wl=this.options.reverse?"left":"right":Yo===0?wl=this.options.reverse?"right":"left":wl="center"),os==="top"?ps==="near"||Lo!==0?Rl=-Ol*Dl+Dl/2:ps==="center"?Rl=-jo.highest.height/2-Qo*Dl+Dl:Rl=-jo.highest.height+Dl/2:ps==="near"||Lo!==0?Rl=Dl/2:ps==="center"?Rl=jo.highest.height/2-Qo*Dl:Rl=jo.highest.height-Ol*Dl,fo&&(Rl*=-1),Lo!==0&&!Ho.showLabelBackdrop&&(_l+=Dl/2*Math.sin(Lo))):(Tl=$l,Rl=(1-Ol)*Dl/2);let yl;if(Ho.showLabelBackdrop){const Il=toPadding(Ho.backdropPadding),Bl=jo.heights[Yo],Gl=jo.widths[Yo];let Nl=Rl-Il.top,zl=0-Il.left;switch(Vo){case"middle":Nl-=Bl/2;break;case"bottom":Nl-=Bl;break}switch(Sl){case"center":zl-=Gl/2;break;case"right":zl-=Gl;break;case"inner":Yo===Wo-1?zl-=Gl:Yo>0&&(zl-=Gl/2);break}yl={left:zl,top:Nl,width:Gl+Il.width,height:Bl+Il.height,color:Ho.backdropColor}}Go.push({label:xl,font:Pl,textOffset:Rl,options:{rotation:Lo,color:El,strokeColor:Xo,strokeWidth:Al,textAlign:wl,textBaseline:Vo,translation:[_l,Tl],backdrop:yl}})}return Go}_getXAxisLabelAlignment(){const{position:Mn,ticks:rs}=this.options;if(-toRadians(this.labelRotation))return Mn==="top"?"left":"right";let os="center";return rs.align==="start"?os="left":rs.align==="end"?os="right":rs.align==="inner"&&(os="inner"),os}_getYAxisLabelAlignment(Mn){const{position:rs,ticks:{crossAlign:is,mirror:os,padding:as}}=this.options,us=this._getLabelSizes(),ds=Mn+as,hs=us.widest.width;let ps,io;return rs==="left"?os?(io=this.right+as,is==="near"?ps="left":is==="center"?(ps="center",io+=hs/2):(ps="right",io+=hs)):(io=this.right-ds,is==="near"?ps="right":is==="center"?(ps="center",io-=hs/2):(ps="left",io=this.left)):rs==="right"?os?(io=this.left+as,is==="near"?ps="right":is==="center"?(ps="center",io-=hs/2):(ps="left",io-=hs)):(io=this.left+ds,is==="near"?ps="left":is==="center"?(ps="center",io+=hs/2):(ps="right",io=this.right)):ps="right",{textAlign:ps,x:io}}_computeLabelArea(){if(this.options.ticks.mirror)return;const Mn=this.chart,rs=this.options.position;if(rs==="left"||rs==="right")return{top:0,left:this.left,bottom:Mn.height,right:this.right};if(rs==="top"||rs==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:Mn.width}}drawBackground(){const{ctx:Mn,options:{backgroundColor:rs},left:is,top:os,width:as,height:us}=this;rs&&(Mn.save(),Mn.fillStyle=rs,Mn.fillRect(is,os,as,us),Mn.restore())}getLineWidthForValue(Mn){const rs=this.options.grid;if(!this._isVisible()||!rs.display)return 0;const os=this.ticks.findIndex(as=>as.value===Mn);return os>=0?rs.setContext(this.getContext(os)).lineWidth:0}drawGrid(Mn){const rs=this.options.grid,is=this.ctx,os=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(Mn));let as,us;const ds=(hs,ps,io)=>{!io.width||!io.color||(is.save(),is.lineWidth=io.width,is.strokeStyle=io.color,is.setLineDash(io.borderDash||[]),is.lineDashOffset=io.borderDashOffset,is.beginPath(),is.moveTo(hs.x,hs.y),is.lineTo(ps.x,ps.y),is.stroke(),is.restore())};if(rs.display)for(as=0,us=os.length;as<us;++as){const hs=os[as];rs.drawOnChartArea&&ds({x:hs.x1,y:hs.y1},{x:hs.x2,y:hs.y2},hs),rs.drawTicks&&ds({x:hs.tx1,y:hs.ty1},{x:hs.tx2,y:hs.ty2},{color:hs.tickColor,width:hs.tickWidth,borderDash:hs.tickBorderDash,borderDashOffset:hs.tickBorderDashOffset})}}drawBorder(){const{chart:Mn,ctx:rs,options:{border:is,grid:os}}=this,as=is.setContext(this.getContext()),us=is.display?as.width:0;if(!us)return;const ds=os.setContext(this.getContext(0)).lineWidth,hs=this._borderValue;let ps,io,fo,mo;this.isHorizontal()?(ps=_alignPixel(Mn,this.left,us)-us/2,io=_alignPixel(Mn,this.right,ds)+ds/2,fo=mo=hs):(fo=_alignPixel(Mn,this.top,us)-us/2,mo=_alignPixel(Mn,this.bottom,ds)+ds/2,ps=io=hs),rs.save(),rs.lineWidth=as.width,rs.strokeStyle=as.color,rs.beginPath(),rs.moveTo(ps,fo),rs.lineTo(io,mo),rs.stroke(),rs.restore()}drawLabels(Mn){if(!this.options.ticks.display)return;const is=this.ctx,os=this._computeLabelArea();os&&clipArea(is,os);const as=this.getLabelItems(Mn);for(const us of as){const ds=us.options,hs=us.font,ps=us.label,io=us.textOffset;renderText(is,ps,0,io,hs,ds)}os&&unclipArea(is)}drawTitle(){const{ctx:Mn,options:{position:rs,title:is,reverse:os}}=this;if(!is.display)return;const as=toFont(is.font),us=toPadding(is.padding),ds=is.align;let hs=as.lineHeight/2;rs==="bottom"||rs==="center"||isObject$1(rs)?(hs+=us.bottom,isArray(is.text)&&(hs+=as.lineHeight*(is.text.length-1))):hs+=us.top;const{titleX:ps,titleY:io,maxWidth:fo,rotation:mo}=titleArgs(this,hs,rs,ds);renderText(Mn,is.text,0,0,as,{color:is.color,maxWidth:fo,rotation:mo,textAlign:titleAlign(ds,rs,os),textBaseline:"middle",translation:[ps,io]})}draw(Mn){this._isVisible()&&(this.drawBackground(),this.drawGrid(Mn),this.drawBorder(),this.drawTitle(),this.drawLabels(Mn))}_layers(){const Mn=this.options,rs=Mn.ticks&&Mn.ticks.z||0,is=valueOrDefault(Mn.grid&&Mn.grid.z,-1),os=valueOrDefault(Mn.border&&Mn.border.z,0);return!this._isVisible()||this.draw!==Scale.prototype.draw?[{z:rs,draw:as=>{this.draw(as)}}]:[{z:is,draw:as=>{this.drawBackground(),this.drawGrid(as),this.drawTitle()}},{z:os,draw:()=>{this.drawBorder()}},{z:rs,draw:as=>{this.drawLabels(as)}}]}getMatchingVisibleMetas(Mn){const rs=this.chart.getSortedVisibleDatasetMetas(),is=this.axis+"AxisID",os=[];let as,us;for(as=0,us=rs.length;as<us;++as){const ds=rs[as];ds[is]===this.id&&(!Mn||ds.type===Mn)&&os.push(ds)}return os}_resolveTickFontOptions(Mn){const rs=this.options.ticks.setContext(this.getContext(Mn));return toFont(rs.font)}_maxDigits(){const Mn=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/Mn}}class TypedRegistry{constructor(Mn,rs,is){this.type=Mn,this.scope=rs,this.override=is,this.items=Object.create(null)}isForType(Mn){return Object.prototype.isPrototypeOf.call(this.type.prototype,Mn.prototype)}register(Mn){const rs=Object.getPrototypeOf(Mn);let is;isIChartComponent(rs)&&(is=this.register(rs));const os=this.items,as=Mn.id,us=this.scope+"."+as;if(!as)throw new Error("class does not have id: "+Mn);return as in os||(os[as]=Mn,registerDefaults(Mn,us,is),this.override&&defaults.override(Mn.id,Mn.overrides)),us}get(Mn){return this.items[Mn]}unregister(Mn){const rs=this.items,is=Mn.id,os=this.scope;is in rs&&delete rs[is],os&&is in defaults[os]&&(delete defaults[os][is],this.override&&delete overrides[is])}}function registerDefaults(Fn,Mn,rs){const is=merge(Object.create(null),[rs?defaults.get(rs):{},defaults.get(Mn),Fn.defaults]);defaults.set(Mn,is),Fn.defaultRoutes&&routeDefaults(Mn,Fn.defaultRoutes),Fn.descriptors&&defaults.describe(Mn,Fn.descriptors)}function routeDefaults(Fn,Mn){Object.keys(Mn).forEach(rs=>{const is=rs.split("."),os=is.pop(),as=[Fn].concat(is).join("."),us=Mn[rs].split("."),ds=us.pop(),hs=us.join(".");defaults.route(as,os,hs,ds)})}function isIChartComponent(Fn){return"id"in Fn&&"defaults"in Fn}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$1,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...Mn){this._each("register",Mn)}remove(...Mn){this._each("unregister",Mn)}addControllers(...Mn){this._each("register",Mn,this.controllers)}addElements(...Mn){this._each("register",Mn,this.elements)}addPlugins(...Mn){this._each("register",Mn,this.plugins)}addScales(...Mn){this._each("register",Mn,this.scales)}getController(Mn){return this._get(Mn,this.controllers,"controller")}getElement(Mn){return this._get(Mn,this.elements,"element")}getPlugin(Mn){return this._get(Mn,this.plugins,"plugin")}getScale(Mn){return this._get(Mn,this.scales,"scale")}removeControllers(...Mn){this._each("unregister",Mn,this.controllers)}removeElements(...Mn){this._each("unregister",Mn,this.elements)}removePlugins(...Mn){this._each("unregister",Mn,this.plugins)}removeScales(...Mn){this._each("unregister",Mn,this.scales)}_each(Mn,rs,is){[...rs].forEach(os=>{const as=is||this._getRegistryForType(os);is||as.isForType(os)||as===this.plugins&&os.id?this._exec(Mn,as,os):each(os,us=>{const ds=is||this._getRegistryForType(us);this._exec(Mn,ds,us)})})}_exec(Mn,rs,is){const os=_capitalize(Mn);callback(is["before"+os],[],is),rs[Mn](is),callback(is["after"+os],[],is)}_getRegistryForType(Mn){for(let rs=0;rs<this._typedRegistries.length;rs++){const is=this._typedRegistries[rs];if(is.isForType(Mn))return is}return this.plugins}_get(Mn,rs,is){const os=rs.get(Mn);if(os===void 0)throw new Error('"'+Mn+'" is not a registered '+is+".");return os}}var registry=new Registry;class PluginService{constructor(){this._init=[]}notify(Mn,rs,is,os){rs==="beforeInit"&&(this._init=this._createDescriptors(Mn,!0),this._notify(this._init,Mn,"install"));const as=os?this._descriptors(Mn).filter(os):this._descriptors(Mn),us=this._notify(as,Mn,rs,is);return rs==="afterDestroy"&&(this._notify(as,Mn,"stop"),this._notify(this._init,Mn,"uninstall")),us}_notify(Mn,rs,is,os){os=os||{};for(const as of Mn){const us=as.plugin,ds=us[is],hs=[rs,os,as.options];if(callback(ds,hs,us)===!1&&os.cancelable)return!1}return!0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(Mn){if(this._cache)return this._cache;const rs=this._cache=this._createDescriptors(Mn);return this._notifyStateChanges(Mn),rs}_createDescriptors(Mn,rs){const is=Mn&&Mn.config,os=valueOrDefault(is.options&&is.options.plugins,{}),as=allPlugins(is);return os===!1&&!rs?[]:createDescriptors(Mn,as,os,rs)}_notifyStateChanges(Mn){const rs=this._oldCache||[],is=this._cache,os=(as,us)=>as.filter(ds=>!us.some(hs=>ds.plugin.id===hs.plugin.id));this._notify(os(rs,is),Mn,"stop"),this._notify(os(is,rs),Mn,"start")}}function allPlugins(Fn){const Mn={},rs=[],is=Object.keys(registry.plugins.items);for(let as=0;as<is.length;as++)rs.push(registry.getPlugin(is[as]));const os=Fn.plugins||[];for(let as=0;as<os.length;as++){const us=os[as];rs.indexOf(us)===-1&&(rs.push(us),Mn[us.id]=!0)}return{plugins:rs,localIds:Mn}}function getOpts(Fn,Mn){return!Mn&&Fn===!1?null:Fn===!0?{}:Fn}function createDescriptors(Fn,{plugins:Mn,localIds:rs},is,os){const as=[],us=Fn.getContext();for(const ds of Mn){const hs=ds.id,ps=getOpts(is[hs],os);ps!==null&&as.push({plugin:ds,options:pluginOpts(Fn.config,{plugin:ds,local:rs[hs]},ps,us)})}return as}function pluginOpts(Fn,{plugin:Mn,local:rs},is,os){const as=Fn.pluginScopeKeys(Mn),us=Fn.getOptionScopes(is,as);return rs&&Mn.defaults&&us.push(Mn.defaults),Fn.createResolver(us,os,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(Fn,Mn){const rs=defaults.datasets[Fn]||{};return((Mn.datasets||{})[Fn]||{}).indexAxis||Mn.indexAxis||rs.indexAxis||"x"}function getAxisFromDefaultScaleID(Fn,Mn){let rs=Fn;return Fn==="_index_"?rs=Mn:Fn==="_value_"&&(rs=Mn==="x"?"y":"x"),rs}function getDefaultScaleIDFromAxis(Fn,Mn){return Fn===Mn?"_index_":"_value_"}function idMatchesAxis(Fn){if(Fn==="x"||Fn==="y"||Fn==="r")return Fn}function axisFromPosition(Fn){if(Fn==="top"||Fn==="bottom")return"x";if(Fn==="left"||Fn==="right")return"y"}function determineAxis(Fn,...Mn){if(idMatchesAxis(Fn))return Fn;for(const rs of Mn){const is=rs.axis||axisFromPosition(rs.position)||Fn.length>1&&idMatchesAxis(Fn[0].toLowerCase());if(is)return is}throw new Error(`Cannot determine type of '${Fn}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(Fn,Mn,rs){if(rs[Mn+"AxisID"]===Fn)return{axis:Mn}}function retrieveAxisFromDatasets(Fn,Mn){if(Mn.data&&Mn.data.datasets){const rs=Mn.data.datasets.filter(is=>is.xAxisID===Fn||is.yAxisID===Fn);if(rs.length)return getAxisFromDataset(Fn,"x",rs[0])||getAxisFromDataset(Fn,"y",rs[0])}return{}}function mergeScaleConfig(Fn,Mn){const rs=overrides[Fn.type]||{scales:{}},is=Mn.scales||{},os=getIndexAxis(Fn.type,Mn),as=Object.create(null);return Object.keys(is).forEach(us=>{const ds=is[us];if(!isObject$1(ds))return console.error(`Invalid scale configuration for scale: ${us}`);if(ds._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${us}`);const hs=determineAxis(us,ds,retrieveAxisFromDatasets(us,Fn),defaults.scales[ds.type]),ps=getDefaultScaleIDFromAxis(hs,os),io=rs.scales||{};as[us]=mergeIf(Object.create(null),[{axis:hs},ds,io[hs],io[ps]])}),Fn.data.datasets.forEach(us=>{const ds=us.type||Fn.type,hs=us.indexAxis||getIndexAxis(ds,Mn),io=(overrides[ds]||{}).scales||{};Object.keys(io).forEach(fo=>{const mo=getAxisFromDefaultScaleID(fo,hs),Ao=us[mo+"AxisID"]||mo;as[Ao]=as[Ao]||Object.create(null),mergeIf(as[Ao],[{axis:mo},is[Ao],io[fo]])})}),Object.keys(as).forEach(us=>{const ds=as[us];mergeIf(ds,[defaults.scales[ds.type],defaults.scale])}),as}function initOptions(Fn){const Mn=Fn.options||(Fn.options={});Mn.plugins=valueOrDefault(Mn.plugins,{}),Mn.scales=mergeScaleConfig(Fn,Mn)}function initData(Fn){return Fn=Fn||{},Fn.datasets=Fn.datasets||[],Fn.labels=Fn.labels||[],Fn}function initConfig(Fn){return Fn=Fn||{},Fn.data=initData(Fn.data),initOptions(Fn),Fn}const keyCache=new Map,keysCached=new Set;function cachedKeys(Fn,Mn){let rs=keyCache.get(Fn);return rs||(rs=Mn(),keyCache.set(Fn,rs),keysCached.add(rs)),rs}const addIfFound=(Fn,Mn,rs)=>{const is=resolveObjectKey(Mn,rs);is!==void 0&&Fn.add(is)};class Config{constructor(Mn){this._config=initConfig(Mn),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(Mn){this._config.type=Mn}get data(){return this._config.data}set data(Mn){this._config.data=initData(Mn)}get options(){return this._config.options}set options(Mn){this._config.options=Mn}get plugins(){return this._config.plugins}update(){const Mn=this._config;this.clearCache(),initOptions(Mn)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(Mn){return cachedKeys(Mn,()=>[[`datasets.${Mn}`,""]])}datasetAnimationScopeKeys(Mn,rs){return cachedKeys(`${Mn}.transition.${rs}`,()=>[[`datasets.${Mn}.transitions.${rs}`,`transitions.${rs}`],[`datasets.${Mn}`,""]])}datasetElementScopeKeys(Mn,rs){return cachedKeys(`${Mn}-${rs}`,()=>[[`datasets.${Mn}.elements.${rs}`,`datasets.${Mn}`,`elements.${rs}`,""]])}pluginScopeKeys(Mn){const rs=Mn.id,is=this.type;return cachedKeys(`${is}-plugin-${rs}`,()=>[[`plugins.${rs}`,...Mn.additionalOptionScopes||[]]])}_cachedScopes(Mn,rs){const is=this._scopeCache;let os=is.get(Mn);return(!os||rs)&&(os=new Map,is.set(Mn,os)),os}getOptionScopes(Mn,rs,is){const{options:os,type:as}=this,us=this._cachedScopes(Mn,is),ds=us.get(rs);if(ds)return ds;const hs=new Set;rs.forEach(io=>{Mn&&(hs.add(Mn),io.forEach(fo=>addIfFound(hs,Mn,fo))),io.forEach(fo=>addIfFound(hs,os,fo)),io.forEach(fo=>addIfFound(hs,overrides[as]||{},fo)),io.forEach(fo=>addIfFound(hs,defaults,fo)),io.forEach(fo=>addIfFound(hs,descriptors,fo))});const ps=Array.from(hs);return ps.length===0&&ps.push(Object.create(null)),keysCached.has(rs)&&us.set(rs,ps),ps}chartOptionScopes(){const{options:Mn,type:rs}=this;return[Mn,overrides[rs]||{},defaults.datasets[rs]||{},{type:rs},defaults,descriptors]}resolveNamedOptions(Mn,rs,is,os=[""]){const as={$shared:!0},{resolver:us,subPrefixes:ds}=getResolver(this._resolverCache,Mn,os);let hs=us;if(needContext(us,rs)){as.$shared=!1,is=isFunction(is)?is():is;const ps=this.createResolver(Mn,is,ds);hs=_attachContext(us,is,ps)}for(const ps of rs)as[ps]=hs[ps];return as}createResolver(Mn,rs,is=[""],os){const{resolver:as}=getResolver(this._resolverCache,Mn,is);return isObject$1(rs)?_attachContext(as,rs,void 0,os):as}}function getResolver(Fn,Mn,rs){let is=Fn.get(Mn);is||(is=new Map,Fn.set(Mn,is));const os=rs.join();let as=is.get(os);return as||(as={resolver:_createResolver(Mn,rs),subPrefixes:rs.filter(ds=>!ds.toLowerCase().includes("hover"))},is.set(os,as)),as}const hasFunction=Fn=>isObject$1(Fn)&&Object.getOwnPropertyNames(Fn).some(Mn=>isFunction(Fn[Mn]));function needContext(Fn,Mn){const{isScriptable:rs,isIndexable:is}=_descriptors(Fn);for(const os of Mn){const as=rs(os),us=is(os),ds=(us||as)&&Fn[os];if(as&&(isFunction(ds)||hasFunction(ds))||us&&isArray(ds))return!0}return!1}var version="4.4.3";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(Fn,Mn){return Fn==="top"||Fn==="bottom"||KNOWN_POSITIONS.indexOf(Fn)===-1&&Mn==="x"}function compare2Level(Fn,Mn){return function(rs,is){return rs[Fn]===is[Fn]?rs[Mn]-is[Mn]:rs[Fn]-is[Fn]}}function onAnimationsComplete(Fn){const Mn=Fn.chart,rs=Mn.options.animation;Mn.notifyPlugins("afterRender"),callback(rs&&rs.onComplete,[Fn],Mn)}function onAnimationProgress(Fn){const Mn=Fn.chart,rs=Mn.options.animation;callback(rs&&rs.onProgress,[Fn],Mn)}function getCanvas(Fn){return _isDomSupported()&&typeof Fn=="string"?Fn=document.getElementById(Fn):Fn&&Fn.length&&(Fn=Fn[0]),Fn&&Fn.canvas&&(Fn=Fn.canvas),Fn}const instances={},getChart=Fn=>{const Mn=getCanvas(Fn);return Object.values(instances).filter(rs=>rs.canvas===Mn).pop()};function moveNumericKeys(Fn,Mn,rs){const is=Object.keys(Fn);for(const os of is){const as=+os;if(as>=Mn){const us=Fn[os];delete Fn[os],(rs>0||as>Mn)&&(Fn[as+rs]=us)}}}function determineLastEvent(Fn,Mn,rs,is){return!rs||Fn.type==="mouseout"?null:is?Mn:Fn}function getSizeForArea(Fn,Mn,rs){return Fn.options.clip?Fn[rs]:Mn[rs]}function getDatasetArea(Fn,Mn){const{xScale:rs,yScale:is}=Fn;return rs&&is?{left:getSizeForArea(rs,Mn,"left"),right:getSizeForArea(rs,Mn,"right"),top:getSizeForArea(is,Mn,"top"),bottom:getSizeForArea(is,Mn,"bottom")}:Mn}var Fv;let Chart$1=(Fv=class{static register(...Mn){registry.add(...Mn),invalidatePlugins()}static unregister(...Mn){registry.remove(...Mn),invalidatePlugins()}constructor(Mn,rs){const is=this.config=new Config(rs),os=getCanvas(Mn),as=getChart(os);if(as)throw new Error("Canvas is already in use. Chart with ID '"+as.id+"' must be destroyed before the canvas with ID '"+as.canvas.id+"' can be reused.");const us=is.createResolver(is.chartOptionScopes(),this.getContext());this.platform=new(is.platform||_detectPlatform(os)),this.platform.updateConfig(is);const ds=this.platform.acquireContext(os,us.aspectRatio),hs=ds&&ds.canvas,ps=hs&&hs.height,io=hs&&hs.width;if(this.id=uid(),this.ctx=ds,this.canvas=hs,this.width=io,this.height=ps,this._options=us,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce$1(fo=>this.update(fo),us.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,!ds||!hs){console.error("Failed to create chart: can't acquire context from the given item");return}animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:Mn,maintainAspectRatio:rs},width:is,height:os,_aspectRatio:as}=this;return isNullOrUndef(Mn)?rs&&as?as:os?is/os:null:Mn}get data(){return this.config.data}set data(Mn){this.config.data=Mn}get options(){return this._options}set options(Mn){this.config.options=Mn}get registry(){return registry}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(Mn,rs){animator.running(this)?this._resizeBeforeDraw={width:Mn,height:rs}:this._resize(Mn,rs)}_resize(Mn,rs){const is=this.options,os=this.canvas,as=is.maintainAspectRatio&&this.aspectRatio,us=this.platform.getMaximumSize(os,Mn,rs,as),ds=is.devicePixelRatio||this.platform.getDevicePixelRatio(),hs=this.width?"resize":"attach";this.width=us.width,this.height=us.height,this._aspectRatio=this.aspectRatio,retinaScale(this,ds,!0)&&(this.notifyPlugins("resize",{size:us}),callback(is.onResize,[this,us],this),this.attached&&this._doResize(hs)&&this.render())}ensureScalesHaveIDs(){const rs=this.options.scales||{};each(rs,(is,os)=>{is.id=os})}buildOrUpdateScales(){const Mn=this.options,rs=Mn.scales,is=this.scales,os=Object.keys(is).reduce((us,ds)=>(us[ds]=!1,us),{});let as=[];rs&&(as=as.concat(Object.keys(rs).map(us=>{const ds=rs[us],hs=determineAxis(us,ds),ps=hs==="r",io=hs==="x";return{options:ds,dposition:ps?"chartArea":io?"bottom":"left",dtype:ps?"radialLinear":io?"category":"linear"}}))),each(as,us=>{const ds=us.options,hs=ds.id,ps=determineAxis(hs,ds),io=valueOrDefault(ds.type,us.dtype);(ds.position===void 0||positionIsHorizontal(ds.position,ps)!==positionIsHorizontal(us.dposition))&&(ds.position=us.dposition),os[hs]=!0;let fo=null;if(hs in is&&is[hs].type===io)fo=is[hs];else{const mo=registry.getScale(io);fo=new mo({id:hs,type:io,ctx:this.ctx,chart:this}),is[fo.id]=fo}fo.init(ds,Mn)}),each(os,(us,ds)=>{us||delete is[ds]}),each(is,us=>{layouts.configure(this,us,us.options),layouts.addBox(this,us)})}_updateMetasets(){const Mn=this._metasets,rs=this.data.datasets.length,is=Mn.length;if(Mn.sort((os,as)=>os.index-as.index),is>rs){for(let os=rs;os<is;++os)this._destroyDatasetMeta(os);Mn.splice(rs,is-rs)}this._sortedMetasets=Mn.slice(0).sort(compare2Level("order","index"))}_removeUnreferencedMetasets(){const{_metasets:Mn,data:{datasets:rs}}=this;Mn.length>rs.length&&delete this._stacks,Mn.forEach((is,os)=>{rs.filter(as=>as===is._dataset).length===0&&this._destroyDatasetMeta(os)})}buildOrUpdateControllers(){const Mn=[],rs=this.data.datasets;let is,os;for(this._removeUnreferencedMetasets(),is=0,os=rs.length;is<os;is++){const as=rs[is];let us=this.getDatasetMeta(is);const ds=as.type||this.config.type;if(us.type&&us.type!==ds&&(this._destroyDatasetMeta(is),us=this.getDatasetMeta(is)),us.type=ds,us.indexAxis=as.indexAxis||getIndexAxis(ds,this.options),us.order=as.order||0,us.index=is,us.label=""+as.label,us.visible=this.isDatasetVisible(is),us.controller)us.controller.updateIndex(is),us.controller.linkScales();else{const hs=registry.getController(ds),{datasetElementType:ps,dataElementType:io}=defaults.datasets[ds];Object.assign(hs,{dataElementType:registry.getElement(io),datasetElementType:ps&&registry.getElement(ps)}),us.controller=new hs(this,is),Mn.push(us.controller)}}return this._updateMetasets(),Mn}_resetElements(){each(this.data.datasets,(Mn,rs)=>{this.getDatasetMeta(rs).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(Mn){const rs=this.config;rs.update();const is=this._options=rs.createResolver(rs.chartOptionScopes(),this.getContext()),os=this._animationsDisabled=!is.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:Mn,cancelable:!0})===!1)return;const as=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let us=0;for(let ps=0,io=this.data.datasets.length;ps<io;ps++){const{controller:fo}=this.getDatasetMeta(ps),mo=!os&&as.indexOf(fo)===-1;fo.buildOrUpdateElements(mo),us=Math.max(+fo.getMaxOverflow(),us)}us=this._minPadding=is.layout.autoPadding?us:0,this._updateLayout(us),os||each(as,ps=>{ps.reset()}),this._updateDatasets(Mn),this.notifyPlugins("afterUpdate",{mode:Mn}),this._layers.sort(compare2Level("z","_idx"));const{_active:ds,_lastEvent:hs}=this;hs?this._eventHandler(hs,!0):ds.length&&this._updateHoverStyles(ds,ds,!0),this.render()}_updateScales(){each(this.scales,Mn=>{layouts.removeBox(this,Mn)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const Mn=this.options,rs=new Set(Object.keys(this._listeners)),is=new Set(Mn.events);(!setsEqual(rs,is)||!!this._responsiveListeners!==Mn.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:Mn}=this,rs=this._getUniformDataChanges()||[];for(const{method:is,start:os,count:as}of rs){const us=is==="_removeElements"?-as:as;moveNumericKeys(Mn,os,us)}}_getUniformDataChanges(){const Mn=this._dataChanges;if(!Mn||!Mn.length)return;this._dataChanges=[];const rs=this.data.datasets.length,is=as=>new Set(Mn.filter(us=>us[0]===as).map((us,ds)=>ds+","+us.splice(1).join(","))),os=is(0);for(let as=1;as<rs;as++)if(!setsEqual(os,is(as)))return;return Array.from(os).map(as=>as.split(",")).map(as=>({method:as[1],start:+as[2],count:+as[3]}))}_updateLayout(Mn){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;layouts.update(this,this.width,this.height,Mn);const rs=this.chartArea,is=rs.width<=0||rs.height<=0;this._layers=[],each(this.boxes,os=>{is&&os.position==="chartArea"||(os.configure&&os.configure(),this._layers.push(...os._layers()))},this),this._layers.forEach((os,as)=>{os._idx=as}),this.notifyPlugins("afterLayout")}_updateDatasets(Mn){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:Mn,cancelable:!0})!==!1){for(let rs=0,is=this.data.datasets.length;rs<is;++rs)this.getDatasetMeta(rs).controller.configure();for(let rs=0,is=this.data.datasets.length;rs<is;++rs)this._updateDataset(rs,isFunction(Mn)?Mn({datasetIndex:rs}):Mn);this.notifyPlugins("afterDatasetsUpdate",{mode:Mn})}}_updateDataset(Mn,rs){const is=this.getDatasetMeta(Mn),os={meta:is,index:Mn,mode:rs,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",os)!==!1&&(is.controller._update(rs),os.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",os))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})))}draw(){let Mn;if(this._resizeBeforeDraw){const{width:is,height:os}=this._resizeBeforeDraw;this._resize(is,os),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const rs=this._layers;for(Mn=0;Mn<rs.length&&rs[Mn].z<=0;++Mn)rs[Mn].draw(this.chartArea);for(this._drawDatasets();Mn<rs.length;++Mn)rs[Mn].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(Mn){const rs=this._sortedMetasets,is=[];let os,as;for(os=0,as=rs.length;os<as;++os){const us=rs[os];(!Mn||us.visible)&&is.push(us)}return is}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const Mn=this.getSortedVisibleDatasetMetas();for(let rs=Mn.length-1;rs>=0;--rs)this._drawDataset(Mn[rs]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(Mn){const rs=this.ctx,is=Mn._clip,os=!is.disabled,as=getDatasetArea(Mn,this.chartArea),us={meta:Mn,index:Mn.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",us)!==!1&&(os&&clipArea(rs,{left:is.left===!1?0:as.left-is.left,right:is.right===!1?this.width:as.right+is.right,top:is.top===!1?0:as.top-is.top,bottom:is.bottom===!1?this.height:as.bottom+is.bottom}),Mn.controller.draw(),os&&unclipArea(rs),us.cancelable=!1,this.notifyPlugins("afterDatasetDraw",us))}isPointInArea(Mn){return _isPointInArea(Mn,this.chartArea,this._minPadding)}getElementsAtEventForMode(Mn,rs,is,os){const as=Interaction.modes[rs];return typeof as=="function"?as(this,Mn,is,os):[]}getDatasetMeta(Mn){const rs=this.data.datasets[Mn],is=this._metasets;let os=is.filter(as=>as&&as._dataset===rs).pop();return os||(os={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:rs&&rs.order||0,index:Mn,_dataset:rs,_parsed:[],_sorted:!1},is.push(os)),os}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(Mn){const rs=this.data.datasets[Mn];if(!rs)return!1;const is=this.getDatasetMeta(Mn);return typeof is.hidden=="boolean"?!is.hidden:!rs.hidden}setDatasetVisibility(Mn,rs){const is=this.getDatasetMeta(Mn);is.hidden=!rs}toggleDataVisibility(Mn){this._hiddenIndices[Mn]=!this._hiddenIndices[Mn]}getDataVisibility(Mn){return!this._hiddenIndices[Mn]}_updateVisibility(Mn,rs,is){const os=is?"show":"hide",as=this.getDatasetMeta(Mn),us=as.controller._resolveAnimations(void 0,os);defined(rs)?(as.data[rs].hidden=!is,this.update()):(this.setDatasetVisibility(Mn,is),us.update(as,{visible:is}),this.update(ds=>ds.datasetIndex===Mn?os:void 0))}hide(Mn,rs){this._updateVisibility(Mn,rs,!1)}show(Mn,rs){this._updateVisibility(Mn,rs,!0)}_destroyDatasetMeta(Mn){const rs=this._metasets[Mn];rs&&rs.controller&&rs.controller._destroy(),delete this._metasets[Mn]}_stop(){let Mn,rs;for(this.stop(),animator.remove(this),Mn=0,rs=this.data.datasets.length;Mn<rs;++Mn)this._destroyDatasetMeta(Mn)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:Mn,ctx:rs}=this;this._stop(),this.config.clearCache(),Mn&&(this.unbindEvents(),clearCanvas(Mn,rs),this.platform.releaseContext(rs),this.canvas=null,this.ctx=null),delete instances[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...Mn){return this.canvas.toDataURL(...Mn)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const Mn=this._listeners,rs=this.platform,is=(as,us)=>{rs.addEventListener(this,as,us),Mn[as]=us},os=(as,us,ds)=>{as.offsetX=us,as.offsetY=ds,this._eventHandler(as)};each(this.options.events,as=>is(as,os))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const Mn=this._responsiveListeners,rs=this.platform,is=(hs,ps)=>{rs.addEventListener(this,hs,ps),Mn[hs]=ps},os=(hs,ps)=>{Mn[hs]&&(rs.removeEventListener(this,hs,ps),delete Mn[hs])},as=(hs,ps)=>{this.canvas&&this.resize(hs,ps)};let us;const ds=()=>{os("attach",ds),this.attached=!0,this.resize(),is("resize",as),is("detach",us)};us=()=>{this.attached=!1,os("resize",as),this._stop(),this._resize(0,0),is("attach",ds)},rs.isAttached(this.canvas)?ds():us()}unbindEvents(){each(this._listeners,(Mn,rs)=>{this.platform.removeEventListener(this,rs,Mn)}),this._listeners={},each(this._responsiveListeners,(Mn,rs)=>{this.platform.removeEventListener(this,rs,Mn)}),this._responsiveListeners=void 0}updateHoverStyle(Mn,rs,is){const os=is?"set":"remove";let as,us,ds,hs;for(rs==="dataset"&&(as=this.getDatasetMeta(Mn[0].datasetIndex),as.controller["_"+os+"DatasetHoverStyle"]()),ds=0,hs=Mn.length;ds<hs;++ds){us=Mn[ds];const ps=us&&this.getDatasetMeta(us.datasetIndex).controller;ps&&ps[os+"HoverStyle"](us.element,us.datasetIndex,us.index)}}getActiveElements(){return this._active||[]}setActiveElements(Mn){const rs=this._active||[],is=Mn.map(({datasetIndex:as,index:us})=>{const ds=this.getDatasetMeta(as);if(!ds)throw new Error("No dataset found at index "+as);return{datasetIndex:as,element:ds.data[us],index:us}});!_elementsEqual(is,rs)&&(this._active=is,this._lastEvent=null,this._updateHoverStyles(is,rs))}notifyPlugins(Mn,rs,is){return this._plugins.notify(this,Mn,rs,is)}isPluginEnabled(Mn){return this._plugins._cache.filter(rs=>rs.plugin.id===Mn).length===1}_updateHoverStyles(Mn,rs,is){const os=this.options.hover,as=(hs,ps)=>hs.filter(io=>!ps.some(fo=>io.datasetIndex===fo.datasetIndex&&io.index===fo.index)),us=as(rs,Mn),ds=is?Mn:as(Mn,rs);us.length&&this.updateHoverStyle(us,os.mode,!1),ds.length&&os.mode&&this.updateHoverStyle(ds,os.mode,!0)}_eventHandler(Mn,rs){const is={event:Mn,replay:rs,cancelable:!0,inChartArea:this.isPointInArea(Mn)},os=us=>(us.options.events||this.options.events).includes(Mn.native.type);if(this.notifyPlugins("beforeEvent",is,os)===!1)return;const as=this._handleEvent(Mn,rs,is.inChartArea);return is.cancelable=!1,this.notifyPlugins("afterEvent",is,os),(as||is.changed)&&this.render(),this}_handleEvent(Mn,rs,is){const{_active:os=[],options:as}=this,us=rs,ds=this._getActiveElements(Mn,os,is,us),hs=_isClickEvent(Mn),ps=determineLastEvent(Mn,this._lastEvent,is,hs);is&&(this._lastEvent=null,callback(as.onHover,[Mn,ds,this],this),hs&&callback(as.onClick,[Mn,ds,this],this));const io=!_elementsEqual(ds,os);return(io||rs)&&(this._active=ds,this._updateHoverStyles(ds,os,rs)),this._lastEvent=ps,io}_getActiveElements(Mn,rs,is,os){if(Mn.type==="mouseout")return[];if(!is)return rs;const as=this.options.hover;return this.getElementsAtEventForMode(Mn,as.mode,as,os)}},_m(Fv,"defaults",defaults),_m(Fv,"instances",instances),_m(Fv,"overrides",overrides),_m(Fv,"registry",registry),_m(Fv,"version",version),_m(Fv,"getChart",getChart),Fv);function invalidatePlugins(){return each(Chart$1.instances,Fn=>Fn._plugins.invalidate())}function getBarBounds(Fn,Mn){const{x:rs,y:is,base:os,width:as,height:us}=Fn.getProps(["x","y","base","width","height"],Mn);let ds,hs,ps,io,fo;return Fn.horizontal?(fo=us/2,ds=Math.min(rs,os),hs=Math.max(rs,os),ps=is-fo,io=is+fo):(fo=as/2,ds=rs-fo,hs=rs+fo,ps=Math.min(is,os),io=Math.max(is,os)),{left:ds,top:ps,right:hs,bottom:io}}function skipOrLimit(Fn,Mn,rs,is){return Fn?0:_limitValue(Mn,rs,is)}function parseBorderWidth(Fn,Mn,rs){const is=Fn.options.borderWidth,os=Fn.borderSkipped,as=toTRBL(is);return{t:skipOrLimit(os.top,as.top,0,rs),r:skipOrLimit(os.right,as.right,0,Mn),b:skipOrLimit(os.bottom,as.bottom,0,rs),l:skipOrLimit(os.left,as.left,0,Mn)}}function parseBorderRadius(Fn,Mn,rs){const{enableBorderRadius:is}=Fn.getProps(["enableBorderRadius"]),os=Fn.options.borderRadius,as=toTRBLCorners(os),us=Math.min(Mn,rs),ds=Fn.borderSkipped,hs=is||isObject$1(os);return{topLeft:skipOrLimit(!hs||ds.top||ds.left,as.topLeft,0,us),topRight:skipOrLimit(!hs||ds.top||ds.right,as.topRight,0,us),bottomLeft:skipOrLimit(!hs||ds.bottom||ds.left,as.bottomLeft,0,us),bottomRight:skipOrLimit(!hs||ds.bottom||ds.right,as.bottomRight,0,us)}}function boundingRects(Fn){const Mn=getBarBounds(Fn),rs=Mn.right-Mn.left,is=Mn.bottom-Mn.top,os=parseBorderWidth(Fn,rs/2,is/2),as=parseBorderRadius(Fn,rs/2,is/2);return{outer:{x:Mn.left,y:Mn.top,w:rs,h:is,radius:as},inner:{x:Mn.left+os.l,y:Mn.top+os.t,w:rs-os.l-os.r,h:is-os.t-os.b,radius:{topLeft:Math.max(0,as.topLeft-Math.max(os.t,os.l)),topRight:Math.max(0,as.topRight-Math.max(os.t,os.r)),bottomLeft:Math.max(0,as.bottomLeft-Math.max(os.b,os.l)),bottomRight:Math.max(0,as.bottomRight-Math.max(os.b,os.r))}}}}function inRange(Fn,Mn,rs,is){const os=Mn===null,as=rs===null,ds=Fn&&!(os&&as)&&getBarBounds(Fn,is);return ds&&(os||_isBetween(Mn,ds.left,ds.right))&&(as||_isBetween(rs,ds.top,ds.bottom))}function hasRadius(Fn){return Fn.topLeft||Fn.topRight||Fn.bottomLeft||Fn.bottomRight}function addNormalRectPath(Fn,Mn){Fn.rect(Mn.x,Mn.y,Mn.w,Mn.h)}function inflateRect(Fn,Mn,rs={}){const is=Fn.x!==rs.x?-Mn:0,os=Fn.y!==rs.y?-Mn:0,as=(Fn.x+Fn.w!==rs.x+rs.w?Mn:0)-is,us=(Fn.y+Fn.h!==rs.y+rs.h?Mn:0)-os;return{x:Fn.x+is,y:Fn.y+os,w:Fn.w+as,h:Fn.h+us,radius:Fn.radius}}class BarElement extends Element$1{constructor(Mn){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,Mn&&Object.assign(this,Mn)}draw(Mn){const{inflateAmount:rs,options:{borderColor:is,backgroundColor:os}}=this,{inner:as,outer:us}=boundingRects(this),ds=hasRadius(us.radius)?addRoundedRectPath:addNormalRectPath;Mn.save(),(us.w!==as.w||us.h!==as.h)&&(Mn.beginPath(),ds(Mn,inflateRect(us,rs,as)),Mn.clip(),ds(Mn,inflateRect(as,-rs,us)),Mn.fillStyle=is,Mn.fill("evenodd")),Mn.beginPath(),ds(Mn,inflateRect(as,rs)),Mn.fillStyle=os,Mn.fill(),Mn.restore()}inRange(Mn,rs,is){return inRange(this,Mn,rs,is)}inXRange(Mn,rs){return inRange(this,Mn,null,rs)}inYRange(Mn,rs){return inRange(this,null,Mn,rs)}getCenterPoint(Mn){const{x:rs,y:is,base:os,horizontal:as}=this.getProps(["x","y","base","horizontal"],Mn);return{x:as?(rs+os)/2:rs,y:as?is:(is+os)/2}}getRange(Mn){return Mn==="x"?this.width/2:this.height/2}}_m(BarElement,"id","bar"),_m(BarElement,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),_m(BarElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const getBoxSize=(Fn,Mn)=>{let{boxHeight:rs=Mn,boxWidth:is=Mn}=Fn;return Fn.usePointStyle&&(rs=Math.min(rs,Mn),is=Fn.pointStyleWidth||Math.min(is,Mn)),{boxWidth:is,boxHeight:rs,itemHeight:Math.max(Mn,rs)}},itemsEqual=(Fn,Mn)=>Fn!==null&&Mn!==null&&Fn.datasetIndex===Mn.datasetIndex&&Fn.index===Mn.index;class Legend extends Element$1{constructor(Mn){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=Mn.chart,this.options=Mn.options,this.ctx=Mn.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(Mn,rs,is){this.maxWidth=Mn,this.maxHeight=rs,this._margins=is,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const Mn=this.options.labels||{};let rs=callback(Mn.generateLabels,[this.chart],this)||[];Mn.filter&&(rs=rs.filter(is=>Mn.filter(is,this.chart.data))),Mn.sort&&(rs=rs.sort((is,os)=>Mn.sort(is,os,this.chart.data))),this.options.reverse&&rs.reverse(),this.legendItems=rs}fit(){const{options:Mn,ctx:rs}=this;if(!Mn.display){this.width=this.height=0;return}const is=Mn.labels,os=toFont(is.font),as=os.size,us=this._computeTitleHeight(),{boxWidth:ds,itemHeight:hs}=getBoxSize(is,as);let ps,io;rs.font=os.string,this.isHorizontal()?(ps=this.maxWidth,io=this._fitRows(us,as,ds,hs)+10):(io=this.maxHeight,ps=this._fitCols(us,os,ds,hs)+10),this.width=Math.min(ps,Mn.maxWidth||this.maxWidth),this.height=Math.min(io,Mn.maxHeight||this.maxHeight)}_fitRows(Mn,rs,is,os){const{ctx:as,maxWidth:us,options:{labels:{padding:ds}}}=this,hs=this.legendHitBoxes=[],ps=this.lineWidths=[0],io=os+ds;let fo=Mn;as.textAlign="left",as.textBaseline="middle";let mo=-1,Ao=-io;return this.legendItems.forEach(($o,Lo)=>{const Go=is+rs/2+as.measureText($o.text).width;(Lo===0||ps[ps.length-1]+Go+2*ds>us)&&(fo+=io,ps[ps.length-(Lo>0?0:1)]=0,Ao+=io,mo++),hs[Lo]={left:0,top:Ao,row:mo,width:Go,height:os},ps[ps.length-1]+=Go+ds}),fo}_fitCols(Mn,rs,is,os){const{ctx:as,maxHeight:us,options:{labels:{padding:ds}}}=this,hs=this.legendHitBoxes=[],ps=this.columnSizes=[],io=us-Mn;let fo=ds,mo=0,Ao=0,$o=0,Lo=0;return this.legendItems.forEach((Go,Yo)=>{const{itemWidth:Wo,itemHeight:Jo}=calculateItemSize(is,rs,as,Go,os);Yo>0&&Ao+Jo+2*ds>io&&(fo+=mo+ds,ps.push({width:mo,height:Ao}),$o+=mo+ds,Lo++,mo=Ao=0),hs[Yo]={left:$o,top:Ao,col:Lo,width:Wo,height:Jo},mo=Math.max(mo,Wo),Ao+=Jo+ds}),fo+=mo,ps.push({width:mo,height:Ao}),fo}adjustHitBoxes(){if(!this.options.display)return;const Mn=this._computeTitleHeight(),{legendHitBoxes:rs,options:{align:is,labels:{padding:os},rtl:as}}=this,us=getRtlAdapter(as,this.left,this.width);if(this.isHorizontal()){let ds=0,hs=_alignStartEnd(is,this.left+os,this.right-this.lineWidths[ds]);for(const ps of rs)ds!==ps.row&&(ds=ps.row,hs=_alignStartEnd(is,this.left+os,this.right-this.lineWidths[ds])),ps.top+=this.top+Mn+os,ps.left=us.leftForLtr(us.x(hs),ps.width),hs+=ps.width+os}else{let ds=0,hs=_alignStartEnd(is,this.top+Mn+os,this.bottom-this.columnSizes[ds].height);for(const ps of rs)ps.col!==ds&&(ds=ps.col,hs=_alignStartEnd(is,this.top+Mn+os,this.bottom-this.columnSizes[ds].height)),ps.top=hs,ps.left+=this.left+os,ps.left=us.leftForLtr(us.x(ps.left),ps.width),hs+=ps.height+os}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const Mn=this.ctx;clipArea(Mn,this),this._draw(),unclipArea(Mn)}}_draw(){const{options:Mn,columnSizes:rs,lineWidths:is,ctx:os}=this,{align:as,labels:us}=Mn,ds=defaults.color,hs=getRtlAdapter(Mn.rtl,this.left,this.width),ps=toFont(us.font),{padding:io}=us,fo=ps.size,mo=fo/2;let Ao;this.drawTitle(),os.textAlign=hs.textAlign("left"),os.textBaseline="middle",os.lineWidth=.5,os.font=ps.string;const{boxWidth:$o,boxHeight:Lo,itemHeight:Go}=getBoxSize(us,fo),Yo=function(Tl,Sl,$l){if(isNaN($o)||$o<=0||isNaN(Lo)||Lo<0)return;os.save();const Pl=valueOrDefault($l.lineWidth,1);if(os.fillStyle=valueOrDefault($l.fillStyle,ds),os.lineCap=valueOrDefault($l.lineCap,"butt"),os.lineDashOffset=valueOrDefault($l.lineDashOffset,0),os.lineJoin=valueOrDefault($l.lineJoin,"miter"),os.lineWidth=Pl,os.strokeStyle=valueOrDefault($l.strokeStyle,ds),os.setLineDash(valueOrDefault($l.lineDash,[])),us.usePointStyle){const Dl={radius:Lo*Math.SQRT2/2,pointStyle:$l.pointStyle,rotation:$l.rotation,borderWidth:Pl},Ol=hs.xPlus(Tl,$o/2),Rl=Sl+mo;drawPointLegend(os,Dl,Ol,Rl,us.pointStyleWidth&&$o)}else{const Dl=Sl+Math.max((fo-Lo)/2,0),Ol=hs.leftForLtr(Tl,$o),Rl=toTRBLCorners($l.borderRadius);os.beginPath(),Object.values(Rl).some(Vo=>Vo!==0)?addRoundedRectPath(os,{x:Ol,y:Dl,w:$o,h:Lo,radius:Rl}):os.rect(Ol,Dl,$o,Lo),os.fill(),Pl!==0&&os.stroke()}os.restore()},Wo=function(Tl,Sl,$l){renderText(os,$l.text,Tl,Sl+Go/2,ps,{strikethrough:$l.hidden,textAlign:hs.textAlign($l.textAlign)})},Jo=this.isHorizontal(),xl=this._computeTitleHeight();Jo?Ao={x:_alignStartEnd(as,this.left+io,this.right-is[0]),y:this.top+io+xl,line:0}:Ao={x:this.left+io,y:_alignStartEnd(as,this.top+xl+io,this.bottom-rs[0].height),line:0},overrideTextDirection(this.ctx,Mn.textDirection);const _l=Go+io;this.legendItems.forEach((Tl,Sl)=>{os.strokeStyle=Tl.fontColor,os.fillStyle=Tl.fontColor;const $l=os.measureText(Tl.text).width,Pl=hs.textAlign(Tl.textAlign||(Tl.textAlign=us.textAlign)),Dl=$o+mo+$l;let Ol=Ao.x,Rl=Ao.y;hs.setWidth(this.width),Jo?Sl>0&&Ol+Dl+io>this.right&&(Rl=Ao.y+=_l,Ao.line++,Ol=Ao.x=_alignStartEnd(as,this.left+io,this.right-is[Ao.line])):Sl>0&&Rl+_l>this.bottom&&(Ol=Ao.x=Ol+rs[Ao.line].width+io,Ao.line++,Rl=Ao.y=_alignStartEnd(as,this.top+xl+io,this.bottom-rs[Ao.line].height));const Vo=hs.x(Ol);if(Yo(Vo,Rl,Tl),Ol=_textX(Pl,Ol+$o+mo,Jo?Ol+Dl:this.right,Mn.rtl),Wo(hs.x(Ol),Rl,Tl),Jo)Ao.x+=Dl+io;else if(typeof Tl.text!="string"){const jo=ps.lineHeight;Ao.y+=calculateLegendItemHeight(Tl,jo)+io}else Ao.y+=_l}),restoreTextDirection(this.ctx,Mn.textDirection)}drawTitle(){const Mn=this.options,rs=Mn.title,is=toFont(rs.font),os=toPadding(rs.padding);if(!rs.display)return;const as=getRtlAdapter(Mn.rtl,this.left,this.width),us=this.ctx,ds=rs.position,hs=is.size/2,ps=os.top+hs;let io,fo=this.left,mo=this.width;if(this.isHorizontal())mo=Math.max(...this.lineWidths),io=this.top+ps,fo=_alignStartEnd(Mn.align,fo,this.right-mo);else{const $o=this.columnSizes.reduce((Lo,Go)=>Math.max(Lo,Go.height),0);io=ps+_alignStartEnd(Mn.align,this.top,this.bottom-$o-Mn.labels.padding-this._computeTitleHeight())}const Ao=_alignStartEnd(ds,fo,fo+mo);us.textAlign=as.textAlign(_toLeftRightCenter(ds)),us.textBaseline="middle",us.strokeStyle=rs.color,us.fillStyle=rs.color,us.font=is.string,renderText(us,rs.text,Ao,io,is)}_computeTitleHeight(){const Mn=this.options.title,rs=toFont(Mn.font),is=toPadding(Mn.padding);return Mn.display?rs.lineHeight+is.height:0}_getLegendItemAt(Mn,rs){let is,os,as;if(_isBetween(Mn,this.left,this.right)&&_isBetween(rs,this.top,this.bottom)){for(as=this.legendHitBoxes,is=0;is<as.length;++is)if(os=as[is],_isBetween(Mn,os.left,os.left+os.width)&&_isBetween(rs,os.top,os.top+os.height))return this.legendItems[is]}return null}handleEvent(Mn){const rs=this.options;if(!isListened(Mn.type,rs))return;const is=this._getLegendItemAt(Mn.x,Mn.y);if(Mn.type==="mousemove"||Mn.type==="mouseout"){const os=this._hoveredItem,as=itemsEqual(os,is);os&&!as&&callback(rs.onLeave,[Mn,os,this],this),this._hoveredItem=is,is&&!as&&callback(rs.onHover,[Mn,is,this],this)}else is&&callback(rs.onClick,[Mn,is,this],this)}}function calculateItemSize(Fn,Mn,rs,is,os){const as=calculateItemWidth(is,Fn,Mn,rs),us=calculateItemHeight(os,is,Mn.lineHeight);return{itemWidth:as,itemHeight:us}}function calculateItemWidth(Fn,Mn,rs,is){let os=Fn.text;return os&&typeof os!="string"&&(os=os.reduce((as,us)=>as.length>us.length?as:us)),Mn+rs.size/2+is.measureText(os).width}function calculateItemHeight(Fn,Mn,rs){let is=Fn;return typeof Mn.text!="string"&&(is=calculateLegendItemHeight(Mn,rs)),is}function calculateLegendItemHeight(Fn,Mn){const rs=Fn.text?Fn.text.length:0;return Mn*rs}function isListened(Fn,Mn){return!!((Fn==="mousemove"||Fn==="mouseout")&&(Mn.onHover||Mn.onLeave)||Mn.onClick&&(Fn==="click"||Fn==="mouseup"))}var plugin_legend={id:"legend",_element:Legend,start(Fn,Mn,rs){const is=Fn.legend=new Legend({ctx:Fn.ctx,options:rs,chart:Fn});layouts.configure(Fn,is,rs),layouts.addBox(Fn,is)},stop(Fn){layouts.removeBox(Fn,Fn.legend),delete Fn.legend},beforeUpdate(Fn,Mn,rs){const is=Fn.legend;layouts.configure(Fn,is,rs),is.options=rs},afterUpdate(Fn){const Mn=Fn.legend;Mn.buildLabels(),Mn.adjustHitBoxes()},afterEvent(Fn,Mn){Mn.replay||Fn.legend.handleEvent(Mn.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(Fn,Mn,rs){const is=Mn.datasetIndex,os=rs.chart;os.isDatasetVisible(is)?(os.hide(is),Mn.hidden=!0):(os.show(is),Mn.hidden=!1)},onHover:null,onLeave:null,labels:{color:Fn=>Fn.chart.options.color,boxWidth:40,padding:10,generateLabels(Fn){const Mn=Fn.data.datasets,{labels:{usePointStyle:rs,pointStyle:is,textAlign:os,color:as,useBorderRadius:us,borderRadius:ds}}=Fn.legend.options;return Fn._getSortedDatasetMetas().map(hs=>{const ps=hs.controller.getStyle(rs?0:void 0),io=toPadding(ps.borderWidth);return{text:Mn[hs.index].label,fillStyle:ps.backgroundColor,fontColor:as,hidden:!hs.visible,lineCap:ps.borderCapStyle,lineDash:ps.borderDash,lineDashOffset:ps.borderDashOffset,lineJoin:ps.borderJoinStyle,lineWidth:(io.width+io.height)/4,strokeStyle:ps.borderColor,pointStyle:is||ps.pointStyle,rotation:ps.rotation,textAlign:os||ps.textAlign,borderRadius:us&&(ds||ps.borderRadius),datasetIndex:hs.index}},this)}},title:{color:Fn=>Fn.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:Fn=>!Fn.startsWith("on"),labels:{_scriptable:Fn=>!["generateLabels","filter","sort"].includes(Fn)}}};class Title extends Element$1{constructor(Mn){super(),this.chart=Mn.chart,this.options=Mn.options,this.ctx=Mn.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(Mn,rs){const is=this.options;if(this.left=0,this.top=0,!is.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=Mn,this.height=this.bottom=rs;const os=isArray(is.text)?is.text.length:1;this._padding=toPadding(is.padding);const as=os*toFont(is.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=as:this.width=as}isHorizontal(){const Mn=this.options.position;return Mn==="top"||Mn==="bottom"}_drawArgs(Mn){const{top:rs,left:is,bottom:os,right:as,options:us}=this,ds=us.align;let hs=0,ps,io,fo;return this.isHorizontal()?(io=_alignStartEnd(ds,is,as),fo=rs+Mn,ps=as-is):(us.position==="left"?(io=is+Mn,fo=_alignStartEnd(ds,os,rs),hs=PI*-.5):(io=as-Mn,fo=_alignStartEnd(ds,rs,os),hs=PI*.5),ps=os-rs),{titleX:io,titleY:fo,maxWidth:ps,rotation:hs}}draw(){const Mn=this.ctx,rs=this.options;if(!rs.display)return;const is=toFont(rs.font),as=is.lineHeight/2+this._padding.top,{titleX:us,titleY:ds,maxWidth:hs,rotation:ps}=this._drawArgs(as);renderText(Mn,rs.text,0,0,is,{color:rs.color,maxWidth:hs,rotation:ps,textAlign:_toLeftRightCenter(rs.align),textBaseline:"middle",translation:[us,ds]})}}function createTitle(Fn,Mn){const rs=new Title({ctx:Fn.ctx,options:Mn,chart:Fn});layouts.configure(Fn,rs,Mn),layouts.addBox(Fn,rs),Fn.titleBlock=rs}var plugin_title={id:"title",_element:Title,start(Fn,Mn,rs){createTitle(Fn,rs)},stop(Fn){const Mn=Fn.titleBlock;layouts.removeBox(Fn,Mn),delete Fn.titleBlock},beforeUpdate(Fn,Mn,rs){const is=Fn.titleBlock;layouts.configure(Fn,is,rs),is.options=rs},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const positioners={average(Fn){if(!Fn.length)return!1;let Mn,rs,is=new Set,os=0,as=0;for(Mn=0,rs=Fn.length;Mn<rs;++Mn){const ds=Fn[Mn].element;if(ds&&ds.hasValue()){const hs=ds.tooltipPosition();is.add(hs.x),os+=hs.y,++as}}return{x:[...is].reduce((ds,hs)=>ds+hs)/is.size,y:os/as}},nearest(Fn,Mn){if(!Fn.length)return!1;let rs=Mn.x,is=Mn.y,os=Number.POSITIVE_INFINITY,as,us,ds;for(as=0,us=Fn.length;as<us;++as){const hs=Fn[as].element;if(hs&&hs.hasValue()){const ps=hs.getCenterPoint(),io=distanceBetweenPoints(Mn,ps);io<os&&(os=io,ds=hs)}}if(ds){const hs=ds.tooltipPosition();rs=hs.x,is=hs.y}return{x:rs,y:is}}};function pushOrConcat(Fn,Mn){return Mn&&(isArray(Mn)?Array.prototype.push.apply(Fn,Mn):Fn.push(Mn)),Fn}function splitNewlines(Fn){return(typeof Fn=="string"||Fn instanceof String)&&Fn.indexOf(`
`)>-1?Fn.split(`
`):Fn}function createTooltipItem(Fn,Mn){const{element:rs,datasetIndex:is,index:os}=Mn,as=Fn.getDatasetMeta(is).controller,{label:us,value:ds}=as.getLabelAndValue(os);return{chart:Fn,label:us,parsed:as.getParsed(os),raw:Fn.data.datasets[is].data[os],formattedValue:ds,dataset:as.getDataset(),dataIndex:os,datasetIndex:is,element:rs}}function getTooltipSize(Fn,Mn){const rs=Fn.chart.ctx,{body:is,footer:os,title:as}=Fn,{boxWidth:us,boxHeight:ds}=Mn,hs=toFont(Mn.bodyFont),ps=toFont(Mn.titleFont),io=toFont(Mn.footerFont),fo=as.length,mo=os.length,Ao=is.length,$o=toPadding(Mn.padding);let Lo=$o.height,Go=0,Yo=is.reduce((xl,_l)=>xl+_l.before.length+_l.lines.length+_l.after.length,0);if(Yo+=Fn.beforeBody.length+Fn.afterBody.length,fo&&(Lo+=fo*ps.lineHeight+(fo-1)*Mn.titleSpacing+Mn.titleMarginBottom),Yo){const xl=Mn.displayColors?Math.max(ds,hs.lineHeight):hs.lineHeight;Lo+=Ao*xl+(Yo-Ao)*hs.lineHeight+(Yo-1)*Mn.bodySpacing}mo&&(Lo+=Mn.footerMarginTop+mo*io.lineHeight+(mo-1)*Mn.footerSpacing);let Wo=0;const Jo=function(xl){Go=Math.max(Go,rs.measureText(xl).width+Wo)};return rs.save(),rs.font=ps.string,each(Fn.title,Jo),rs.font=hs.string,each(Fn.beforeBody.concat(Fn.afterBody),Jo),Wo=Mn.displayColors?us+2+Mn.boxPadding:0,each(is,xl=>{each(xl.before,Jo),each(xl.lines,Jo),each(xl.after,Jo)}),Wo=0,rs.font=io.string,each(Fn.footer,Jo),rs.restore(),Go+=$o.width,{width:Go,height:Lo}}function determineYAlign(Fn,Mn){const{y:rs,height:is}=Mn;return rs<is/2?"top":rs>Fn.height-is/2?"bottom":"center"}function doesNotFitWithAlign(Fn,Mn,rs,is){const{x:os,width:as}=is,us=rs.caretSize+rs.caretPadding;if(Fn==="left"&&os+as+us>Mn.width||Fn==="right"&&os-as-us<0)return!0}function determineXAlign(Fn,Mn,rs,is){const{x:os,width:as}=rs,{width:us,chartArea:{left:ds,right:hs}}=Fn;let ps="center";return is==="center"?ps=os<=(ds+hs)/2?"left":"right":os<=as/2?ps="left":os>=us-as/2&&(ps="right"),doesNotFitWithAlign(ps,Fn,Mn,rs)&&(ps="center"),ps}function determineAlignment(Fn,Mn,rs){const is=rs.yAlign||Mn.yAlign||determineYAlign(Fn,rs);return{xAlign:rs.xAlign||Mn.xAlign||determineXAlign(Fn,Mn,rs,is),yAlign:is}}function alignX(Fn,Mn){let{x:rs,width:is}=Fn;return Mn==="right"?rs-=is:Mn==="center"&&(rs-=is/2),rs}function alignY(Fn,Mn,rs){let{y:is,height:os}=Fn;return Mn==="top"?is+=rs:Mn==="bottom"?is-=os+rs:is-=os/2,is}function getBackgroundPoint(Fn,Mn,rs,is){const{caretSize:os,caretPadding:as,cornerRadius:us}=Fn,{xAlign:ds,yAlign:hs}=rs,ps=os+as,{topLeft:io,topRight:fo,bottomLeft:mo,bottomRight:Ao}=toTRBLCorners(us);let $o=alignX(Mn,ds);const Lo=alignY(Mn,hs,ps);return hs==="center"?ds==="left"?$o+=ps:ds==="right"&&($o-=ps):ds==="left"?$o-=Math.max(io,mo)+os:ds==="right"&&($o+=Math.max(fo,Ao)+os),{x:_limitValue($o,0,is.width-Mn.width),y:_limitValue(Lo,0,is.height-Mn.height)}}function getAlignedX(Fn,Mn,rs){const is=toPadding(rs.padding);return Mn==="center"?Fn.x+Fn.width/2:Mn==="right"?Fn.x+Fn.width-is.right:Fn.x+is.left}function getBeforeAfterBodyLines(Fn){return pushOrConcat([],splitNewlines(Fn))}function createTooltipContext(Fn,Mn,rs){return createContext(Fn,{tooltip:Mn,tooltipItems:rs,type:"tooltip"})}function overrideCallbacks(Fn,Mn){const rs=Mn&&Mn.dataset&&Mn.dataset.tooltip&&Mn.dataset.tooltip.callbacks;return rs?Fn.override(rs):Fn}const defaultCallbacks={beforeTitle:noop$2,title(Fn){if(Fn.length>0){const Mn=Fn[0],rs=Mn.chart.data.labels,is=rs?rs.length:0;if(this&&this.options&&this.options.mode==="dataset")return Mn.dataset.label||"";if(Mn.label)return Mn.label;if(is>0&&Mn.dataIndex<is)return rs[Mn.dataIndex]}return""},afterTitle:noop$2,beforeBody:noop$2,beforeLabel:noop$2,label(Fn){if(this&&this.options&&this.options.mode==="dataset")return Fn.label+": "+Fn.formattedValue||Fn.formattedValue;let Mn=Fn.dataset.label||"";Mn&&(Mn+=": ");const rs=Fn.formattedValue;return isNullOrUndef(rs)||(Mn+=rs),Mn},labelColor(Fn){const rs=Fn.chart.getDatasetMeta(Fn.datasetIndex).controller.getStyle(Fn.dataIndex);return{borderColor:rs.borderColor,backgroundColor:rs.backgroundColor,borderWidth:rs.borderWidth,borderDash:rs.borderDash,borderDashOffset:rs.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(Fn){const rs=Fn.chart.getDatasetMeta(Fn.datasetIndex).controller.getStyle(Fn.dataIndex);return{pointStyle:rs.pointStyle,rotation:rs.rotation}},afterLabel:noop$2,afterBody:noop$2,beforeFooter:noop$2,footer:noop$2,afterFooter:noop$2};function invokeCallbackWithFallback(Fn,Mn,rs,is){const os=Fn[Mn].call(rs,is);return typeof os>"u"?defaultCallbacks[Mn].call(rs,is):os}class Tooltip extends Element$1{constructor(Mn){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=Mn.chart,this.options=Mn.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(Mn){this.options=Mn,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const Mn=this._cachedAnimations;if(Mn)return Mn;const rs=this.chart,is=this.options.setContext(this.getContext()),os=is.enabled&&rs.options.animation&&is.animations,as=new Animations(this.chart,os);return os._cacheable&&(this._cachedAnimations=Object.freeze(as)),as}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(Mn,rs){const{callbacks:is}=rs,os=invokeCallbackWithFallback(is,"beforeTitle",this,Mn),as=invokeCallbackWithFallback(is,"title",this,Mn),us=invokeCallbackWithFallback(is,"afterTitle",this,Mn);let ds=[];return ds=pushOrConcat(ds,splitNewlines(os)),ds=pushOrConcat(ds,splitNewlines(as)),ds=pushOrConcat(ds,splitNewlines(us)),ds}getBeforeBody(Mn,rs){return getBeforeAfterBodyLines(invokeCallbackWithFallback(rs.callbacks,"beforeBody",this,Mn))}getBody(Mn,rs){const{callbacks:is}=rs,os=[];return each(Mn,as=>{const us={before:[],lines:[],after:[]},ds=overrideCallbacks(is,as);pushOrConcat(us.before,splitNewlines(invokeCallbackWithFallback(ds,"beforeLabel",this,as))),pushOrConcat(us.lines,invokeCallbackWithFallback(ds,"label",this,as)),pushOrConcat(us.after,splitNewlines(invokeCallbackWithFallback(ds,"afterLabel",this,as))),os.push(us)}),os}getAfterBody(Mn,rs){return getBeforeAfterBodyLines(invokeCallbackWithFallback(rs.callbacks,"afterBody",this,Mn))}getFooter(Mn,rs){const{callbacks:is}=rs,os=invokeCallbackWithFallback(is,"beforeFooter",this,Mn),as=invokeCallbackWithFallback(is,"footer",this,Mn),us=invokeCallbackWithFallback(is,"afterFooter",this,Mn);let ds=[];return ds=pushOrConcat(ds,splitNewlines(os)),ds=pushOrConcat(ds,splitNewlines(as)),ds=pushOrConcat(ds,splitNewlines(us)),ds}_createItems(Mn){const rs=this._active,is=this.chart.data,os=[],as=[],us=[];let ds=[],hs,ps;for(hs=0,ps=rs.length;hs<ps;++hs)ds.push(createTooltipItem(this.chart,rs[hs]));return Mn.filter&&(ds=ds.filter((io,fo,mo)=>Mn.filter(io,fo,mo,is))),Mn.itemSort&&(ds=ds.sort((io,fo)=>Mn.itemSort(io,fo,is))),each(ds,io=>{const fo=overrideCallbacks(Mn.callbacks,io);os.push(invokeCallbackWithFallback(fo,"labelColor",this,io)),as.push(invokeCallbackWithFallback(fo,"labelPointStyle",this,io)),us.push(invokeCallbackWithFallback(fo,"labelTextColor",this,io))}),this.labelColors=os,this.labelPointStyles=as,this.labelTextColors=us,this.dataPoints=ds,ds}update(Mn,rs){const is=this.options.setContext(this.getContext()),os=this._active;let as,us=[];if(!os.length)this.opacity!==0&&(as={opacity:0});else{const ds=positioners[is.position].call(this,os,this._eventPosition);us=this._createItems(is),this.title=this.getTitle(us,is),this.beforeBody=this.getBeforeBody(us,is),this.body=this.getBody(us,is),this.afterBody=this.getAfterBody(us,is),this.footer=this.getFooter(us,is);const hs=this._size=getTooltipSize(this,is),ps=Object.assign({},ds,hs),io=determineAlignment(this.chart,is,ps),fo=getBackgroundPoint(is,ps,io,this.chart);this.xAlign=io.xAlign,this.yAlign=io.yAlign,as={opacity:1,x:fo.x,y:fo.y,width:hs.width,height:hs.height,caretX:ds.x,caretY:ds.y}}this._tooltipItems=us,this.$context=void 0,as&&this._resolveAnimations().update(this,as),Mn&&is.external&&is.external.call(this,{chart:this.chart,tooltip:this,replay:rs})}drawCaret(Mn,rs,is,os){const as=this.getCaretPosition(Mn,is,os);rs.lineTo(as.x1,as.y1),rs.lineTo(as.x2,as.y2),rs.lineTo(as.x3,as.y3)}getCaretPosition(Mn,rs,is){const{xAlign:os,yAlign:as}=this,{caretSize:us,cornerRadius:ds}=is,{topLeft:hs,topRight:ps,bottomLeft:io,bottomRight:fo}=toTRBLCorners(ds),{x:mo,y:Ao}=Mn,{width:$o,height:Lo}=rs;let Go,Yo,Wo,Jo,xl,_l;return as==="center"?(xl=Ao+Lo/2,os==="left"?(Go=mo,Yo=Go-us,Jo=xl+us,_l=xl-us):(Go=mo+$o,Yo=Go+us,Jo=xl-us,_l=xl+us),Wo=Go):(os==="left"?Yo=mo+Math.max(hs,io)+us:os==="right"?Yo=mo+$o-Math.max(ps,fo)-us:Yo=this.caretX,as==="top"?(Jo=Ao,xl=Jo-us,Go=Yo-us,Wo=Yo+us):(Jo=Ao+Lo,xl=Jo+us,Go=Yo+us,Wo=Yo-us),_l=Jo),{x1:Go,x2:Yo,x3:Wo,y1:Jo,y2:xl,y3:_l}}drawTitle(Mn,rs,is){const os=this.title,as=os.length;let us,ds,hs;if(as){const ps=getRtlAdapter(is.rtl,this.x,this.width);for(Mn.x=getAlignedX(this,is.titleAlign,is),rs.textAlign=ps.textAlign(is.titleAlign),rs.textBaseline="middle",us=toFont(is.titleFont),ds=is.titleSpacing,rs.fillStyle=is.titleColor,rs.font=us.string,hs=0;hs<as;++hs)rs.fillText(os[hs],ps.x(Mn.x),Mn.y+us.lineHeight/2),Mn.y+=us.lineHeight+ds,hs+1===as&&(Mn.y+=is.titleMarginBottom-ds)}}_drawColorBox(Mn,rs,is,os,as){const us=this.labelColors[is],ds=this.labelPointStyles[is],{boxHeight:hs,boxWidth:ps}=as,io=toFont(as.bodyFont),fo=getAlignedX(this,"left",as),mo=os.x(fo),Ao=hs<io.lineHeight?(io.lineHeight-hs)/2:0,$o=rs.y+Ao;if(as.usePointStyle){const Lo={radius:Math.min(ps,hs)/2,pointStyle:ds.pointStyle,rotation:ds.rotation,borderWidth:1},Go=os.leftForLtr(mo,ps)+ps/2,Yo=$o+hs/2;Mn.strokeStyle=as.multiKeyBackground,Mn.fillStyle=as.multiKeyBackground,drawPoint(Mn,Lo,Go,Yo),Mn.strokeStyle=us.borderColor,Mn.fillStyle=us.backgroundColor,drawPoint(Mn,Lo,Go,Yo)}else{Mn.lineWidth=isObject$1(us.borderWidth)?Math.max(...Object.values(us.borderWidth)):us.borderWidth||1,Mn.strokeStyle=us.borderColor,Mn.setLineDash(us.borderDash||[]),Mn.lineDashOffset=us.borderDashOffset||0;const Lo=os.leftForLtr(mo,ps),Go=os.leftForLtr(os.xPlus(mo,1),ps-2),Yo=toTRBLCorners(us.borderRadius);Object.values(Yo).some(Wo=>Wo!==0)?(Mn.beginPath(),Mn.fillStyle=as.multiKeyBackground,addRoundedRectPath(Mn,{x:Lo,y:$o,w:ps,h:hs,radius:Yo}),Mn.fill(),Mn.stroke(),Mn.fillStyle=us.backgroundColor,Mn.beginPath(),addRoundedRectPath(Mn,{x:Go,y:$o+1,w:ps-2,h:hs-2,radius:Yo}),Mn.fill()):(Mn.fillStyle=as.multiKeyBackground,Mn.fillRect(Lo,$o,ps,hs),Mn.strokeRect(Lo,$o,ps,hs),Mn.fillStyle=us.backgroundColor,Mn.fillRect(Go,$o+1,ps-2,hs-2))}Mn.fillStyle=this.labelTextColors[is]}drawBody(Mn,rs,is){const{body:os}=this,{bodySpacing:as,bodyAlign:us,displayColors:ds,boxHeight:hs,boxWidth:ps,boxPadding:io}=is,fo=toFont(is.bodyFont);let mo=fo.lineHeight,Ao=0;const $o=getRtlAdapter(is.rtl,this.x,this.width),Lo=function($l){rs.fillText($l,$o.x(Mn.x+Ao),Mn.y+mo/2),Mn.y+=mo+as},Go=$o.textAlign(us);let Yo,Wo,Jo,xl,_l,Tl,Sl;for(rs.textAlign=us,rs.textBaseline="middle",rs.font=fo.string,Mn.x=getAlignedX(this,Go,is),rs.fillStyle=is.bodyColor,each(this.beforeBody,Lo),Ao=ds&&Go!=="right"?us==="center"?ps/2+io:ps+2+io:0,xl=0,Tl=os.length;xl<Tl;++xl){for(Yo=os[xl],Wo=this.labelTextColors[xl],rs.fillStyle=Wo,each(Yo.before,Lo),Jo=Yo.lines,ds&&Jo.length&&(this._drawColorBox(rs,Mn,xl,$o,is),mo=Math.max(fo.lineHeight,hs)),_l=0,Sl=Jo.length;_l<Sl;++_l)Lo(Jo[_l]),mo=fo.lineHeight;each(Yo.after,Lo)}Ao=0,mo=fo.lineHeight,each(this.afterBody,Lo),Mn.y-=as}drawFooter(Mn,rs,is){const os=this.footer,as=os.length;let us,ds;if(as){const hs=getRtlAdapter(is.rtl,this.x,this.width);for(Mn.x=getAlignedX(this,is.footerAlign,is),Mn.y+=is.footerMarginTop,rs.textAlign=hs.textAlign(is.footerAlign),rs.textBaseline="middle",us=toFont(is.footerFont),rs.fillStyle=is.footerColor,rs.font=us.string,ds=0;ds<as;++ds)rs.fillText(os[ds],hs.x(Mn.x),Mn.y+us.lineHeight/2),Mn.y+=us.lineHeight+is.footerSpacing}}drawBackground(Mn,rs,is,os){const{xAlign:as,yAlign:us}=this,{x:ds,y:hs}=Mn,{width:ps,height:io}=is,{topLeft:fo,topRight:mo,bottomLeft:Ao,bottomRight:$o}=toTRBLCorners(os.cornerRadius);rs.fillStyle=os.backgroundColor,rs.strokeStyle=os.borderColor,rs.lineWidth=os.borderWidth,rs.beginPath(),rs.moveTo(ds+fo,hs),us==="top"&&this.drawCaret(Mn,rs,is,os),rs.lineTo(ds+ps-mo,hs),rs.quadraticCurveTo(ds+ps,hs,ds+ps,hs+mo),us==="center"&&as==="right"&&this.drawCaret(Mn,rs,is,os),rs.lineTo(ds+ps,hs+io-$o),rs.quadraticCurveTo(ds+ps,hs+io,ds+ps-$o,hs+io),us==="bottom"&&this.drawCaret(Mn,rs,is,os),rs.lineTo(ds+Ao,hs+io),rs.quadraticCurveTo(ds,hs+io,ds,hs+io-Ao),us==="center"&&as==="left"&&this.drawCaret(Mn,rs,is,os),rs.lineTo(ds,hs+fo),rs.quadraticCurveTo(ds,hs,ds+fo,hs),rs.closePath(),rs.fill(),os.borderWidth>0&&rs.stroke()}_updateAnimationTarget(Mn){const rs=this.chart,is=this.$animations,os=is&&is.x,as=is&&is.y;if(os||as){const us=positioners[Mn.position].call(this,this._active,this._eventPosition);if(!us)return;const ds=this._size=getTooltipSize(this,Mn),hs=Object.assign({},us,this._size),ps=determineAlignment(rs,Mn,hs),io=getBackgroundPoint(Mn,hs,ps,rs);(os._to!==io.x||as._to!==io.y)&&(this.xAlign=ps.xAlign,this.yAlign=ps.yAlign,this.width=ds.width,this.height=ds.height,this.caretX=us.x,this.caretY=us.y,this._resolveAnimations().update(this,io))}}_willRender(){return!!this.opacity}draw(Mn){const rs=this.options.setContext(this.getContext());let is=this.opacity;if(!is)return;this._updateAnimationTarget(rs);const os={width:this.width,height:this.height},as={x:this.x,y:this.y};is=Math.abs(is)<.001?0:is;const us=toPadding(rs.padding),ds=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;rs.enabled&&ds&&(Mn.save(),Mn.globalAlpha=is,this.drawBackground(as,Mn,os,rs),overrideTextDirection(Mn,rs.textDirection),as.y+=us.top,this.drawTitle(as,Mn,rs),this.drawBody(as,Mn,rs),this.drawFooter(as,Mn,rs),restoreTextDirection(Mn,rs.textDirection),Mn.restore())}getActiveElements(){return this._active||[]}setActiveElements(Mn,rs){const is=this._active,os=Mn.map(({datasetIndex:ds,index:hs})=>{const ps=this.chart.getDatasetMeta(ds);if(!ps)throw new Error("Cannot find a dataset at index "+ds);return{datasetIndex:ds,element:ps.data[hs],index:hs}}),as=!_elementsEqual(is,os),us=this._positionChanged(os,rs);(as||us)&&(this._active=os,this._eventPosition=rs,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(Mn,rs,is=!0){if(rs&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const os=this.options,as=this._active||[],us=this._getActiveElements(Mn,as,rs,is),ds=this._positionChanged(us,Mn),hs=rs||!_elementsEqual(us,as)||ds;return hs&&(this._active=us,(os.enabled||os.external)&&(this._eventPosition={x:Mn.x,y:Mn.y},this.update(!0,rs))),hs}_getActiveElements(Mn,rs,is,os){const as=this.options;if(Mn.type==="mouseout")return[];if(!os)return rs.filter(ds=>this.chart.data.datasets[ds.datasetIndex]&&this.chart.getDatasetMeta(ds.datasetIndex).controller.getParsed(ds.index)!==void 0);const us=this.chart.getElementsAtEventForMode(Mn,as.mode,as,is);return as.reverse&&us.reverse(),us}_positionChanged(Mn,rs){const{caretX:is,caretY:os,options:as}=this,us=positioners[as.position].call(this,Mn,rs);return us!==!1&&(is!==us.x||os!==us.y)}}_m(Tooltip,"positioners",positioners);var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(Fn,Mn,rs){rs&&(Fn.tooltip=new Tooltip({chart:Fn,options:rs}))},beforeUpdate(Fn,Mn,rs){Fn.tooltip&&Fn.tooltip.initialize(rs)},reset(Fn,Mn,rs){Fn.tooltip&&Fn.tooltip.initialize(rs)},afterDraw(Fn){const Mn=Fn.tooltip;if(Mn&&Mn._willRender()){const rs={tooltip:Mn};if(Fn.notifyPlugins("beforeTooltipDraw",{...rs,cancelable:!0})===!1)return;Mn.draw(Fn.ctx),Fn.notifyPlugins("afterTooltipDraw",rs)}},afterEvent(Fn,Mn){if(Fn.tooltip){const rs=Mn.replay;Fn.tooltip.handleEvent(Mn.event,rs,Mn.inChartArea)&&(Mn.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(Fn,Mn)=>Mn.bodyFont.size,boxWidth:(Fn,Mn)=>Mn.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:defaultCallbacks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:Fn=>Fn!=="filter"&&Fn!=="itemSort"&&Fn!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=(Fn,Mn,rs,is)=>(typeof Mn=="string"?(rs=Fn.push(Mn)-1,is.unshift({index:rs,label:Mn})):isNaN(Mn)&&(rs=null),rs);function findOrAddLabel(Fn,Mn,rs,is){const os=Fn.indexOf(Mn);if(os===-1)return addIfString(Fn,Mn,rs,is);const as=Fn.lastIndexOf(Mn);return os!==as?rs:os}const validIndex=(Fn,Mn)=>Fn===null?null:_limitValue(Math.round(Fn),0,Mn);function _getLabelForValue(Fn){const Mn=this.getLabels();return Fn>=0&&Fn<Mn.length?Mn[Fn]:Fn}class CategoryScale extends Scale{constructor(Mn){super(Mn),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(Mn){const rs=this._addedLabels;if(rs.length){const is=this.getLabels();for(const{index:os,label:as}of rs)is[os]===as&&is.splice(os,1);this._addedLabels=[]}super.init(Mn)}parse(Mn,rs){if(isNullOrUndef(Mn))return null;const is=this.getLabels();return rs=isFinite(rs)&&is[rs]===Mn?rs:findOrAddLabel(is,Mn,valueOrDefault(rs,Mn),this._addedLabels),validIndex(rs,is.length-1)}determineDataLimits(){const{minDefined:Mn,maxDefined:rs}=this.getUserBounds();let{min:is,max:os}=this.getMinMax(!0);this.options.bounds==="ticks"&&(Mn||(is=0),rs||(os=this.getLabels().length-1)),this.min=is,this.max=os}buildTicks(){const Mn=this.min,rs=this.max,is=this.options.offset,os=[];let as=this.getLabels();as=Mn===0&&rs===as.length-1?as:as.slice(Mn,rs+1),this._valueRange=Math.max(as.length-(is?0:1),1),this._startValue=this.min-(is?.5:0);for(let us=Mn;us<=rs;us++)os.push({value:us});return os}getLabelForValue(Mn){return _getLabelForValue.call(this,Mn)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(Mn){return typeof Mn!="number"&&(Mn=this.parse(Mn)),Mn===null?NaN:this.getPixelForDecimal((Mn-this._startValue)/this._valueRange)}getPixelForTick(Mn){const rs=this.ticks;return Mn<0||Mn>rs.length-1?null:this.getPixelForValue(rs[Mn].value)}getValueForPixel(Mn){return Math.round(this._startValue+this.getDecimalForPixel(Mn)*this._valueRange)}getBasePixel(){return this.bottom}}_m(CategoryScale,"id","category"),_m(CategoryScale,"defaults",{ticks:{callback:_getLabelForValue}});function generateTicks$1(Fn,Mn){const rs=[],{bounds:os,step:as,min:us,max:ds,precision:hs,count:ps,maxTicks:io,maxDigits:fo,includeBounds:mo}=Fn,Ao=as||1,$o=io-1,{min:Lo,max:Go}=Mn,Yo=!isNullOrUndef(us),Wo=!isNullOrUndef(ds),Jo=!isNullOrUndef(ps),xl=(Go-Lo)/(fo+1);let _l=niceNum((Go-Lo)/$o/Ao)*Ao,Tl,Sl,$l,Pl;if(_l<1e-14&&!Yo&&!Wo)return[{value:Lo},{value:Go}];Pl=Math.ceil(Go/_l)-Math.floor(Lo/_l),Pl>$o&&(_l=niceNum(Pl*_l/$o/Ao)*Ao),isNullOrUndef(hs)||(Tl=Math.pow(10,hs),_l=Math.ceil(_l*Tl)/Tl),os==="ticks"?(Sl=Math.floor(Lo/_l)*_l,$l=Math.ceil(Go/_l)*_l):(Sl=Lo,$l=Go),Yo&&Wo&&as&&almostWhole((ds-us)/as,_l/1e3)?(Pl=Math.round(Math.min((ds-us)/_l,io)),_l=(ds-us)/Pl,Sl=us,$l=ds):Jo?(Sl=Yo?us:Sl,$l=Wo?ds:$l,Pl=ps-1,_l=($l-Sl)/Pl):(Pl=($l-Sl)/_l,almostEquals(Pl,Math.round(Pl),_l/1e3)?Pl=Math.round(Pl):Pl=Math.ceil(Pl));const Dl=Math.max(_decimalPlaces(_l),_decimalPlaces(Sl));Tl=Math.pow(10,isNullOrUndef(hs)?Dl:hs),Sl=Math.round(Sl*Tl)/Tl,$l=Math.round($l*Tl)/Tl;let Ol=0;for(Yo&&(mo&&Sl!==us?(rs.push({value:us}),Sl<us&&Ol++,almostEquals(Math.round((Sl+Ol*_l)*Tl)/Tl,us,relativeLabelSize(us,xl,Fn))&&Ol++):Sl<us&&Ol++);Ol<Pl;++Ol){const Rl=Math.round((Sl+Ol*_l)*Tl)/Tl;if(Wo&&Rl>ds)break;rs.push({value:Rl})}return Wo&&mo&&$l!==ds?rs.length&&almostEquals(rs[rs.length-1].value,ds,relativeLabelSize(ds,xl,Fn))?rs[rs.length-1].value=ds:rs.push({value:ds}):(!Wo||$l===ds)&&rs.push({value:$l}),rs}function relativeLabelSize(Fn,Mn,{horizontal:rs,minRotation:is}){const os=toRadians(is),as=(rs?Math.sin(os):Math.cos(os))||.001,us=.75*Mn*(""+Fn).length;return Math.min(Mn/as,us)}class LinearScaleBase extends Scale{constructor(Mn){super(Mn),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(Mn,rs){return isNullOrUndef(Mn)||(typeof Mn=="number"||Mn instanceof Number)&&!isFinite(+Mn)?null:+Mn}handleTickRangeOptions(){const{beginAtZero:Mn}=this.options,{minDefined:rs,maxDefined:is}=this.getUserBounds();let{min:os,max:as}=this;const us=hs=>os=rs?os:hs,ds=hs=>as=is?as:hs;if(Mn){const hs=sign(os),ps=sign(as);hs<0&&ps<0?ds(0):hs>0&&ps>0&&us(0)}if(os===as){let hs=as===0?1:Math.abs(as*.05);ds(as+hs),Mn||us(os-hs)}this.min=os,this.max=as}getTickLimit(){const Mn=this.options.ticks;let{maxTicksLimit:rs,stepSize:is}=Mn,os;return is?(os=Math.ceil(this.max/is)-Math.floor(this.min/is)+1,os>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${is} would result generating up to ${os} ticks. Limiting to 1000.`),os=1e3)):(os=this.computeTickLimit(),rs=rs||11),rs&&(os=Math.min(rs,os)),os}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const Mn=this.options,rs=Mn.ticks;let is=this.getTickLimit();is=Math.max(2,is);const os={maxTicks:is,bounds:Mn.bounds,min:Mn.min,max:Mn.max,precision:rs.precision,step:rs.stepSize,count:rs.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:rs.minRotation||0,includeBounds:rs.includeBounds!==!1},as=this._range||this,us=generateTicks$1(os,as);return Mn.bounds==="ticks"&&_setMinAndMaxByKey(us,this,"value"),Mn.reverse?(us.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),us}configure(){const Mn=this.ticks;let rs=this.min,is=this.max;if(super.configure(),this.options.offset&&Mn.length){const os=(is-rs)/Math.max(Mn.length-1,1)/2;rs-=os,is+=os}this._startValue=rs,this._endValue=is,this._valueRange=is-rs}getLabelForValue(Mn){return formatNumber(Mn,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const{min:Mn,max:rs}=this.getMinMax(!0);this.min=isNumberFinite(Mn)?Mn:0,this.max=isNumberFinite(rs)?rs:1,this.handleTickRangeOptions()}computeTickLimit(){const Mn=this.isHorizontal(),rs=Mn?this.width:this.height,is=toRadians(this.options.ticks.minRotation),os=(Mn?Math.sin(is):Math.cos(is))||.001,as=this._resolveTickFontOptions(0);return Math.ceil(rs/Math.min(40,as.lineHeight/os))}getPixelForValue(Mn){return Mn===null?NaN:this.getPixelForDecimal((Mn-this._startValue)/this._valueRange)}getValueForPixel(Mn){return this._startValue+this.getDecimalForPixel(Mn)*this._valueRange}}_m(LinearScale,"id","linear"),_m(LinearScale,"defaults",{ticks:{callback:Ticks.formatters.numeric}});const log10Floor=Fn=>Math.floor(log10(Fn)),changeExponent=(Fn,Mn)=>Math.pow(10,log10Floor(Fn)+Mn);function isMajor(Fn){return Fn/Math.pow(10,log10Floor(Fn))===1}function steps(Fn,Mn,rs){const is=Math.pow(10,rs),os=Math.floor(Fn/is);return Math.ceil(Mn/is)-os}function startExp(Fn,Mn){const rs=Mn-Fn;let is=log10Floor(rs);for(;steps(Fn,Mn,is)>10;)is++;for(;steps(Fn,Mn,is)<10;)is--;return Math.min(is,log10Floor(Fn))}function generateTicks(Fn,{min:Mn,max:rs}){Mn=finiteOrDefault(Fn.min,Mn);const is=[],os=log10Floor(Mn);let as=startExp(Mn,rs),us=as<0?Math.pow(10,Math.abs(as)):1;const ds=Math.pow(10,as),hs=os>as?Math.pow(10,os):0,ps=Math.round((Mn-hs)*us)/us,io=Math.floor((Mn-hs)/ds/10)*ds*10;let fo=Math.floor((ps-io)/Math.pow(10,as)),mo=finiteOrDefault(Fn.min,Math.round((hs+io+fo*Math.pow(10,as))*us)/us);for(;mo<rs;)is.push({value:mo,major:isMajor(mo),significand:fo}),fo>=10?fo=fo<15?15:20:fo++,fo>=20&&(as++,fo=2,us=as>=0?1:us),mo=Math.round((hs+io+fo*Math.pow(10,as))*us)/us;const Ao=finiteOrDefault(Fn.max,mo);return is.push({value:Ao,major:isMajor(Ao),significand:fo}),is}class LogarithmicScale extends Scale{constructor(Mn){super(Mn),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(Mn,rs){const is=LinearScaleBase.prototype.parse.apply(this,[Mn,rs]);if(is===0){this._zero=!0;return}return isNumberFinite(is)&&is>0?is:null}determineDataLimits(){const{min:Mn,max:rs}=this.getMinMax(!0);this.min=isNumberFinite(Mn)?Math.max(0,Mn):null,this.max=isNumberFinite(rs)?Math.max(0,rs):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!isNumberFinite(this._userMin)&&(this.min=Mn===changeExponent(this.min,0)?changeExponent(this.min,-1):changeExponent(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:Mn,maxDefined:rs}=this.getUserBounds();let is=this.min,os=this.max;const as=ds=>is=Mn?is:ds,us=ds=>os=rs?os:ds;is===os&&(is<=0?(as(1),us(10)):(as(changeExponent(is,-1)),us(changeExponent(os,1)))),is<=0&&as(changeExponent(os,-1)),os<=0&&us(changeExponent(is,1)),this.min=is,this.max=os}buildTicks(){const Mn=this.options,rs={min:this._userMin,max:this._userMax},is=generateTicks(rs,this);return Mn.bounds==="ticks"&&_setMinAndMaxByKey(is,this,"value"),Mn.reverse?(is.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),is}getLabelForValue(Mn){return Mn===void 0?"0":formatNumber(Mn,this.chart.options.locale,this.options.ticks.format)}configure(){const Mn=this.min;super.configure(),this._startValue=log10(Mn),this._valueRange=log10(this.max)-log10(Mn)}getPixelForValue(Mn){return(Mn===void 0||Mn===0)&&(Mn=this.min),Mn===null||isNaN(Mn)?NaN:this.getPixelForDecimal(Mn===this.min?0:(log10(Mn)-this._startValue)/this._valueRange)}getValueForPixel(Mn){const rs=this.getDecimalForPixel(Mn);return Math.pow(10,this._startValue+rs*this._valueRange)}}_m(LogarithmicScale,"id","logarithmic"),_m(LogarithmicScale,"defaults",{ticks:{callback:Ticks.formatters.logarithmic,major:{enabled:!0}}});function getTickBackdropHeight(Fn){const Mn=Fn.ticks;if(Mn.display&&Fn.display){const rs=toPadding(Mn.backdropPadding);return valueOrDefault(Mn.font&&Mn.font.size,defaults.font.size)+rs.height}return 0}function measureLabelSize(Fn,Mn,rs){return rs=isArray(rs)?rs:[rs],{w:_longestText(Fn,Mn.string,rs),h:rs.length*Mn.lineHeight}}function determineLimits(Fn,Mn,rs,is,os){return Fn===is||Fn===os?{start:Mn-rs/2,end:Mn+rs/2}:Fn<is||Fn>os?{start:Mn-rs,end:Mn}:{start:Mn,end:Mn+rs}}function fitWithPointLabels(Fn){const Mn={l:Fn.left+Fn._padding.left,r:Fn.right-Fn._padding.right,t:Fn.top+Fn._padding.top,b:Fn.bottom-Fn._padding.bottom},rs=Object.assign({},Mn),is=[],os=[],as=Fn._pointLabels.length,us=Fn.options.pointLabels,ds=us.centerPointLabels?PI/as:0;for(let hs=0;hs<as;hs++){const ps=us.setContext(Fn.getPointLabelContext(hs));os[hs]=ps.padding;const io=Fn.getPointPosition(hs,Fn.drawingArea+os[hs],ds),fo=toFont(ps.font),mo=measureLabelSize(Fn.ctx,fo,Fn._pointLabels[hs]);is[hs]=mo;const Ao=_normalizeAngle(Fn.getIndexAngle(hs)+ds),$o=Math.round(toDegrees(Ao)),Lo=determineLimits($o,io.x,mo.w,0,180),Go=determineLimits($o,io.y,mo.h,90,270);updateLimits(rs,Mn,Ao,Lo,Go)}Fn.setCenterPoint(Mn.l-rs.l,rs.r-Mn.r,Mn.t-rs.t,rs.b-Mn.b),Fn._pointLabelItems=buildPointLabelItems(Fn,is,os)}function updateLimits(Fn,Mn,rs,is,os){const as=Math.abs(Math.sin(rs)),us=Math.abs(Math.cos(rs));let ds=0,hs=0;is.start<Mn.l?(ds=(Mn.l-is.start)/as,Fn.l=Math.min(Fn.l,Mn.l-ds)):is.end>Mn.r&&(ds=(is.end-Mn.r)/as,Fn.r=Math.max(Fn.r,Mn.r+ds)),os.start<Mn.t?(hs=(Mn.t-os.start)/us,Fn.t=Math.min(Fn.t,Mn.t-hs)):os.end>Mn.b&&(hs=(os.end-Mn.b)/us,Fn.b=Math.max(Fn.b,Mn.b+hs))}function createPointLabelItem(Fn,Mn,rs){const is=Fn.drawingArea,{extra:os,additionalAngle:as,padding:us,size:ds}=rs,hs=Fn.getPointPosition(Mn,is+os+us,as),ps=Math.round(toDegrees(_normalizeAngle(hs.angle+HALF_PI))),io=yForAngle(hs.y,ds.h,ps),fo=getTextAlignForAngle(ps),mo=leftForTextAlign(hs.x,ds.w,fo);return{visible:!0,x:hs.x,y:io,textAlign:fo,left:mo,top:io,right:mo+ds.w,bottom:io+ds.h}}function isNotOverlapped(Fn,Mn){if(!Mn)return!0;const{left:rs,top:is,right:os,bottom:as}=Fn;return!(_isPointInArea({x:rs,y:is},Mn)||_isPointInArea({x:rs,y:as},Mn)||_isPointInArea({x:os,y:is},Mn)||_isPointInArea({x:os,y:as},Mn))}function buildPointLabelItems(Fn,Mn,rs){const is=[],os=Fn._pointLabels.length,as=Fn.options,{centerPointLabels:us,display:ds}=as.pointLabels,hs={extra:getTickBackdropHeight(as)/2,additionalAngle:us?PI/os:0};let ps;for(let io=0;io<os;io++){hs.padding=rs[io],hs.size=Mn[io];const fo=createPointLabelItem(Fn,io,hs);is.push(fo),ds==="auto"&&(fo.visible=isNotOverlapped(fo,ps),fo.visible&&(ps=fo))}return is}function getTextAlignForAngle(Fn){return Fn===0||Fn===180?"center":Fn<180?"left":"right"}function leftForTextAlign(Fn,Mn,rs){return rs==="right"?Fn-=Mn:rs==="center"&&(Fn-=Mn/2),Fn}function yForAngle(Fn,Mn,rs){return rs===90||rs===270?Fn-=Mn/2:(rs>270||rs<90)&&(Fn-=Mn),Fn}function drawPointLabelBox(Fn,Mn,rs){const{left:is,top:os,right:as,bottom:us}=rs,{backdropColor:ds}=Mn;if(!isNullOrUndef(ds)){const hs=toTRBLCorners(Mn.borderRadius),ps=toPadding(Mn.backdropPadding);Fn.fillStyle=ds;const io=is-ps.left,fo=os-ps.top,mo=as-is+ps.width,Ao=us-os+ps.height;Object.values(hs).some($o=>$o!==0)?(Fn.beginPath(),addRoundedRectPath(Fn,{x:io,y:fo,w:mo,h:Ao,radius:hs}),Fn.fill()):Fn.fillRect(io,fo,mo,Ao)}}function drawPointLabels(Fn,Mn){const{ctx:rs,options:{pointLabels:is}}=Fn;for(let os=Mn-1;os>=0;os--){const as=Fn._pointLabelItems[os];if(!as.visible)continue;const us=is.setContext(Fn.getPointLabelContext(os));drawPointLabelBox(rs,us,as);const ds=toFont(us.font),{x:hs,y:ps,textAlign:io}=as;renderText(rs,Fn._pointLabels[os],hs,ps+ds.lineHeight/2,ds,{color:us.color,textAlign:io,textBaseline:"middle"})}}function pathRadiusLine(Fn,Mn,rs,is){const{ctx:os}=Fn;if(rs)os.arc(Fn.xCenter,Fn.yCenter,Mn,0,TAU);else{let as=Fn.getPointPosition(0,Mn);os.moveTo(as.x,as.y);for(let us=1;us<is;us++)as=Fn.getPointPosition(us,Mn),os.lineTo(as.x,as.y)}}function drawRadiusLine(Fn,Mn,rs,is,os){const as=Fn.ctx,us=Mn.circular,{color:ds,lineWidth:hs}=Mn;!us&&!is||!ds||!hs||rs<0||(as.save(),as.strokeStyle=ds,as.lineWidth=hs,as.setLineDash(os.dash),as.lineDashOffset=os.dashOffset,as.beginPath(),pathRadiusLine(Fn,rs,us,is),as.closePath(),as.stroke(),as.restore())}function createPointLabelContext(Fn,Mn,rs){return createContext(Fn,{label:rs,index:Mn,type:"pointLabel"})}class RadialLinearScale extends LinearScaleBase{constructor(Mn){super(Mn),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const Mn=this._padding=toPadding(getTickBackdropHeight(this.options)/2),rs=this.width=this.maxWidth-Mn.width,is=this.height=this.maxHeight-Mn.height;this.xCenter=Math.floor(this.left+rs/2+Mn.left),this.yCenter=Math.floor(this.top+is/2+Mn.top),this.drawingArea=Math.floor(Math.min(rs,is)/2)}determineDataLimits(){const{min:Mn,max:rs}=this.getMinMax(!1);this.min=isNumberFinite(Mn)&&!isNaN(Mn)?Mn:0,this.max=isNumberFinite(rs)&&!isNaN(rs)?rs:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))}generateTickLabels(Mn){LinearScaleBase.prototype.generateTickLabels.call(this,Mn),this._pointLabels=this.getLabels().map((rs,is)=>{const os=callback(this.options.pointLabels.callback,[rs,is],this);return os||os===0?os:""}).filter((rs,is)=>this.chart.getDataVisibility(is))}fit(){const Mn=this.options;Mn.display&&Mn.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(Mn,rs,is,os){this.xCenter+=Math.floor((Mn-rs)/2),this.yCenter+=Math.floor((is-os)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(Mn,rs,is,os))}getIndexAngle(Mn){const rs=TAU/(this._pointLabels.length||1),is=this.options.startAngle||0;return _normalizeAngle(Mn*rs+toRadians(is))}getDistanceFromCenterForValue(Mn){if(isNullOrUndef(Mn))return NaN;const rs=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-Mn)*rs:(Mn-this.min)*rs}getValueForDistanceFromCenter(Mn){if(isNullOrUndef(Mn))return NaN;const rs=Mn/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-rs:this.min+rs}getPointLabelContext(Mn){const rs=this._pointLabels||[];if(Mn>=0&&Mn<rs.length){const is=rs[Mn];return createPointLabelContext(this.getContext(),Mn,is)}}getPointPosition(Mn,rs,is=0){const os=this.getIndexAngle(Mn)-HALF_PI+is;return{x:Math.cos(os)*rs+this.xCenter,y:Math.sin(os)*rs+this.yCenter,angle:os}}getPointPositionForValue(Mn,rs){return this.getPointPosition(Mn,this.getDistanceFromCenterForValue(rs))}getBasePosition(Mn){return this.getPointPositionForValue(Mn||0,this.getBaseValue())}getPointLabelPosition(Mn){const{left:rs,top:is,right:os,bottom:as}=this._pointLabelItems[Mn];return{left:rs,top:is,right:os,bottom:as}}drawBackground(){const{backgroundColor:Mn,grid:{circular:rs}}=this.options;if(Mn){const is=this.ctx;is.save(),is.beginPath(),pathRadiusLine(this,this.getDistanceFromCenterForValue(this._endValue),rs,this._pointLabels.length),is.closePath(),is.fillStyle=Mn,is.fill(),is.restore()}}drawGrid(){const Mn=this.ctx,rs=this.options,{angleLines:is,grid:os,border:as}=rs,us=this._pointLabels.length;let ds,hs,ps;if(rs.pointLabels.display&&drawPointLabels(this,us),os.display&&this.ticks.forEach((io,fo)=>{if(fo!==0||fo===0&&this.min<0){hs=this.getDistanceFromCenterForValue(io.value);const mo=this.getContext(fo),Ao=os.setContext(mo),$o=as.setContext(mo);drawRadiusLine(this,Ao,hs,us,$o)}}),is.display){for(Mn.save(),ds=us-1;ds>=0;ds--){const io=is.setContext(this.getPointLabelContext(ds)),{color:fo,lineWidth:mo}=io;!mo||!fo||(Mn.lineWidth=mo,Mn.strokeStyle=fo,Mn.setLineDash(io.borderDash),Mn.lineDashOffset=io.borderDashOffset,hs=this.getDistanceFromCenterForValue(rs.ticks.reverse?this.min:this.max),ps=this.getPointPosition(ds,hs),Mn.beginPath(),Mn.moveTo(this.xCenter,this.yCenter),Mn.lineTo(ps.x,ps.y),Mn.stroke())}Mn.restore()}}drawBorder(){}drawLabels(){const Mn=this.ctx,rs=this.options,is=rs.ticks;if(!is.display)return;const os=this.getIndexAngle(0);let as,us;Mn.save(),Mn.translate(this.xCenter,this.yCenter),Mn.rotate(os),Mn.textAlign="center",Mn.textBaseline="middle",this.ticks.forEach((ds,hs)=>{if(hs===0&&this.min>=0&&!rs.reverse)return;const ps=is.setContext(this.getContext(hs)),io=toFont(ps.font);if(as=this.getDistanceFromCenterForValue(this.ticks[hs].value),ps.showLabelBackdrop){Mn.font=io.string,us=Mn.measureText(ds.label).width,Mn.fillStyle=ps.backdropColor;const fo=toPadding(ps.backdropPadding);Mn.fillRect(-us/2-fo.left,-as-io.size/2-fo.top,us+fo.width,io.size+fo.height)}renderText(Mn,ds.label,0,-as,io,{color:ps.color,strokeColor:ps.textStrokeColor,strokeWidth:ps.textStrokeWidth})}),Mn.restore()}drawTitle(){}}_m(RadialLinearScale,"id","radialLinear"),_m(RadialLinearScale,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(Mn){return Mn},padding:5,centerPointLabels:!1}}),_m(RadialLinearScale,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),_m(RadialLinearScale,"descriptors",{angleLines:{_fallback:"grid"}});const INTERVALS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},UNITS=Object.keys(INTERVALS);function sorter(Fn,Mn){return Fn-Mn}function parse(Fn,Mn){if(isNullOrUndef(Mn))return null;const rs=Fn._adapter,{parser:is,round:os,isoWeekday:as}=Fn._parseOpts;let us=Mn;return typeof is=="function"&&(us=is(us)),isNumberFinite(us)||(us=typeof is=="string"?rs.parse(us,is):rs.parse(us)),us===null?null:(os&&(us=os==="week"&&(isNumber(as)||as===!0)?rs.startOf(us,"isoWeek",as):rs.startOf(us,os)),+us)}function determineUnitForAutoTicks(Fn,Mn,rs,is){const os=UNITS.length;for(let as=UNITS.indexOf(Fn);as<os-1;++as){const us=INTERVALS[UNITS[as]],ds=us.steps?us.steps:Number.MAX_SAFE_INTEGER;if(us.common&&Math.ceil((rs-Mn)/(ds*us.size))<=is)return UNITS[as]}return UNITS[os-1]}function determineUnitForFormatting(Fn,Mn,rs,is,os){for(let as=UNITS.length-1;as>=UNITS.indexOf(rs);as--){const us=UNITS[as];if(INTERVALS[us].common&&Fn._adapter.diff(os,is,us)>=Mn-1)return us}return UNITS[rs?UNITS.indexOf(rs):0]}function determineMajorUnit(Fn){for(let Mn=UNITS.indexOf(Fn)+1,rs=UNITS.length;Mn<rs;++Mn)if(INTERVALS[UNITS[Mn]].common)return UNITS[Mn]}function addTick(Fn,Mn,rs){if(!rs)Fn[Mn]=!0;else if(rs.length){const{lo:is,hi:os}=_lookup(rs,Mn),as=rs[is]>=Mn?rs[is]:rs[os];Fn[as]=!0}}function setMajorTicks(Fn,Mn,rs,is){const os=Fn._adapter,as=+os.startOf(Mn[0].value,is),us=Mn[Mn.length-1].value;let ds,hs;for(ds=as;ds<=us;ds=+os.add(ds,1,is))hs=rs[ds],hs>=0&&(Mn[hs].major=!0);return Mn}function ticksFromTimestamps(Fn,Mn,rs){const is=[],os={},as=Mn.length;let us,ds;for(us=0;us<as;++us)ds=Mn[us],os[ds]=us,is.push({value:ds,major:!1});return as===0||!rs?is:setMajorTicks(Fn,is,os,rs)}class TimeScale extends Scale{constructor(Mn){super(Mn),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(Mn,rs={}){const is=Mn.time||(Mn.time={}),os=this._adapter=new adapters._date(Mn.adapters.date);os.init(rs),mergeIf(is.displayFormats,os.formats()),this._parseOpts={parser:is.parser,round:is.round,isoWeekday:is.isoWeekday},super.init(Mn),this._normalized=rs.normalized}parse(Mn,rs){return Mn===void 0?null:parse(this,Mn)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const Mn=this.options,rs=this._adapter,is=Mn.time.unit||"day";let{min:os,max:as,minDefined:us,maxDefined:ds}=this.getUserBounds();function hs(ps){!us&&!isNaN(ps.min)&&(os=Math.min(os,ps.min)),!ds&&!isNaN(ps.max)&&(as=Math.max(as,ps.max))}(!us||!ds)&&(hs(this._getLabelBounds()),(Mn.bounds!=="ticks"||Mn.ticks.source!=="labels")&&hs(this.getMinMax(!1))),os=isNumberFinite(os)&&!isNaN(os)?os:+rs.startOf(Date.now(),is),as=isNumberFinite(as)&&!isNaN(as)?as:+rs.endOf(Date.now(),is)+1,this.min=Math.min(os,as-1),this.max=Math.max(os+1,as)}_getLabelBounds(){const Mn=this.getLabelTimestamps();let rs=Number.POSITIVE_INFINITY,is=Number.NEGATIVE_INFINITY;return Mn.length&&(rs=Mn[0],is=Mn[Mn.length-1]),{min:rs,max:is}}buildTicks(){const Mn=this.options,rs=Mn.time,is=Mn.ticks,os=is.source==="labels"?this.getLabelTimestamps():this._generate();Mn.bounds==="ticks"&&os.length&&(this.min=this._userMin||os[0],this.max=this._userMax||os[os.length-1]);const as=this.min,us=this.max,ds=_filterBetween(os,as,us);return this._unit=rs.unit||(is.autoSkip?determineUnitForAutoTicks(rs.minUnit,this.min,this.max,this._getLabelCapacity(as)):determineUnitForFormatting(this,ds.length,rs.minUnit,this.min,this.max)),this._majorUnit=!is.major.enabled||this._unit==="year"?void 0:determineMajorUnit(this._unit),this.initOffsets(os),Mn.reverse&&ds.reverse(),ticksFromTimestamps(this,ds,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(Mn=>+Mn.value))}initOffsets(Mn=[]){let rs=0,is=0,os,as;this.options.offset&&Mn.length&&(os=this.getDecimalForValue(Mn[0]),Mn.length===1?rs=1-os:rs=(this.getDecimalForValue(Mn[1])-os)/2,as=this.getDecimalForValue(Mn[Mn.length-1]),Mn.length===1?is=as:is=(as-this.getDecimalForValue(Mn[Mn.length-2]))/2);const us=Mn.length<3?.5:.25;rs=_limitValue(rs,0,us),is=_limitValue(is,0,us),this._offsets={start:rs,end:is,factor:1/(rs+1+is)}}_generate(){const Mn=this._adapter,rs=this.min,is=this.max,os=this.options,as=os.time,us=as.unit||determineUnitForAutoTicks(as.minUnit,rs,is,this._getLabelCapacity(rs)),ds=valueOrDefault(os.ticks.stepSize,1),hs=us==="week"?as.isoWeekday:!1,ps=isNumber(hs)||hs===!0,io={};let fo=rs,mo,Ao;if(ps&&(fo=+Mn.startOf(fo,"isoWeek",hs)),fo=+Mn.startOf(fo,ps?"day":us),Mn.diff(is,rs,us)>1e5*ds)throw new Error(rs+" and "+is+" are too far apart with stepSize of "+ds+" "+us);const $o=os.ticks.source==="data"&&this.getDataTimestamps();for(mo=fo,Ao=0;mo<is;mo=+Mn.add(mo,ds,us),Ao++)addTick(io,mo,$o);return(mo===is||os.bounds==="ticks"||Ao===1)&&addTick(io,mo,$o),Object.keys(io).sort(sorter).map(Lo=>+Lo)}getLabelForValue(Mn){const rs=this._adapter,is=this.options.time;return is.tooltipFormat?rs.format(Mn,is.tooltipFormat):rs.format(Mn,is.displayFormats.datetime)}format(Mn,rs){const os=this.options.time.displayFormats,as=this._unit,us=rs||os[as];return this._adapter.format(Mn,us)}_tickFormatFunction(Mn,rs,is,os){const as=this.options,us=as.ticks.callback;if(us)return callback(us,[Mn,rs,is],this);const ds=as.time.displayFormats,hs=this._unit,ps=this._majorUnit,io=hs&&ds[hs],fo=ps&&ds[ps],mo=is[rs],Ao=ps&&fo&&mo&&mo.major;return this._adapter.format(Mn,os||(Ao?fo:io))}generateTickLabels(Mn){let rs,is,os;for(rs=0,is=Mn.length;rs<is;++rs)os=Mn[rs],os.label=this._tickFormatFunction(os.value,rs,Mn)}getDecimalForValue(Mn){return Mn===null?NaN:(Mn-this.min)/(this.max-this.min)}getPixelForValue(Mn){const rs=this._offsets,is=this.getDecimalForValue(Mn);return this.getPixelForDecimal((rs.start+is)*rs.factor)}getValueForPixel(Mn){const rs=this._offsets,is=this.getDecimalForPixel(Mn)/rs.factor-rs.end;return this.min+is*(this.max-this.min)}_getLabelSize(Mn){const rs=this.options.ticks,is=this.ctx.measureText(Mn).width,os=toRadians(this.isHorizontal()?rs.maxRotation:rs.minRotation),as=Math.cos(os),us=Math.sin(os),ds=this._resolveTickFontOptions(0).size;return{w:is*as+ds*us,h:is*us+ds*as}}_getLabelCapacity(Mn){const rs=this.options.time,is=rs.displayFormats,os=is[rs.unit]||is.millisecond,as=this._tickFormatFunction(Mn,0,ticksFromTimestamps(this,[Mn],this._majorUnit),os),us=this._getLabelSize(as),ds=Math.floor(this.isHorizontal()?this.width/us.w:this.height/us.h)-1;return ds>0?ds:1}getDataTimestamps(){let Mn=this._cache.data||[],rs,is;if(Mn.length)return Mn;const os=this.getMatchingVisibleMetas();if(this._normalized&&os.length)return this._cache.data=os[0].controller.getAllParsedValues(this);for(rs=0,is=os.length;rs<is;++rs)Mn=Mn.concat(os[rs].controller.getAllParsedValues(this));return this._cache.data=this.normalize(Mn)}getLabelTimestamps(){const Mn=this._cache.labels||[];let rs,is;if(Mn.length)return Mn;const os=this.getLabels();for(rs=0,is=os.length;rs<is;++rs)Mn.push(parse(this,os[rs]));return this._cache.labels=this._normalized?Mn:this.normalize(Mn)}normalize(Mn){return _arrayUnique(Mn.sort(sorter))}}_m(TimeScale,"id","time"),_m(TimeScale,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function interpolate(Fn,Mn,rs){let is=0,os=Fn.length-1,as,us,ds,hs;rs?(Mn>=Fn[is].pos&&Mn<=Fn[os].pos&&({lo:is,hi:os}=_lookupByKey(Fn,"pos",Mn)),{pos:as,time:ds}=Fn[is],{pos:us,time:hs}=Fn[os]):(Mn>=Fn[is].time&&Mn<=Fn[os].time&&({lo:is,hi:os}=_lookupByKey(Fn,"time",Mn)),{time:as,pos:ds}=Fn[is],{time:us,pos:hs}=Fn[os]);const ps=us-as;return ps?ds+(hs-ds)*(Mn-as)/ps:ds}class TimeSeriesScale extends TimeScale{constructor(Mn){super(Mn),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const Mn=this._getTimestampsForTable(),rs=this._table=this.buildLookupTable(Mn);this._minPos=interpolate(rs,this.min),this._tableRange=interpolate(rs,this.max)-this._minPos,super.initOffsets(Mn)}buildLookupTable(Mn){const{min:rs,max:is}=this,os=[],as=[];let us,ds,hs,ps,io;for(us=0,ds=Mn.length;us<ds;++us)ps=Mn[us],ps>=rs&&ps<=is&&os.push(ps);if(os.length<2)return[{time:rs,pos:0},{time:is,pos:1}];for(us=0,ds=os.length;us<ds;++us)io=os[us+1],hs=os[us-1],ps=os[us],Math.round((io+hs)/2)!==ps&&as.push({time:ps,pos:us/(ds-1)});return as}_generate(){const Mn=this.min,rs=this.max;let is=super.getDataTimestamps();return(!is.includes(Mn)||!is.length)&&is.splice(0,0,Mn),(!is.includes(rs)||is.length===1)&&is.push(rs),is.sort((os,as)=>os-as)}_getTimestampsForTable(){let Mn=this._cache.all||[];if(Mn.length)return Mn;const rs=this.getDataTimestamps(),is=this.getLabelTimestamps();return rs.length&&is.length?Mn=this.normalize(rs.concat(is)):Mn=rs.length?rs:is,Mn=this._cache.all=Mn,Mn}getDecimalForValue(Mn){return(interpolate(this._table,Mn)-this._minPos)/this._tableRange}getValueForPixel(Mn){const rs=this._offsets,is=this.getDecimalForPixel(Mn)/rs.factor-rs.end;return interpolate(this._table,is*this._tableRange+this._minPos,!0)}}_m(TimeSeriesScale,"id","timeseries"),_m(TimeSeriesScale,"defaults",TimeScale.defaults);const defaultDatasetIdKey="label";function reforwardRef(Fn,Mn){typeof Fn=="function"?Fn(Mn):Fn&&(Fn.current=Mn)}function setOptions(Fn,Mn){const rs=Fn.options;rs&&Mn&&Object.assign(rs,Mn)}function setLabels(Fn,Mn){Fn.labels=Mn}function setDatasets(Fn,Mn){let rs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:defaultDatasetIdKey;const is=[];Fn.datasets=Mn.map(os=>{const as=Fn.datasets.find(us=>us[rs]===os[rs]);return!as||!os.data||is.includes(as)?{...os}:(is.push(as),Object.assign(as,os),as)})}function cloneData(Fn){let Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:defaultDatasetIdKey;const rs={labels:[],datasets:[]};return setLabels(rs,Fn.labels),setDatasets(rs,Fn.datasets,Mn),rs}function ChartComponent(Fn,Mn){const{height:rs=150,width:is=300,redraw:os=!1,datasetIdKey:as,type:us,data:ds,options:hs,plugins:ps=[],fallbackContent:io,updateMode:fo,...mo}=Fn,Ao=reactExports.useRef(null),$o=reactExports.useRef(),Lo=()=>{Ao.current&&($o.current=new Chart$1(Ao.current,{type:us,data:cloneData(ds,as),options:hs&&{...hs},plugins:ps}),reforwardRef(Mn,$o.current))},Go=()=>{reforwardRef(Mn,null),$o.current&&($o.current.destroy(),$o.current=null)};return reactExports.useEffect(()=>{!os&&$o.current&&hs&&setOptions($o.current,hs)},[os,hs]),reactExports.useEffect(()=>{!os&&$o.current&&setLabels($o.current.config.data,ds.labels)},[os,ds.labels]),reactExports.useEffect(()=>{!os&&$o.current&&ds.datasets&&setDatasets($o.current.config.data,ds.datasets,as)},[os,ds.datasets]),reactExports.useEffect(()=>{$o.current&&(os?(Go(),setTimeout(Lo)):$o.current.update(fo))},[os,hs,ds.labels,ds.datasets,fo]),reactExports.useEffect(()=>{$o.current&&(Go(),setTimeout(Lo))},[us]),reactExports.useEffect(()=>(Lo(),()=>Go()),[]),React.createElement("canvas",Object.assign({ref:Ao,role:"img",height:rs,width:is},mo),io)}const Chart=reactExports.forwardRef(ChartComponent);function createTypedChart(Fn,Mn){return Chart$1.register(Mn),reactExports.forwardRef((rs,is)=>React.createElement(Chart,Object.assign({},rs,{ref:is,type:Fn})))}const Bar=createTypedChart("bar",BarController);Chart$1.register(CategoryScale,LinearScale,BarElement,plugin_title,plugin_tooltip,plugin_legend);let delayed;function ChartApp(){const{chartValue:Fn,isMode:Mn,selectedCrypto:rs}=useStore(),is={responsive:!0,interaction:{mode:"index",intersect:!1},animation:{onComplete:()=>{delayed=!0},delay:as=>{let us=0;return as.type==="data"&&as.mode==="default"&&!delayed&&(us=as.dataIndex*300+as.datasetIndex*100),us}},scales:{x:{stacked:!0},y:{stacked:!0}},plugins:{tooltip:{callbacks:{label:as=>{const us=as.dataset.label||"",ds=as.parsed.y,hs=Fn[as.dataIndex].timeDuration,ps=Fn[as.dataIndex].eth,io=Fn[as.dataIndex].leverage;return us==="Long "+Mn+" OPerps"?[`${"L"+(Mn===OPTIONS.PUT?"P":"C")+"O Return"}:  ${ds} %`]:[`${"S"+(Mn===OPTIONS.PUT?"P":"C")+"O Return"}:  ${ds} %`,`${rs} Price change : ${ps} %`,`Leverage: ${io}`,`Cycle duration : ${hs}`]}}}}},os={labels:Fn.map(as=>`${as.shortdate} ${as.time}`),datasets:[{label:`Long ${Mn} OPerps`,data:Fn.map(as=>as.long),backgroundColor:"#0E9384",stack:"Stack 0"},{label:`Short ${Mn} OPerps`,data:Fn.map(as=>as.short),backgroundColor:"#1570EF",stack:"Stack 1"}]};return jsxRuntimeExports.jsx(Bar,{options:is,data:os})}const CycleDetails=()=>{const{isDarkMode:Fn}=useStore(),{tooltipStyle:Mn}=useStyles();return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Tabs,{children:[jsxRuntimeExports.jsx(TabList,{className:`flex justify-start items-center rounded-tl-2xl border-b ${Fn?"border-[#e3e8ef]":"border-[#292a2d]"}`,children:jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-center flex flex-1 flex-row justify-start items-center  2xl:text-sm xl:text-sm lg:text-sm md:text-sm sm:text-xs max-sm:text-xs outline-none text-[#364152] font-bold h-14":"text-center flex flex-1 flex-row justify-start items-center   2xl:text-sm xl:text-sm lg:text-sm md:text-sm sm:text-xs max-sm:text-xs outline-none text-[#FFFFFF] font-bold h-14 border-[rgba(245,247,250,0.06)]"} gap-1 w-full px-4`,children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Traders and Liquidity providers can see the leverage, returns and price change of LCO/SCO and LPO/LCO in previous cycles",arrow:!1,overlayInnerStyle:Mn,children:"Previous Cycles"})})}),jsxRuntimeExports.jsx(TabPanel,{className:"w-full",children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("div",{className:` ${Fn?"bg-[#FCFDFE]":"bg-transparent"} rounded-[0_0_1rem_1rem] py-4 `,children:jsxRuntimeExports.jsx(ChartApp,{})})})})]})})},CurrentAndNextCycle=()=>{var ds,hs,ps,io;const{t:Fn}=useTranslation(),{isDarkMode:Mn,timing:rs,pnl:is,multiMarketPnlData:os,selectedCrypto:as,isMode:us}=useStore();return jsxRuntimeExports.jsx("div",{className:" w-full timing justify-start items-start h-full flex flex-col gap-4 bg-transparent mt-4",children:jsxRuntimeExports.jsxs("div",{className:"w-full rounded-2xl  xxl:hidden bxl:hidden xl:hidden sxl:hidden lg:inline md:inline sm:inline xd:inline  ",children:[jsxRuntimeExports.jsx("div",{className:"w-full",children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[#0C0C0D]":"text-[white]"} w-auto flex flex-col justify-between items-center text-sm px-4 py-2`,children:[jsxRuntimeExports.jsx("div",{className:"w-full font-extrabold text-sm mb-4",children:Fn("currentcycle")}),jsxRuntimeExports.jsxs("div",{className:`w-full rounded-lg flex justify-between items-center text-[0.625rem] font-bold ${Mn?"text-[#0E9384]":"text-[#2ED3B7]"}`,children:[jsxRuntimeExports.jsxs("div",{className:"bg-transparent flex flex-col justify-center items-start my-2",children:[jsxRuntimeExports.jsx("div",{className:" text-[#A5A5A6] font-normal text-xs",children:"Start Price"}),jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-black":"text-[#FFFFFF]"} font-extrabold text-sm`,children:["$",parseFloat(rs.cycleStartPriceFinal)>=50?parseFloat(rs.cycleStartPriceFinal).toLocaleString():parseFloat(rs.cycleStartPriceFinal)]})]}),jsxRuntimeExports.jsxs("div",{className:"bg-transparent flex flex-col justify-center items-start my-2",children:[jsxRuntimeExports.jsx("div",{className:" text-[#A5A5A6] font-normal text-xs",children:"Breakeven Price"}),jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-black":"text-[#FFFFFF]"} font-extrabold text-sm`,children:["$",rs.breakEvenPrice>=50?rs.breakEvenPrice.toLocaleString():rs.breakEvenPrice]})]}),jsxRuntimeExports.jsxs("div",{className:"bg-transparent flex flex-col justify-center items-start my-2",id:"element-id-for-guide-6",children:[jsxRuntimeExports.jsx("div",{className:" text-[#A5A5A6] font-normal text-xs",children:"Leverage"}),jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-black":"text-[#FFFFFF]"} font-extrabold text-sm`,children:[rs.currentLeverage>=50?rs.currentLeverage.toFixed():rs.currentLeverage,"x"]})]}),jsxRuntimeExports.jsxs("div",{className:"bg-transparent flex flex-col justify-center items-start my-2",children:[jsxRuntimeExports.jsx("div",{className:" text-[#A5A5A6] font-normal text-xs",children:"Long PnL "}),jsxRuntimeExports.jsxs("div",{className:`${os&&parseFloat((hs=(ds=os==null?void 0:os[as])==null?void 0:ds[us])==null?void 0:hs.CurrentLSPnl)<0?"text-[#F04438]":"text-[#12B76A]"} font-extrabold text-sm`,children:[os?(io=(ps=os==null?void 0:os[as])==null?void 0:ps[us])==null?void 0:io.CurrentLSPnl:"0.00","%"]})]})]})]})}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("div",{className:"2xl:inline-flex xl:inline-flex lg:inline-flex md:inline-flex sm:inline-flex max-sm:inline-flex   w-full h-full",children:jsxRuntimeExports.jsx(CandlestickChart,{id:"instance3"})})})]})})},FooterGraph=()=>{const{isDarkMode:Fn}=useStore();return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:`flex flex-col gap-4 xxl:rounded-2xl bxl:rounded-2xl xl:rounded-2xl sxl:rounded-2xl lg:rounded-2xl md:rounded-none sm:rounded-none xd:rounded-none !h-full !w-full z-[0] xxl:border bxl:border xl:border sxl:border lg:border-transparent md:border-transparent sm:border-transparent xd:border-transparent ${Fn?"xxl:border-[#E3E8EF] bxl:border-[#E3E8EF] xl:border-[#E3E8EF] sxl:border-[#E3E8EF] xxl:bg-[#FCFDFE] bxl:bg-[#FCFDFE] xl:bg-[#FCFDFE] sxl:bg-[#FCFDFE] lg:bg-[#FCFDFE] md:bg-[#E4F2F3] sm:bg-[#E4F2F3] xd:bg-[#E4F2F3] text-[black]":"xxl:border-[rgba(255,255,255,0.10)] bxl:border-[rgba(255,255,255,0.10)] xl:border-[rgba(255,255,255,0.10)] sxl:border-[rgba(255,255,255,0.10)] xxl:bg-[rgba(23,24,26,0.50)] bxl:bg-[rgba(23,24,26,0.50)] xl:bg-[rgba(23,24,26,0.50)] sxl:bg-[rgba(23,24,26,0.50)] lg:bg-[rgba(23,24,26,0.50)] md:bg-[#0C0C0D] sm:bg-[#0C0C0D] xd:bg-[#0C0C0D] text-[white]"}`,children:jsxRuntimeExports.jsx(CurrentAndNextCycle,{})})})},FooterOrderDetails=()=>{const{isDarkMode:Fn,isSelectedChain:Mn,selectedCrypto:rs,isMode:is}=useStore(),{executeOrder:os,executeCancel:as,executeClaim:us,executeInvaultSell:ds}=useOrder(),{address:hs,isConnected:ps}=useAccount(),[io,fo]=reactExports.useState("Open Orders"),[mo,Ao]=reactExports.useState(!1),{tooltipStyle:$o}=useStyles(),{fetchData:Lo}=useData(),Go=async()=>{try{Ao(!0),ps&&await Lo(hs,!1),Ao(!1)}catch{Ao(!1)}};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-4 xxl:rounded-2xl bxl:rounded-2xl xl:rounded-2xl sxl:rounded-2xl lg:rounded-2xl md:rounded-none sm:rounded-none xd:rounded-none !h-full !w-full z-[0] xxl:border bxl:border xl:border sxl:border lg:border-transparent md:border-transparent sm:border-transparent xd:border-transparent",children:jsxRuntimeExports.jsx("div",{className:"w-full",id:"element-id-for-guide-8",children:jsxRuntimeExports.jsxs(Tabs,{children:[jsxRuntimeExports.jsxs("div",{className:`${Fn?"border-[#E3E8EF]":" border-[rgba(245,247,250,0.06)]"} xxl:flex bxl:flex xl:flex sxl:flex justify-between border-b-2`,children:[jsxRuntimeExports.jsx(TabList,{children:jsxRuntimeExports.jsxs("div",{className:"flex h-12 gap-4 text-xs",children:[jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-[#777879]":"text-[#A5A5A6]"} ${io==="Open Orders"?`${Fn?"bg-[#FCFDFE] text-black":"bg-[#ffffff0f] text-white"} font-extrabold`:""} flex justify-center items-center p-3.5 text-[#A5A5A6] outline-none cursor-pointer`,onClick:()=>fo("Open Orders"),children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"When a Long OPerps trader/ liquidity provider first buys/sells, the transaction is shown here. This indicates that it's yet to be an active trade. Once the next cycle starts, the trade/position will move over to positions where you can also see profit and loss",arrow:!1,overlayInnerStyle:{marginTop:"1rem",...$o},children:"Open Orders"})}),jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-[#777879]":"text-[#A5A5A6]"} ${io==="Positions"?`${Fn?"bg-[#FCFDFE] text-black":"bg-[#ffffff0f] text-white"} font-extrabold`:""} flex justify-center items-center p-3.5 text-[#A5A5A6] outline-none cursor-pointer`,onClick:()=>fo("Positions"),children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"An OPerps trader or Liquidity provider can see their live trades here including the current balance and profit and loss",arrow:!1,overlayInnerStyle:{marginBottom:"1rem",marginTop:"1rem",...$o},children:"Positions"})}),jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-[#777879]":"text-[#A5A5A6]"} ${io==="Withdraw"?`${Fn?"bg-[#FCFDFE] text-black":"bg-[#ffffff0f] text-white"} font-extrabold`:""}  flex justify-center items-center p-3.5 text-[#A5A5A6] outline-none cursor-pointer`,onClick:()=>fo("Withdraw"),children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"An OPerps trader can withdraw the USDC left after closing the trade",arrow:!1,overlayInnerStyle:{marginBottom:"1rem",...$o},children:"Withdraw"})}),jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-[#777879]":"text-[#A5A5A6]"} ${io==="Trades"?`${Fn?"bg-[#FCFDFE] text-black":"bg-[#ffffff0f] text-white"} font-extrabold`:""}  flex justify-center items-center p-3.5 text-[#A5A5A6] outline-none cursor-pointer`,onClick:()=>fo("Trades"),children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"An OPerps trader or Liquidity provider can see their buy/sell transactions here",arrow:!1,overlayInnerStyle:{marginBottom:"1rem",...$o},children:"Trades"})})]})}),jsxRuntimeExports.jsxs("div",{className:"flex py-3.5 xxl:justify-end bxl:justify-end xl:justify-end sxl:justify-end lg:justify-start md:justify-start sm:justify-start xd:justify-start ml-2",children:[jsxRuntimeExports.jsxs("a",{className:"flex mr-4",href:`https://dpanshu.pythonanywhere.com/user_history?address=${hs}&chain=${Mn}&token=${rs}&option_type=${is}`,target:"_blank",children:[jsxRuntimeExports.jsx("img",{src:Download,alt:"Download",className:"w-4 h-4"}),jsxRuntimeExports.jsx("div",{className:"text-[#2ED3B7] font-extrabold text-xs ml-2",children:"Download PnL History"})]}),jsxRuntimeExports.jsx("img",{src:Fn?refreshIconBlack:refreshIcon,alt:"refreshIcon",onClick:Go,className:` mr-4 w-5 cursor-pointer ${mo?"animate-spin":""} `})]})]}),jsxRuntimeExports.jsx("div",{className:"flex justify-between h-auto w-full",children:jsxRuntimeExports.jsx(TabPanel,{className:"w-full",children:jsxRuntimeExports.jsx(MobileOpenOrder,{executeCancel:as})})}),jsxRuntimeExports.jsx("div",{className:"flex  w-full  h-auto overflow-x-auto",children:jsxRuntimeExports.jsx(TabPanel,{className:"w-full",children:jsxRuntimeExports.jsx(MobilePositions,{executeOrder:os,executeClaim:us,executeInvaultSell:ds})})}),jsxRuntimeExports.jsx("div",{className:"flex  w-full h-auto overflow-x-auto",children:jsxRuntimeExports.jsx(TabPanel,{className:"w-full",children:jsxRuntimeExports.jsx(MobileWithdraw,{executeClaim:us})})}),jsxRuntimeExports.jsx("div",{className:"flex  w-full h-auto",children:jsxRuntimeExports.jsx(TabPanel,{className:"w-full",children:jsxRuntimeExports.jsx(MobileTrades,{})})})]})})})})},FooterBuySell=()=>{const{isDarkMode:Fn}=useStore();return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:`flex flex-col gap-4 xxl:rounded-2xl bxl:rounded-2xl xl:rounded-2xl sxl:rounded-2xl lg:rounded-2xl md:rounded-none sm:rounded-none xd:rounded-none !h-full !w-full z-[0] xxl:border bxl:border xl:border sxl:border lg:border-transparent md:border-transparent sm:border-transparent xd:border-transparent ${Fn?"xxl:border-[#E3E8EF] bxl:border-[#E3E8EF] xl:border-[#E3E8EF] sxl:border-[#E3E8EF] xxl:bg-[#FCFDFE] bxl:bg-[#FCFDFE] xl:bg-[#FCFDFE] sxl:bg-[#FCFDFE] lg:bg-[#FCFDFE] md:bg-[#E4F2F3] sm:bg-[#E4F2F3] xd:bg-[#E4F2F3] text-[black]":"xxl:border-[rgba(255,255,255,0.10)] bxl:border-[rgba(255,255,255,0.10)] xl:border-[rgba(255,255,255,0.10)] sxl:border-[rgba(255,255,255,0.10)] xxl:bg-[rgba(23,24,26,0.50)] bxl:bg-[rgba(23,24,26,0.50)] xl:bg-[rgba(23,24,26,0.50)] sxl:bg-[rgba(23,24,26,0.50)] lg:bg-[rgba(23,24,26,0.50)] md:bg-[#0C0C0D] sm:bg-[#0C0C0D] xd:bg-[#0C0C0D] text-[white]"}`,children:jsxRuntimeExports.jsx("div",{className:`${Fn?"bg-[#FFFFFF] border-[#E3E8EF]":"bg-gradient-to-r from-[#f5fffa0f] to-[#F5F7FA00] border-[rgba(245,247,250,0.06)] bg_container"} !w-full h-auto border my-4 rounded-2xl`,children:jsxRuntimeExports.jsx(BuySell,{})})})})},FooterCycleDetails=()=>{const{isDarkMode:Fn}=useStore();return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:`flex flex-col gap-4 xxl:rounded-2xl bxl:rounded-2xl xl:rounded-2xl sxl:rounded-2xl lg:rounded-2xl md:rounded-none sm:rounded-none xd:rounded-none !h-full !w-full z-[0] xxl:border bxl:border xl:border sxl:border lg:border-transparent md:border-transparent sm:border-transparent xd:border-transparent ${Fn?"xxl:border-[#E3E8EF] bxl:border-[#E3E8EF] xl:border-[#E3E8EF] sxl:border-[#E3E8EF] xxl:bg-[#FCFDFE] bxl:bg-[#FCFDFE] xl:bg-[#FCFDFE] sxl:bg-[#FCFDFE] lg:bg-[#FCFDFE] md:bg-[#E4F2F3] sm:bg-[#E4F2F3] xd:bg-[#E4F2F3] text-[black]":"xxl:border-[rgba(255,255,255,0.10)] bxl:border-[rgba(255,255,255,0.10)] xl:border-[rgba(255,255,255,0.10)] sxl:border-[rgba(255,255,255,0.10)] xxl:bg-[rgba(23,24,26,0.50)] bxl:bg-[rgba(23,24,26,0.50)] xl:bg-[rgba(23,24,26,0.50)] sxl:bg-[rgba(23,24,26,0.50)] lg:bg-[rgba(23,24,26,0.50)] md:bg-[#0C0C0D] sm:bg-[#0C0C0D] xd:bg-[#0C0C0D] text-[white]"}`,children:jsxRuntimeExports.jsx("div",{className:" w-full timing justify-start items-start h-full flex flex-col gap-4 bg-transparent ",children:jsxRuntimeExports.jsx("div",{className:`${Fn?"text-[black] border-[#E3E8EF] bg-white":"text-[white] border-[rgba(245,247,250,0.06)]  bg-[#17181A]"} border my-4 rounded-2xl w-full`,children:jsxRuntimeExports.jsx(CycleDetails,{})})})})})},user="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='M5.3163%2019.4384C5.92462%2018.0052%207.34492%2017%209%2017H15C16.6551%2017%2018.0754%2018.0052%2018.6837%2019.4384M16%209.5C16%2011.7091%2014.2091%2013.5%2012%2013.5C9.79086%2013.5%208%2011.7091%208%209.5C8%207.29086%209.79086%205.5%2012%205.5C14.2091%205.5%2016%207.29086%2016%209.5ZM22%2012C22%2017.5228%2017.5228%2022%2012%2022C6.47715%2022%202%2017.5228%202%2012C2%206.47715%206.47715%202%2012%202C17.5228%202%2022%206.47715%2022%2012Z'%20stroke='white'%20stroke-opacity='0.8'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",userBlack="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='M5.3163%2019.4384C5.92462%2018.0052%207.34492%2017%209%2017H15C16.6551%2017%2018.0754%2018.0052%2018.6837%2019.4384M16%209.5C16%2011.7091%2014.2091%2013.5%2012%2013.5C9.79086%2013.5%208%2011.7091%208%209.5C8%207.29086%209.79086%205.5%2012%205.5C14.2091%205.5%2016%207.29086%2016%209.5ZM22%2012C22%2017.5228%2017.5228%2022%2012%2022C6.47715%2022%202%2017.5228%202%2012C2%206.47715%206.47715%202%2012%202C17.5228%202%2022%206.47715%2022%2012Z'%20stroke='%234A4B4D'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",FooterWallet=()=>{var ps;const{isDarkMode:Fn}=useStore(),{disconnect:Mn}=useDisconnect(),{address:rs,isConnected:is}=useAccount(),{tooltipStyle:os,notificationStyle:as}=useStyles(),{open:us}=useAppKit(),ds=reactExports.useCallback(async io=>{await navigator.clipboard.writeText(io)},[]),hs=()=>{localStorage.setItem("isShowPopup","false"),Mn()};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"w-full flex flex-col justify-start items-start pt-3 pb-16 px-2 gap-2 ",children:jsxRuntimeExports.jsx("div",{className:"flex xxl:flex-[0.4] bxl:flex-[0.4] xl:flex-[0.4] sxl:flex-[0.4] lg:flex-[0.5] md:flex-[1] sm:flex-[1] xd:flex-[1] xxl:flex-row bxl:flex-row xl:flex-row sxl:flex-row lg:flex-row md:flex-col sm:flex-col xd:flex-col !justify-start items-center gap-2 w-full",children:is?jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center w-full gap-2",children:jsxRuntimeExports.jsxs("div",{className:`w-full py-4 px-6 rounded-lg ${Fn?"bg-[#FCFDFE]":"bg-[#1D1E20]"} `,children:[jsxRuntimeExports.jsx("p",{className:`${Fn?"text-[#000]":"text-[#777879]"} text-sm font-manrope font-normal`,children:"Wallet Address"}),jsxRuntimeExports.jsxs("h1",{className:"text-[#2ED3B7] flex items-center justify-start font-bold font-manrope text-xs",children:[(rs==null?void 0:rs.slice(0,5))+".."+((ps=rs==null?void 0:rs.toString())==null?void 0:ps.slice(-5)),jsxRuntimeExports.jsx(Tooltip$1,{placement:"bottom",title:"Copy Wallet Address",arrow:!1,overlayInnerStyle:os,children:jsxRuntimeExports.jsx("img",{src:Fn?CopyDark:Copy,alt:"Copy",className:"w-6 h-6 ml-2 cursor-pointer",onClick:()=>{ds(rs),staticMethods.success({message:"Address Copied",style:as})}})})]})]})}):jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center w-full gap-2",children:jsxRuntimeExports.jsxs("div",{className:`w-full flex flex-col items-center justify-center py-4 px-6 rounded-lg ${Fn?"bg-[#FCFDFE]":"bg-[#1D1E20]"}`,children:[jsxRuntimeExports.jsx("img",{src:Fn?userBlack:user,alt:"",className:"w-24 h-24 mr-2"}),jsxRuntimeExports.jsx("div",{className:"text-[#777879] mt-4 text-xs font-manrope font-normal",children:"Connect wallet to check your account details"})]})})})}),jsxRuntimeExports.jsx("div",{className:"w-full fixed bottom-28 left-0 px-2",children:jsxRuntimeExports.jsx("button",{className:`w-full  ${is?"buy-button-red":Fn?"buy-button-dark":"buy-button"}`,onClick:()=>{is?hs():us()},children:jsxRuntimeExports.jsx("div",{className:`
				${Fn?"buy-button-inner_blue":"buy-button-inner"} h-full flex flex-row justify-center items-center font-bold leading-[normal] py-[0.938rem] rounded-2xl text-center text-gray-900 text-xl w-full`,children:jsxRuntimeExports.jsx("span",{className:`${is?"button-text-red":Fn?"button-text_dark":"button-text"}`,children:is?"Disconnect Wallet":"Connect Wallet"})})})})]})},BarChart="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='M8%2013V17M16%2011V17M12%207V17M7.8%2021H16.2C17.8802%2021%2018.7202%2021%2019.362%2020.673C19.9265%2020.3854%2020.3854%2019.9265%2020.673%2019.362C21%2018.7202%2021%2017.8802%2021%2016.2V7.8C21%206.11984%2021%205.27976%2020.673%204.63803C20.3854%204.07354%2019.9265%203.6146%2019.362%203.32698C18.7202%203%2017.8802%203%2016.2%203H7.8C6.11984%203%205.27976%203%204.63803%203.32698C4.07354%203.6146%203.6146%204.07354%203.32698%204.63803C3%205.27976%203%206.11984%203%207.8V16.2C3%2017.8802%203%2018.7202%203.32698%2019.362C3.6146%2019.9265%204.07354%2020.3854%204.63803%2020.673C5.27976%2021%206.11984%2021%207.8%2021Z'%20stroke='%23A5A5A6'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",BarChartGreen="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='M8%2013V17M16%2011V17M12%207V17M7.8%2021H16.2C17.8802%2021%2018.7202%2021%2019.362%2020.673C19.9265%2020.3854%2020.3854%2019.9265%2020.673%2019.362C21%2018.7202%2021%2017.8802%2021%2016.2V7.8C21%206.11984%2021%205.27976%2020.673%204.63803C20.3854%204.07354%2019.9265%203.6146%2019.362%203.32698C18.7202%203%2017.8802%203%2016.2%203H7.8C6.11984%203%205.27976%203%204.63803%203.32698C4.07354%203.6146%203.6146%204.07354%203.32698%204.63803C3%205.27976%203%206.11984%203%207.8V16.2C3%2017.8802%203%2018.7202%203.32698%2019.362C3.6146%2019.9265%204.07354%2020.3854%204.63803%2020.673C5.27976%2021%206.11984%2021%207.8%2021Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",FileSearch="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%2011H8M10%2015H8M16%207H8M20%2010.5V6.8C20%205.11984%2020%204.27976%2019.673%203.63803C19.3854%203.07354%2018.9265%202.6146%2018.362%202.32698C17.7202%202%2016.8802%202%2015.2%202H8.8C7.11984%202%206.27976%202%205.63803%202.32698C5.07354%202.6146%204.6146%203.07354%204.32698%203.63803C4%204.27976%204%205.11984%204%206.8V17.2C4%2018.8802%204%2019.7202%204.32698%2020.362C4.6146%2020.9265%205.07354%2021.3854%205.63803%2021.673C6.27976%2022%207.11984%2022%208.8%2022H11.5M22%2022L20.5%2020.5M21.5%2018C21.5%2019.933%2019.933%2021.5%2018%2021.5C16.067%2021.5%2014.5%2019.933%2014.5%2018C14.5%2016.067%2016.067%2014.5%2018%2014.5C19.933%2014.5%2021.5%2016.067%2021.5%2018Z'%20stroke='%23A5A5A6'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",FileSearchGreen="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%2011H8M10%2015H8M16%207H8M20%2010.5V6.8C20%205.11984%2020%204.27976%2019.673%203.63803C19.3854%203.07354%2018.9265%202.6146%2018.362%202.32698C17.7202%202%2016.8802%202%2015.2%202H8.8C7.11984%202%206.27976%202%205.63803%202.32698C5.07354%202.6146%204.6146%203.07354%204.32698%203.63803C4%204.27976%204%205.11984%204%206.8V17.2C4%2018.8802%204%2019.7202%204.32698%2020.362C4.6146%2020.9265%205.07354%2021.3854%205.63803%2021.673C6.27976%2022%207.11984%2022%208.8%2022H11.5M22%2022L20.5%2020.5M21.5%2018C21.5%2019.933%2019.933%2021.5%2018%2021.5C16.067%2021.5%2014.5%2019.933%2014.5%2018C14.5%2016.067%2016.067%2014.5%2018%2014.5C19.933%2014.5%2021.5%2016.067%2021.5%2018Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",SwitchVertical="data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='switch-vertical-02'%3e%3cpath%20id='Icon'%20d='M7.5%204V20M7.5%2020L3.5%2016M7.5%2020L11.5%2016M17.5%2020V4M17.5%204L13.5%208M17.5%204L21.5%208'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/svg%3e",SwitchVerticalLight="data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='switch-vertical-02'%3e%3cpath%20id='Icon'%20d='M7.5%204V20M7.5%2020L3.5%2016M7.5%2020L11.5%2016M17.5%2020V4M17.5%204L13.5%208M17.5%204L21.5%208'%20stroke='%23A5A5A6'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/svg%3e",Clock="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='M22.7%2013.5L20.7005%2011.5L18.7%2013.5M21%2012C21%2016.9706%2016.9706%2021%2012%2021C7.02944%2021%203%2016.9706%203%2012C3%207.02944%207.02944%203%2012%203C15.3019%203%2018.1885%204.77814%2019.7545%207.42909M12%207V12L15%2014'%20stroke='%23A5A5A6'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ClockGreen="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='M22.7%2013.5L20.7005%2011.5L18.7%2013.5M21%2012C21%2016.9706%2016.9706%2021%2012%2021C7.02944%2021%203%2016.9706%203%2012C3%207.02944%207.02944%203%2012%203C15.3019%203%2018.1885%204.77814%2019.7545%207.42909M12%207V12L15%2014'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",WalletLight="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='M16.5%2014H16.51M3%205V19C3%2020.1046%203.89543%2021%205%2021H19C20.1046%2021%2021%2020.1046%2021%2019V9C21%207.89543%2020.1046%207%2019%207L5%207C3.89543%207%203%206.10457%203%205ZM3%205C3%203.89543%203.89543%203%205%203H17M17%2014C17%2014.2761%2016.7761%2014.5%2016.5%2014.5C16.2239%2014.5%2016%2014.2761%2016%2014C16%2013.7239%2016.2239%2013.5%2016.5%2013.5C16.7761%2013.5%2017%2013.7239%2017%2014Z'%20stroke='%23A5A5A6'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",WalletGreen="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='M16.5%2014H16.51M3%205V19C3%2020.1046%203.89543%2021%205%2021H19C20.1046%2021%2021%2020.1046%2021%2019V9C21%207.89543%2020.1046%207%2019%207L5%207C3.89543%207%203%206.10457%203%205ZM3%205C3%203.89543%203.89543%203%205%203H17M17%2014C17%2014.2761%2016.7761%2014.5%2016.5%2014.5C16.2239%2014.5%2016%2014.2761%2016%2014C16%2013.7239%2016.2239%2013.5%2016.5%2013.5C16.7761%2013.5%2017%2013.7239%2017%2014Z'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ComingSoon=()=>{const Fn=window.innerWidth<1051,{isDarkMode:Mn}=useStore();if(Fn)return jsxRuntimeExports.jsx("div",{className:" left-0 top-0 xxl:!hidden bxl:!hidden xl:!hidden sxl:!hidden lg:!flex md:!flex sm:!flex xd:!flex fixed w-[100vw] h-[100vh] z-[!99999]",children:jsxRuntimeExports.jsx("div",{className:"fixed w-full h-full backdrop-blur-[0.75rem] flex flex-row xxl:items-center bxl:items-center xl:items-center sxl:items-center lg:items-center md:items-end sm:items-end xd:items-end font-manrope justify-center z-[!99999]",children:jsxRuntimeExports.jsxs("div",{className:`backdrop-blur-[1.25rem] xxl:w-[40%] bxl:w-[40%] xl:w-[40%] sxl:w-[40%] lg:w-[60%] md:w-full sm:w-full xd:w-full h-auto rounded-2xl border ${Mn?"bg-[rgba(252,253,254,0.70)] border-[#E3E8EF]":"bg-[#17181A] border-[rgba(255,255,255,0.10)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?"bg-[#FCFDFE] border-b-[#E3E8EF]":"bg-[rgba(255,255,255,0.06)] border-b-[rgba(255,255,255,0.10)]"} border-b flex flex-row justify-between items-center py-5 rounded-t-[1rem] px-6`,children:jsxRuntimeExports.jsx("div",{className:`font-inter text-xl font-bold ${Mn?"text-[#000000]":"text-[white]"}`,children:"Coming Soon"})}),jsxRuntimeExports.jsxs("div",{className:"p-6 flex flex-col gap-4 w-full rounded-[0rem_0rem_1rem_1rem]",children:[jsxRuntimeExports.jsxs("div",{className:`rounded-2xl flex flex-col p-4 gap-4 ${Mn?"bg-[#FCFDFE] border border-[#E3E8EF]":"bg-[rgba(255,255,255,0.06)] border border-[rgba(255,255,255,0.10)]"}`,children:[jsxRuntimeExports.jsxs("div",{className:`${Mn?"border-[#E3E8EF] text-[rgba(0,0,0,0.80)]":"border-[rgba(255,255,255,0.10)] text-[rgba(255,255,255,0.80)]"} gap-2 border-b pb-4 text-sm font-normal flex flex-row justify-start items-center`,children:[jsxRuntimeExports.jsx("img",{src:Mn?DisclaimerDark:DisclaimerImg,alt:""}),"OPerps is not compatible with mobile devices currently!"]}),jsxRuntimeExports.jsxs("div",{className:`${Mn?"text-[rgba(0,0,0,0.80)]":"text-[rgba(255,255,255,0.80)]"} gap-2 text-sm font-normal`,children:["Please visit"," ",jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx("a",{href:"https://operps.kanalabs.io/",target:"_blank",className:`font-extrabold font-manrope text-sm ${Mn?"text-[#0E9384]":"text-[#2ED3B7]"}`,children:"operps.kanalabs.io"})})," ","on a Windows, Mac, or Linux-based computer."]})]}),jsxRuntimeExports.jsx("a",{href:"https://ethosx.gitbook.io/operps",target:"_blank",className:"cursor-pointer w-full outline-none",children:jsxRuntimeExports.jsx("div",{className:`cursor-pointer ${Mn?"buy-button-light":"buy-button"}`,children:jsxRuntimeExports.jsx("div",{className:`cursor-pointer text-base font-bold text-center ${Mn?"buy-button-inner-light text-[#0E9384]":"buy-button-inner text-[#2ED3B7]"}`,children:"Learn more about OPerps"})})})]})]})})})},BottomNav=()=>{const{isDarkMode:Fn}=useStore(),[Mn,rs]=reactExports.useState(!0),[is,os]=reactExports.useState(!1),[as,us]=reactExports.useState(!1),[ds,hs]=reactExports.useState(!1),[ps,io]=reactExports.useState(!1),fo="TESTNET",mo=()=>{rs(!0),os(!1),us(!1),hs(!1),io(!1)},Ao=()=>{os(!0),rs(!1),us(!1),hs(!1),io(!1)},$o=()=>{us(!0),rs(!1),os(!1),hs(!1),io(!1)},Lo=()=>{hs(!0),rs(!1),os(!1),us(!1),io(!1)},Go=()=>{io(!0),rs(!1),os(!1),us(!1),hs(!1)};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:fo===Network.MAINNET?jsxRuntimeExports.jsx(ComingSoon,{}):jsxRuntimeExports.jsxs("div",{className:"xxl:hidden bxl:hidden xl:hidden sxl:hidden lg:inline-flex md:inline-flex sm:inline-flex xd:inline-flex container-fluid z-[1] justify-start items-start",children:[Mn&&jsxRuntimeExports.jsx("ul",{className:`${Fn?"bg-[#E4F2F3]":"bg-[#0C0C0D]"} w-full flex-1 flex flex-col justify-start items-start pb-3 md:pb-0 z-[9]`,children:jsxRuntimeExports.jsx(FooterGraph,{})}),is&&jsxRuntimeExports.jsx("ul",{className:`${Fn?"bg-[#E4F2F3]":"bg-[#0C0C0D]"} w-full flex-1 flex flex-col justify-start items-start pb-3 md:pb-0 z-[9]`,children:jsxRuntimeExports.jsx(FooterOrderDetails,{})}),as&&jsxRuntimeExports.jsx("ul",{className:`${Fn?"bg-[#E4F2F3]":"bg-[#0C0C0D]"} w-full flex-1 flex flex-col justify-start items-start pb-3 md:pb-0 px-2 z-[9]`,children:jsxRuntimeExports.jsx(FooterBuySell,{})}),ds&&jsxRuntimeExports.jsx("ul",{className:`${Fn?"bg-[#E4F2F3]":"bg-[#0C0C0D]"} w-full flex-1 flex flex-col justify-start items-start pb-3 md:pb-0 px-2 z-[9]`,children:jsxRuntimeExports.jsx(FooterCycleDetails,{})}),ps&&jsxRuntimeExports.jsx("ul",{className:`${Fn?"bg-[#E4F2F3]":"bg-[#0C0C0D]"} w-full flex-1 flex flex-col justify-start items-start pb-3 md:pb-0 px-2 z-[9]`,children:jsxRuntimeExports.jsx(FooterWallet,{})}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"bg-[#fff]":"bg-[#17181A]"} h-24 z-[999] !fixed !bottom-0 flex  justify-between w-full !font-manrop ml-0 xxl:hidden bxl:hidden xl:hidden sxl:hidden lg:hidden md:flex sm:flex xd:flex`,children:[jsxRuntimeExports.jsxs("div",{className:`border-t-2 ${Mn?"border-t-[#2ED3B7]":"border-t-transparent"} flex flex-col justify-center items-center w-full`,onClick:mo,children:[Mn?jsxRuntimeExports.jsx("img",{src:BarChartGreen,alt:"",className:"w-6 h-6"}):jsxRuntimeExports.jsx("img",{src:BarChart,alt:"",className:"w-6 h-6"}),jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[#2ED3B7] ":"text-[#A5A5A6]"} font-manrope text-[10px] font-normal pt-2`,children:"Graph"})]}),jsxRuntimeExports.jsxs("div",{className:`border-t-2 ${is?" border-t-[#2ED3B7]":"border-t-transparent"} flex flex-col justify-center items-center w-full`,onClick:Ao,children:[is?jsxRuntimeExports.jsx("img",{src:FileSearchGreen,alt:"",className:" w-6 h-6"}):jsxRuntimeExports.jsx("img",{src:FileSearch,alt:"",className:" w-6 h-6"}),jsxRuntimeExports.jsx("div",{className:`${is?"text-[#2ED3B7] ":"text-[#A5A5A6]"} font-manrope text-[10px] font-normal pt-2`,children:"Order Details"})]}),jsxRuntimeExports.jsxs("div",{className:`border-t-2 ${as?" border-t-[#2ED3B7]":"border-t-transparent"} flex flex-col justify-center items-center w-full`,onClick:$o,children:[as?jsxRuntimeExports.jsx("img",{src:SwitchVertical,alt:"",className:" w-6 h-6"}):jsxRuntimeExports.jsx("img",{src:SwitchVerticalLight,alt:"",className:" w-6 h-6"}),jsxRuntimeExports.jsx("div",{className:`${as?"text-[#2ED3B7] ":"text-[#A5A5A6]"} font-manrope text-[10px] font-normal pt-2`,children:"Buy/Sell"})]}),jsxRuntimeExports.jsxs("div",{className:`border-t-2 ${ds?" border-t-[#2ED3B7]":"border-t-transparent"} flex flex-col justify-center items-center w-full`,onClick:Lo,children:[ds?jsxRuntimeExports.jsx("img",{src:ClockGreen,alt:"",className:" w-6 h-6"}):jsxRuntimeExports.jsx("img",{src:Clock,alt:"",className:" w-6 h-6"}),jsxRuntimeExports.jsx("div",{className:`${ds?"text-[#2ED3B7] ":"text-[#A5A5A6]"} font-manrope text-[10px] font-normal pt-2`,children:"Cycle Details"})]}),jsxRuntimeExports.jsxs("div",{className:`border-t-2 ${ps?" border-t-[#2ED3B7]":"border-t-transparent"} flex flex-col justify-center items-center w-full`,onClick:Go,children:[ps?jsxRuntimeExports.jsx("img",{src:WalletGreen,alt:"",className:" w-6 h-6"}):jsxRuntimeExports.jsx("img",{src:WalletLight,alt:"",className:" w-6 h-6"}),jsxRuntimeExports.jsx("div",{className:`${ps?"text-[#2ED3B7] ":"text-[#A5A5A6]"} font-manrope text-[10px] font-normal pt-2`,children:"Wallet"})]})]})]})})},Dashboard=()=>{var Y1,Q1,o2,m2;const{isDarkMode:Fn,isMode:Mn,setIsMode:rs,isWalletConnectVisible:is,isCalculateVisible:os,updateDashboardInputValue:as,updateChartValue:us,updateTiming:ds,updateCurrentAPY:hs,updateIsDisclaimerVisible:ps,isCalculateVisibleShort:io,updateIsVideoVisible:fo,updateIsLongTourVisible:mo,updateIsShortTourVisible:Ao,isLongTourVisible:$o,isShortTourVisible:Lo,selectedCrypto:Go,selectedTokenPrice:Yo,multiMarketTokenPrices:Wo,updateSelectedTokenPrice:Jo,updateMultiMarketTokenPrices:xl,isSelectedChain:_l,setCallModeSet:Tl,setPutModeSet:Sl,isCallModeSet:$l,setIsItLongSwitchChart:Pl,setSelectedTabIndex:Dl,updateIsQuestionVisible:Ol,updateIsSelectedChain:Rl,setSelectedCrypto:Vo,isGuideOpen:jo,setIsGuideOpen:Ho,updateOpenOrders:Qo,updatePositions:El,updateWithdrawable:Xo,updateTrades:Al,usdcBalance:wl,setUsdcBalance:yl,multiMarketOpenOrders:Il,setMultiMarketOpenOrders:Bl,multiMarketPositionData:Gl,setMultiMarketPositionData:Nl,multiMarketPnlData:zl,setMultiMarketPnlData:Vl,timing:Hl,isInitialTableLoaded:Yl,updateIsInitialTableLoaded:Ll}=useStore(),{switchChain:Zl}=useSwitchChain(),{executeOrder:Xl,executeCancel:wu,executeClaim:yu,executeInvaultSell:rp}=useOrder(),{tooltipStyle:dp}=useStyles(),[up,wp]=reactExports.useState(!1),{fetchData:vp}=useData(),pp=reactExports.useRef(null),cp=reactExports.useRef(null),gp=reactExports.useRef(null),mp=reactExports.useRef(null),fp=reactExports.useRef(null),hp=reactExports.useRef(null),xp=reactExports.useRef(null),Kl=reactExports.useRef(null),Fl=reactExports.useRef(null),Ul=reactExports.useRef(null),Jl=reactExports.useRef(null),fu=reactExports.useRef(null),_d=reactExports.useRef(null),tp=reactExports.useRef(null),yp=reactExports.useRef(null),_p=reactExports.useRef(null),Sp=reactExports.useRef(null),Ap=reactExports.useRef(null),Op=reactExports.useRef(null),Zp=reactExports.useRef(null),[Qp,Xp]=reactExports.useState(!1),{t:h0}=useTranslation();reactExports.useEffect(()=>{localStorage.getItem("tourCompleted")||Xp(!0)},[]);const Wp=[],Np=[{title:"",description:"Welcome to Long CALL OPerps (LCO) tour!",target:()=>Op.current,mask:!1,placement:"bottom"},{title:"",description:"Given current market conditions, next cycle is expected to have this leverage. It changes with underlying price change and new buy/sell orders.",target:()=>cp.current,mask:!1,placement:"bottom"},{title:"",description:`In every cycle of ${CHAIN_PARAMS_CONFIG[_l].cycle_duration} minutes, LCO Pool pays ${CHAIN_PARAMS_CONFIG[_l].premium_per_cycle*100}% of its supply to SCO Pool as premium`,target:()=>gp.current,mask:!1,placement:"bottom"},{title:"",description:"Premium paid is the max loss for LCO holders in a cycle",target:()=>mp.current,mask:!1,placement:"bottom"},{title:"",description:"Profit earned by LCO holders, if market rises more than 2.5% in next cycle.",target:()=>fp.current,mask:!1,placement:"bottom"},{title:"",description:"Expected supply numbers of LCO and SCO Pools in next cycle.",target:()=>hp.current,mask:!1,placement:"bottom"},{title:"",description:"Try our virtual simulator to understand how much can you earn from your investments in LCO tokens.",target:()=>Ap.current,mask:!1,placement:"bottom"},{title:"",description:"Enter how many LCO tokens you wish to buy.",target:()=>pp.current,mask:!1,placement:"bottom"},{title:"",description:"Click the Buy button and approve the transactions in your wallet. Once the transaction is completed on chain, you will see your order in the Open Orders section.",target:()=>xp.current,mask:!1,placement:"bottom"},{title:"",description:"Your investment will automatically start from the upcoming cycle.",target:()=>Kl.current,mask:!1,placement:"top"},{title:"",description:"Time remaining before your investment is active",target:()=>Fl.current,mask:!1,placement:"top"}],Rp=[{title:"",description:"Welcome to Short CALL OPerps (SCO) tour!",target:()=>Zp.current,mask:!1,placement:"bottom"},{title:"",description:"You buy SCO tokens for earning in neurtal/falling markets. Each SCO token is worth 1 USDC. If market doesn't rise, you get more SCO tokens which you can redeem for 1 USDC each.",target:()=>Ul.current,mask:!1,placement:"bottom"},{title:"",description:`Settlement happens in CALL OPerps every ${CHAIN_PARAMS_CONFIG[_l].cycle_duration} minutes, which is called a cycle. In every settlement, Premium is transferred from LCO Pool to SCO Pool and if market rises during the cycle, LCO Pool is compensated by SCO Pool, proportional to market rise.`,target:()=>Jl.current,mask:!1,placement:"bottom"},{title:"",description:"LCO holders pay this premium to SCO holders in return for exposure to rising market.",target:()=>fu.current,mask:!1,placement:"bottom"},{title:"",description:"Average of last 12 cycle returns for SCO holders. Please note that this is not an indication of future returns.",target:()=>_d.current,mask:!1,placement:"bottom"},{title:"",description:"The price at which the premium received equals compensation paid for market rise. If market rises beyond this price, SCO holders become net losers in this cycle.",target:()=>tp.current,mask:!1,placement:"bottom"},{title:"",description:"Try our virtual simulator to understand how much can you earn from your investments in SCO tokens.",target:()=>yp.current,mask:!1,placement:"bottom"},{title:"",description:"Enter how many SCO tokens you wish to buy.",target:()=>_p.current,mask:!1,placement:"bottom"},{title:"",description:"Click the Buy button and approve the transactions in your wallet. Once the transaction is completed on chain, you will see your order in the Open Orders section.",target:()=>Sp.current,mask:!1,placement:"bottom"},{title:"",description:"Your investment will automatically start from the upcoming cycle.",target:()=>Kl.current,mask:!1,placement:"top"},{title:"",description:"Time remaining before your investment is active.",target:()=>Fl.current,mask:!1,placement:"bottom"}],Pp=[{title:"",description:"Welcome to Long PUT OPerps (LPO) tour!",target:()=>Op.current,mask:!1,placement:"bottom"},{title:"",description:"Given current market conditions, next cycle is expected to have this leverage. It changes with underlying price change and new buy/sell orders.",target:()=>cp.current,mask:!1,placement:"bottom"},{title:"",description:`In every cycle of ${CHAIN_PARAMS_CONFIG[_l].cycle_duration} minutes, LPO Pool pays ${CHAIN_PARAMS_CONFIG[_l].premium_per_cycle*100}% of its supply to SPO Pool as premium`,target:()=>gp.current,mask:!1,placement:"bottom"},{title:"",description:"Premium paid is the max loss for LPO holders in a cycle",target:()=>mp.current,mask:!1,placement:"bottom"},{title:"",description:"Profit earned by LPO holders, if market falls more than 2.5% in next cycle",target:()=>fp.current,mask:!1,placement:"bottom"},{title:"",description:"Expected supply numbers of LPO and SPO Pools in next cycle.",target:()=>hp.current,mask:!1,placement:"bottom"},{title:"",description:"Try our virtual simulator to understand how much can you earn from your investments in LPO tokens.",target:()=>Ap.current,mask:!1,placement:"bottom"},{title:"",description:"Enter how many LPO tokens you wish to buy.",target:()=>pp.current,mask:!1,placement:"bottom"},{title:"",description:"Click the Buy button and approve the transactions in your wallet. Once the transaction is completed on chain, you will see your order in the Open Orders section.",target:()=>xp.current,mask:!1,placement:"bottom"},{title:"",description:"Your investment will automatically start from the upcoming cycle.",target:()=>Kl.current,mask:!1,placement:"top"},{title:"",description:"Time remaining before your investment is active.",target:()=>Fl.current,mask:!1,placement:"top"}],Hp=[{title:"",description:"Welcome to Short PUT OPerps (SPO) tour!",target:()=>Zp.current,mask:!1,placement:"bottom"},{title:"",description:"You buy SPO tokens for earning in neurtal/rising markets. Each SPO token is worth 1 USDC. If market doesn't fall, you get more SPO tokens which you can redeem for 1 USDC each.",target:()=>Ul.current,mask:!1,placement:"bottom"},{title:"",description:`Settlement happens in PUT OPerps every ${CHAIN_PARAMS_CONFIG[_l].cycle_duration} minutes, which is called a cycle. In every settlement, Premium is transferred from LPO Pool to SPO Pool and if market falls during the cycle, LPO Pool is compensated by SPO Pool, proportional to market fall.`,target:()=>Jl.current,mask:!1,placement:"bottom"},{title:"",description:"LPO holders pay this premium to SPO holders in return for exposure to falling market.",target:()=>fu.current,mask:!1,placement:"bottom"},{title:"",description:"Average of last 12 cycle returns for SPO holders. Please note that this is not an indication of future returns.",target:()=>_d.current,mask:!1,placement:"bottom"},{title:"",description:"The price at which the premium received equals compensation paid for market fall. If market falls beyond this price, SPO holders become net losers in this cycle.",target:()=>tp.current,mask:!1,placement:"bottom"},{title:"",description:"Try our virtual simulator to understand how much can you earn from your investments in SPO tokens.",target:()=>yp.current,mask:!1,placement:"bottom"},{title:"",description:"Enter how many SPO tokens you wish to buy.",target:()=>_p.current,mask:!1,placement:"bottom"},{title:"",description:"Click the Buy button and approve the transactions in your wallet. Once the transaction is completed on chain, you will see your order in the Open Orders section.",target:()=>Sp.current,mask:!1,placement:"bottom"},{title:"",description:"Your investment will automatically start from the upcoming cycle.",target:()=>Kl.current,mask:!1,placement:"top"},{title:"",description:"Time remaining before your investment is active.",target:()=>Fl.current,mask:!1,placement:"bottom"}],kp=()=>{localStorage.setItem("tourCompleted","true"),Xp(!1)},Gp=()=>{mo(!1)},Yp=()=>{Ao(!1)},Mp=()=>{Ho(!0),p2(!1)};staticMethods.useNotification();const{address:Ip,chain:Dp,isConnected:Lp}=useAccount(),[zp,Bp]=reactExports.useState(0),[qp,Vp]=reactExports.useState(0),[tm,g0]=reactExports.useState("Open Orders"),[rm,Jp]=reactExports.useState(!1),[lm,$m]=reactExports.useState([]),km=JSON.parse(localStorage.getItem("allCycleData")||"[]"),[Cm,Am]=reactExports.useState({}),[pm,Ym]=reactExports.useState(0),qm=CHAIN_PARAMS_CONFIG[_l].provider;reactExports.useEffect(()=>{(async()=>{var im={};CHAIN_TOKEN_MAP[_l].forEach(function(mm){im[mm]=0}),Am(im),Ym(0)})()},[_l]),reactExports.useEffect(()=>{const Up=async()=>{try{const mm=await fetchTokenPrices(_l);let Wm={};mm.forEach(function(Pm){const Kp=Pm.token;let cm=(Pm.cycle_end_price/Math.pow(10,18)).toFixed(TOKEN_PRICE_USE_DECIMALS[Kp]);Wm[Kp]=cm}),xl(Wm),Jo(Wm[Go])}catch(mm){console.error("Error fetching token prices from db:",mm)}};Up();const im=setInterval(Up,5e3);return()=>{clearInterval(im)}},[_l,Go]),reactExports.useEffect(()=>{(async()=>{try{if(Date.now()/1e3-pm>2){let mm=await getMultiMarketCurrentPnL(_l);if(Vl(mm),Gl==null||mm===null||mm===void 0)console.log("multiMarketPositionData",Gl),console.log("allTokenCurrentPnLs",mm);else{const Wm=await updateMultiMarketPnLs(Gl,mm);Nl(Wm);const Pm=await updateMultiMarketOpenOrdersReceiveValue(Il,mm);Bl(Pm),Ym(Date.now()/1e3)}}}catch(im){console.error("Error fetching all token prices:",im)}})()},[_l,Wo,Gl,pm]);const Qm=async()=>{try{us(await getChart$1(_l,Go,Mn))}catch(Up){console.error("Error fetchPrevRetChart:",Up)}},o1=async()=>{try{if(!(Go in TOKEN_NAME))throw new Error("Invalid selectedCrypto value");const[Up]=await Promise.all([getTiming(Yo,qm,Yo,_l,Go,Mn)]);ds(Up)}catch(Up){console.error("Error fetchSettlement:",Up)}};reactExports.useEffect(()=>{(async()=>{try{await o1()}catch(im){console.error("Error in the useEffect fetchSettlement and fetchCycle:",im)}})()},[Yo,Go,_l,Mn]),reactExports.useEffect(()=>{(async()=>{try{var im=Date.now()/1e3;await Qm(),console.log("fetchPrevRetChart in ",Date.now()/1e3-im,"seconds")}catch(mm){console.error("Error in the useEffect fetchPrevRetChart:",mm)}})()},[Go,_l,Mn]),reactExports.useEffect(()=>{(async()=>{try{console.log("Acting on Market change");const im=await getCurrentAPY(_l,Go,Mn);console.log("Setting short APY to",im),hs(im)}catch(im){console.error("Error in the useEffect fetchSettlement and fetchCycle:",im)}})()},[_l,Go,Mn]),reactExports.useEffect(()=>{const Up=async()=>{try{CHAIN_TOKEN_MAP[_l].forEach(async function(mm){const Wm=mm.split("_")[0],Pm=mm.split("_")[1],Kp=await fetchCycleInfo(_l,Wm,Pm);var cm=Cm;Kp.last_settlement_time-Cm[mm]>0&&Cm[mm]>0&&Lp&&Yl&&(console.log("Acting on settlement for",Ip,_l,Wm,Pm,"at",Date.now()/1e3,cm[mm]),cm[mm]=Kp.last_settlement_time,Am(cm),await vp(Ip,!1))})}catch(mm){console.error("Error in actOnSettlement:",mm)}};Up();const im=setInterval(Up,1e3);return()=>{clearInterval(im)}},[_l,Lp,Cm,Yl]);const e1=async Up=>{try{if(Up){const im=await fetchDisclaimer(Up),mm=await fetchQuestion(Up);im.data.length>0?im.data[0].user_result?ps(!1):im.user_result&&ps(!0):ps(!0),localStorage.getItem("isShowPopup")==="false"&&(fo(!0),localStorage.setItem("isShowPopup","true"))}}catch(im){console.error("Error fetchDisclaimerData:",im)}};reactExports.useEffect(()=>{(async()=>{try{Lp?await vp(Ip,!1):(Bp(0),Vp(0),yl(0),Qo(null),El(null),Xo(null),Al(null))}catch(im){console.error("Error in the useEffect fetchData:",im)}})()},[Lp,Ip,_l]),reactExports.useEffect(()=>{(async()=>{try{if(Lp){if(await e1(Ip),!Yl){var im=Cm;CHAIN_TOKEN_MAP[_l].forEach(async function(mm){const Wm=mm.split("_")[0],Pm=mm.split("_")[1],Kp=await fetchCycleInfo(_l,Wm,Pm);im[mm]=Kp.last_settlement_time}),Am(im),Ll(!0)}}else Bp(0),Vp(0),yl(0),Qo(null),El(null),Xo(null),Al(null)}catch(mm){console.error("Error in the useEffect fetchData:",mm)}})()},[Lp,Ip]);const Zm=async Up=>{try{const Kp=await new Contract(CHAIN_PARAMS_CONFIG[_l].info_aggregator_address,ABI.InfoAggregator,qm).getAllBalances(Up,Go,Mn),cm=formatUnits(Kp.native_token_balance);var im=formatUnits(Kp.long_token_balance.toString(),CHAIN_PARAMS_CONFIG[_l].settlement_token_decimals);im=truncateDecimals(im,6);var mm=formatUnits(Kp.short_token_balance.toString(),CHAIN_PARAMS_CONFIG[_l].settlement_token_decimals);mm=truncateDecimals(mm,6);var Wm=formatUnits(Kp.settlement_token_balance.toString(),CHAIN_PARAMS_CONFIG[_l].settlement_token_decimals);return Wm=truncateDecimals(Wm,6),Bp(Number(im)),Vp(Number(mm)),yl(Number(Wm)),{longToken:Number(im),shortToken:Number(mm)}}catch(Pm){console.log("Error updating balances:",Pm)}return{longToken:Number(zp),shortToken:Number(qp)}},t1=Up=>{const im=Up===OPTIONS.CALL;Tl(im),Sl(!im),rs(Up)};async function Bm(Up){await Zm(Up)}const Dm=(Up,im)=>{Rl(Up),Vo(im),g1(!1)};let Om=[];for(const[Up,im]of Object.entries(CHOOSE_OPTION_TYPE))for(const mm of Object.keys(im))Om.push([+Up,mm]);const[r1,g1]=reactExports.useState(!1),b1=()=>{g1(Up=>!Up)},[F1,P1]=reactExports.useState(!1),K1=()=>{P1(Up=>!Up)},w1=Up=>{Rl(Up),P1(!1)},S2=()=>{F1&&P1(!1)},n2=()=>{r1&&g1(!1)},[i2,p2]=reactExports.useState(!1),O2=()=>{p2(!i2)},M2=()=>{i2&&p2(!1)},[s2,D2]=reactExports.useState(!0),L2=()=>{D2(!1)};reactExports.useEffect(()=>{const Up=localStorage.getItem("guideDontShow");(Up==="false"||Up===null)&&Ho(!0)},[]);const q1=async()=>{try{Jp(!0),Lp&&await vp(Ip,!1),Jp(!1)}catch{Jp(!1)}},[k1,E1]=reactExports.useState(!1),[v1,$2]=reactExports.useState(!0),[a1,Z1]=reactExports.useState([]);return reactExports.useEffect(()=>{const Up=()=>{const im=window.innerWidth<1200;$2(im)};return window.addEventListener("resize",Up),Up(),()=>window.removeEventListener("resize",Up)},[]),reactExports.useEffect(()=>{(Dp==null?void 0:Dp.id)!==_l&&Lp&&Zl({chainId:_l})},[_l,Lp]),reactExports.useEffect(()=>{const Up=setInterval(()=>{fetchAllCycleData(),wp(!0)},2e3);return()=>clearInterval(Up)},[]),reactExports.useEffect(()=>{if(!up||!km||(Om==null?void 0:Om.length)===0)return;let Up=[];km.forEach(Pm=>{if(Om.some(Kp=>Kp[0]===Pm.chain&&Kp[1]===Pm.token)){const Kp=`${Pm.chain}-${Pm.token}`;Up.some(cm=>`${cm.chain}-${cm.token}`===Kp)||Up.push(Pm)}});let im=[];const mm=Up.filter(Pm=>Pm.chain===_l);Up.forEach(Pm=>{im.push(Pm.chain)}),im=im.filter((Pm,Kp)=>im.indexOf(Pm)===Kp);const Wm=im.map(Pm=>CHAIN_PARAMS_CONFIG[Pm]);Z1(Wm),$m(mm),wp(!1)},[up]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(ConfigProvider,{theme:{components:{Tour:{colorPrimary:"#0E9384",fontSize:15,sizePopupArrow:30}}},children:[jsxRuntimeExports.jsxs("div",{className:`${Fn?"bg-[#E4F2F3]":"bg-[#ffffff0f]"} min-h-screen h-full font-manorope flex gap-4 !w-full`,children:[Lp?jo&&jsxRuntimeExports.jsx(GuideWrapper,{}):"",jsxRuntimeExports.jsx("div",{className:" xxl:inline bxl:inline xl:inline sxl:inline lg:hidden md:hidden sm:hidden xd:hidden    ",children:jsxRuntimeExports.jsx(Sidebar,{isSidebarExpanded:k1,setIsSidebarExpanded:E1,isSidebarHidden:v1})}),jsxRuntimeExports.jsxs("div",{className:"   w-full gap-4   h-full flex  flex-col xxl:pr-4 bxl:pr-4 xl:pr-4 sxl:pr-4 lg:pr-0 md:pr-0 sm:pr-0 xd:pr-0 transition ease-in hover:ease-in-out duration-300  xxl:pb-6 bxl:pb-6 xl:pb-6 sxl:pb-6 lg:pb-24 md:pb-24 sm:pb-24 xd:pb-24",children:[jsxRuntimeExports.jsx(Navbar,{isSidebarHidden:v1,onBalanceUpdate:Bm}),jsxRuntimeExports.jsxs("div",{className:"  flex xxl:flex-row bxl:flex-row xl:flex-row sxl:flex-row lg:flex-col  md:flex-col sm:flex-col xd:flex-col justify-center items-start gap-4  md:px-4 sm:px-4 xd:px-4 xxl:w-auto bxl:w-auto xl:w-auto sxl:w-auto lg:w-full md:w-full sm:w-full xd:w-full lg:!hidden md:!hidden sm:!hidden xd:!hidden",children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-1 flex-col gap-4 xxl:w-full bxl:w-full xl:w-full sxl:w-full lg:w-full md:w-full sm:w-full xd:w-full justify-start items-start ",children:[jsxRuntimeExports.jsxs("div",{className:`w-full flex flex-row justify-between items-center text-sm font-extrabold font-manorope p-4 ${Fn?" border-[#E3E8EF] text-[#0C0C0D] bg-white":" border-[rgba(245,247,250,0.06)] text-[rgba(255,255,255,1)]"} w-full rounded-2xl border`,children:[jsxRuntimeExports.jsxs("div",{className:`w-full flex flex-row justify-between items-center text-sm font-extrabold font-manorope ${Fn?" border-[#E3E8EF] text-[#0C0C0D] bg-white":" border-[rgba(245,247,250,0.06)] text-[rgba(255,255,255,1)]"} w-full`,id:"element-id-for-guide-10",children:[jsxRuntimeExports.jsx("div",{className:"w-full",children:jsxRuntimeExports.jsxs("div",{className:`${Fn?"!bg-[#EFF7F8] text-[#0E9384] hover:!bg-[#E4F2F3]":"!bg-[#1D1E20] hover:!bg-[#1f2122] text-[#2ED3B7]"} common-pointer h-10 w-[98%]    xxl:flex bxl:flex xl:flex sxl:flex lg:flex md:hidden sm:hidden xd:hidden flex-row justify-between items-center cursor-pointer leading-[normal]  rounded-lg    font-manorope font-extrabold  text-sm `,onClick:b1,children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-between items-center gap-2 pl-4",children:[jsxRuntimeExports.jsx("img",{src:TOKEN_LOGO[Go],alt:Go,className:"w-[1.2rem]"}),jsxRuntimeExports.jsx("span",{className:`${Fn?"text-[#364152]":"text-white"} flex 2xl:text-base xl:text-base lg:text-base md:text-base sm:text-sm max-sm:text-sm font-bold`,children:jsxRuntimeExports.jsx("span",{children:Go})})]}),jsxRuntimeExports.jsxs("div",{className:"flex mr-4",children:[jsxRuntimeExports.jsx("span",{className:"font-normal text-[#a5a5a6] pt-0.5",children:_l===DEFAULT_CHAIN_ID?"5 Minutes Cycle":"2 Hour Cycle"}),jsxRuntimeExports.jsx("img",{src:Fn?Vectorlight:ChevronWhite,alt:"VectorDown",className:" ml-1"})]}),r1&&jsxRuntimeExports.jsx(c$9,{onClickAway:n2,children:jsxRuntimeExports.jsx("div",{id:"dropdown-options",className:`flex flex-col justify-start items-start overflow-y-visible xxl:!w-[23%] bxl:!w-[23%] xl:!w-[23%] sxl:!w-[23%] lg:!w-full md:!w-[80%] sm:!w-[80%] xd:!w-[80%] cursor-pointer absolute !z-[100] rounded-lg scroll-smooth backdrop-blur-sm ${Fn?"bg-[#EFF7F8]":"bg-[#1D1E20]"} mt-[14rem]`,children:lm.map((Up,im)=>jsxRuntimeExports.jsxs("div",{id:im.toString(),className:`${Fn?"bg-[#EFF7F8] hover:!bg-[#E4F2F3]":"bg-[#1D1E20] hover:!bg-[#1f2122]"} cursor-pointer rounded-2xl flex flex-row justify-between items-center p-[0.5rem_1rem] w-full`,onClick:()=>Dm(Up.chain,Up.token),children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center py-3.5",children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("img",{src:TOKEN_LOGO[Up.token],alt:"BTC",className:"w-6"})}),jsxRuntimeExports.jsxs("div",{className:`px-2 flex flex-col ${Fn?"text-[#364152]":"text-[#ffffff]"}`,onClick:()=>Dm(Up.chain,Up.token),children:[jsxRuntimeExports.jsx("span",{children:Up.token}),jsxRuntimeExports.jsx("span",{className:" text-[#a5a5a6] text-[0.7rem]",children:CHAIN_PARAMS_CONFIG[Up.chain].name})]})]}),jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-end items-center gap-[0.2rem]",children:jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-[#0E9384]":"text-[#2ED3B7]"} text-[0.65rem] font-manrope font-extrabold`,children:[jsxRuntimeExports.jsx("span",{onClick:()=>Dm(Up.chain,Up.token),children:"$ "}),jsxRuntimeExports.jsx("span",{children:(Up.cycle_end_price/Math.pow(10,18)).toFixed(TOKEN_PRICE_USE_DECIMALS[Up.token])}),jsxRuntimeExports.jsx("span",{children:" USDC"}),jsxRuntimeExports.jsxs("span",{className:" font-normal text-[#a5a5a6] flex justify-end",children:[Up.chain===DEFAULT_CHAIN_ID?"5 Minutes":"2 hours"," Cycle"," "]}),jsxRuntimeExports.jsx("span",{className:"font-normal text-[#a5a5a6] flex justify-end items-end text-right",children:Up.chain===DEFAULT_CHAIN_ID?"(Degen Mode)":""})]})})]},im))})})]})}),jsxRuntimeExports.jsxs("div",{className:"w-full",children:[jsxRuntimeExports.jsxs("div",{className:`${Fn?"!bg-[#EFF7F8] text-[#0E9384]":"!bg-[#1D1E20] text-[#FFFFFF]"} cursor-pointer h-10 w-[98%] xxl:flex bxl:flex xl:flex sxl:flex lg:flex md:hidden sm:hidden xd:hidden flex-row justify-between items-center leading-[normal] rounded-lg font-manorope font-extrabold text-sm p-[0%_4%]`,onClick:K1,children:[jsxRuntimeExports.jsx("div",{className:" font-normal flex justify-between",children:jsxRuntimeExports.jsx("span",{children:CHAIN_PARAMS_CONFIG[_l].name})}),jsxRuntimeExports.jsx("img",{src:Fn?Vectorlight:ChevronWhite,alt:"VectorDown",className:" ml-1"})]}),F1&&jsxRuntimeExports.jsx(c$9,{onClickAway:S2,children:jsxRuntimeExports.jsx("div",{id:"dropdown-options",className:`flex flex-col absolute justify-start items-start overflow-y-visible xxl:!w-[23%] bxl:!w-[23%] xl:!w-[23%] sxl:!w-[23%] lg:!w-full md:!w-[80%] sm:!w-[80%] xd:!w-[80%] cursor-pointer !z-[100] rounded-lg scroll-smooth backdrop-blur-sm mt-2 ${Fn?"bg-[#EFF7F8]":"bg-[#1D1E20]"}`,children:a1.map((Up,im)=>jsxRuntimeExports.jsxs("div",{id:im.toString(),className:`${Fn?"bg-[#EFF7F8] hover:!bg-[#E4F2F3]":"bg-[#1D1E20] hover:!bg-[#1f2122]"} cursor-pointer rounded-2xl flex flex-row justify-between items-center p-[0.5rem_1rem] w-full`,onClick:()=>w1(Up.chain_id),children:[jsxRuntimeExports.jsx("div",{className:"flex items-center py-3.5",children:jsxRuntimeExports.jsx("span",{children:Up.name})}),jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-end items-center gap-[0.2rem]",children:jsxRuntimeExports.jsx("div",{className:`${Fn?"text-[#0E9384]":"text-[#2ED3B7]"} text-[0.65rem] font-manrope font-extrabold`,children:jsxRuntimeExports.jsxs("span",{className:" font-normal text-[#a5a5a6] flex justify-end",children:[Up.cycle_duration===5?"5 Minutes":"2 hours"," Cycle"," "]})})})]},im))})})]})]}),jsxRuntimeExports.jsxs("div",{className:` ${Fn?"border-[#ffffff1a] text-[#777879] ":" border-[#ffffff1a] text-[#A5A5A6] "} text-base font-normal rounded-lg border flex flex-row justify-start items-center `,id:"element-id-for-guide-3",children:[jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Call OPerps include Long Call Operps and Short Call OPerps",arrow:!1,overlayInnerStyle:dp,children:jsxRuntimeExports.jsx("div",{onClick:()=>t1(OPTIONS.CALL),className:` cursor-pointer p-[0.5rem_1rem] rounded-[0.45rem] ${Mn==="CALL"?` ${Fn?" bg-[#0E9384] font-bold text-[#FFF] ":" text-[#FFF] font-bold bg-[#107569] "}`:""} `,children:"Call"})}),jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"Put OPerps include Long Put Operps and Short Put OPerps",arrow:!1,overlayInnerStyle:dp,children:jsxRuntimeExports.jsx("div",{onClick:()=>t1(OPTIONS.PUT),className:` cursor-pointer p-[0.5rem_1rem] rounded-[0.45rem] ${Mn==="PUT"?` ${Fn?" bg-[#0E9384] font-bold text-[#FFF] ":" text-[#FFF] font-bold bg-[#107569] "}`:""} `,children:"Put"})})]})]}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"bg-white border-[#E3E8EF]":"bg-[#17181A] border-[rgba(245,247,250,0.06)]"} w-full border rounded-2xl xxl:inline bxl:inline xl:inline sxl:inline lg:hidden md:hidden sm:hidden xd:hidden`,children:[jsxRuntimeExports.jsx("div",{className:"w-full",children:jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-[#0C0C0D]":"text-[white]"} flex justify-between items-center text-sm px-4 py-2 h-14 w-auto`,children:[jsxRuntimeExports.jsx("div",{className:"  font-extrabold",children:h0("currentcycle")}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-[#0E9384]":"text-[#2ED3B7]"} gap-4 rounded-lg flex justify-center items-center text-[0.625rem] font-bold`,children:[jsxRuntimeExports.jsxs("div",{className:"bg-transparent flex flex-col justify-center items-start my-2 mx-4",children:[jsxRuntimeExports.jsx("div",{className:" text-[#A5A5A6] font-normal text-xs",children:"Start Price"}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-black":"text-[#FFFFFF]"} font-extrabold text-sm`,children:["$",parseFloat(Hl.cycleStartPriceFinal)>=50?parseFloat(Hl.cycleStartPriceFinal).toLocaleString():parseFloat(Hl.cycleStartPriceFinal)]})]}),jsxRuntimeExports.jsxs("div",{className:"bg-transparent flex flex-col justify-center items-start my-2 mx-4",children:[jsxRuntimeExports.jsx("div",{className:" text-[#A5A5A6] font-normal text-xs",children:"Breakeven Price"}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-black":"text-[#FFFFFF]"} font-extrabold text-sm`,children:["$",Hl.breakEvenPrice>=50?Hl.breakEvenPrice.toLocaleString():Hl.breakEvenPrice]})]}),jsxRuntimeExports.jsxs("div",{className:"bg-transparent flex flex-col justify-center items-start my-2 mx-4",id:"element-id-for-guide-6",children:[jsxRuntimeExports.jsx("div",{className:" text-[#A5A5A6] font-normal text-xs",children:"Leverage"}),jsxRuntimeExports.jsxs("div",{className:`${Fn?"text-black":"text-[#FFFFFF]"} font-extrabold text-sm`,children:[Hl.currentLeverage>=50?Hl.currentLeverage.toFixed():Hl.currentLeverage,"x"]})]}),jsxRuntimeExports.jsxs("div",{className:"bg-transparent flex flex-col justify-center items-start my-2 mx-4",children:[jsxRuntimeExports.jsx("div",{className:" text-[#A5A5A6] font-normal text-xs",children:"Long PnL "}),jsxRuntimeExports.jsxs("div",{className:`${zl&&parseFloat((Q1=(Y1=zl==null?void 0:zl[Go])==null?void 0:Y1[Mn])==null?void 0:Q1.CurrentLSPnl)<0?"text-[#F04438]":"text-[#12B76A]"} font-extrabold text-sm`,children:[zl?(m2=(o2=zl==null?void 0:zl[Go])==null?void 0:o2[Mn])==null?void 0:m2.CurrentLSPnl:"0.00","%"]})]})]})]})}),jsxRuntimeExports.jsx("div",{className:"2xl:inline-flex xl:inline-flex lg:inline-flex md:inline-flex sm:hidden max-sm:hidden   w-full h-full",children:jsxRuntimeExports.jsx(CandlestickChart,{id:"instance1",ref10:Fl})})]}),jsxRuntimeExports.jsx("div",{className:`${Fn?"bg-[#FCFDFE] border-[#E3E8EF]":"bg-[#17181a] border-[rgba(245,247,250,0.06)]"} border-[0.063rem] rounded-2xl inline w-full`,children:jsxRuntimeExports.jsx("div",{className:"w-full",id:"element-id-for-guide-8",children:jsxRuntimeExports.jsxs(Tabs,{children:[jsxRuntimeExports.jsxs("div",{className:`${Fn?"border-[#E3E8EF]":" border-[rgba(245,247,250,0.06)]"} xxl:flex bxl:flex xl:flex sxl:flex justify-between border-b-2`,children:[jsxRuntimeExports.jsx(TabList,{children:jsxRuntimeExports.jsxs("div",{className:"flex h-12 gap-4 text-xs",children:[jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-[#777879]":"text-[#A5A5A6]"} ${tm==="Open Orders"?`${Fn?"bg-[#FCFDFE] text-black":"bg-[#ffffff0f] text-white"} font-extrabold`:""} rounded-tl-[1rem] flex justify-center items-center p-3.5 text-[#A5A5A6] outline-none cursor-pointer`,onClick:()=>g0("Open Orders"),children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"When a Long OPerps trader/ liquidity provider first buys/sells, the transaction is shown here. This indicates that it's yet to be an active trade. Once the next cycle starts, the trade/position will move over to positions where you can also see profit and loss",arrow:!1,overlayInnerStyle:dp,children:"Open Orders"})}),jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-[#777879]":"text-[#A5A5A6]"} ${tm==="Positions"?`${Fn?"bg-[#FCFDFE] text-black":"bg-[#ffffff0f] text-white"} font-extrabold`:""} flex justify-center items-center p-3.5 text-[#A5A5A6] outline-none cursor-pointer`,onClick:()=>g0("Positions"),children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"An OPerps trader or Liquidity provider can see their live trades here including the current balance and profit and loss",arrow:!1,overlayInnerStyle:dp,children:"Positions"})}),jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-[#777879]":"text-[#A5A5A6]"} ${tm==="Withdraw"?`${Fn?"bg-[#FCFDFE] text-black":"bg-[#ffffff0f] text-white"} font-extrabold`:""}  flex justify-center items-center p-3.5 text-[#A5A5A6] outline-none cursor-pointer`,onClick:()=>g0("Withdraw"),children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"An OPerps trader can withdraw the USDC left after closing the trade",arrow:!1,overlayInnerStyle:dp,children:"Withdraw"})}),jsxRuntimeExports.jsx(Tab,{className:`${Fn?"text-[#777879]":"text-[#A5A5A6]"} ${tm==="Trades"?`${Fn?"bg-[#FCFDFE] text-black":"bg-[#ffffff0f] text-white"} font-extrabold`:""}  flex justify-center items-center p-3.5 text-[#A5A5A6] outline-none cursor-pointer`,onClick:()=>g0("Trades"),children:jsxRuntimeExports.jsx(Tooltip$1,{placement:"top",title:"An OPerps trader or Liquidity provider can see their buy/sell transactions here",arrow:!1,overlayInnerStyle:dp,children:"Trades"})})]})}),jsxRuntimeExports.jsxs("div",{className:"flex py-3.5 xxl:justify-end bxl:justify-end xl:justify-end sxl:justify-end lg:justify-start md:justify-start sm:justify-start xd:justify-start ml-2",children:[jsxRuntimeExports.jsxs("a",{className:"flex mr-4",href:`https://dpanshu.pythonanywhere.com/user_history?address=${Ip}&chain=${_l}&token=${Go}&option_type=${Mn}`,target:"_blank",children:[jsxRuntimeExports.jsx("img",{src:Download,alt:"Download",className:"w-4 h-4"}),jsxRuntimeExports.jsx("div",{className:"text-[#2ED3B7] font-extrabold text-xs ml-2",children:"Download PnL History"})]}),jsxRuntimeExports.jsx("img",{src:Fn?refreshIconBlack:refreshIcon,alt:"refreshIcon",onClick:q1,className:` mr-4 w-5 cursor-pointer ${rm?"animate-spin":""} `})]})]}),jsxRuntimeExports.jsx("div",{className:"flex justify-between h-auto w-full",children:jsxRuntimeExports.jsx(TabPanel,{className:"w-full",children:jsxRuntimeExports.jsx(OpenOrder,{executeCancel:wu})})}),jsxRuntimeExports.jsx("div",{className:"flex  w-full  h-auto overflow-x-auto",children:jsxRuntimeExports.jsx(TabPanel,{className:"w-full",children:jsxRuntimeExports.jsx(Positions,{executeOrder:Xl,executeClaim:yu,executeInvaultSell:rp})})}),jsxRuntimeExports.jsx("div",{className:"flex  w-full h-auto overflow-x-auto",children:jsxRuntimeExports.jsx(TabPanel,{className:"w-full",children:jsxRuntimeExports.jsx(Withdraw,{executeClaim:yu})})}),jsxRuntimeExports.jsx("div",{className:"flex  w-full h-auto",children:jsxRuntimeExports.jsx(TabPanel,{className:"w-full",children:jsxRuntimeExports.jsx(Trades,{})})})]})})})]}),jsxRuntimeExports.jsxs("div",{className:"  flex flex-col xxl:w-[410px] bxl:w-[410px] xl:w-[410px] sxl:w-[410px] lg:w-full md:w-full sm:w-full xd:w-full justify-start items-start ",children:[jsxRuntimeExports.jsx("div",{className:"w-full",children:s2&&jsxRuntimeExports.jsx(LearnSwitch,{onClose:L2})}),jsxRuntimeExports.jsx("div",{className:` ${Fn?"bg-[#FFFFFF] border-[#E3E8EF]":"bg-[#17181A] border-[rgba(245,247,250,0.06)] bg_container"} !w-full h-auto border mb-4 rounded-2xl ${s2&&"mt-4"} `,children:jsxRuntimeExports.jsx(BuySell,{})}),Lp?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:`${Fn?"rounded-2xl text-[black] border w-full border-[#E3E8EF] bg-white ":"rounded-2xl text-[white] border w-full border-[rgba(245,247,250,0.06)]  bg-[#17181A]  "} border`,children:[jsxRuntimeExports.jsx(CycleDetails,{}),jsxRuntimeExports.jsxs("div",{className:`fixed bottom-4 right-4 ${Fn?"bg-[white]":"bg-[#17181A80]"} w-32 cursor-pointer h-14 rounded-2xl border-[0.063rem] border-[rgba(255,255,255,0.10)] text-[#2ED3B7] font-extrabold flex items-center justify-around p-[0.7rem] backdrop-blur-[0.5rem]`,onClick:O2,children:[jsxRuntimeExports.jsx("img",{src:help,alt:"help",className:"w-6 h-6"}),jsxRuntimeExports.jsx("div",{children:"Help"}),jsxRuntimeExports.jsx("img",{src:i2?Fn?Vectorlight:Vectordown:Helpup,alt:"Vector",className:"w-6 h-6"})]}),i2&&jsxRuntimeExports.jsx(c$9,{onClickAway:M2,children:jsxRuntimeExports.jsx("div",{className:`fixed bottom-20 right-4 ${Fn?"bg-[white]":"bg-[#17181A80]"} w-[15.75rem] rounded-lg border border-[rgba(255,255,255,0.10)] text-[#2ED3B7] text-sm backdrop-blur-[0.5rem] font-extrabold`,children:jsxRuntimeExports.jsxs("ul",{className:"flex flex-col justify-center gap-2",children:[jsxRuntimeExports.jsxs("li",{className:"cursor-pointer border-b-[0.063rem] border-[rgba(255,255,255,0.10)] flex items-center px-2 py-4",onClick:()=>Mp(),children:[jsxRuntimeExports.jsx("img",{src:GuideTour,alt:"guidetour"}),jsxRuntimeExports.jsx("span",{className:"pl-2",children:"Guided tour"})]}),jsxRuntimeExports.jsxs("li",{className:"cursor-pointer border-b-[0.063rem] border-[rgba(255,255,255,0.10)] flex items-center px-2 py-4",onClick:()=>Ol(!0),children:[jsxRuntimeExports.jsx("img",{src:market,alt:"market"}),jsxRuntimeExports.jsx("span",{className:"pl-2",children:"Help me choose the market"})]}),jsxRuntimeExports.jsx("li",{className:"cursor-pointer border-b-[0.063rem] border-[rgba(255,255,255,0.10)] flex items-center px-2 py-4",children:jsxRuntimeExports.jsxs("a",{href:LINKS.GITBOOK,target:"_blank",className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:Docs,alt:"Docs"}),jsxRuntimeExports.jsx("span",{className:"pl-2",children:"Docs"})]})}),jsxRuntimeExports.jsx("li",{className:"cursor-pointer flex items-center px-2 py-4",children:jsxRuntimeExports.jsxs("a",{href:"https://discord.gg/wA2unt8fsS",target:"_blank",rel:"noopener noreferrer",className:"flex items-center",children:[jsxRuntimeExports.jsx("img",{src:report,alt:"report"}),jsxRuntimeExports.jsx("span",{className:"pl-2",children:"Report"})]})})]})})})]})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]})]}),is&&jsxRuntimeExports.jsx(ConnectWallet,{}),os&&jsxRuntimeExports.jsx(CalculatePopup,{}),io&&jsxRuntimeExports.jsx(CalculatePopupShort,{}),jsxRuntimeExports.jsx(BottomNav,{})]}),jsxRuntimeExports.jsx(Tour,{open:Qp,onClose:kp,steps:Wp,disabledInteraction:!0,indicatorsRender:(Up,im)=>jsxRuntimeExports.jsxs("span",{children:[Up+1," / ",im]}),type:"primary",className:"bg-black p-4"}),jsxRuntimeExports.jsx(Tour,{open:$o,onClose:Gp,steps:$l?Np:Pp,disabledInteraction:!0,indicatorsRender:(Up,im)=>jsxRuntimeExports.jsxs("span",{children:[Up+1," / ",im]}),type:"primary",className:"bg-black p-4"}),jsxRuntimeExports.jsx(Tour,{open:Lo,onClose:Yp,steps:$l?Rp:Hp,disabledInteraction:!0,indicatorsRender:(Up,im)=>jsxRuntimeExports.jsxs("span",{children:[Up+1," / ",im]}),type:"primary",className:"bg-black p-4"})]}),!is&&jsxRuntimeExports.jsx(ConnectWalletPrompt,{})]}),jsxRuntimeExports.jsx(Analytics,{})]})};function NotFoundPage(){return jsxRuntimeExports.jsxs("div",{className:"text-center m-20",children:[jsxRuntimeExports.jsx("h1",{className:"text-6xl font-bold text-gray-800",children:"404 - Sorry!"}),jsxRuntimeExports.jsx("p",{className:"text-lg text-gray-600",children:"The page you’re looking for cannot be found."}),jsxRuntimeExports.jsx("a",{href:"/",className:"text-blue-500 font-medium mt-4 block",children:"Go to Homepage"})]})}const StakeIcon="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='M8.66683%203.33333C8.66683%204.06971%207.02521%204.66667%205.00016%204.66667C2.97512%204.66667%201.3335%204.06971%201.3335%203.33333M8.66683%203.33333C8.66683%202.59695%207.02521%202%205.00016%202C2.97512%202%201.3335%202.59695%201.3335%203.33333M8.66683%203.33333V4.33333M1.3335%203.33333V11.3333C1.3335%2012.0697%202.97512%2012.6667%205.00016%2012.6667M5.00016%207.33333C4.8878%207.33333%204.77662%207.3315%204.66683%207.3279C2.798%207.26666%201.3335%206.69552%201.3335%206M5.00016%2010C2.97512%2010%201.3335%209.40305%201.3335%208.66667M14.6668%207.66667C14.6668%208.40305%2013.0252%209%2011.0002%209C8.97512%209%207.3335%208.40305%207.3335%207.66667M14.6668%207.66667C14.6668%206.93029%2013.0252%206.33333%2011.0002%206.33333C8.97512%206.33333%207.3335%206.93029%207.3335%207.66667M14.6668%207.66667V12.6667C14.6668%2013.403%2013.0252%2014%2011.0002%2014C8.97512%2014%207.3335%2013.403%207.3335%2012.6667V7.66667M14.6668%2010.1667C14.6668%2010.903%2013.0252%2011.5%2011.0002%2011.5C8.97512%2011.5%207.3335%2010.903%207.3335%2010.1667'%20stroke='white'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",StakeDarkIcon="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='M8.66683%203.33333C8.66683%204.06971%207.02521%204.66667%205.00016%204.66667C2.97512%204.66667%201.3335%204.06971%201.3335%203.33333M8.66683%203.33333C8.66683%202.59695%207.02521%202%205.00016%202C2.97512%202%201.3335%202.59695%201.3335%203.33333M8.66683%203.33333V4.33333M1.3335%203.33333V11.3333C1.3335%2012.0697%202.97512%2012.6667%205.00016%2012.6667M5.00016%207.33333C4.8878%207.33333%204.77662%207.3315%204.66683%207.3279C2.798%207.26666%201.3335%206.69552%201.3335%206M5.00016%2010C2.97512%2010%201.3335%209.40305%201.3335%208.66667M14.6668%207.66667C14.6668%208.40305%2013.0252%209%2011.0002%209C8.97512%209%207.3335%208.40305%207.3335%207.66667M14.6668%207.66667C14.6668%206.93029%2013.0252%206.33333%2011.0002%206.33333C8.97512%206.33333%207.3335%206.93029%207.3335%207.66667M14.6668%207.66667V12.6667C14.6668%2013.403%2013.0252%2014%2011.0002%2014C8.97512%2014%207.3335%2013.403%207.3335%2012.6667V7.66667M14.6668%2010.1667C14.6668%2010.903%2013.0252%2011.5%2011.0002%2011.5C8.97512%2011.5%207.3335%2010.903%207.3335%2010.1667'%20stroke='%230C0C0D'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",arrowLeft="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='arrow-left'%3e%3cpath%20id='Icon'%20d='M19%2012H5M5%2012L12%2019M5%2012L12%205'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/svg%3e",arrowLeftDark="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='arrow-left'%3e%3cpath%20id='Icon'%20d='M19%2012H5M5%2012L12%2019M5%2012L12%205'%20stroke='%23107569'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/svg%3e",FaqHeader=()=>{const{t:Fn}=useTranslation();reactExports.useEffect(()=>{const Tl=Sl=>{Ao.current&&!Ao.current.contains(Sl.target)&&Jo()};return $o?document.addEventListener("click",Tl):document.removeEventListener("click",Tl),()=>{document.removeEventListener("click",Tl)}},[]);const[Mn,rs]=reactExports.useState(1),[is,os]=reactExports.useState(!1),[as,us]=reactExports.useState(!1),[ds,hs]=reactExports.useState(!1),ps=Tl=>{if(Tl===1){if(Tl===Mn)return;rs(Tl)}Tl===2&&(us(!1),rs(Tl),os(!1)),Tl===3&&(us(!1),rs(Tl),os(!1)),Tl===4&&(us(!1),rs(Tl),os(!1)),Tl===5&&(us(!1),rs(Tl),os(!1)),Tl===6&&(us(!1),rs(Tl),os(!1))},[io,fo]=reactExports.useState(!1),mo=()=>{fo(!io)},Ao=reactExports.useRef(null),[$o,Lo]=reactExports.useState(!1),{isDarkMode:Go,updateIsDarkMode:Yo}=useStore(),Wo=useNavigate(),Jo=()=>{Lo(!1)},xl=()=>{ds===!1?(hs(!0),Jo()):(hs(!1),Jo())};reactExports.useEffect(()=>{const Tl=Sl=>{Ao.current&&!Ao.current.contains(Sl.target)&&Jo()};return $o?document.addEventListener("click",Tl):document.removeEventListener("click",Tl),()=>{document.removeEventListener("click",Tl)}},[$o]);const _l=Tl=>{switch(Tl){case"Learn":Wo("/learn");break;case"switch":Wo("/");break}};return jsxRuntimeExports.jsxs("div",{className:`${Go?"!bg-[#FCFDFE]":"!bg-[#111213]"} h-auto z-[1]  !fixed !top-0 flex flex-col justify-between items-start !font-inter   xxl:!rounded-[0_0_1rem_1rem] bxl:!rounded-[0_0_1rem_1rem] xl:!rounded-[0_0_1rem_1rem] sxl:!rounded-[0_0_1rem_1rem] lg:!rounded-none md:!rounded-none sm:!rounded-none xd:!rounded-none  xxl:!w-[1600px] bxl:!w-[1600px] xl:!w-[85%] sxl:!w-[90%] lg:!w-[96%] md:!w-full sm:!w-full xd:!w-full `,children:[jsxRuntimeExports.jsx("div",{className:"!h-24 flex flex-row  items-center justify-between  w-full xxl:!px-6 bxl:!px-6 xl:!px-6 sxl:!px-6 lg:!pr-6 md:!pr-0 sm:!pr-0 xd:!pr-0 ",children:jsxRuntimeExports.jsxs("div",{className:"  py-6 px-4 flex flex-row   gap-4 !items-center !justify-between top-[0] w-full      ",children:[jsxRuntimeExports.jsx("img",{src:Kana,alt:"kana-logo",className:"w-8 h-8 xxl:!hidden bxl:!hidden xl:!hidden sxl:!hidden lg:!flex md:!flex sm:!flex xd:!flex"}),jsxRuntimeExports.jsx("div",{className:`${Go?"bg-[#EFF7F8]":"bg-[#ffffff0f]"} h-14 rounded-[2rem] cursor-pointer xxl:!w-[22%] bxl:!w-[22%] xl:!w-[22%] sxl:!w-[21%] lg:!w-[70%] md:!w-[70%] sm:!w-[70%] xd:!w-[70%] xxl:ml-5 xl:ml-5 lg:ml-5 md:ml-5 sm:ml-0 max-sm:ml-0 gap-2 flex justify-start items-center p-[16px_32px] 2xl:inline-flex xl:inline-flex lg:inline-flex md:hidden sm:hidden  max-sm:hidden`,onClick:()=>_l("switch"),children:jsxRuntimeExports.jsxs("div",{className:`${Go?"text-[#107569]":"text-[#2ED3B7]"} font-normal text-base flex flex-row justify-start items-center gap-2`,children:[jsxRuntimeExports.jsx("div",{children:Go?jsxRuntimeExports.jsx("img",{src:arrowLeftDark,alt:""}):jsxRuntimeExports.jsx("img",{src:arrowLeft,alt:""})}),jsxRuntimeExports.jsx("div",{children:"Use OPerps"})]})}),jsxRuntimeExports.jsx("div",{onClick:()=>Yo(!Go),className:`${Go?"bg-[#EFF7F8]":"bg-[#1D1E20]"} w-[3.875rem]  xxl:!flex bxl:!flex xl:!flex sxl:!flex lg:!hidden md:!hidden sm:!hidden xd:!hidden   h-[3.875rem]    flex-row  justify-center items-center  cursor-pointer !rounded-2xl`,children:jsxRuntimeExports.jsx("img",{src:Go?SettingGreen:SettingDark,alt:"sun"})}),jsxRuntimeExports.jsx("div",{className:"text-[2rem]  text-[rgba(255,255,255,0.6)] cursor-pointer xxl:!hidden bxl:!hidden xl:!hidden sxl:!hidden lg:!flex md:!flex sm:!flex xd:!flex",onClick:mo,children:io?jsxRuntimeExports.jsx("img",{src:WrongRed,alt:"WrongRed"}):jsxRuntimeExports.jsx("img",{src:Go?BarMenuDark:BarMenu,alt:"BarMenu"})})]})}),io?jsxRuntimeExports.jsxs("ul",{className:`  flex-col h-[90vh] justify-between items-start py-3 mt-24 xxl:hidden bxl:hidden xl:hidden sxl:hidden lg:flex md:flex lg:!mx-[1.3rem] md:!mx-[0rem] sm:!mx-[0rem] xd:!mx-[0rem] md:w-full sm:w-full xd:w-full  md:pb-0 md:mt-24 sm:mt-24 xd:mt-24 z-[9] ${Go?"!bg-[#FCFDFE]":"!bg-[#17181A]"} ${io?"!fixed !right-0 !left-0  lg:!bottom-0 md:!bottom-24 sm:!bottom-24 xd:!bottom-24 !top-0	 ":"hidden"}`,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-col  items-start justify-between align-middle  h-full  w-full lg:!px-4 md:!px-4 sm:!px-4 xd:!px-4 !bg-transparent",children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-col justify-start items-start bg-transparent w-full gap-2",children:[jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:" https://app.kanalabs.io/",className:"w-full flex  h-[52px] flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${Go?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===2?`!font-extrabold !opacity-[1]  ${Go?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:Go?SwapDark:Swap,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:Go?"text-[#0C0C0D]":"text-[white]",children:Fn("Swap")})]})})}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:" https://tradebook.kanalabs.io/",target:"_blank",className:"w-full flex  h-[52px] flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${Go?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===2?`!font-extrabold !opacity-[1]  ${Go?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:Go?StakeDarkIcon:StakeIcon,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:Go?"text-[#0C0C0D]":"text-[white]",children:Fn("Stake")})]})})}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://app.kanalabs.io/stake-yield",target:"_blank",className:"w-full  h-[52px] flex flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${Go?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===2?`!font-extrabold !opacity-[1]  ${Go?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:Go?StakeDarkIcon:StakeIcon,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:Go?"text-[#0C0C0D]":"text-[white]",children:Fn("Stake")})]})})}),jsxRuntimeExports.jsx("div",{className:` ${Go?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===2?`!font-extrabold !opacity-[1]  ${Go?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>ps(1),children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-between w-full items-center",onClick:xl,children:[jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:Go?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:Go?"text-[#0C0C0D]":"text-[white]",children:"Leaderboard"})]}),jsxRuntimeExports.jsx("img",{src:Go?ChevronDownDark:ChevronDown,alt:"ChevronDown",className:ds?" rotate-180 ml-2":" ml-2 rotate-0"})]})}),ds&&jsxRuntimeExports.jsxs("div",{className:"submenu w-full",children:[jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://app.kanalabs.io/leader-board",className:"w-full  h-[52px] flex flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` bg-transparent menu-item text-base my-1  w-full h-auto text-[white] font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl hover:bg-[rgba(255,255,255,0.06)] hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===3?"font-extrabold opacity-[1] bg-[rgba(255,255,255,0.06)]":"opacity-[0.5]"}`,onClick:()=>ps(3),children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4 opacity-0",src:Go?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:Go?"text-[#0C0C0D]":"text-[white]",children:"Swap Leaderboard"})]})})}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://tradebook.kanalabs.io/leaderboard",className:"w-full  h-[52px] flex flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` bg-transparent menu-item text-base my-1  w-full h-auto text-[white] text-base font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl hover:bg-[rgba(255,255,255,0.06)] hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===6?"font-extrabold opacity-[1] bg-[rgba(255,255,255,0.06)]":"opacity-[0.5]"}`,onClick:()=>ps(6),children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4 opacity-0",src:Go?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:Go?"text-[#0C0C0D]":"text-[white]",children:"Trade Leaderboard"})]})})})]}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://app.kanalabs.io/referrals",className:"w-full  h-[52px] flex flex-row justify-start items-center  bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` bg-transparent menu-item text-base my-1  w-full h-auto text-[white] text-base font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl hover:bg-[rgba(255,255,255,0.06)] hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===6?"font-extrabold opacity-[1] bg-[rgba(255,255,255,0.06)]":"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:Go?ReferralDark:Referral,alt:"Referral"}),jsxRuntimeExports.jsx("div",{className:Go?"text-[#0C0C0D]":"text-[white]",children:"Referral"})]})})})]}),jsxRuntimeExports.jsx("div",{className:"xxl:hidden w-full xl:hidden lg:hidden md:flex sm:flex max-sm:flex mt-1.5 ",onClick:()=>Yo(!Go),children:jsxRuntimeExports.jsxs("div",{className:`${Go?"bg-[#EFF7F8] text-[#0C0C0D]":"bg-[#1D1E20] text-[#FFF]"} w-full  font-extrabold  h-[3.875rem] !rounded-[2rem] py-4 px-6 flex flex-row justify-between gap-4 items-center  cursor-pointer `,children:[jsxRuntimeExports.jsx("div",{children:"Theme"}),jsxRuntimeExports.jsx("img",{src:Go?SettingGreen:SettingDark,alt:"sun"})]})})]}),jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-center items-center gap-4 w-full ",children:jsxRuntimeExports.jsx("div",{className:`${Go?"text-[#A5A5A6]":"text-[rgba(255,255,255,0.50)]"} text-xs  py-5 font-inter`,children:"Powered by"})})]}):jsxRuntimeExports.jsx("ul",{})]})},LeaderBoardRank=({rank:Fn,address:Mn,pnl:rs})=>{var os;const{isDarkMode:is}=useStore();return jsxRuntimeExports.jsxs("div",{className:`w-full px-6 py-6 font-normal ${is?"text-[#A5A5A6] border-[#E3E8EF]":"text-[#FFFFFF] border-[#FFFFFF1A]"} border-b-2  flex h-[7.6%] items-center sm:text-[0.8rem] sm:px-3`,children:[jsxRuntimeExports.jsx("div",{className:"w-[8%] flex justify-start sm:w-[7%]",children:Fn}),jsxRuntimeExports.jsx("div",{className:"w-[40%] flex justify-center overflow-hidden sm:w-[31%]",children:(Mn==null?void 0:Mn.slice(0,13))+".."+((os=Mn==null?void 0:Mn.toString())==null?void 0:os.slice(-13))}),jsxRuntimeExports.jsx("div",{className:"w-[35%] flex justify-end sm:!justify-center sm:w-[31%]",children:rs})]})},Pagination=({totalPage:Fn,currentPage:Mn,setPage:rs})=>{const{isDarkMode:is}=useStore(),os=5,as=Math.floor(os/2);let us=Math.max(Mn-as,1),ds=Math.min(us+os-1,Fn);Fn-us<os&&(us=Math.max(Fn-os+1,1));const hs=[];for(let ps=us;ps<=ds;ps++)hs.push(ps);return jsxRuntimeExports.jsx("div",{children:hs.map(ps=>jsxRuntimeExports.jsx("button",{onClick:()=>rs(ps),className:`${Mn===ps?is?"bg-[#E4F2F3] text-[#4A4B4D]":"bg-[#FFFFFF0F] text-[#FFFFFFCC]":""} w-12 h-12 rounded-xl sm:w-10 sm:h-10 sm:text-[0.8rem] sm:rounded-lg`,children:ps},ps))})},LeftArrow="data:image/svg+xml,%3csvg%20width='41'%20height='40'%20viewBox='0%200%2041%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.22%2020.7199C16.0793%2020.5793%2016.0002%2020.3887%2016%2020.1899V19.8099C16.0023%2019.6114%2016.0811%2019.4216%2016.22%2019.2799L21.36%2014.1499C21.4539%2014.0552%2021.5817%2014.002%2021.715%2014.002C21.8483%2014.002%2021.9761%2014.0552%2022.07%2014.1499L22.78%2014.8599C22.8741%2014.952%2022.9271%2015.0782%2022.9271%2015.2099C22.9271%2015.3415%2022.8741%2015.4677%2022.78%2015.5599L18.33%2019.9999L22.78%2024.4399C22.8747%2024.5337%2022.9279%2024.6615%2022.9279%2024.7949C22.9279%2024.9282%2022.8747%2025.056%2022.78%2025.1499L22.07%2025.8499C21.9761%2025.9445%2021.8483%2025.9978%2021.715%2025.9978C21.5817%2025.9978%2021.4539%2025.9445%2021.36%2025.8499L16.22%2020.7199Z'%20fill='%23D2D2D2'/%3e%3c/svg%3e",RightArrow="data:image/svg+xml,%3csvg%20width='41'%20height='40'%20viewBox='0%200%2041%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.78%2020.7199C23.9207%2020.5793%2023.9998%2020.3887%2024%2020.1899V19.8099C23.9977%2019.6114%2023.9189%2019.4216%2023.78%2019.2799L18.64%2014.1499C18.5461%2014.0552%2018.4183%2014.002%2018.285%2014.002C18.1517%2014.002%2018.0239%2014.0552%2017.93%2014.1499L17.22%2014.8599C17.1259%2014.952%2017.0729%2015.0782%2017.0729%2015.2099C17.0729%2015.3415%2017.1259%2015.4677%2017.22%2015.5599L21.67%2019.9999L17.22%2024.4399C17.1253%2024.5337%2017.0721%2024.6615%2017.0721%2024.7949C17.0721%2024.9282%2017.1253%2025.056%2017.22%2025.1499L17.93%2025.8499C18.0239%2025.9445%2018.1517%2025.9978%2018.285%2025.9978C18.4183%2025.9978%2018.5461%2025.9445%2018.64%2025.8499L23.78%2020.7199Z'%20fill='%230E9384'/%3e%3c/svg%3e",LeaderBoard=()=>{var Sl;const{isDarkMode:Fn,updateIsWalletConnectVisible:Mn,isWalletConnectVisible:rs}=useStore(),{isConnected:is}=useAccount(),[os,as]=reactExports.useState(1),[us,ds]=reactExports.useState([{}]),[hs,ps]=reactExports.useState(0),[io,fo]=reactExports.useState("NA"),[mo,Ao]=reactExports.useState(0),[$o,Lo]=reactExports.useState(0),[Go,Yo]=reactExports.useState([]),{address:Wo}=useAccount(),[Jo,xl]=reactExports.useState("");reactExports.useEffect(()=>{$o>=1e12?xl(Math.floor($o/1e12*10)/10+"T"):$o>=1e9?xl(Math.floor($o/1e9*10)/10+"B"):$o>=1e6?xl(Math.floor($o/1e6*10)/10+"M"):$o>=1e3?xl(Math.floor($o/1e3*10)/10+"K"):xl($o+"")},[$o]);const _l=10,Tl=async()=>{try{const $l=await generateRandomDataAndNonce(),Pl={headers:{accept:"application/json","x-nonce":$l.nonceValue,"x-hash":$l.hash}},Ol=(await axios.get(`${SWITCHBACKENDURL}/leaderboard`,Pl)).data.data;console.log("fetchedData",Ol),Yo(Ol)}catch($l){console.error("error",$l)}};return reactExports.useEffect(()=>{is&&Mn(!1)},[is]),reactExports.useEffect(()=>{Tl()},[]),reactExports.useEffect(()=>{if((Go==null?void 0:Go.length)>0){const $l=Go.slice((os-1)*_l,os*_l),Pl=Math.ceil(Go.length/_l);ds($l),ps(Pl)}},[os,Go]),reactExports.useEffect(()=>{if(Go&&Wo){const $l=Wo,Pl=Go.findIndex(Ol=>Ol.user_address.toLowerCase()===$l.toLowerCase()),Dl=Go.findIndex(Ol=>Ol.user_address.toLowerCase()===$l.toLowerCase());Dl!==-1&&(fo(Pl!==-1?Pl+1:"NA"),Ao(Math.floor((Go[Dl].pnl-1)*1e4)/100),Lo(Go[Dl].total_to))}},[Go,Wo]),jsxRuntimeExports.jsxs("div",{className:`${Fn?"bg-[#E4F2F3]":"bg-[#ffffff0f]"} min-h-screen h-full font-inter flex !w-full`,children:[jsxRuntimeExports.jsx("div",{className:" xxl:inline bxl:inline xl:inline sxl:inline lg:hidden md:hidden sm:hidden xd:hidden w-[5%]  "}),jsxRuntimeExports.jsx("div",{className:"w-full flex flex-row justify-center items-start",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col  xxl:!w-[1600px] bxl:!w-[1600px] xl:!w-[88%] sxl:!w-[94%] lg:!w-[96%] md:!w-full sm:!w-full xd:!w-full    ",children:[jsxRuntimeExports.jsx(FaqHeader,{}),jsxRuntimeExports.jsx("div",{className:"mt-28 mb-4   md:px-4 sm:px-4 xd:px-4 w-full ",children:jsxRuntimeExports.jsxs("div",{className:" my-4  gap-4 flex xxl:flex-row xl:flex-row lg:flex-row md:flex-col-reverse sm:flex-col-reverse max-sm:flex-col-reverse lg:h-full w-full h-[85vh] sm:h-full ",children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-col xxl:w-[70%] ${Fn?"bg-white border-[#E3E8EF] text-[black]":"bg-[#17181A] border-[#FFFFFF1A] text-[#FFFFFF]"} border rounded-2xl bxl:w-[70%] xl:w-[70%] sxl:w-[70%] lg:w-[70%] md:w-full sm:w-full max-sm:w-full h-full lg:h-[80%] md:h-[80%] sm:h-[80%]`,children:[jsxRuntimeExports.jsx("div",{className:`w-full px-6 py-6 font-extrabold ${Fn?"text-[#777879] border-[#E3E8EF]":"border-[#FFFFFF1A] text-[#A5A5A6]"}  border-b-2  h-[7.6%] items-center flex`,children:"Leaderboard"}),jsxRuntimeExports.jsxs("div",{className:`w-full px-6 py-6 font-normal ${Fn?"text-[#A5A5A6] bg-[#F2F9F9] border-[#E3E8EF]":"border-[#FFFFFF1A] bg-[#111213] text-[#777879]"}  border-b-2  flex h-[7.6%] items-center sm:text-[0.8rem] sm:px-3`,children:[jsxRuntimeExports.jsx("div",{className:"w-[8%] flex justify-start sm:w-[7%]",children:"Rank"}),jsxRuntimeExports.jsx("div",{className:"w-[40%] flex justify-center sm:w-[31%]",children:"Address"}),jsxRuntimeExports.jsx("div",{className:"w-[35%] flex justify-end sm:!justify-center sm:w-[31%]",children:"PnL($)"})]}),(Go==null?void 0:Go.length)>0?us.map(($l,Pl)=>jsxRuntimeExports.jsx(LeaderBoardRank,{rank:(os-1)*10+(Pl+1),address:$l.user_address,pnl:Math.floor($l.pnl)},Pl)):jsxRuntimeExports.jsx("div",{}),(Go==null?void 0:Go.length)>0?jsxRuntimeExports.jsx("div",{className:"text-[#A5A5A6] w-full px-6 py-6 font-normal  flex h-[7.6%] items-center sm:px-0",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center w-full",children:[jsxRuntimeExports.jsx("img",{src:LeftArrow,alt:"LeftArrow",onClick:()=>as(os-1),className:`${os===1?"hidden":""} cursor-pointer w-12 h-12 sm:w-10 sm:h-10 `}),jsxRuntimeExports.jsx(Pagination,{totalPage:hs,currentPage:os,setPage:as}),jsxRuntimeExports.jsx("img",{src:RightArrow,alt:"RightArrow",onClick:()=>as(os+1),className:`${os===Math.ceil(Go.length/_l)?"hidden":""} cursor-pointer w-12 h-12 sm:w-10 sm:h-10`})]})}):jsxRuntimeExports.jsx("div",{})]}),jsxRuntimeExports.jsx("div",{className:"xxl:w-[30%] bxl:w-[30%] xl:w-[30%] sxl:w-[30%] lg:w-[30%] md:w-full sm:w-full lg:h-full md:h-full sm:h-full",children:jsxRuntimeExports.jsxs("div",{className:`w-full  ${Fn?"border-[#E3E8EF] text-[black] bg-white":"border-[#FFFFFF1A] text-[#FFFFFF] bg-[#17181A]"}  border rounded-2xl lg:h-full md:h-full sm:h-full `,children:[jsxRuntimeExports.jsx("div",{className:`w-full px-6 py-6 font-extrabold border-b-2  h-[7.6%] items-center flex ${Fn?"text-[#777879] border-[#E3E8EF]":"text-[#A5A5A6] border-[#FFFFFF1A]"}`,children:"Your Stats"}),jsxRuntimeExports.jsxs("div",{className:`${Wo?"hidden":""} border ${Fn?"border-[#0E9384] text-[#0E9384]":"border-[#2ED3B7] text-[#2ED3B7]"}  rounded-md w-[95%] mx-auto  h-8 flex justify-center m-4 cursor-pointer`,children:[jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-start items-center gap-2 ",onClick:()=>{Mn(!0)},children:"Connect wallet to see your stats"}),rs&&jsxRuntimeExports.jsx(ConnectWallet,{})]}),jsxRuntimeExports.jsxs("div",{className:`${Wo?"":"hidden"} flex w-full px-6 my-8 ${Fn?"text-[#0C0C0D]":"text-[#FFFFFF]"} `,children:[jsxRuntimeExports.jsx("div",{className:"w-[50%]",children:"Rank"}),jsxRuntimeExports.jsx("div",{className:"w-[50%] flex justify-end",children:io})]}),jsxRuntimeExports.jsxs("div",{className:`${Wo?"":"hidden"} flex w-full px-6 my-8 ${Fn?"text-[#0C0C0D]":"text-[#FFFFFF]"}`,children:[jsxRuntimeExports.jsx("div",{className:"w-[50%]",children:"Address"}),jsxRuntimeExports.jsx("div",{className:"w-[50%] flex justify-end",children:(Wo==null?void 0:Wo.slice(0,6))+".."+((Sl=Wo==null?void 0:Wo.toString())==null?void 0:Sl.slice(-6))})]}),jsxRuntimeExports.jsxs("div",{className:`${Wo?"":"hidden"} flex w-full px-6 my-8 ${Fn?"text-[#0C0C0D]":"text-[#FFFFFF]"}`,children:[jsxRuntimeExports.jsx("div",{className:"w-[50%]",children:"PnL%"}),jsxRuntimeExports.jsx("div",{className:"w-[50%] flex justify-end",children:mo+"%"})]}),jsxRuntimeExports.jsxs("div",{className:`${Wo?"":"hidden"} flex w-full px-6 my-8 ${Fn?"text-[#0C0C0D]":"text-[#FFFFFF]"}`,children:[jsxRuntimeExports.jsx("div",{className:"w-[50%]",children:"Trade Consistency"}),jsxRuntimeExports.jsx("div",{className:"w-[50%] flex justify-end",children:"$"+Jo})]})]})})]})})]})})]})},consoleLogger={type:"logger",log(Fn){this.output("log",Fn)},warn(Fn){this.output("warn",Fn)},error(Fn){this.output("error",Fn)},output(Fn,Mn){console&&console[Fn]&&console[Fn].apply(console,Mn)}};class Logger{constructor(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(Mn,rs)}init(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=rs.prefix||"i18next:",this.logger=Mn||consoleLogger,this.options=rs,this.debug=rs.debug}log(){for(var Mn=arguments.length,rs=new Array(Mn),is=0;is<Mn;is++)rs[is]=arguments[is];return this.forward(rs,"log","",!0)}warn(){for(var Mn=arguments.length,rs=new Array(Mn),is=0;is<Mn;is++)rs[is]=arguments[is];return this.forward(rs,"warn","",!0)}error(){for(var Mn=arguments.length,rs=new Array(Mn),is=0;is<Mn;is++)rs[is]=arguments[is];return this.forward(rs,"error","")}deprecate(){for(var Mn=arguments.length,rs=new Array(Mn),is=0;is<Mn;is++)rs[is]=arguments[is];return this.forward(rs,"warn","WARNING DEPRECATED: ",!0)}forward(Mn,rs,is,os){return os&&!this.debug?null:(typeof Mn[0]=="string"&&(Mn[0]=`${is}${this.prefix} ${Mn[0]}`),this.logger[rs](Mn))}create(Mn){return new Logger(this.logger,{prefix:`${this.prefix}:${Mn}:`,...this.options})}clone(Mn){return Mn=Mn||this.options,Mn.prefix=Mn.prefix||this.prefix,new Logger(this.logger,Mn)}}var baseLogger=new Logger;class EventEmitter{constructor(){this.observers={}}on(Mn,rs){return Mn.split(" ").forEach(is=>{this.observers[is]||(this.observers[is]=new Map);const os=this.observers[is].get(rs)||0;this.observers[is].set(rs,os+1)}),this}off(Mn,rs){if(this.observers[Mn]){if(!rs){delete this.observers[Mn];return}this.observers[Mn].delete(rs)}}emit(Mn){for(var rs=arguments.length,is=new Array(rs>1?rs-1:0),os=1;os<rs;os++)is[os-1]=arguments[os];this.observers[Mn]&&Array.from(this.observers[Mn].entries()).forEach(us=>{let[ds,hs]=us;for(let ps=0;ps<hs;ps++)ds(...is)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(us=>{let[ds,hs]=us;for(let ps=0;ps<hs;ps++)ds.apply(ds,[Mn,...is])})}}const defer=()=>{let Fn,Mn;const rs=new Promise((is,os)=>{Fn=is,Mn=os});return rs.resolve=Fn,rs.reject=Mn,rs},makeString=Fn=>Fn==null?"":""+Fn,copy=(Fn,Mn,rs)=>{Fn.forEach(is=>{Mn[is]&&(rs[is]=Mn[is])})},lastOfPathSeparatorRegExp=/###/g,cleanKey=Fn=>Fn&&Fn.indexOf("###")>-1?Fn.replace(lastOfPathSeparatorRegExp,"."):Fn,canNotTraverseDeeper=Fn=>!Fn||typeof Fn=="string",getLastOfPath=(Fn,Mn,rs)=>{const is=typeof Mn!="string"?Mn:Mn.split(".");let os=0;for(;os<is.length-1;){if(canNotTraverseDeeper(Fn))return{};const as=cleanKey(is[os]);!Fn[as]&&rs&&(Fn[as]=new rs),Object.prototype.hasOwnProperty.call(Fn,as)?Fn=Fn[as]:Fn={},++os}return canNotTraverseDeeper(Fn)?{}:{obj:Fn,k:cleanKey(is[os])}},setPath=(Fn,Mn,rs)=>{const{obj:is,k:os}=getLastOfPath(Fn,Mn,Object);if(is!==void 0||Mn.length===1){is[os]=rs;return}let as=Mn[Mn.length-1],us=Mn.slice(0,Mn.length-1),ds=getLastOfPath(Fn,us,Object);for(;ds.obj===void 0&&us.length;)as=`${us[us.length-1]}.${as}`,us=us.slice(0,us.length-1),ds=getLastOfPath(Fn,us,Object),ds&&ds.obj&&typeof ds.obj[`${ds.k}.${as}`]<"u"&&(ds.obj=void 0);ds.obj[`${ds.k}.${as}`]=rs},pushPath=(Fn,Mn,rs,is)=>{const{obj:os,k:as}=getLastOfPath(Fn,Mn,Object);os[as]=os[as]||[],os[as].push(rs)},getPath=(Fn,Mn)=>{const{obj:rs,k:is}=getLastOfPath(Fn,Mn);if(rs)return rs[is]},getPathWithDefaults=(Fn,Mn,rs)=>{const is=getPath(Fn,rs);return is!==void 0?is:getPath(Mn,rs)},deepExtend=(Fn,Mn,rs)=>{for(const is in Mn)is!=="__proto__"&&is!=="constructor"&&(is in Fn?typeof Fn[is]=="string"||Fn[is]instanceof String||typeof Mn[is]=="string"||Mn[is]instanceof String?rs&&(Fn[is]=Mn[is]):deepExtend(Fn[is],Mn[is],rs):Fn[is]=Mn[is]);return Fn},regexEscape=Fn=>Fn.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const escape=Fn=>typeof Fn=="string"?Fn.replace(/[&<>"'\/]/g,Mn=>_entityMap[Mn]):Fn;class RegExpCache{constructor(Mn){this.capacity=Mn,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(Mn){const rs=this.regExpMap.get(Mn);if(rs!==void 0)return rs;const is=new RegExp(Mn);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(Mn,is),this.regExpQueue.push(Mn),is}}const chars=[" ",",","?","!",";"],looksLikeObjectPathRegExpCache=new RegExpCache(20),looksLikeObjectPath=(Fn,Mn,rs)=>{Mn=Mn||"",rs=rs||"";const is=chars.filter(us=>Mn.indexOf(us)<0&&rs.indexOf(us)<0);if(is.length===0)return!0;const os=looksLikeObjectPathRegExpCache.getRegExp(`(${is.map(us=>us==="?"?"\\?":us).join("|")})`);let as=!os.test(Fn);if(!as){const us=Fn.indexOf(rs);us>0&&!os.test(Fn.substring(0,us))&&(as=!0)}return as},deepFind=function(Fn,Mn){let rs=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!Fn)return;if(Fn[Mn])return Fn[Mn];const is=Mn.split(rs);let os=Fn;for(let as=0;as<is.length;){if(!os||typeof os!="object")return;let us,ds="";for(let hs=as;hs<is.length;++hs)if(hs!==as&&(ds+=rs),ds+=is[hs],us=os[ds],us!==void 0){if(["string","number","boolean"].indexOf(typeof us)>-1&&hs<is.length-1)continue;as+=hs-as+1;break}os=us}return os},getCleanedCode=Fn=>Fn&&Fn.indexOf("_")>0?Fn.replace("_","-"):Fn;class ResourceStore extends EventEmitter{constructor(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=Mn||{},this.options=rs,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(Mn){this.options.ns.indexOf(Mn)<0&&this.options.ns.push(Mn)}removeNamespaces(Mn){const rs=this.options.ns.indexOf(Mn);rs>-1&&this.options.ns.splice(rs,1)}getResource(Mn,rs,is){let os=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const as=os.keySeparator!==void 0?os.keySeparator:this.options.keySeparator,us=os.ignoreJSONStructure!==void 0?os.ignoreJSONStructure:this.options.ignoreJSONStructure;let ds;Mn.indexOf(".")>-1?ds=Mn.split("."):(ds=[Mn,rs],is&&(Array.isArray(is)?ds.push(...is):typeof is=="string"&&as?ds.push(...is.split(as)):ds.push(is)));const hs=getPath(this.data,ds);return!hs&&!rs&&!is&&Mn.indexOf(".")>-1&&(Mn=ds[0],rs=ds[1],is=ds.slice(2).join(".")),hs||!us||typeof is!="string"?hs:deepFind(this.data&&this.data[Mn]&&this.data[Mn][rs],is,as)}addResource(Mn,rs,is,os){let as=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const us=as.keySeparator!==void 0?as.keySeparator:this.options.keySeparator;let ds=[Mn,rs];is&&(ds=ds.concat(us?is.split(us):is)),Mn.indexOf(".")>-1&&(ds=Mn.split("."),os=rs,rs=ds[1]),this.addNamespaces(rs),setPath(this.data,ds,os),as.silent||this.emit("added",Mn,rs,is,os)}addResources(Mn,rs,is){let os=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const as in is)(typeof is[as]=="string"||Array.isArray(is[as]))&&this.addResource(Mn,rs,as,is[as],{silent:!0});os.silent||this.emit("added",Mn,rs,is)}addResourceBundle(Mn,rs,is,os,as){let us=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},ds=[Mn,rs];Mn.indexOf(".")>-1&&(ds=Mn.split("."),os=is,is=rs,rs=ds[1]),this.addNamespaces(rs);let hs=getPath(this.data,ds)||{};us.skipCopy||(is=JSON.parse(JSON.stringify(is))),os?deepExtend(hs,is,as):hs={...hs,...is},setPath(this.data,ds,hs),us.silent||this.emit("added",Mn,rs,is)}removeResourceBundle(Mn,rs){this.hasResourceBundle(Mn,rs)&&delete this.data[Mn][rs],this.removeNamespaces(rs),this.emit("removed",Mn,rs)}hasResourceBundle(Mn,rs){return this.getResource(Mn,rs)!==void 0}getResourceBundle(Mn,rs){return rs||(rs=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(Mn,rs)}:this.getResource(Mn,rs)}getDataByLanguage(Mn){return this.data[Mn]}hasLanguageSomeTranslations(Mn){const rs=this.getDataByLanguage(Mn);return!!(rs&&Object.keys(rs)||[]).find(os=>rs[os]&&Object.keys(rs[os]).length>0)}toJSON(){return this.data}}var postProcessor={processors:{},addPostProcessor(Fn){this.processors[Fn.name]=Fn},handle(Fn,Mn,rs,is,os){return Fn.forEach(as=>{this.processors[as]&&(Mn=this.processors[as].process(Mn,rs,is,os))}),Mn}};const checkedLoadedFor={};class Translator extends EventEmitter{constructor(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],Mn,this),this.options=rs,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=baseLogger.create("translator")}changeLanguage(Mn){Mn&&(this.language=Mn)}exists(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(Mn==null)return!1;const is=this.resolve(Mn,rs);return is&&is.res!==void 0}extractFromKey(Mn,rs){let is=rs.nsSeparator!==void 0?rs.nsSeparator:this.options.nsSeparator;is===void 0&&(is=":");const os=rs.keySeparator!==void 0?rs.keySeparator:this.options.keySeparator;let as=rs.ns||this.options.defaultNS||[];const us=is&&Mn.indexOf(is)>-1,ds=!this.options.userDefinedKeySeparator&&!rs.keySeparator&&!this.options.userDefinedNsSeparator&&!rs.nsSeparator&&!looksLikeObjectPath(Mn,is,os);if(us&&!ds){const hs=Mn.match(this.interpolator.nestingRegexp);if(hs&&hs.length>0)return{key:Mn,namespaces:as};const ps=Mn.split(is);(is!==os||is===os&&this.options.ns.indexOf(ps[0])>-1)&&(as=ps.shift()),Mn=ps.join(os)}return typeof as=="string"&&(as=[as]),{key:Mn,namespaces:as}}translate(Mn,rs,is){if(typeof rs!="object"&&this.options.overloadTranslationOptionHandler&&(rs=this.options.overloadTranslationOptionHandler(arguments)),typeof rs=="object"&&(rs={...rs}),rs||(rs={}),Mn==null)return"";Array.isArray(Mn)||(Mn=[String(Mn)]);const os=rs.returnDetails!==void 0?rs.returnDetails:this.options.returnDetails,as=rs.keySeparator!==void 0?rs.keySeparator:this.options.keySeparator,{key:us,namespaces:ds}=this.extractFromKey(Mn[Mn.length-1],rs),hs=ds[ds.length-1],ps=rs.lng||this.language,io=rs.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(ps&&ps.toLowerCase()==="cimode"){if(io){const xl=rs.nsSeparator||this.options.nsSeparator;return os?{res:`${hs}${xl}${us}`,usedKey:us,exactUsedKey:us,usedLng:ps,usedNS:hs,usedParams:this.getUsedParamsDetails(rs)}:`${hs}${xl}${us}`}return os?{res:us,usedKey:us,exactUsedKey:us,usedLng:ps,usedNS:hs,usedParams:this.getUsedParamsDetails(rs)}:us}const fo=this.resolve(Mn,rs);let mo=fo&&fo.res;const Ao=fo&&fo.usedKey||us,$o=fo&&fo.exactUsedKey||us,Lo=Object.prototype.toString.apply(mo),Go=["[object Number]","[object Function]","[object RegExp]"],Yo=rs.joinArrays!==void 0?rs.joinArrays:this.options.joinArrays,Wo=!this.i18nFormat||this.i18nFormat.handleAsObject;if(Wo&&mo&&(typeof mo!="string"&&typeof mo!="boolean"&&typeof mo!="number")&&Go.indexOf(Lo)<0&&!(typeof Yo=="string"&&Array.isArray(mo))){if(!rs.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const xl=this.options.returnedObjectHandler?this.options.returnedObjectHandler(Ao,mo,{...rs,ns:ds}):`key '${us} (${this.language})' returned an object instead of string.`;return os?(fo.res=xl,fo.usedParams=this.getUsedParamsDetails(rs),fo):xl}if(as){const xl=Array.isArray(mo),_l=xl?[]:{},Tl=xl?$o:Ao;for(const Sl in mo)if(Object.prototype.hasOwnProperty.call(mo,Sl)){const $l=`${Tl}${as}${Sl}`;_l[Sl]=this.translate($l,{...rs,joinArrays:!1,ns:ds}),_l[Sl]===$l&&(_l[Sl]=mo[Sl])}mo=_l}}else if(Wo&&typeof Yo=="string"&&Array.isArray(mo))mo=mo.join(Yo),mo&&(mo=this.extendTranslation(mo,Mn,rs,is));else{let xl=!1,_l=!1;const Tl=rs.count!==void 0&&typeof rs.count!="string",Sl=Translator.hasDefaultValue(rs),$l=Tl?this.pluralResolver.getSuffix(ps,rs.count,rs):"",Pl=rs.ordinal&&Tl?this.pluralResolver.getSuffix(ps,rs.count,{ordinal:!1}):"",Dl=Tl&&!rs.ordinal&&rs.count===0&&this.pluralResolver.shouldUseIntlApi(),Ol=Dl&&rs[`defaultValue${this.options.pluralSeparator}zero`]||rs[`defaultValue${$l}`]||rs[`defaultValue${Pl}`]||rs.defaultValue;!this.isValidLookup(mo)&&Sl&&(xl=!0,mo=Ol),this.isValidLookup(mo)||(_l=!0,mo=us);const Vo=(rs.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&_l?void 0:mo,jo=Sl&&Ol!==mo&&this.options.updateMissing;if(_l||xl||jo){if(this.logger.log(jo?"updateKey":"missingKey",ps,hs,us,jo?Ol:mo),as){const Xo=this.resolve(us,{...rs,keySeparator:!1});Xo&&Xo.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Ho=[];const Qo=this.languageUtils.getFallbackCodes(this.options.fallbackLng,rs.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Qo&&Qo[0])for(let Xo=0;Xo<Qo.length;Xo++)Ho.push(Qo[Xo]);else this.options.saveMissingTo==="all"?Ho=this.languageUtils.toResolveHierarchy(rs.lng||this.language):Ho.push(rs.lng||this.language);const El=(Xo,Al,wl)=>{const yl=Sl&&wl!==mo?wl:Vo;this.options.missingKeyHandler?this.options.missingKeyHandler(Xo,hs,Al,yl,jo,rs):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(Xo,hs,Al,yl,jo,rs),this.emit("missingKey",Xo,hs,Al,mo)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Tl?Ho.forEach(Xo=>{const Al=this.pluralResolver.getSuffixes(Xo,rs);Dl&&rs[`defaultValue${this.options.pluralSeparator}zero`]&&Al.indexOf(`${this.options.pluralSeparator}zero`)<0&&Al.push(`${this.options.pluralSeparator}zero`),Al.forEach(wl=>{El([Xo],us+wl,rs[`defaultValue${wl}`]||Ol)})}):El(Ho,us,Ol))}mo=this.extendTranslation(mo,Mn,rs,fo,is),_l&&mo===us&&this.options.appendNamespaceToMissingKey&&(mo=`${hs}:${us}`),(_l||xl)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?mo=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${hs}:${us}`:us,xl?mo:void 0):mo=this.options.parseMissingKeyHandler(mo))}return os?(fo.res=mo,fo.usedParams=this.getUsedParamsDetails(rs),fo):mo}extendTranslation(Mn,rs,is,os,as){var us=this;if(this.i18nFormat&&this.i18nFormat.parse)Mn=this.i18nFormat.parse(Mn,{...this.options.interpolation.defaultVariables,...is},is.lng||this.language||os.usedLng,os.usedNS,os.usedKey,{resolved:os});else if(!is.skipInterpolation){is.interpolation&&this.interpolator.init({...is,interpolation:{...this.options.interpolation,...is.interpolation}});const ps=typeof Mn=="string"&&(is&&is.interpolation&&is.interpolation.skipOnVariables!==void 0?is.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let io;if(ps){const mo=Mn.match(this.interpolator.nestingRegexp);io=mo&&mo.length}let fo=is.replace&&typeof is.replace!="string"?is.replace:is;if(this.options.interpolation.defaultVariables&&(fo={...this.options.interpolation.defaultVariables,...fo}),Mn=this.interpolator.interpolate(Mn,fo,is.lng||this.language||os.usedLng,is),ps){const mo=Mn.match(this.interpolator.nestingRegexp),Ao=mo&&mo.length;io<Ao&&(is.nest=!1)}!is.lng&&this.options.compatibilityAPI!=="v1"&&os&&os.res&&(is.lng=this.language||os.usedLng),is.nest!==!1&&(Mn=this.interpolator.nest(Mn,function(){for(var mo=arguments.length,Ao=new Array(mo),$o=0;$o<mo;$o++)Ao[$o]=arguments[$o];return as&&as[0]===Ao[0]&&!is.context?(us.logger.warn(`It seems you are nesting recursively key: ${Ao[0]} in key: ${rs[0]}`),null):us.translate(...Ao,rs)},is)),is.interpolation&&this.interpolator.reset()}const ds=is.postProcess||this.options.postProcess,hs=typeof ds=="string"?[ds]:ds;return Mn!=null&&hs&&hs.length&&is.applyPostProcessor!==!1&&(Mn=postProcessor.handle(hs,Mn,rs,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...os,usedParams:this.getUsedParamsDetails(is)},...is}:is,this)),Mn}resolve(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},is,os,as,us,ds;return typeof Mn=="string"&&(Mn=[Mn]),Mn.forEach(hs=>{if(this.isValidLookup(is))return;const ps=this.extractFromKey(hs,rs),io=ps.key;os=io;let fo=ps.namespaces;this.options.fallbackNS&&(fo=fo.concat(this.options.fallbackNS));const mo=rs.count!==void 0&&typeof rs.count!="string",Ao=mo&&!rs.ordinal&&rs.count===0&&this.pluralResolver.shouldUseIntlApi(),$o=rs.context!==void 0&&(typeof rs.context=="string"||typeof rs.context=="number")&&rs.context!=="",Lo=rs.lngs?rs.lngs:this.languageUtils.toResolveHierarchy(rs.lng||this.language,rs.fallbackLng);fo.forEach(Go=>{this.isValidLookup(is)||(ds=Go,!checkedLoadedFor[`${Lo[0]}-${Go}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(ds)&&(checkedLoadedFor[`${Lo[0]}-${Go}`]=!0,this.logger.warn(`key "${os}" for languages "${Lo.join(", ")}" won't get resolved as namespace "${ds}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),Lo.forEach(Yo=>{if(this.isValidLookup(is))return;us=Yo;const Wo=[io];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(Wo,io,Yo,Go,rs);else{let xl;mo&&(xl=this.pluralResolver.getSuffix(Yo,rs.count,rs));const _l=`${this.options.pluralSeparator}zero`,Tl=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(mo&&(Wo.push(io+xl),rs.ordinal&&xl.indexOf(Tl)===0&&Wo.push(io+xl.replace(Tl,this.options.pluralSeparator)),Ao&&Wo.push(io+_l)),$o){const Sl=`${io}${this.options.contextSeparator}${rs.context}`;Wo.push(Sl),mo&&(Wo.push(Sl+xl),rs.ordinal&&xl.indexOf(Tl)===0&&Wo.push(Sl+xl.replace(Tl,this.options.pluralSeparator)),Ao&&Wo.push(Sl+_l))}}let Jo;for(;Jo=Wo.pop();)this.isValidLookup(is)||(as=Jo,is=this.getResource(Yo,Go,Jo,rs))}))})}),{res:is,usedKey:os,exactUsedKey:as,usedLng:us,usedNS:ds}}isValidLookup(Mn){return Mn!==void 0&&!(!this.options.returnNull&&Mn===null)&&!(!this.options.returnEmptyString&&Mn==="")}getResource(Mn,rs,is){let os=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(Mn,rs,is,os):this.resourceStore.getResource(Mn,rs,is,os)}getUsedParamsDetails(){let Mn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const rs=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],is=Mn.replace&&typeof Mn.replace!="string";let os=is?Mn.replace:Mn;if(is&&typeof Mn.count<"u"&&(os.count=Mn.count),this.options.interpolation.defaultVariables&&(os={...this.options.interpolation.defaultVariables,...os}),!is){os={...os};for(const as of rs)delete os[as]}return os}static hasDefaultValue(Mn){const rs="defaultValue";for(const is in Mn)if(Object.prototype.hasOwnProperty.call(Mn,is)&&rs===is.substring(0,rs.length)&&Mn[is]!==void 0)return!0;return!1}}const capitalize=Fn=>Fn.charAt(0).toUpperCase()+Fn.slice(1);class LanguageUtil{constructor(Mn){this.options=Mn,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}getScriptPartFromCode(Mn){if(Mn=getCleanedCode(Mn),!Mn||Mn.indexOf("-")<0)return null;const rs=Mn.split("-");return rs.length===2||(rs.pop(),rs[rs.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(rs.join("-"))}getLanguagePartFromCode(Mn){if(Mn=getCleanedCode(Mn),!Mn||Mn.indexOf("-")<0)return Mn;const rs=Mn.split("-");return this.formatLanguageCode(rs[0])}formatLanguageCode(Mn){if(typeof Mn=="string"&&Mn.indexOf("-")>-1){const rs=["hans","hant","latn","cyrl","cans","mong","arab"];let is=Mn.split("-");return this.options.lowerCaseLng?is=is.map(os=>os.toLowerCase()):is.length===2?(is[0]=is[0].toLowerCase(),is[1]=is[1].toUpperCase(),rs.indexOf(is[1].toLowerCase())>-1&&(is[1]=capitalize(is[1].toLowerCase()))):is.length===3&&(is[0]=is[0].toLowerCase(),is[1].length===2&&(is[1]=is[1].toUpperCase()),is[0]!=="sgn"&&is[2].length===2&&(is[2]=is[2].toUpperCase()),rs.indexOf(is[1].toLowerCase())>-1&&(is[1]=capitalize(is[1].toLowerCase())),rs.indexOf(is[2].toLowerCase())>-1&&(is[2]=capitalize(is[2].toLowerCase()))),is.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?Mn.toLowerCase():Mn}isSupportedCode(Mn){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(Mn=this.getLanguagePartFromCode(Mn)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(Mn)>-1}getBestMatchFromCodes(Mn){if(!Mn)return null;let rs;return Mn.forEach(is=>{if(rs)return;const os=this.formatLanguageCode(is);(!this.options.supportedLngs||this.isSupportedCode(os))&&(rs=os)}),!rs&&this.options.supportedLngs&&Mn.forEach(is=>{if(rs)return;const os=this.getLanguagePartFromCode(is);if(this.isSupportedCode(os))return rs=os;rs=this.options.supportedLngs.find(as=>{if(as===os)return as;if(!(as.indexOf("-")<0&&os.indexOf("-")<0)&&(as.indexOf("-")>0&&os.indexOf("-")<0&&as.substring(0,as.indexOf("-"))===os||as.indexOf(os)===0&&os.length>1))return as})}),rs||(rs=this.getFallbackCodes(this.options.fallbackLng)[0]),rs}getFallbackCodes(Mn,rs){if(!Mn)return[];if(typeof Mn=="function"&&(Mn=Mn(rs)),typeof Mn=="string"&&(Mn=[Mn]),Array.isArray(Mn))return Mn;if(!rs)return Mn.default||[];let is=Mn[rs];return is||(is=Mn[this.getScriptPartFromCode(rs)]),is||(is=Mn[this.formatLanguageCode(rs)]),is||(is=Mn[this.getLanguagePartFromCode(rs)]),is||(is=Mn.default),is||[]}toResolveHierarchy(Mn,rs){const is=this.getFallbackCodes(rs||this.options.fallbackLng||[],Mn),os=[],as=us=>{us&&(this.isSupportedCode(us)?os.push(us):this.logger.warn(`rejecting language code not found in supportedLngs: ${us}`))};return typeof Mn=="string"&&(Mn.indexOf("-")>-1||Mn.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&as(this.formatLanguageCode(Mn)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&as(this.getScriptPartFromCode(Mn)),this.options.load!=="currentOnly"&&as(this.getLanguagePartFromCode(Mn))):typeof Mn=="string"&&as(this.formatLanguageCode(Mn)),is.forEach(us=>{os.indexOf(us)<0&&as(this.formatLanguageCode(us))}),os}}let sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:Fn=>+(Fn>1),2:Fn=>+(Fn!=1),3:Fn=>0,4:Fn=>Fn%10==1&&Fn%100!=11?0:Fn%10>=2&&Fn%10<=4&&(Fn%100<10||Fn%100>=20)?1:2,5:Fn=>Fn==0?0:Fn==1?1:Fn==2?2:Fn%100>=3&&Fn%100<=10?3:Fn%100>=11?4:5,6:Fn=>Fn==1?0:Fn>=2&&Fn<=4?1:2,7:Fn=>Fn==1?0:Fn%10>=2&&Fn%10<=4&&(Fn%100<10||Fn%100>=20)?1:2,8:Fn=>Fn==1?0:Fn==2?1:Fn!=8&&Fn!=11?2:3,9:Fn=>+(Fn>=2),10:Fn=>Fn==1?0:Fn==2?1:Fn<7?2:Fn<11?3:4,11:Fn=>Fn==1||Fn==11?0:Fn==2||Fn==12?1:Fn>2&&Fn<20?2:3,12:Fn=>+(Fn%10!=1||Fn%100==11),13:Fn=>+(Fn!==0),14:Fn=>Fn==1?0:Fn==2?1:Fn==3?2:3,15:Fn=>Fn%10==1&&Fn%100!=11?0:Fn%10>=2&&(Fn%100<10||Fn%100>=20)?1:2,16:Fn=>Fn%10==1&&Fn%100!=11?0:Fn!==0?1:2,17:Fn=>Fn==1||Fn%10==1&&Fn%100!=11?0:1,18:Fn=>Fn==0?0:Fn==1?1:2,19:Fn=>Fn==1?0:Fn==0||Fn%100>1&&Fn%100<11?1:Fn%100>10&&Fn%100<20?2:3,20:Fn=>Fn==1?0:Fn==0||Fn%100>0&&Fn%100<20?1:2,21:Fn=>Fn%100==1?1:Fn%100==2?2:Fn%100==3||Fn%100==4?3:0,22:Fn=>Fn==1?0:Fn==2?1:(Fn<0||Fn>10)&&Fn%10==0?2:3};const nonIntlVersions=["v1","v2","v3"],intlVersions=["v4"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5},createRules=()=>{const Fn={};return sets.forEach(Mn=>{Mn.lngs.forEach(rs=>{Fn[rs]={numbers:Mn.nr,plurals:_rulesPluralsTypes[Mn.fc]}})}),Fn};class PluralResolver{constructor(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=Mn,this.options=rs,this.logger=baseLogger.create("pluralResolver"),(!this.options.compatibilityJSON||intlVersions.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}addRule(Mn,rs){this.rules[Mn]=rs}getRule(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(getCleanedCode(Mn==="dev"?"en":Mn),{type:rs.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[Mn]||this.rules[this.languageUtils.getLanguagePartFromCode(Mn)]}needsPlural(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const is=this.getRule(Mn,rs);return this.shouldUseIntlApi()?is&&is.resolvedOptions().pluralCategories.length>1:is&&is.numbers.length>1}getPluralFormsOfKey(Mn,rs){let is=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(Mn,is).map(os=>`${rs}${os}`)}getSuffixes(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const is=this.getRule(Mn,rs);return is?this.shouldUseIntlApi()?is.resolvedOptions().pluralCategories.sort((os,as)=>suffixesOrder[os]-suffixesOrder[as]).map(os=>`${this.options.prepend}${rs.ordinal?`ordinal${this.options.prepend}`:""}${os}`):is.numbers.map(os=>this.getSuffix(Mn,os,rs)):[]}getSuffix(Mn,rs){let is=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const os=this.getRule(Mn,is);return os?this.shouldUseIntlApi()?`${this.options.prepend}${is.ordinal?`ordinal${this.options.prepend}`:""}${os.select(rs)}`:this.getSuffixRetroCompatible(os,rs):(this.logger.warn(`no plural rule found for: ${Mn}`),"")}getSuffixRetroCompatible(Mn,rs){const is=Mn.noAbs?Mn.plurals(rs):Mn.plurals(Math.abs(rs));let os=Mn.numbers[is];this.options.simplifyPluralSuffix&&Mn.numbers.length===2&&Mn.numbers[0]===1&&(os===2?os="plural":os===1&&(os=""));const as=()=>this.options.prepend&&os.toString()?this.options.prepend+os.toString():os.toString();return this.options.compatibilityJSON==="v1"?os===1?"":typeof os=="number"?`_plural_${os.toString()}`:as():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&Mn.numbers.length===2&&Mn.numbers[0]===1?as():this.options.prepend&&is.toString()?this.options.prepend+is.toString():is.toString()}shouldUseIntlApi(){return!nonIntlVersions.includes(this.options.compatibilityJSON)}}const deepFindWithDefaults=function(Fn,Mn,rs){let is=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",os=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,as=getPathWithDefaults(Fn,Mn,rs);return!as&&os&&typeof rs=="string"&&(as=deepFind(Fn,rs,is),as===void 0&&(as=deepFind(Mn,rs,is))),as},regexSafe=Fn=>Fn.replace(/\$/g,"$$$$");class Interpolator{constructor(){let Mn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("interpolator"),this.options=Mn,this.format=Mn.interpolation&&Mn.interpolation.format||(rs=>rs),this.init(Mn)}init(){let Mn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mn.interpolation||(Mn.interpolation={escapeValue:!0});const{escape:rs,escapeValue:is,useRawValueToEscape:os,prefix:as,prefixEscaped:us,suffix:ds,suffixEscaped:hs,formatSeparator:ps,unescapeSuffix:io,unescapePrefix:fo,nestingPrefix:mo,nestingPrefixEscaped:Ao,nestingSuffix:$o,nestingSuffixEscaped:Lo,nestingOptionsSeparator:Go,maxReplaces:Yo,alwaysFormat:Wo}=Mn.interpolation;this.escape=rs!==void 0?rs:escape,this.escapeValue=is!==void 0?is:!0,this.useRawValueToEscape=os!==void 0?os:!1,this.prefix=as?regexEscape(as):us||"{{",this.suffix=ds?regexEscape(ds):hs||"}}",this.formatSeparator=ps||",",this.unescapePrefix=io?"":fo||"-",this.unescapeSuffix=this.unescapePrefix?"":io||"",this.nestingPrefix=mo?regexEscape(mo):Ao||regexEscape("$t("),this.nestingSuffix=$o?regexEscape($o):Lo||regexEscape(")"),this.nestingOptionsSeparator=Go||",",this.maxReplaces=Yo||1e3,this.alwaysFormat=Wo!==void 0?Wo:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const Mn=(rs,is)=>rs&&rs.source===is?(rs.lastIndex=0,rs):new RegExp(is,"g");this.regexp=Mn(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=Mn(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=Mn(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(Mn,rs,is,os){let as,us,ds;const hs=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},ps=Ao=>{if(Ao.indexOf(this.formatSeparator)<0){const Yo=deepFindWithDefaults(rs,hs,Ao,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(Yo,void 0,is,{...os,...rs,interpolationkey:Ao}):Yo}const $o=Ao.split(this.formatSeparator),Lo=$o.shift().trim(),Go=$o.join(this.formatSeparator).trim();return this.format(deepFindWithDefaults(rs,hs,Lo,this.options.keySeparator,this.options.ignoreJSONStructure),Go,is,{...os,...rs,interpolationkey:Lo})};this.resetRegExp();const io=os&&os.missingInterpolationHandler||this.options.missingInterpolationHandler,fo=os&&os.interpolation&&os.interpolation.skipOnVariables!==void 0?os.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:Ao=>regexSafe(Ao)},{regex:this.regexp,safeValue:Ao=>this.escapeValue?regexSafe(this.escape(Ao)):regexSafe(Ao)}].forEach(Ao=>{for(ds=0;as=Ao.regex.exec(Mn);){const $o=as[1].trim();if(us=ps($o),us===void 0)if(typeof io=="function"){const Go=io(Mn,as,os);us=typeof Go=="string"?Go:""}else if(os&&Object.prototype.hasOwnProperty.call(os,$o))us="";else if(fo){us=as[0];continue}else this.logger.warn(`missed to pass in variable ${$o} for interpolating ${Mn}`),us="";else typeof us!="string"&&!this.useRawValueToEscape&&(us=makeString(us));const Lo=Ao.safeValue(us);if(Mn=Mn.replace(as[0],Lo),fo?(Ao.regex.lastIndex+=us.length,Ao.regex.lastIndex-=as[0].length):Ao.regex.lastIndex=0,ds++,ds>=this.maxReplaces)break}}),Mn}nest(Mn,rs){let is=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},os,as,us;const ds=(hs,ps)=>{const io=this.nestingOptionsSeparator;if(hs.indexOf(io)<0)return hs;const fo=hs.split(new RegExp(`${io}[ ]*{`));let mo=`{${fo[1]}`;hs=fo[0],mo=this.interpolate(mo,us);const Ao=mo.match(/'/g),$o=mo.match(/"/g);(Ao&&Ao.length%2===0&&!$o||$o.length%2!==0)&&(mo=mo.replace(/'/g,'"'));try{us=JSON.parse(mo),ps&&(us={...ps,...us})}catch(Lo){return this.logger.warn(`failed parsing options string in nesting for key ${hs}`,Lo),`${hs}${io}${mo}`}return us.defaultValue&&us.defaultValue.indexOf(this.prefix)>-1&&delete us.defaultValue,hs};for(;os=this.nestingRegexp.exec(Mn);){let hs=[];us={...is},us=us.replace&&typeof us.replace!="string"?us.replace:us,us.applyPostProcessor=!1,delete us.defaultValue;let ps=!1;if(os[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(os[1])){const io=os[1].split(this.formatSeparator).map(fo=>fo.trim());os[1]=io.shift(),hs=io,ps=!0}if(as=rs(ds.call(this,os[1].trim(),us),us),as&&os[0]===Mn&&typeof as!="string")return as;typeof as!="string"&&(as=makeString(as)),as||(this.logger.warn(`missed to resolve ${os[1]} for nesting ${Mn}`),as=""),ps&&(as=hs.reduce((io,fo)=>this.format(io,fo,is.lng,{...is,interpolationkey:os[1].trim()}),as.trim())),Mn=Mn.replace(os[0],as),this.regexp.lastIndex=0}return Mn}}const parseFormatStr=Fn=>{let Mn=Fn.toLowerCase().trim();const rs={};if(Fn.indexOf("(")>-1){const is=Fn.split("(");Mn=is[0].toLowerCase().trim();const os=is[1].substring(0,is[1].length-1);Mn==="currency"&&os.indexOf(":")<0?rs.currency||(rs.currency=os.trim()):Mn==="relativetime"&&os.indexOf(":")<0?rs.range||(rs.range=os.trim()):os.split(";").forEach(us=>{if(us){const[ds,...hs]=us.split(":"),ps=hs.join(":").trim().replace(/^'+|'+$/g,""),io=ds.trim();rs[io]||(rs[io]=ps),ps==="false"&&(rs[io]=!1),ps==="true"&&(rs[io]=!0),isNaN(ps)||(rs[io]=parseInt(ps,10))}})}return{formatName:Mn,formatOptions:rs}},createCachedFormatter=Fn=>{const Mn={};return(rs,is,os)=>{const as=is+JSON.stringify(os);let us=Mn[as];return us||(us=Fn(getCleanedCode(is),os),Mn[as]=us),us(rs)}};class Formatter{constructor(){let Mn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("formatter"),this.options=Mn,this.formats={number:createCachedFormatter((rs,is)=>{const os=new Intl.NumberFormat(rs,{...is});return as=>os.format(as)}),currency:createCachedFormatter((rs,is)=>{const os=new Intl.NumberFormat(rs,{...is,style:"currency"});return as=>os.format(as)}),datetime:createCachedFormatter((rs,is)=>{const os=new Intl.DateTimeFormat(rs,{...is});return as=>os.format(as)}),relativetime:createCachedFormatter((rs,is)=>{const os=new Intl.RelativeTimeFormat(rs,{...is});return as=>os.format(as,is.range||"day")}),list:createCachedFormatter((rs,is)=>{const os=new Intl.ListFormat(rs,{...is});return as=>os.format(as)})},this.init(Mn)}init(Mn){const is=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=is.formatSeparator?is.formatSeparator:is.formatSeparator||","}add(Mn,rs){this.formats[Mn.toLowerCase().trim()]=rs}addCached(Mn,rs){this.formats[Mn.toLowerCase().trim()]=createCachedFormatter(rs)}format(Mn,rs,is){let os=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const as=rs.split(this.formatSeparator);if(as.length>1&&as[0].indexOf("(")>1&&as[0].indexOf(")")<0&&as.find(ds=>ds.indexOf(")")>-1)){const ds=as.findIndex(hs=>hs.indexOf(")")>-1);as[0]=[as[0],...as.splice(1,ds)].join(this.formatSeparator)}return as.reduce((ds,hs)=>{const{formatName:ps,formatOptions:io}=parseFormatStr(hs);if(this.formats[ps]){let fo=ds;try{const mo=os&&os.formatParams&&os.formatParams[os.interpolationkey]||{},Ao=mo.locale||mo.lng||os.locale||os.lng||is;fo=this.formats[ps](ds,Ao,{...io,...os,...mo})}catch(mo){this.logger.warn(mo)}return fo}else this.logger.warn(`there was no format function for ${ps}`);return ds},Mn)}}const removePending=(Fn,Mn)=>{Fn.pending[Mn]!==void 0&&(delete Fn.pending[Mn],Fn.pendingCount--)};class Connector extends EventEmitter{constructor(Mn,rs,is){let os=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=Mn,this.store=rs,this.services=is,this.languageUtils=is.languageUtils,this.options=os,this.logger=baseLogger.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=os.maxParallelReads||10,this.readingCalls=0,this.maxRetries=os.maxRetries>=0?os.maxRetries:5,this.retryTimeout=os.retryTimeout>=1?os.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(is,os.backend,os)}queueLoad(Mn,rs,is,os){const as={},us={},ds={},hs={};return Mn.forEach(ps=>{let io=!0;rs.forEach(fo=>{const mo=`${ps}|${fo}`;!is.reload&&this.store.hasResourceBundle(ps,fo)?this.state[mo]=2:this.state[mo]<0||(this.state[mo]===1?us[mo]===void 0&&(us[mo]=!0):(this.state[mo]=1,io=!1,us[mo]===void 0&&(us[mo]=!0),as[mo]===void 0&&(as[mo]=!0),hs[fo]===void 0&&(hs[fo]=!0)))}),io||(ds[ps]=!0)}),(Object.keys(as).length||Object.keys(us).length)&&this.queue.push({pending:us,pendingCount:Object.keys(us).length,loaded:{},errors:[],callback:os}),{toLoad:Object.keys(as),pending:Object.keys(us),toLoadLanguages:Object.keys(ds),toLoadNamespaces:Object.keys(hs)}}loaded(Mn,rs,is){const os=Mn.split("|"),as=os[0],us=os[1];rs&&this.emit("failedLoading",as,us,rs),is&&this.store.addResourceBundle(as,us,is,void 0,void 0,{skipCopy:!0}),this.state[Mn]=rs?-1:2;const ds={};this.queue.forEach(hs=>{pushPath(hs.loaded,[as],us),removePending(hs,Mn),rs&&hs.errors.push(rs),hs.pendingCount===0&&!hs.done&&(Object.keys(hs.loaded).forEach(ps=>{ds[ps]||(ds[ps]={});const io=hs.loaded[ps];io.length&&io.forEach(fo=>{ds[ps][fo]===void 0&&(ds[ps][fo]=!0)})}),hs.done=!0,hs.errors.length?hs.callback(hs.errors):hs.callback())}),this.emit("loaded",ds),this.queue=this.queue.filter(hs=>!hs.done)}read(Mn,rs,is){let os=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,as=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,us=arguments.length>5?arguments[5]:void 0;if(!Mn.length)return us(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:Mn,ns:rs,fcName:is,tried:os,wait:as,callback:us});return}this.readingCalls++;const ds=(ps,io)=>{if(this.readingCalls--,this.waitingReads.length>0){const fo=this.waitingReads.shift();this.read(fo.lng,fo.ns,fo.fcName,fo.tried,fo.wait,fo.callback)}if(ps&&io&&os<this.maxRetries){setTimeout(()=>{this.read.call(this,Mn,rs,is,os+1,as*2,us)},as);return}us(ps,io)},hs=this.backend[is].bind(this.backend);if(hs.length===2){try{const ps=hs(Mn,rs);ps&&typeof ps.then=="function"?ps.then(io=>ds(null,io)).catch(ds):ds(null,ps)}catch(ps){ds(ps)}return}return hs(Mn,rs,ds)}prepareLoading(Mn,rs){let is=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},os=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),os&&os();typeof Mn=="string"&&(Mn=this.languageUtils.toResolveHierarchy(Mn)),typeof rs=="string"&&(rs=[rs]);const as=this.queueLoad(Mn,rs,is,os);if(!as.toLoad.length)return as.pending.length||os(),null;as.toLoad.forEach(us=>{this.loadOne(us)})}load(Mn,rs,is){this.prepareLoading(Mn,rs,{},is)}reload(Mn,rs,is){this.prepareLoading(Mn,rs,{reload:!0},is)}loadOne(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const is=Mn.split("|"),os=is[0],as=is[1];this.read(os,as,"read",void 0,void 0,(us,ds)=>{us&&this.logger.warn(`${rs}loading namespace ${as} for language ${os} failed`,us),!us&&ds&&this.logger.log(`${rs}loaded namespace ${as} for language ${os}`,ds),this.loaded(Mn,us,ds)})}saveMissing(Mn,rs,is,os,as){let us=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},ds=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(rs)){this.logger.warn(`did not save key "${is}" as the namespace "${rs}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(is==null||is==="")){if(this.backend&&this.backend.create){const hs={...us,isUpdate:as},ps=this.backend.create.bind(this.backend);if(ps.length<6)try{let io;ps.length===5?io=ps(Mn,rs,is,os,hs):io=ps(Mn,rs,is,os),io&&typeof io.then=="function"?io.then(fo=>ds(null,fo)).catch(ds):ds(null,io)}catch(io){ds(io)}else ps(Mn,rs,is,os,ds,hs)}!Mn||!Mn[0]||this.store.addResource(Mn[0],rs,is,os)}}}const get=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:Fn=>{let Mn={};if(typeof Fn[1]=="object"&&(Mn=Fn[1]),typeof Fn[1]=="string"&&(Mn.defaultValue=Fn[1]),typeof Fn[2]=="string"&&(Mn.tDescription=Fn[2]),typeof Fn[2]=="object"||typeof Fn[3]=="object"){const rs=Fn[3]||Fn[2];Object.keys(rs).forEach(is=>{Mn[is]=rs[is]})}return Mn},interpolation:{escapeValue:!0,format:Fn=>Fn,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),transformOptions=Fn=>(typeof Fn.ns=="string"&&(Fn.ns=[Fn.ns]),typeof Fn.fallbackLng=="string"&&(Fn.fallbackLng=[Fn.fallbackLng]),typeof Fn.fallbackNS=="string"&&(Fn.fallbackNS=[Fn.fallbackNS]),Fn.supportedLngs&&Fn.supportedLngs.indexOf("cimode")<0&&(Fn.supportedLngs=Fn.supportedLngs.concat(["cimode"])),Fn),noop$1=()=>{},bindMemberFunctions=Fn=>{Object.getOwnPropertyNames(Object.getPrototypeOf(Fn)).forEach(rs=>{typeof Fn[rs]=="function"&&(Fn[rs]=Fn[rs].bind(Fn))})};class I18n extends EventEmitter{constructor(){let Mn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},rs=arguments.length>1?arguments[1]:void 0;if(super(),this.options=transformOptions(Mn),this.services={},this.logger=baseLogger,this.modules={external:[]},bindMemberFunctions(this),rs&&!this.isInitialized&&!Mn.isClone){if(!this.options.initImmediate)return this.init(Mn,rs),this;setTimeout(()=>{this.init(Mn,rs)},0)}}init(){var Mn=this;let rs=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},is=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof rs=="function"&&(is=rs,rs={}),!rs.defaultNS&&rs.defaultNS!==!1&&rs.ns&&(typeof rs.ns=="string"?rs.defaultNS=rs.ns:rs.ns.indexOf("translation")<0&&(rs.defaultNS=rs.ns[0]));const os=get();this.options={...os,...this.options,...transformOptions(rs)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...os.interpolation,...this.options.interpolation}),rs.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=rs.keySeparator),rs.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=rs.nsSeparator);const as=io=>io?typeof io=="function"?new io:io:null;if(!this.options.isClone){this.modules.logger?baseLogger.init(as(this.modules.logger),this.options):baseLogger.init(null,this.options);let io;this.modules.formatter?io=this.modules.formatter:typeof Intl<"u"&&(io=Formatter);const fo=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);const mo=this.services;mo.logger=baseLogger,mo.resourceStore=this.store,mo.languageUtils=fo,mo.pluralResolver=new PluralResolver(fo,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),io&&(!this.options.interpolation.format||this.options.interpolation.format===os.interpolation.format)&&(mo.formatter=as(io),mo.formatter.init(mo,this.options),this.options.interpolation.format=mo.formatter.format.bind(mo.formatter)),mo.interpolator=new Interpolator(this.options),mo.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},mo.backendConnector=new Connector(as(this.modules.backend),mo.resourceStore,mo,this.options),mo.backendConnector.on("*",function(Ao){for(var $o=arguments.length,Lo=new Array($o>1?$o-1:0),Go=1;Go<$o;Go++)Lo[Go-1]=arguments[Go];Mn.emit(Ao,...Lo)}),this.modules.languageDetector&&(mo.languageDetector=as(this.modules.languageDetector),mo.languageDetector.init&&mo.languageDetector.init(mo,this.options.detection,this.options)),this.modules.i18nFormat&&(mo.i18nFormat=as(this.modules.i18nFormat),mo.i18nFormat.init&&mo.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(Ao){for(var $o=arguments.length,Lo=new Array($o>1?$o-1:0),Go=1;Go<$o;Go++)Lo[Go-1]=arguments[Go];Mn.emit(Ao,...Lo)}),this.modules.external.forEach(Ao=>{Ao.init&&Ao.init(this)})}if(this.format=this.options.interpolation.format,is||(is=noop$1),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const io=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);io.length>0&&io[0]!=="dev"&&(this.options.lng=io[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(io=>{this[io]=function(){return Mn.store[io](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(io=>{this[io]=function(){return Mn.store[io](...arguments),Mn}});const hs=defer(),ps=()=>{const io=(fo,mo)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),hs.resolve(mo),is(fo,mo)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return io(null,this.t.bind(this));this.changeLanguage(this.options.lng,io)};return this.options.resources||!this.options.initImmediate?ps():setTimeout(ps,0),hs}loadResources(Mn){let is=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$1;const os=typeof Mn=="string"?Mn:this.language;if(typeof Mn=="function"&&(is=Mn),!this.options.resources||this.options.partialBundledLanguages){if(os&&os.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return is();const as=[],us=ds=>{if(!ds||ds==="cimode")return;this.services.languageUtils.toResolveHierarchy(ds).forEach(ps=>{ps!=="cimode"&&as.indexOf(ps)<0&&as.push(ps)})};os?us(os):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(hs=>us(hs)),this.options.preload&&this.options.preload.forEach(ds=>us(ds)),this.services.backendConnector.load(as,this.options.ns,ds=>{!ds&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),is(ds)})}else is(null)}reloadResources(Mn,rs,is){const os=defer();return Mn||(Mn=this.languages),rs||(rs=this.options.ns),is||(is=noop$1),this.services.backendConnector.reload(Mn,rs,as=>{os.resolve(),is(as)}),os}use(Mn){if(!Mn)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!Mn.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return Mn.type==="backend"&&(this.modules.backend=Mn),(Mn.type==="logger"||Mn.log&&Mn.warn&&Mn.error)&&(this.modules.logger=Mn),Mn.type==="languageDetector"&&(this.modules.languageDetector=Mn),Mn.type==="i18nFormat"&&(this.modules.i18nFormat=Mn),Mn.type==="postProcessor"&&postProcessor.addPostProcessor(Mn),Mn.type==="formatter"&&(this.modules.formatter=Mn),Mn.type==="3rdParty"&&this.modules.external.push(Mn),this}setResolvedLanguage(Mn){if(!(!Mn||!this.languages)&&!(["cimode","dev"].indexOf(Mn)>-1))for(let rs=0;rs<this.languages.length;rs++){const is=this.languages[rs];if(!(["cimode","dev"].indexOf(is)>-1)&&this.store.hasLanguageSomeTranslations(is)){this.resolvedLanguage=is;break}}}changeLanguage(Mn,rs){var is=this;this.isLanguageChangingTo=Mn;const os=defer();this.emit("languageChanging",Mn);const as=hs=>{this.language=hs,this.languages=this.services.languageUtils.toResolveHierarchy(hs),this.resolvedLanguage=void 0,this.setResolvedLanguage(hs)},us=(hs,ps)=>{ps?(as(ps),this.translator.changeLanguage(ps),this.isLanguageChangingTo=void 0,this.emit("languageChanged",ps),this.logger.log("languageChanged",ps)):this.isLanguageChangingTo=void 0,os.resolve(function(){return is.t(...arguments)}),rs&&rs(hs,function(){return is.t(...arguments)})},ds=hs=>{!Mn&&!hs&&this.services.languageDetector&&(hs=[]);const ps=typeof hs=="string"?hs:this.services.languageUtils.getBestMatchFromCodes(hs);ps&&(this.language||as(ps),this.translator.language||this.translator.changeLanguage(ps),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(ps)),this.loadResources(ps,io=>{us(io,ps)})};return!Mn&&this.services.languageDetector&&!this.services.languageDetector.async?ds(this.services.languageDetector.detect()):!Mn&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(ds):this.services.languageDetector.detect(ds):ds(Mn),os}getFixedT(Mn,rs,is){var os=this;const as=function(us,ds){let hs;if(typeof ds!="object"){for(var ps=arguments.length,io=new Array(ps>2?ps-2:0),fo=2;fo<ps;fo++)io[fo-2]=arguments[fo];hs=os.options.overloadTranslationOptionHandler([us,ds].concat(io))}else hs={...ds};hs.lng=hs.lng||as.lng,hs.lngs=hs.lngs||as.lngs,hs.ns=hs.ns||as.ns,hs.keyPrefix!==""&&(hs.keyPrefix=hs.keyPrefix||is||as.keyPrefix);const mo=os.options.keySeparator||".";let Ao;return hs.keyPrefix&&Array.isArray(us)?Ao=us.map($o=>`${hs.keyPrefix}${mo}${$o}`):Ao=hs.keyPrefix?`${hs.keyPrefix}${mo}${us}`:us,os.t(Ao,hs)};return typeof Mn=="string"?as.lng=Mn:as.lngs=Mn,as.ns=rs,as.keyPrefix=is,as}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(Mn){this.options.defaultNS=Mn}hasLoadedNamespace(Mn){let rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const is=rs.lng||this.resolvedLanguage||this.languages[0],os=this.options?this.options.fallbackLng:!1,as=this.languages[this.languages.length-1];if(is.toLowerCase()==="cimode")return!0;const us=(ds,hs)=>{const ps=this.services.backendConnector.state[`${ds}|${hs}`];return ps===-1||ps===2};if(rs.precheck){const ds=rs.precheck(this,us);if(ds!==void 0)return ds}return!!(this.hasResourceBundle(is,Mn)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||us(is,Mn)&&(!os||us(as,Mn)))}loadNamespaces(Mn,rs){const is=defer();return this.options.ns?(typeof Mn=="string"&&(Mn=[Mn]),Mn.forEach(os=>{this.options.ns.indexOf(os)<0&&this.options.ns.push(os)}),this.loadResources(os=>{is.resolve(),rs&&rs(os)}),is):(rs&&rs(),Promise.resolve())}loadLanguages(Mn,rs){const is=defer();typeof Mn=="string"&&(Mn=[Mn]);const os=this.options.preload||[],as=Mn.filter(us=>os.indexOf(us)<0&&this.services.languageUtils.isSupportedCode(us));return as.length?(this.options.preload=os.concat(as),this.loadResources(us=>{is.resolve(),rs&&rs(us)}),is):(rs&&rs(),Promise.resolve())}dir(Mn){if(Mn||(Mn=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!Mn)return"rtl";const rs=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],is=this.services&&this.services.languageUtils||new LanguageUtil(get());return rs.indexOf(is.getLanguagePartFromCode(Mn))>-1||Mn.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let Mn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},rs=arguments.length>1?arguments[1]:void 0;return new I18n(Mn,rs)}cloneInstance(){let Mn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$1;const is=Mn.forkResourceStore;is&&delete Mn.forkResourceStore;const os={...this.options,...Mn,isClone:!0},as=new I18n(os);return(Mn.debug!==void 0||Mn.prefix!==void 0)&&(as.logger=as.logger.clone(Mn)),["store","services","language"].forEach(ds=>{as[ds]=this[ds]}),as.services={...this.services},as.services.utils={hasLoadedNamespace:as.hasLoadedNamespace.bind(as)},is&&(as.store=new ResourceStore(this.store.data,os),as.services.resourceStore=as.store),as.translator=new Translator(as.services,os),as.translator.on("*",function(ds){for(var hs=arguments.length,ps=new Array(hs>1?hs-1:0),io=1;io<hs;io++)ps[io-1]=arguments[io];as.emit(ds,...ps)}),as.init(os,rs),as.translator.options=os,as.translator.backendConnector.services.utils={hasLoadedNamespace:as.hasLoadedNamespace.bind(as)},as}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const instance=I18n.createInstance();instance.createInstance=I18n.createInstance;instance.createInstance;instance.dir;instance.init;instance.loadResources;instance.reloadResources;instance.use;instance.changeLanguage;instance.getFixedT;instance.t;instance.exists;instance.setDefaultNamespace;instance.hasLoadedNamespace;instance.loadNamespaces;instance.loadLanguages;const advanced="Advanced View",binance_test="Binance",operps="OPerps",powered="Powered by",connect_wallet="Connect Wallet",eth="ETH",btc="BTC",ethereum="ethereum",arbitrum="arbitrum",bitcoin="bitcoin",follow_us="FOLLOW US",contact_us="Contact us",hedge="Hedge",earn="Deposit",last_day_return="Last day’s return",last_day_apy="Last day’s APY",last_hour_return="Last hour’s return",last_hour_apy="Last hour’s APY",quantity_sell="Quantity",calculate="Calculate",calculate_hedge="Calculate Hedge",long_switch_token="Long Switch Token",holding="Holdings (LS)",max="MAX",clear="Clear",holding_p="Holdings (pUSDC)",buy="Buy",sell="Sell",short_switch_token="Short Switch Token",holdings_ss="Holdings (SS)",open_orders="Open Orders",position="Positions",open_claims="Open Claims",history="History",cancel="Cancel",claim="Claim",profit="Profit",apy="APY",chart="Chart",hide="Hide",current_cycle="Current Cycle",cycle_start_time="Cycle Start Time:",start_price="Start Price",eth_90="(ETH):",current_price="Current Price",expected_premium="Expected Premium:",next_cycle="Next Cycle (Tentative)",trigger="Trigger Price",up_eth="Up (ETH):",down_eth="Down (ETH):",long="Long",short="Short",previous_cycle="Previous Cycles",social_wallets="Social Wallets",web3_wallets="Web3 Wallets",disconnect="Disconnect",amount_to_be_hedged="Amount To Be Hedged",long_switch_token_to_buy="Long Switch Tokens To Buy",ls="LS",apply="Apply",leverage="Leverage",deposit="Deposit",withdraw="Withdraw",open="Open",cycle="1 Cycle",arb_cycle="5 Minutes",premium="Premium",premiumcycle="3% / cycle",break_even_price_drop="Breakeven Price",long_switch="Long Switch",short_switch="Short Switch",longorshort="Long Switch or Short Switch?",currentcycle="Current Cycle",startPrice="Start Price",longvsshort="Long vs Short Distribution",leverages="Leverage:",lscurrentpnl="LS Current PnL:",lsPremium="LS Premium:",sscurrentpnl="SS Current PnL:",sspremium="SS Premium",chartTime="Chart Time",en={advanced,binance_test,switch:"Switch",operps,powered,connect_wallet,eth,btc,ethereum,arbitrum,bitcoin,follow_us,contact_us,hedge,earn,"1_long_switch":"1 Long Switch (LS)","1_eth":"1 ETH",last_day_return,last_day_apy,last_hour_return,last_hour_apy,"1_usdc":"1.00 USDC",quantity_sell,calculate,calculate_hedge,long_switch_token,holding,max,clear,holding_p,buy,sell,"1_short_switch":"1 Short Switch (SS)",short_switch_token,holdings_ss,open_orders,position,open_claims,history,cancel,claim,profit,"0.4_usdc":"0.4 USDC",apy,chart,hide,current_cycle,cycle_start_time,start_price,eth_90,current_price,expected_premium,next_cycle,trigger,up_eth,down_eth,long,short,previous_cycle,social_wallets,web3_wallets,disconnect,amount_to_be_hedged,long_switch_token_to_buy,ls,apply,leverage,deposit,withdraw,open,cycle,"1_cycle":"120 Minutes",arb_cycle,premium,premiumcycle,break_even_price_drop,long_switch,short_switch,longorshort,currentcycle,startPrice,"break-evenprice":"Break-even Price","current price":"Current Price",longvsshort,leverages,lscurrentpnl,lsPremium,sscurrentpnl,sspremium,"tBNB Balance":"TBNB Balance","ARB Balance":"Arbitrum Sepolia Balance",chartTime},resources={en:{translation:en}};instance.use(initReactI18next).init({resources,lng:"en",interpolation:{escapeValue:!1}});const LearnHeader=()=>{const{t:Fn}=useTranslation();reactExports.useEffect(()=>{const Tl=Sl=>{fo.current&&!fo.current.contains(Sl.target)&&Yo()};return mo?document.addEventListener("click",Tl):document.removeEventListener("click",Tl),()=>{document.removeEventListener("click",Tl)}},[]);const[Mn,rs]=reactExports.useState(1),[is,os]=reactExports.useState(!1),[as,us]=reactExports.useState(!1),ds=Tl=>{if(Tl===1){if(Tl===Mn)return;rs(Tl)}Tl===2&&(us(!1),rs(Tl),os(!1)),Tl===3&&(us(!1),rs(Tl),os(!1)),Tl===4&&(us(!1),rs(Tl),os(!1)),Tl===5&&(us(!1),rs(Tl),os(!1))},[hs,ps]=reactExports.useState(!1),io=()=>{ps(!hs)},fo=reactExports.useRef(null),[mo,Ao]=reactExports.useState(!1),{isDarkMode:$o,updateIsDarkMode:Lo}=useStore(),Go=useNavigate(),Yo=()=>{Ao(!1)};reactExports.useEffect(()=>{const Tl=Sl=>{fo.current&&!fo.current.contains(Sl.target)&&Yo()};return mo?document.addEventListener("click",Tl):document.removeEventListener("click",Tl),()=>{document.removeEventListener("click",Tl)}},[mo]);const Wo=Tl=>{switch(Tl){case"Learn":Go("/learn");break;case"switch":Go("/");break}},[Jo,xl]=reactExports.useState(!1),_l=()=>{xl(Jo===!1)};return jsxRuntimeExports.jsxs("div",{className:`${$o?"!bg-[#FCFDFE]":"!bg-[#111213]"} h-auto z-[1]  !fixed !top-0 flex flex-col justify-between items-start !font-inter   xxl:!rounded-[0_0_1rem_1rem] bxl:!rounded-[0_0_1rem_1rem] xl:!rounded-[0_0_1rem_1rem] sxl:!rounded-[0_0_1rem_1rem] lg:!rounded-none md:!rounded-none sm:!rounded-none xd:!rounded-none  xxl:!w-[1600px] bxl:!w-[1600px] xl:!w-[85%] sxl:!w-[90%] lg:!w-[96%] md:!w-full sm:!w-full xd:!w-full `,children:[jsxRuntimeExports.jsx("div",{className:"!h-24 flex flex-row  items-center justify-between  w-full xxl:!px-6 bxl:!px-6 xl:!px-6 sxl:!px-6 lg:!pr-6 md:!pr-0 sm:!pr-0 xd:!pr-0 ",children:jsxRuntimeExports.jsxs("div",{className:"  py-6 px-4 flex flex-row   gap-4 !items-center !justify-between top-[0] w-full      ",children:[jsxRuntimeExports.jsx("img",{src:Kana,alt:"kana-logo",className:"w-8 h-8 xxl:!hidden bxl:!hidden xl:!hidden sxl:!hidden lg:!flex md:!flex sm:!flex xd:!flex"}),jsxRuntimeExports.jsx("div",{className:`${$o?"bg-[#EFF7F8]":"bg-[#ffffff0f]"} cursor-pointer xxl:!w-[22%] bxl:!w-[22%] xl:!w-[22%] sxl:!w-[21%]  lg:!w-[70%] md:!w-[70%] sm:!w-[70%] xd:!w-[70%] h-14 rounded-[2rem] xxl:ml-5 xl:ml-5 lg:ml-5 md:ml-5 sm:ml-0 max-sm:ml-0 gap-2 flex justify-start items-center p-[16px_32px] 2xl:inline-flex xl:inline-flex lg:inline-flex md:hidden sm:hidden  max-sm:hidden`,onClick:()=>Wo("switch"),children:jsxRuntimeExports.jsxs("div",{className:`${$o?"text-[#107569]":"text-[#2ED3B7]"} flex flex-row justify-start items-center gap-2 text-base font-normal`,children:[jsxRuntimeExports.jsx("div",{children:$o?jsxRuntimeExports.jsx("img",{src:arrowLeftDark,alt:""}):jsxRuntimeExports.jsx("img",{src:arrowLeft,alt:""})}),jsxRuntimeExports.jsx("div",{children:"Use OPerps"})]})}),jsxRuntimeExports.jsx("div",{onClick:()=>Lo(!$o),className:`${$o?"bg-[#EFF7F8]":"bg-[#1D1E20]"} w-[3.875rem]  xxl:!flex bxl:!flex xl:!flex sxl:!flex lg:!hidden md:!hidden sm:!hidden xd:!hidden   h-[3.875rem]    flex-row  justify-center items-center  cursor-pointer !rounded-2xl`,children:jsxRuntimeExports.jsx("img",{src:$o?SettingGreen:SettingDark,alt:"sun"})}),jsxRuntimeExports.jsx("div",{className:"text-[2rem]  text-[rgba(255,255,255,0.6)] cursor-pointer xxl:!hidden bxl:!hidden xl:!hidden sxl:!hidden lg:!flex md:!flex sm:!flex xd:!flex",onClick:io,children:hs?jsxRuntimeExports.jsx("img",{src:WrongRed,alt:"WrongRed"}):jsxRuntimeExports.jsx("img",{src:$o?BarMenuDark:BarMenu,alt:"BarMenu"})})]})}),hs?jsxRuntimeExports.jsxs("ul",{className:`  flex-col h-[90vh] justify-between items-start py-3 mt-24 xxl:!hidden bxl:!hidden xl:!hidden sxl:!hidden lg:!flex md:!flex sm:!flex xd:!flex lg:!mx-[1.3rem] md:!mx-[0rem] sm:!mx-[0rem] xd:!mx-[0rem] md:w-full sm:w-full xd:w-full  md:pb-0 md:mt-24 sm:mt-24 xd:mt-24 z-[9] ${$o?"!bg-[#FCFDFE]":"!bg-[#17181A]"} ${hs?"!fixed !right-0 !left-0  lg:!bottom-0 md:!bottom-24 sm:!bottom-24 xd:!bottom-24 !top-0	 ":"hidden"}`,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-col  items-start justify-between align-middle  h-full  w-full lg:!px-4 md:!px-4 sm:!px-4 xd:!px-4 !bg-transparent",children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-col justify-start items-start bg-transparent w-full gap-2",children:[jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:" https://app.kanalabs.io/",className:"w-full flex  h-[52px] flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${$o?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===2?`!font-extrabold !opacity-[1]  ${$o?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:$o?SwapDark:Swap,alt:"Swap"}),jsxRuntimeExports.jsx("div",{className:$o?"text-[#0C0C0D]":"text-[white]",children:Fn("Swap")})]})})}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:" https://tradebook.kanalabs.io/",className:"w-full flex  h-[52px] flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${$o?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===3?`!font-extrabold !opacity-[1]  ${$o?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:$o?Trade_dark:TradeIcon,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:$o?"text-[#0C0C0D]":"text-[white]",children:Fn("Trade")})]})})}),jsxRuntimeExports.jsx(Link,{to:"/",className:" cursor-pointer   h-[52px] flex flex-row justify-start items-center  w-full  bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${$o?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center ${mo?"py-4 px-[1.4rem]":"py-[1.2rem] px-[1.4rem]"}  rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===1?`!font-extrabold !opacity-[1]  ${$o?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>ds(1),children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:$o?SwitchDark:Switch,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:$o?"text-[#0C0C0D]":"text-[white]",children:Fn("switch")})]})})}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://app.kanalabs.io/stake-yield",className:"w-full  h-[52px] flex flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` ${$o?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===4?`!font-extrabold !opacity-[1]  ${$o?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:$o?StakeDarkIcon:StakeIcon,alt:"Stake"}),jsxRuntimeExports.jsx("div",{className:$o?"text-[#0C0C0D]":"text-[white]",children:Fn("Stake")})]})})}),jsxRuntimeExports.jsx("div",{className:` ${$o?"hover:bg-[#EFF7F8]":"hover:bg-[rgba(255,255,255,0.06)]"} bg-transparent menu-item text-base my-1  w-full h-auto font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl  hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===2?`!font-extrabold !opacity-[1]  ${$o?" !bg-[#EFF7F8] ":" !bg-[rgba(255,255,255,0.06)] "}`:"opacity-[0.5]"}`,onClick:()=>ds(1),children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-between w-full items-center",onClick:_l,children:[jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:$o?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:$o?"text-[#0C0C0D]":"text-[white]",children:"Leaderboard"})]}),jsxRuntimeExports.jsx("img",{src:$o?ChevronDownDark:ChevronDown,alt:"ChevronDown",className:Jo?" rotate-180 ml-2":" ml-2 rotate-0"})]})}),Jo&&jsxRuntimeExports.jsxs("div",{className:"submenu w-full",children:[jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://app.kanalabs.io/leader-board",className:"w-full  h-[52px] flex flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` bg-transparent menu-item text-base my-1  w-full h-auto text-[white] text-base font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl hover:bg-[rgba(255,255,255,0.06)] hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===3?"font-extrabold opacity-[1] bg-[rgba(255,255,255,0.06)]":"opacity-[0.5]"}`,onClick:()=>ds(3),children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4 opacity-0",src:$o?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:$o?"text-[#0C0C0D]":"text-[white]",children:"Swap Leaderboard"})]})})}),jsxRuntimeExports.jsx(Link,{rel:"noreferrer",to:"https://tradebook.kanalabs.io/leaderboard",className:"w-full  h-[52px] flex flex-row justify-start items-center    bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` bg-transparent menu-item text-base my-1  w-full h-auto text-[white] text-base font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl hover:bg-[rgba(255,255,255,0.06)] hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===6?"font-extrabold opacity-[1] bg-[rgba(255,255,255,0.06)]":"opacity-[0.5]"}`,onClick:()=>ds(6),children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4 opacity-0",src:$o?LeaderboardDark:Leaderboard,alt:"TradeIcon"}),jsxRuntimeExports.jsx("div",{className:$o?"text-[#0C0C0D]":"text-[white]",children:"Trade Leaderboard"})]})})})]}),jsxRuntimeExports.jsx("a",{rel:"noreferrer",href:"https://app.kanalabs.io/referrals",className:"w-full  h-[52px] flex flex-row justify-start items-center  bg-transparent gap-4",children:jsxRuntimeExports.jsx("div",{className:` bg-transparent menu-item text-base my-1  w-full h-auto text-[white] text-base font-normal flex flex-row justify-start items-center py-4 px-[1.4rem] rounded-2xl hover:bg-[rgba(255,255,255,0.06)] hover:opacity-[1] hover:text-[white] hover:font-bold gap-4 ${Mn===6?"font-extrabold opacity-[1] bg-[rgba(255,255,255,0.06)]":"opacity-[0.5]"}`,children:jsxRuntimeExports.jsxs("div",{className:" flex flex-row justify-start items-center gap-4",children:[jsxRuntimeExports.jsx("img",{className:"bg-transparent  !h-4",src:$o?ReferralDark:Referral,alt:"Referral"}),jsxRuntimeExports.jsx("div",{className:$o?"text-[#0C0C0D]":"text-[white]",children:"Referral"})]})})})]}),jsxRuntimeExports.jsx("div",{className:"xxl:hidden w-full xl:hidden lg:hidden md:flex sm:flex max-sm:flex mt-1.5 ",onClick:()=>Lo(!$o),children:jsxRuntimeExports.jsxs("div",{className:`${$o?"bg-[#EFF7F8] text-[#0C0C0D]":"bg-[#1D1E20] text-[#FFF]"} w-full  font-extrabold  h-[3.875rem]  py-4 px-6 flex flex-row justify-between gap-4 items-center  cursor-pointer !rounded-[2rem]`,children:[jsxRuntimeExports.jsx("div",{children:"Theme"}),jsxRuntimeExports.jsx("img",{src:$o?SettingGreen:SettingDark,alt:"sun"})]})})]}),jsxRuntimeExports.jsx("div",{className:"flex flex-row justify-center items-center gap-4 w-full ",children:jsxRuntimeExports.jsx("div",{className:`${$o?"text-[#A5A5A6]":"text-[rgba(255,255,255,0.50)]"} text-xs  py-5 font-inter`,children:"Powered by"})})]}):jsxRuntimeExports.jsx("ul",{})]})},LinkExternal="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%206.00001L14%202.00001M14%202.00001H9.99999M14%202.00001L8%208M6.66667%202H5.2C4.0799%202%203.51984%202%203.09202%202.21799C2.71569%202.40973%202.40973%202.71569%202.21799%203.09202C2%203.51984%202%204.07989%202%205.2V10.8C2%2011.9201%202%2012.4802%202.21799%2012.908C2.40973%2013.2843%202.71569%2013.5903%203.09202%2013.782C3.51984%2014%204.07989%2014%205.2%2014H10.8C11.9201%2014%2012.4802%2014%2012.908%2013.782C13.2843%2013.5903%2013.5903%2013.2843%2013.782%2012.908C14%2012.4802%2014%2011.9201%2014%2010.8V9.33333'%20stroke='%232ED3B7'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",LinkExternalDark="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%206.00001L14%202.00001M14%202.00001H9.99999M14%202.00001L8%208M6.66667%202H5.2C4.0799%202%203.51984%202%203.09202%202.21799C2.71569%202.40973%202.40973%202.71569%202.21799%203.09202C2%203.51984%202%204.07989%202%205.2V10.8C2%2011.9201%202%2012.4802%202.21799%2012.908C2.40973%2013.2843%202.71569%2013.5903%203.09202%2013.782C3.51984%2014%204.07989%2014%205.2%2014H10.8C11.9201%2014%2012.4802%2014%2012.908%2013.782C13.2843%2013.5903%2013.5903%2013.2843%2013.782%2012.908C14%2012.4802%2014%2011.9201%2014%2010.8V9.33333'%20stroke='%23107569'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";var lib$1={},slider={},innerSlider={},initialState={};(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.default=void 0;var Mn={animating:!1,autoplaying:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,dragging:!1,edgeDragged:!1,initialized:!1,lazyLoadedList:[],listHeight:null,listWidth:null,scrolling:!1,slideCount:null,slideHeight:null,slideWidth:null,swipeLeft:null,swiped:!1,swiping:!1,touchObject:{startX:0,startY:0,curX:0,curY:0},trackStyle:{},trackWidth:0,targetSlide:0},rs=Mn;Fn.default=rs})(initialState);var FUNC_ERROR_TEXT="Expected a function",NAN=NaN,symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt,freeGlobal=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root$1=freeGlobal||freeSelf||Function("return this")(),objectProto=Object.prototype,objectToString=objectProto.toString,nativeMax=Math.max,nativeMin=Math.min,now=function(){return root$1.Date.now()};function debounce(Fn,Mn,rs){var is,os,as,us,ds,hs,ps=0,io=!1,fo=!1,mo=!0;if(typeof Fn!="function")throw new TypeError(FUNC_ERROR_TEXT);Mn=toNumber(Mn)||0,isObject(rs)&&(io=!!rs.leading,fo="maxWait"in rs,as=fo?nativeMax(toNumber(rs.maxWait)||0,Mn):as,mo="trailing"in rs?!!rs.trailing:mo);function Ao(Tl){var Sl=is,$l=os;return is=os=void 0,ps=Tl,us=Fn.apply($l,Sl),us}function $o(Tl){return ps=Tl,ds=setTimeout(Yo,Mn),io?Ao(Tl):us}function Lo(Tl){var Sl=Tl-hs,$l=Tl-ps,Pl=Mn-Sl;return fo?nativeMin(Pl,as-$l):Pl}function Go(Tl){var Sl=Tl-hs,$l=Tl-ps;return hs===void 0||Sl>=Mn||Sl<0||fo&&$l>=as}function Yo(){var Tl=now();if(Go(Tl))return Wo(Tl);ds=setTimeout(Yo,Lo(Tl))}function Wo(Tl){return ds=void 0,mo&&is?Ao(Tl):(is=os=void 0,us)}function Jo(){ds!==void 0&&clearTimeout(ds),ps=0,is=hs=os=ds=void 0}function xl(){return ds===void 0?us:Wo(now())}function _l(){var Tl=now(),Sl=Go(Tl);if(is=arguments,os=this,hs=Tl,Sl){if(ds===void 0)return $o(hs);if(fo)return ds=setTimeout(Yo,Mn),Ao(hs)}return ds===void 0&&(ds=setTimeout(Yo,Mn)),us}return _l.cancel=Jo,_l.flush=xl,_l}function isObject(Fn){var Mn=typeof Fn;return!!Fn&&(Mn=="object"||Mn=="function")}function isObjectLike(Fn){return!!Fn&&typeof Fn=="object"}function isSymbol(Fn){return typeof Fn=="symbol"||isObjectLike(Fn)&&objectToString.call(Fn)==symbolTag}function toNumber(Fn){if(typeof Fn=="number")return Fn;if(isSymbol(Fn))return NAN;if(isObject(Fn)){var Mn=typeof Fn.valueOf=="function"?Fn.valueOf():Fn;Fn=isObject(Mn)?Mn+"":Mn}if(typeof Fn!="string")return Fn===0?Fn:+Fn;Fn=Fn.replace(reTrim,"");var rs=reIsBinary.test(Fn);return rs||reIsOctal.test(Fn)?freeParseInt(Fn.slice(2),rs?2:8):reIsBadHex.test(Fn)?NAN:+Fn}var lodash_debounce=debounce,innerSliderUtils={};Object.defineProperty(innerSliderUtils,"__esModule",{value:!0});innerSliderUtils.checkSpecKeys=innerSliderUtils.checkNavigable=innerSliderUtils.changeSlide=innerSliderUtils.canUseDOM=innerSliderUtils.canGoNext=void 0;innerSliderUtils.clamp=clamp;innerSliderUtils.swipeStart=innerSliderUtils.swipeMove=innerSliderUtils.swipeEnd=innerSliderUtils.slidesOnRight=innerSliderUtils.slidesOnLeft=innerSliderUtils.slideHandler=innerSliderUtils.siblingDirection=innerSliderUtils.safePreventDefault=innerSliderUtils.lazyStartIndex=innerSliderUtils.lazySlidesOnRight=innerSliderUtils.lazySlidesOnLeft=innerSliderUtils.lazyEndIndex=innerSliderUtils.keyHandler=innerSliderUtils.initializedState=innerSliderUtils.getWidth=innerSliderUtils.getTrackLeft=innerSliderUtils.getTrackCSS=innerSliderUtils.getTrackAnimateCSS=innerSliderUtils.getTotalSlides=innerSliderUtils.getSwipeDirection=innerSliderUtils.getSlideCount=innerSliderUtils.getRequiredLazySlides=innerSliderUtils.getPreClones=innerSliderUtils.getPostClones=innerSliderUtils.getOnDemandLazySlides=innerSliderUtils.getNavigableIndexes=innerSliderUtils.getHeight=innerSliderUtils.extractObject=void 0;var _react$4=_interopRequireDefault$4(reactExports);function _interopRequireDefault$4(Fn){return Fn&&Fn.__esModule?Fn:{default:Fn}}function ownKeys$4(Fn,Mn){var rs=Object.keys(Fn);if(Object.getOwnPropertySymbols){var is=Object.getOwnPropertySymbols(Fn);Mn&&(is=is.filter(function(os){return Object.getOwnPropertyDescriptor(Fn,os).enumerable})),rs.push.apply(rs,is)}return rs}function _objectSpread$4(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn]!=null?arguments[Mn]:{};Mn%2?ownKeys$4(Object(rs),!0).forEach(function(is){_defineProperty$4(Fn,is,rs[is])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Fn,Object.getOwnPropertyDescriptors(rs)):ownKeys$4(Object(rs)).forEach(function(is){Object.defineProperty(Fn,is,Object.getOwnPropertyDescriptor(rs,is))})}return Fn}function _defineProperty$4(Fn,Mn,rs){return Mn in Fn?Object.defineProperty(Fn,Mn,{value:rs,enumerable:!0,configurable:!0,writable:!0}):Fn[Mn]=rs,Fn}function clamp(Fn,Mn,rs){return Math.max(Mn,Math.min(Fn,rs))}var safePreventDefault=function Fn(Mn){var rs=["onTouchStart","onTouchMove","onWheel"];rs.includes(Mn._reactName)||Mn.preventDefault()};innerSliderUtils.safePreventDefault=safePreventDefault;var getOnDemandLazySlides=function Fn(Mn){for(var rs=[],is=lazyStartIndex(Mn),os=lazyEndIndex(Mn),as=is;as<os;as++)Mn.lazyLoadedList.indexOf(as)<0&&rs.push(as);return rs};innerSliderUtils.getOnDemandLazySlides=getOnDemandLazySlides;var getRequiredLazySlides=function Fn(Mn){for(var rs=[],is=lazyStartIndex(Mn),os=lazyEndIndex(Mn),as=is;as<os;as++)rs.push(as);return rs};innerSliderUtils.getRequiredLazySlides=getRequiredLazySlides;var lazyStartIndex=function Fn(Mn){return Mn.currentSlide-lazySlidesOnLeft(Mn)};innerSliderUtils.lazyStartIndex=lazyStartIndex;var lazyEndIndex=function Fn(Mn){return Mn.currentSlide+lazySlidesOnRight(Mn)};innerSliderUtils.lazyEndIndex=lazyEndIndex;var lazySlidesOnLeft=function Fn(Mn){return Mn.centerMode?Math.floor(Mn.slidesToShow/2)+(parseInt(Mn.centerPadding)>0?1:0):0};innerSliderUtils.lazySlidesOnLeft=lazySlidesOnLeft;var lazySlidesOnRight=function Fn(Mn){return Mn.centerMode?Math.floor((Mn.slidesToShow-1)/2)+1+(parseInt(Mn.centerPadding)>0?1:0):Mn.slidesToShow};innerSliderUtils.lazySlidesOnRight=lazySlidesOnRight;var getWidth=function Fn(Mn){return Mn&&Mn.offsetWidth||0};innerSliderUtils.getWidth=getWidth;var getHeight=function Fn(Mn){return Mn&&Mn.offsetHeight||0};innerSliderUtils.getHeight=getHeight;var getSwipeDirection=function Fn(Mn){var rs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,is,os,as,us;return is=Mn.startX-Mn.curX,os=Mn.startY-Mn.curY,as=Math.atan2(os,is),us=Math.round(as*180/Math.PI),us<0&&(us=360-Math.abs(us)),us<=45&&us>=0||us<=360&&us>=315?"left":us>=135&&us<=225?"right":rs===!0?us>=35&&us<=135?"up":"down":"vertical"};innerSliderUtils.getSwipeDirection=getSwipeDirection;var canGoNext=function Fn(Mn){var rs=!0;return Mn.infinite||(Mn.centerMode&&Mn.currentSlide>=Mn.slideCount-1||Mn.slideCount<=Mn.slidesToShow||Mn.currentSlide>=Mn.slideCount-Mn.slidesToShow)&&(rs=!1),rs};innerSliderUtils.canGoNext=canGoNext;var extractObject=function Fn(Mn,rs){var is={};return rs.forEach(function(os){return is[os]=Mn[os]}),is};innerSliderUtils.extractObject=extractObject;var initializedState=function Fn(Mn){var rs=_react$4.default.Children.count(Mn.children),is=Mn.listRef,os=Math.ceil(getWidth(is)),as=Mn.trackRef&&Mn.trackRef.node,us=Math.ceil(getWidth(as)),ds;if(Mn.vertical)ds=os;else{var hs=Mn.centerMode&&parseInt(Mn.centerPadding)*2;typeof Mn.centerPadding=="string"&&Mn.centerPadding.slice(-1)==="%"&&(hs*=os/100),ds=Math.ceil((os-hs)/Mn.slidesToShow)}var ps=is&&getHeight(is.querySelector('[data-index="0"]')),io=ps*Mn.slidesToShow,fo=Mn.currentSlide===void 0?Mn.initialSlide:Mn.currentSlide;Mn.rtl&&Mn.currentSlide===void 0&&(fo=rs-1-Mn.initialSlide);var mo=Mn.lazyLoadedList||[],Ao=getOnDemandLazySlides(_objectSpread$4(_objectSpread$4({},Mn),{},{currentSlide:fo,lazyLoadedList:mo}));mo=mo.concat(Ao);var $o={slideCount:rs,slideWidth:ds,listWidth:os,trackWidth:us,currentSlide:fo,slideHeight:ps,listHeight:io,lazyLoadedList:mo};return Mn.autoplaying===null&&Mn.autoplay&&($o.autoplaying="playing"),$o};innerSliderUtils.initializedState=initializedState;var slideHandler=function Fn(Mn){var rs=Mn.waitForAnimate,is=Mn.animating,os=Mn.fade,as=Mn.infinite,us=Mn.index,ds=Mn.slideCount,hs=Mn.lazyLoad,ps=Mn.currentSlide,io=Mn.centerMode,fo=Mn.slidesToScroll,mo=Mn.slidesToShow,Ao=Mn.useCSS,$o=Mn.lazyLoadedList;if(rs&&is)return{};var Lo=us,Go,Yo,Wo,Jo={},xl={},_l=as?us:clamp(us,0,ds-1);if(os){if(!as&&(us<0||us>=ds))return{};us<0?Lo=us+ds:us>=ds&&(Lo=us-ds),hs&&$o.indexOf(Lo)<0&&($o=$o.concat(Lo)),Jo={animating:!0,currentSlide:Lo,lazyLoadedList:$o,targetSlide:Lo},xl={animating:!1,targetSlide:Lo}}else Go=Lo,Lo<0?(Go=Lo+ds,as?ds%fo!==0&&(Go=ds-ds%fo):Go=0):!canGoNext(Mn)&&Lo>ps?Lo=Go=ps:io&&Lo>=ds?(Lo=as?ds:ds-1,Go=as?0:ds-1):Lo>=ds&&(Go=Lo-ds,as?ds%fo!==0&&(Go=0):Go=ds-mo),!as&&Lo+mo>=ds&&(Go=ds-mo),Yo=getTrackLeft(_objectSpread$4(_objectSpread$4({},Mn),{},{slideIndex:Lo})),Wo=getTrackLeft(_objectSpread$4(_objectSpread$4({},Mn),{},{slideIndex:Go})),as||(Yo===Wo&&(Lo=Go),Yo=Wo),hs&&($o=$o.concat(getOnDemandLazySlides(_objectSpread$4(_objectSpread$4({},Mn),{},{currentSlide:Lo})))),Ao?(Jo={animating:!0,currentSlide:Go,trackStyle:getTrackAnimateCSS(_objectSpread$4(_objectSpread$4({},Mn),{},{left:Yo})),lazyLoadedList:$o,targetSlide:_l},xl={animating:!1,currentSlide:Go,trackStyle:getTrackCSS(_objectSpread$4(_objectSpread$4({},Mn),{},{left:Wo})),swipeLeft:null,targetSlide:_l}):Jo={currentSlide:Go,trackStyle:getTrackCSS(_objectSpread$4(_objectSpread$4({},Mn),{},{left:Wo})),lazyLoadedList:$o,targetSlide:_l};return{state:Jo,nextState:xl}};innerSliderUtils.slideHandler=slideHandler;var changeSlide=function Fn(Mn,rs){var is,os,as,us,ds,hs=Mn.slidesToScroll,ps=Mn.slidesToShow,io=Mn.slideCount,fo=Mn.currentSlide,mo=Mn.targetSlide,Ao=Mn.lazyLoad,$o=Mn.infinite;if(us=io%hs!==0,is=us?0:(io-fo)%hs,rs.message==="previous")as=is===0?hs:ps-is,ds=fo-as,Ao&&!$o&&(os=fo-as,ds=os===-1?io-1:os),$o||(ds=mo-hs);else if(rs.message==="next")as=is===0?hs:is,ds=fo+as,Ao&&!$o&&(ds=(fo+hs)%io+is),$o||(ds=mo+hs);else if(rs.message==="dots")ds=rs.index*rs.slidesToScroll;else if(rs.message==="children"){if(ds=rs.index,$o){var Lo=siblingDirection(_objectSpread$4(_objectSpread$4({},Mn),{},{targetSlide:ds}));ds>rs.currentSlide&&Lo==="left"?ds=ds-io:ds<rs.currentSlide&&Lo==="right"&&(ds=ds+io)}}else rs.message==="index"&&(ds=Number(rs.index));return ds};innerSliderUtils.changeSlide=changeSlide;var keyHandler=function Fn(Mn,rs,is){return Mn.target.tagName.match("TEXTAREA|INPUT|SELECT")||!rs?"":Mn.keyCode===37?is?"next":"previous":Mn.keyCode===39?is?"previous":"next":""};innerSliderUtils.keyHandler=keyHandler;var swipeStart=function Fn(Mn,rs,is){return Mn.target.tagName==="IMG"&&safePreventDefault(Mn),!rs||!is&&Mn.type.indexOf("mouse")!==-1?"":{dragging:!0,touchObject:{startX:Mn.touches?Mn.touches[0].pageX:Mn.clientX,startY:Mn.touches?Mn.touches[0].pageY:Mn.clientY,curX:Mn.touches?Mn.touches[0].pageX:Mn.clientX,curY:Mn.touches?Mn.touches[0].pageY:Mn.clientY}}};innerSliderUtils.swipeStart=swipeStart;var swipeMove=function Fn(Mn,rs){var is=rs.scrolling,os=rs.animating,as=rs.vertical,us=rs.swipeToSlide,ds=rs.verticalSwiping,hs=rs.rtl,ps=rs.currentSlide,io=rs.edgeFriction,fo=rs.edgeDragged,mo=rs.onEdge,Ao=rs.swiped,$o=rs.swiping,Lo=rs.slideCount,Go=rs.slidesToScroll,Yo=rs.infinite,Wo=rs.touchObject,Jo=rs.swipeEvent,xl=rs.listHeight,_l=rs.listWidth;if(!is){if(os)return safePreventDefault(Mn);as&&us&&ds&&safePreventDefault(Mn);var Tl,Sl={},$l=getTrackLeft(rs);Wo.curX=Mn.touches?Mn.touches[0].pageX:Mn.clientX,Wo.curY=Mn.touches?Mn.touches[0].pageY:Mn.clientY,Wo.swipeLength=Math.round(Math.sqrt(Math.pow(Wo.curX-Wo.startX,2)));var Pl=Math.round(Math.sqrt(Math.pow(Wo.curY-Wo.startY,2)));if(!ds&&!$o&&Pl>10)return{scrolling:!0};ds&&(Wo.swipeLength=Pl);var Dl=(hs?-1:1)*(Wo.curX>Wo.startX?1:-1);ds&&(Dl=Wo.curY>Wo.startY?1:-1);var Ol=Math.ceil(Lo/Go),Rl=getSwipeDirection(rs.touchObject,ds),Vo=Wo.swipeLength;return Yo||(ps===0&&(Rl==="right"||Rl==="down")||ps+1>=Ol&&(Rl==="left"||Rl==="up")||!canGoNext(rs)&&(Rl==="left"||Rl==="up"))&&(Vo=Wo.swipeLength*io,fo===!1&&mo&&(mo(Rl),Sl.edgeDragged=!0)),!Ao&&Jo&&(Jo(Rl),Sl.swiped=!0),as?Tl=$l+Vo*(xl/_l)*Dl:hs?Tl=$l-Vo*Dl:Tl=$l+Vo*Dl,ds&&(Tl=$l+Vo*Dl),Sl=_objectSpread$4(_objectSpread$4({},Sl),{},{touchObject:Wo,swipeLeft:Tl,trackStyle:getTrackCSS(_objectSpread$4(_objectSpread$4({},rs),{},{left:Tl}))}),Math.abs(Wo.curX-Wo.startX)<Math.abs(Wo.curY-Wo.startY)*.8||Wo.swipeLength>10&&(Sl.swiping=!0,safePreventDefault(Mn)),Sl}};innerSliderUtils.swipeMove=swipeMove;var swipeEnd=function Fn(Mn,rs){var is=rs.dragging,os=rs.swipe,as=rs.touchObject,us=rs.listWidth,ds=rs.touchThreshold,hs=rs.verticalSwiping,ps=rs.listHeight,io=rs.swipeToSlide,fo=rs.scrolling,mo=rs.onSwipe,Ao=rs.targetSlide,$o=rs.currentSlide,Lo=rs.infinite;if(!is)return os&&safePreventDefault(Mn),{};var Go=hs?ps/ds:us/ds,Yo=getSwipeDirection(as,hs),Wo={dragging:!1,edgeDragged:!1,scrolling:!1,swiping:!1,swiped:!1,swipeLeft:null,touchObject:{}};if(fo||!as.swipeLength)return Wo;if(as.swipeLength>Go){safePreventDefault(Mn),mo&&mo(Yo);var Jo,xl,_l=Lo?$o:Ao;switch(Yo){case"left":case"up":xl=_l+getSlideCount(rs),Jo=io?checkNavigable(rs,xl):xl,Wo.currentDirection=0;break;case"right":case"down":xl=_l-getSlideCount(rs),Jo=io?checkNavigable(rs,xl):xl,Wo.currentDirection=1;break;default:Jo=_l}Wo.triggerSlideHandler=Jo}else{var Tl=getTrackLeft(rs);Wo.trackStyle=getTrackAnimateCSS(_objectSpread$4(_objectSpread$4({},rs),{},{left:Tl}))}return Wo};innerSliderUtils.swipeEnd=swipeEnd;var getNavigableIndexes=function Fn(Mn){for(var rs=Mn.infinite?Mn.slideCount*2:Mn.slideCount,is=Mn.infinite?Mn.slidesToShow*-1:0,os=Mn.infinite?Mn.slidesToShow*-1:0,as=[];is<rs;)as.push(is),is=os+Mn.slidesToScroll,os+=Math.min(Mn.slidesToScroll,Mn.slidesToShow);return as};innerSliderUtils.getNavigableIndexes=getNavigableIndexes;var checkNavigable=function Fn(Mn,rs){var is=getNavigableIndexes(Mn),os=0;if(rs>is[is.length-1])rs=is[is.length-1];else for(var as in is){if(rs<is[as]){rs=os;break}os=is[as]}return rs};innerSliderUtils.checkNavigable=checkNavigable;var getSlideCount=function Fn(Mn){var rs=Mn.centerMode?Mn.slideWidth*Math.floor(Mn.slidesToShow/2):0;if(Mn.swipeToSlide){var is,os=Mn.listRef,as=os.querySelectorAll&&os.querySelectorAll(".slick-slide")||[];if(Array.from(as).every(function(hs){if(Mn.vertical){if(hs.offsetTop+getHeight(hs)/2>Mn.swipeLeft*-1)return is=hs,!1}else if(hs.offsetLeft-rs+getWidth(hs)/2>Mn.swipeLeft*-1)return is=hs,!1;return!0}),!is)return 0;var us=Mn.rtl===!0?Mn.slideCount-Mn.currentSlide:Mn.currentSlide,ds=Math.abs(is.dataset.index-us)||1;return ds}else return Mn.slidesToScroll};innerSliderUtils.getSlideCount=getSlideCount;var checkSpecKeys=function Fn(Mn,rs){return rs.reduce(function(is,os){return is&&Mn.hasOwnProperty(os)},!0)?null:console.error("Keys Missing:",Mn)};innerSliderUtils.checkSpecKeys=checkSpecKeys;var getTrackCSS=function Fn(Mn){checkSpecKeys(Mn,["left","variableWidth","slideCount","slidesToShow","slideWidth"]);var rs,is,os=Mn.slideCount+2*Mn.slidesToShow;Mn.vertical?is=os*Mn.slideHeight:rs=getTotalSlides(Mn)*Mn.slideWidth;var as={opacity:1,transition:"",WebkitTransition:""};if(Mn.useTransform){var us=Mn.vertical?"translate3d(0px, "+Mn.left+"px, 0px)":"translate3d("+Mn.left+"px, 0px, 0px)",ds=Mn.vertical?"translate3d(0px, "+Mn.left+"px, 0px)":"translate3d("+Mn.left+"px, 0px, 0px)",hs=Mn.vertical?"translateY("+Mn.left+"px)":"translateX("+Mn.left+"px)";as=_objectSpread$4(_objectSpread$4({},as),{},{WebkitTransform:us,transform:ds,msTransform:hs})}else Mn.vertical?as.top=Mn.left:as.left=Mn.left;return Mn.fade&&(as={opacity:1}),rs&&(as.width=rs),is&&(as.height=is),window&&!window.addEventListener&&window.attachEvent&&(Mn.vertical?as.marginTop=Mn.left+"px":as.marginLeft=Mn.left+"px"),as};innerSliderUtils.getTrackCSS=getTrackCSS;var getTrackAnimateCSS=function Fn(Mn){checkSpecKeys(Mn,["left","variableWidth","slideCount","slidesToShow","slideWidth","speed","cssEase"]);var rs=getTrackCSS(Mn);return Mn.useTransform?(rs.WebkitTransition="-webkit-transform "+Mn.speed+"ms "+Mn.cssEase,rs.transition="transform "+Mn.speed+"ms "+Mn.cssEase):Mn.vertical?rs.transition="top "+Mn.speed+"ms "+Mn.cssEase:rs.transition="left "+Mn.speed+"ms "+Mn.cssEase,rs};innerSliderUtils.getTrackAnimateCSS=getTrackAnimateCSS;var getTrackLeft=function Fn(Mn){if(Mn.unslick)return 0;checkSpecKeys(Mn,["slideIndex","trackRef","infinite","centerMode","slideCount","slidesToShow","slidesToScroll","slideWidth","listWidth","variableWidth","slideHeight"]);var rs=Mn.slideIndex,is=Mn.trackRef,os=Mn.infinite,as=Mn.centerMode,us=Mn.slideCount,ds=Mn.slidesToShow,hs=Mn.slidesToScroll,ps=Mn.slideWidth,io=Mn.listWidth,fo=Mn.variableWidth,mo=Mn.slideHeight,Ao=Mn.fade,$o=Mn.vertical,Lo=0,Go,Yo,Wo=0;if(Ao||Mn.slideCount===1)return 0;var Jo=0;if(os?(Jo=-getPreClones(Mn),us%hs!==0&&rs+hs>us&&(Jo=-(rs>us?ds-(rs-us):us%hs)),as&&(Jo+=parseInt(ds/2))):(us%hs!==0&&rs+hs>us&&(Jo=ds-us%hs),as&&(Jo=parseInt(ds/2))),Lo=Jo*ps,Wo=Jo*mo,$o?Go=rs*mo*-1+Wo:Go=rs*ps*-1+Lo,fo===!0){var xl,_l=is&&is.node;if(xl=rs+getPreClones(Mn),Yo=_l&&_l.childNodes[xl],Go=Yo?Yo.offsetLeft*-1:0,as===!0){xl=os?rs+getPreClones(Mn):rs,Yo=_l&&_l.children[xl],Go=0;for(var Tl=0;Tl<xl;Tl++)Go-=_l&&_l.children[Tl]&&_l.children[Tl].offsetWidth;Go-=parseInt(Mn.centerPadding),Go+=Yo&&(io-Yo.offsetWidth)/2}}return Go};innerSliderUtils.getTrackLeft=getTrackLeft;var getPreClones=function Fn(Mn){return Mn.unslick||!Mn.infinite?0:Mn.variableWidth?Mn.slideCount:Mn.slidesToShow+(Mn.centerMode?1:0)};innerSliderUtils.getPreClones=getPreClones;var getPostClones=function Fn(Mn){return Mn.unslick||!Mn.infinite?0:Mn.slideCount};innerSliderUtils.getPostClones=getPostClones;var getTotalSlides=function Fn(Mn){return Mn.slideCount===1?1:getPreClones(Mn)+Mn.slideCount+getPostClones(Mn)};innerSliderUtils.getTotalSlides=getTotalSlides;var siblingDirection=function Fn(Mn){return Mn.targetSlide>Mn.currentSlide?Mn.targetSlide>Mn.currentSlide+slidesOnRight(Mn)?"left":"right":Mn.targetSlide<Mn.currentSlide-slidesOnLeft(Mn)?"right":"left"};innerSliderUtils.siblingDirection=siblingDirection;var slidesOnRight=function Fn(Mn){var rs=Mn.slidesToShow,is=Mn.centerMode,os=Mn.rtl,as=Mn.centerPadding;if(is){var us=(rs-1)/2+1;return parseInt(as)>0&&(us+=1),os&&rs%2===0&&(us+=1),us}return os?0:rs-1};innerSliderUtils.slidesOnRight=slidesOnRight;var slidesOnLeft=function Fn(Mn){var rs=Mn.slidesToShow,is=Mn.centerMode,os=Mn.rtl,as=Mn.centerPadding;if(is){var us=(rs-1)/2+1;return parseInt(as)>0&&(us+=1),!os&&rs%2===0&&(us+=1),us}return os?rs-1:0};innerSliderUtils.slidesOnLeft=slidesOnLeft;var canUseDOM=function Fn(){return!!(typeof window<"u"&&window.document&&window.document.createElement)};innerSliderUtils.canUseDOM=canUseDOM;var track={};function _typeof$3(Fn){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Mn){return typeof Mn}:function(Mn){return Mn&&typeof Symbol=="function"&&Mn.constructor===Symbol&&Mn!==Symbol.prototype?"symbol":typeof Mn},_typeof$3(Fn)}Object.defineProperty(track,"__esModule",{value:!0});track.Track=void 0;var _react$3=_interopRequireDefault$3(reactExports),_classnames$3=_interopRequireDefault$3(classnamesExports),_innerSliderUtils$3=innerSliderUtils;function _interopRequireDefault$3(Fn){return Fn&&Fn.__esModule?Fn:{default:Fn}}function _extends$2(){return _extends$2=Object.assign||function(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn];for(var is in rs)Object.prototype.hasOwnProperty.call(rs,is)&&(Fn[is]=rs[is])}return Fn},_extends$2.apply(this,arguments)}function _classCallCheck$3(Fn,Mn){if(!(Fn instanceof Mn))throw new TypeError("Cannot call a class as a function")}function _defineProperties$3(Fn,Mn){for(var rs=0;rs<Mn.length;rs++){var is=Mn[rs];is.enumerable=is.enumerable||!1,is.configurable=!0,"value"in is&&(is.writable=!0),Object.defineProperty(Fn,is.key,is)}}function _createClass$3(Fn,Mn,rs){return Mn&&_defineProperties$3(Fn.prototype,Mn),Object.defineProperty(Fn,"prototype",{writable:!1}),Fn}function _inherits$3(Fn,Mn){if(typeof Mn!="function"&&Mn!==null)throw new TypeError("Super expression must either be null or a function");Fn.prototype=Object.create(Mn&&Mn.prototype,{constructor:{value:Fn,writable:!0,configurable:!0}}),Object.defineProperty(Fn,"prototype",{writable:!1}),Mn&&_setPrototypeOf$3(Fn,Mn)}function _setPrototypeOf$3(Fn,Mn){return _setPrototypeOf$3=Object.setPrototypeOf||function(is,os){return is.__proto__=os,is},_setPrototypeOf$3(Fn,Mn)}function _createSuper$3(Fn){var Mn=_isNativeReflectConstruct$3();return function(){var is=_getPrototypeOf$3(Fn),os;if(Mn){var as=_getPrototypeOf$3(this).constructor;os=Reflect.construct(is,arguments,as)}else os=is.apply(this,arguments);return _possibleConstructorReturn$3(this,os)}}function _possibleConstructorReturn$3(Fn,Mn){if(Mn&&(_typeof$3(Mn)==="object"||typeof Mn=="function"))return Mn;if(Mn!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$3(Fn)}function _assertThisInitialized$3(Fn){if(Fn===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Fn}function _isNativeReflectConstruct$3(){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 _getPrototypeOf$3(Fn){return _getPrototypeOf$3=Object.setPrototypeOf?Object.getPrototypeOf:function(rs){return rs.__proto__||Object.getPrototypeOf(rs)},_getPrototypeOf$3(Fn)}function ownKeys$3(Fn,Mn){var rs=Object.keys(Fn);if(Object.getOwnPropertySymbols){var is=Object.getOwnPropertySymbols(Fn);Mn&&(is=is.filter(function(os){return Object.getOwnPropertyDescriptor(Fn,os).enumerable})),rs.push.apply(rs,is)}return rs}function _objectSpread$3(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn]!=null?arguments[Mn]:{};Mn%2?ownKeys$3(Object(rs),!0).forEach(function(is){_defineProperty$3(Fn,is,rs[is])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Fn,Object.getOwnPropertyDescriptors(rs)):ownKeys$3(Object(rs)).forEach(function(is){Object.defineProperty(Fn,is,Object.getOwnPropertyDescriptor(rs,is))})}return Fn}function _defineProperty$3(Fn,Mn,rs){return Mn in Fn?Object.defineProperty(Fn,Mn,{value:rs,enumerable:!0,configurable:!0,writable:!0}):Fn[Mn]=rs,Fn}var getSlideClasses=function Fn(Mn){var rs,is,os,as,us;Mn.rtl?us=Mn.slideCount-1-Mn.index:us=Mn.index,os=us<0||us>=Mn.slideCount,Mn.centerMode?(as=Math.floor(Mn.slidesToShow/2),is=(us-Mn.currentSlide)%Mn.slideCount===0,us>Mn.currentSlide-as-1&&us<=Mn.currentSlide+as&&(rs=!0)):rs=Mn.currentSlide<=us&&us<Mn.currentSlide+Mn.slidesToShow;var ds;Mn.targetSlide<0?ds=Mn.targetSlide+Mn.slideCount:Mn.targetSlide>=Mn.slideCount?ds=Mn.targetSlide-Mn.slideCount:ds=Mn.targetSlide;var hs=us===ds;return{"slick-slide":!0,"slick-active":rs,"slick-center":is,"slick-cloned":os,"slick-current":hs}},getSlideStyle=function Fn(Mn){var rs={};return(Mn.variableWidth===void 0||Mn.variableWidth===!1)&&(rs.width=Mn.slideWidth),Mn.fade&&(rs.position="relative",Mn.vertical?rs.top=-Mn.index*parseInt(Mn.slideHeight):rs.left=-Mn.index*parseInt(Mn.slideWidth),rs.opacity=Mn.currentSlide===Mn.index?1:0,Mn.useCSS&&(rs.transition="opacity "+Mn.speed+"ms "+Mn.cssEase+", visibility "+Mn.speed+"ms "+Mn.cssEase)),rs},getKey=function Fn(Mn,rs){return Mn.key||rs},renderSlides=function Fn(Mn){var rs,is=[],os=[],as=[],us=_react$3.default.Children.count(Mn.children),ds=(0,_innerSliderUtils$3.lazyStartIndex)(Mn),hs=(0,_innerSliderUtils$3.lazyEndIndex)(Mn);return _react$3.default.Children.forEach(Mn.children,function(ps,io){var fo,mo={message:"children",index:io,slidesToScroll:Mn.slidesToScroll,currentSlide:Mn.currentSlide};!Mn.lazyLoad||Mn.lazyLoad&&Mn.lazyLoadedList.indexOf(io)>=0?fo=ps:fo=_react$3.default.createElement("div",null);var Ao=getSlideStyle(_objectSpread$3(_objectSpread$3({},Mn),{},{index:io})),$o=fo.props.className||"",Lo=getSlideClasses(_objectSpread$3(_objectSpread$3({},Mn),{},{index:io}));if(is.push(_react$3.default.cloneElement(fo,{key:"original"+getKey(fo,io),"data-index":io,className:(0,_classnames$3.default)(Lo,$o),tabIndex:"-1","aria-hidden":!Lo["slick-active"],style:_objectSpread$3(_objectSpread$3({outline:"none"},fo.props.style||{}),Ao),onClick:function(Wo){fo.props&&fo.props.onClick&&fo.props.onClick(Wo),Mn.focusOnSelect&&Mn.focusOnSelect(mo)}})),Mn.infinite&&Mn.fade===!1){var Go=us-io;Go<=(0,_innerSliderUtils$3.getPreClones)(Mn)&&us!==Mn.slidesToShow&&(rs=-Go,rs>=ds&&(fo=ps),Lo=getSlideClasses(_objectSpread$3(_objectSpread$3({},Mn),{},{index:rs})),os.push(_react$3.default.cloneElement(fo,{key:"precloned"+getKey(fo,rs),"data-index":rs,tabIndex:"-1",className:(0,_classnames$3.default)(Lo,$o),"aria-hidden":!Lo["slick-active"],style:_objectSpread$3(_objectSpread$3({},fo.props.style||{}),Ao),onClick:function(Wo){fo.props&&fo.props.onClick&&fo.props.onClick(Wo),Mn.focusOnSelect&&Mn.focusOnSelect(mo)}}))),us!==Mn.slidesToShow&&(rs=us+io,rs<hs&&(fo=ps),Lo=getSlideClasses(_objectSpread$3(_objectSpread$3({},Mn),{},{index:rs})),as.push(_react$3.default.cloneElement(fo,{key:"postcloned"+getKey(fo,rs),"data-index":rs,tabIndex:"-1",className:(0,_classnames$3.default)(Lo,$o),"aria-hidden":!Lo["slick-active"],style:_objectSpread$3(_objectSpread$3({},fo.props.style||{}),Ao),onClick:function(Wo){fo.props&&fo.props.onClick&&fo.props.onClick(Wo),Mn.focusOnSelect&&Mn.focusOnSelect(mo)}})))}}),Mn.rtl?os.concat(is,as).reverse():os.concat(is,as)},Track=function(Fn){_inherits$3(rs,Fn);var Mn=_createSuper$3(rs);function rs(){var is;_classCallCheck$3(this,rs);for(var os=arguments.length,as=new Array(os),us=0;us<os;us++)as[us]=arguments[us];return is=Mn.call.apply(Mn,[this].concat(as)),_defineProperty$3(_assertThisInitialized$3(is),"node",null),_defineProperty$3(_assertThisInitialized$3(is),"handleRef",function(ds){is.node=ds}),is}return _createClass$3(rs,[{key:"render",value:function(){var os=renderSlides(this.props),as=this.props,us=as.onMouseEnter,ds=as.onMouseOver,hs=as.onMouseLeave,ps={onMouseEnter:us,onMouseOver:ds,onMouseLeave:hs};return _react$3.default.createElement("div",_extends$2({ref:this.handleRef,className:"slick-track",style:this.props.trackStyle},ps),os)}}]),rs}(_react$3.default.PureComponent);track.Track=Track;var dots={};function _typeof$2(Fn){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Mn){return typeof Mn}:function(Mn){return Mn&&typeof Symbol=="function"&&Mn.constructor===Symbol&&Mn!==Symbol.prototype?"symbol":typeof Mn},_typeof$2(Fn)}Object.defineProperty(dots,"__esModule",{value:!0});dots.Dots=void 0;var _react$2=_interopRequireDefault$2(reactExports),_classnames$2=_interopRequireDefault$2(classnamesExports),_innerSliderUtils$2=innerSliderUtils;function _interopRequireDefault$2(Fn){return Fn&&Fn.__esModule?Fn:{default:Fn}}function ownKeys$2(Fn,Mn){var rs=Object.keys(Fn);if(Object.getOwnPropertySymbols){var is=Object.getOwnPropertySymbols(Fn);Mn&&(is=is.filter(function(os){return Object.getOwnPropertyDescriptor(Fn,os).enumerable})),rs.push.apply(rs,is)}return rs}function _objectSpread$2(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn]!=null?arguments[Mn]:{};Mn%2?ownKeys$2(Object(rs),!0).forEach(function(is){_defineProperty$2(Fn,is,rs[is])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Fn,Object.getOwnPropertyDescriptors(rs)):ownKeys$2(Object(rs)).forEach(function(is){Object.defineProperty(Fn,is,Object.getOwnPropertyDescriptor(rs,is))})}return Fn}function _defineProperty$2(Fn,Mn,rs){return Mn in Fn?Object.defineProperty(Fn,Mn,{value:rs,enumerable:!0,configurable:!0,writable:!0}):Fn[Mn]=rs,Fn}function _classCallCheck$2(Fn,Mn){if(!(Fn instanceof Mn))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(Fn,Mn){for(var rs=0;rs<Mn.length;rs++){var is=Mn[rs];is.enumerable=is.enumerable||!1,is.configurable=!0,"value"in is&&(is.writable=!0),Object.defineProperty(Fn,is.key,is)}}function _createClass$2(Fn,Mn,rs){return Mn&&_defineProperties$2(Fn.prototype,Mn),Object.defineProperty(Fn,"prototype",{writable:!1}),Fn}function _inherits$2(Fn,Mn){if(typeof Mn!="function"&&Mn!==null)throw new TypeError("Super expression must either be null or a function");Fn.prototype=Object.create(Mn&&Mn.prototype,{constructor:{value:Fn,writable:!0,configurable:!0}}),Object.defineProperty(Fn,"prototype",{writable:!1}),Mn&&_setPrototypeOf$2(Fn,Mn)}function _setPrototypeOf$2(Fn,Mn){return _setPrototypeOf$2=Object.setPrototypeOf||function(is,os){return is.__proto__=os,is},_setPrototypeOf$2(Fn,Mn)}function _createSuper$2(Fn){var Mn=_isNativeReflectConstruct$2();return function(){var is=_getPrototypeOf$2(Fn),os;if(Mn){var as=_getPrototypeOf$2(this).constructor;os=Reflect.construct(is,arguments,as)}else os=is.apply(this,arguments);return _possibleConstructorReturn$2(this,os)}}function _possibleConstructorReturn$2(Fn,Mn){if(Mn&&(_typeof$2(Mn)==="object"||typeof Mn=="function"))return Mn;if(Mn!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$2(Fn)}function _assertThisInitialized$2(Fn){if(Fn===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Fn}function _isNativeReflectConstruct$2(){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 _getPrototypeOf$2(Fn){return _getPrototypeOf$2=Object.setPrototypeOf?Object.getPrototypeOf:function(rs){return rs.__proto__||Object.getPrototypeOf(rs)},_getPrototypeOf$2(Fn)}var getDotCount=function Fn(Mn){var rs;return Mn.infinite?rs=Math.ceil(Mn.slideCount/Mn.slidesToScroll):rs=Math.ceil((Mn.slideCount-Mn.slidesToShow)/Mn.slidesToScroll)+1,rs},Dots=function(Fn){_inherits$2(rs,Fn);var Mn=_createSuper$2(rs);function rs(){return _classCallCheck$2(this,rs),Mn.apply(this,arguments)}return _createClass$2(rs,[{key:"clickHandler",value:function(os,as){as.preventDefault(),this.props.clickHandler(os)}},{key:"render",value:function(){for(var os=this.props,as=os.onMouseEnter,us=os.onMouseOver,ds=os.onMouseLeave,hs=os.infinite,ps=os.slidesToScroll,io=os.slidesToShow,fo=os.slideCount,mo=os.currentSlide,Ao=getDotCount({slideCount:fo,slidesToScroll:ps,slidesToShow:io,infinite:hs}),$o={onMouseEnter:as,onMouseOver:us,onMouseLeave:ds},Lo=[],Go=0;Go<Ao;Go++){var Yo=(Go+1)*ps-1,Wo=hs?Yo:(0,_innerSliderUtils$2.clamp)(Yo,0,fo-1),Jo=Wo-(ps-1),xl=hs?Jo:(0,_innerSliderUtils$2.clamp)(Jo,0,fo-1),_l=(0,_classnames$2.default)({"slick-active":hs?mo>=xl&&mo<=Wo:mo===xl}),Tl={message:"dots",index:Go,slidesToScroll:ps,currentSlide:mo},Sl=this.clickHandler.bind(this,Tl);Lo=Lo.concat(_react$2.default.createElement("li",{key:Go,className:_l},_react$2.default.cloneElement(this.props.customPaging(Go),{onClick:Sl})))}return _react$2.default.cloneElement(this.props.appendDots(Lo),_objectSpread$2({className:this.props.dotsClass},$o))}}]),rs}(_react$2.default.PureComponent);dots.Dots=Dots;var arrows={};function _typeof$1(Fn){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Mn){return typeof Mn}:function(Mn){return Mn&&typeof Symbol=="function"&&Mn.constructor===Symbol&&Mn!==Symbol.prototype?"symbol":typeof Mn},_typeof$1(Fn)}Object.defineProperty(arrows,"__esModule",{value:!0});arrows.PrevArrow=arrows.NextArrow=void 0;var _react$1=_interopRequireDefault$1(reactExports),_classnames$1=_interopRequireDefault$1(classnamesExports),_innerSliderUtils$1=innerSliderUtils;function _interopRequireDefault$1(Fn){return Fn&&Fn.__esModule?Fn:{default:Fn}}function _extends$1(){return _extends$1=Object.assign||function(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn];for(var is in rs)Object.prototype.hasOwnProperty.call(rs,is)&&(Fn[is]=rs[is])}return Fn},_extends$1.apply(this,arguments)}function ownKeys$1(Fn,Mn){var rs=Object.keys(Fn);if(Object.getOwnPropertySymbols){var is=Object.getOwnPropertySymbols(Fn);Mn&&(is=is.filter(function(os){return Object.getOwnPropertyDescriptor(Fn,os).enumerable})),rs.push.apply(rs,is)}return rs}function _objectSpread$1(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn]!=null?arguments[Mn]:{};Mn%2?ownKeys$1(Object(rs),!0).forEach(function(is){_defineProperty$1(Fn,is,rs[is])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Fn,Object.getOwnPropertyDescriptors(rs)):ownKeys$1(Object(rs)).forEach(function(is){Object.defineProperty(Fn,is,Object.getOwnPropertyDescriptor(rs,is))})}return Fn}function _defineProperty$1(Fn,Mn,rs){return Mn in Fn?Object.defineProperty(Fn,Mn,{value:rs,enumerable:!0,configurable:!0,writable:!0}):Fn[Mn]=rs,Fn}function _classCallCheck$1(Fn,Mn){if(!(Fn instanceof Mn))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(Fn,Mn){for(var rs=0;rs<Mn.length;rs++){var is=Mn[rs];is.enumerable=is.enumerable||!1,is.configurable=!0,"value"in is&&(is.writable=!0),Object.defineProperty(Fn,is.key,is)}}function _createClass$1(Fn,Mn,rs){return Mn&&_defineProperties$1(Fn.prototype,Mn),Object.defineProperty(Fn,"prototype",{writable:!1}),Fn}function _inherits$1(Fn,Mn){if(typeof Mn!="function"&&Mn!==null)throw new TypeError("Super expression must either be null or a function");Fn.prototype=Object.create(Mn&&Mn.prototype,{constructor:{value:Fn,writable:!0,configurable:!0}}),Object.defineProperty(Fn,"prototype",{writable:!1}),Mn&&_setPrototypeOf$1(Fn,Mn)}function _setPrototypeOf$1(Fn,Mn){return _setPrototypeOf$1=Object.setPrototypeOf||function(is,os){return is.__proto__=os,is},_setPrototypeOf$1(Fn,Mn)}function _createSuper$1(Fn){var Mn=_isNativeReflectConstruct$1();return function(){var is=_getPrototypeOf$1(Fn),os;if(Mn){var as=_getPrototypeOf$1(this).constructor;os=Reflect.construct(is,arguments,as)}else os=is.apply(this,arguments);return _possibleConstructorReturn$1(this,os)}}function _possibleConstructorReturn$1(Fn,Mn){if(Mn&&(_typeof$1(Mn)==="object"||typeof Mn=="function"))return Mn;if(Mn!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(Fn)}function _assertThisInitialized$1(Fn){if(Fn===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Fn}function _isNativeReflectConstruct$1(){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 _getPrototypeOf$1(Fn){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf:function(rs){return rs.__proto__||Object.getPrototypeOf(rs)},_getPrototypeOf$1(Fn)}var PrevArrow=function(Fn){_inherits$1(rs,Fn);var Mn=_createSuper$1(rs);function rs(){return _classCallCheck$1(this,rs),Mn.apply(this,arguments)}return _createClass$1(rs,[{key:"clickHandler",value:function(os,as){as&&as.preventDefault(),this.props.clickHandler(os,as)}},{key:"render",value:function(){var os={"slick-arrow":!0,"slick-prev":!0},as=this.clickHandler.bind(this,{message:"previous"});!this.props.infinite&&(this.props.currentSlide===0||this.props.slideCount<=this.props.slidesToShow)&&(os["slick-disabled"]=!0,as=null);var us={key:"0","data-role":"none",className:(0,_classnames$1.default)(os),style:{display:"block"},onClick:as},ds={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},hs;return this.props.prevArrow?hs=_react$1.default.cloneElement(this.props.prevArrow,_objectSpread$1(_objectSpread$1({},us),ds)):hs=_react$1.default.createElement("button",_extends$1({key:"0",type:"button"},us)," ","Previous"),hs}}]),rs}(_react$1.default.PureComponent);arrows.PrevArrow=PrevArrow;var NextArrow=function(Fn){_inherits$1(rs,Fn);var Mn=_createSuper$1(rs);function rs(){return _classCallCheck$1(this,rs),Mn.apply(this,arguments)}return _createClass$1(rs,[{key:"clickHandler",value:function(os,as){as&&as.preventDefault(),this.props.clickHandler(os,as)}},{key:"render",value:function(){var os={"slick-arrow":!0,"slick-next":!0},as=this.clickHandler.bind(this,{message:"next"});(0,_innerSliderUtils$1.canGoNext)(this.props)||(os["slick-disabled"]=!0,as=null);var us={key:"1","data-role":"none",className:(0,_classnames$1.default)(os),style:{display:"block"},onClick:as},ds={currentSlide:this.props.currentSlide,slideCount:this.props.slideCount},hs;return this.props.nextArrow?hs=_react$1.default.cloneElement(this.props.nextArrow,_objectSpread$1(_objectSpread$1({},us),ds)):hs=_react$1.default.createElement("button",_extends$1({key:"1",type:"button"},us)," ","Next"),hs}}]),rs}(_react$1.default.PureComponent);arrows.NextArrow=NextArrow;const require$$8=getAugmentedNamespace(ResizeObserver_es);Object.defineProperty(innerSlider,"__esModule",{value:!0});innerSlider.InnerSlider=void 0;var _react=_interopRequireDefault(reactExports),_initialState=_interopRequireDefault(initialState),_lodash=_interopRequireDefault(lodash_debounce),_classnames=_interopRequireDefault(classnamesExports),_innerSliderUtils=innerSliderUtils,_track=track,_dots=dots,_arrows=arrows,_resizeObserverPolyfill=_interopRequireDefault(require$$8);function _interopRequireDefault(Fn){return Fn&&Fn.__esModule?Fn:{default:Fn}}function _typeof(Fn){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Mn){return typeof Mn}:function(Mn){return Mn&&typeof Symbol=="function"&&Mn.constructor===Symbol&&Mn!==Symbol.prototype?"symbol":typeof Mn},_typeof(Fn)}function _extends(){return _extends=Object.assign||function(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn];for(var is in rs)Object.prototype.hasOwnProperty.call(rs,is)&&(Fn[is]=rs[is])}return Fn},_extends.apply(this,arguments)}function _objectWithoutProperties(Fn,Mn){if(Fn==null)return{};var rs=_objectWithoutPropertiesLoose(Fn,Mn),is,os;if(Object.getOwnPropertySymbols){var as=Object.getOwnPropertySymbols(Fn);for(os=0;os<as.length;os++)is=as[os],!(Mn.indexOf(is)>=0)&&Object.prototype.propertyIsEnumerable.call(Fn,is)&&(rs[is]=Fn[is])}return rs}function _objectWithoutPropertiesLoose(Fn,Mn){if(Fn==null)return{};var rs={},is=Object.keys(Fn),os,as;for(as=0;as<is.length;as++)os=is[as],!(Mn.indexOf(os)>=0)&&(rs[os]=Fn[os]);return rs}function ownKeys(Fn,Mn){var rs=Object.keys(Fn);if(Object.getOwnPropertySymbols){var is=Object.getOwnPropertySymbols(Fn);Mn&&(is=is.filter(function(os){return Object.getOwnPropertyDescriptor(Fn,os).enumerable})),rs.push.apply(rs,is)}return rs}function _objectSpread(Fn){for(var Mn=1;Mn<arguments.length;Mn++){var rs=arguments[Mn]!=null?arguments[Mn]:{};Mn%2?ownKeys(Object(rs),!0).forEach(function(is){_defineProperty(Fn,is,rs[is])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Fn,Object.getOwnPropertyDescriptors(rs)):ownKeys(Object(rs)).forEach(function(is){Object.defineProperty(Fn,is,Object.getOwnPropertyDescriptor(rs,is))})}return Fn}function _classCallCheck(Fn,Mn){if(!(Fn instanceof Mn))throw new TypeError("Cannot call a class as a function")}function _defineProperties(Fn,Mn){for(var rs=0;rs<Mn.length;rs++){var is=Mn[rs];is.enumerable=is.enumerable||!1,is.configurable=!0,"value"in is&&(is.writable=!0),Object.defineProperty(Fn,is.key,is)}}function _createClass(Fn,Mn,rs){return Mn&&_defineProperties(Fn.prototype,Mn),Object.defineProperty(Fn,"prototype",{writable:!1}),Fn}function _inherits(Fn,Mn){if(typeof Mn!="function"&&Mn!==null)throw new TypeError("Super expression must either be null or a function");Fn.prototype=Object.create(Mn&&Mn.prototype,{constructor:{value:Fn,writable:!0,configurable:!0}}),Object.defineProperty(Fn,"prototype",{writable:!1}),Mn&&_setPrototypeOf(Fn,Mn)}function _setPrototypeOf(Fn,Mn){return _setPrototypeOf=Object.setPrototypeOf||function(is,os){return is.__proto__=os,is},_setPrototypeOf(Fn,Mn)}function _createSuper(Fn){var Mn=_isNativeReflectConstruct();return function(){var is=_getPrototypeOf(Fn),os;if(Mn){var as=_getPrototypeOf(this).constructor;os=Reflect.construct(is,arguments,as)}else os=is.apply(this,arguments);return _possibleConstructorReturn(this,os)}}function _possibleConstructorReturn(Fn,Mn){if(Mn&&(_typeof(Mn)==="object"||typeof Mn=="function"))return Mn;if(Mn!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(Fn)}function _assertThisInitialized(Fn){if(Fn===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Fn}function _isNativeReflectConstruct(){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 _getPrototypeOf(Fn){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(rs){return rs.__proto__||Object.getPrototypeOf(rs)},_getPrototypeOf(Fn)}function _defineProperty(Fn,Mn,rs){return Mn in Fn?Object.defineProperty(Fn,Mn,{value:rs,enumerable:!0,configurable:!0,writable:!0}):Fn[Mn]=rs,Fn}var InnerSlider=function(Fn){_inherits(rs,Fn);var Mn=_createSuper(rs);function rs(is){var os;_classCallCheck(this,rs),os=Mn.call(this,is),_defineProperty(_assertThisInitialized(os),"listRefHandler",function(us){return os.list=us}),_defineProperty(_assertThisInitialized(os),"trackRefHandler",function(us){return os.track=us}),_defineProperty(_assertThisInitialized(os),"adaptHeight",function(){if(os.props.adaptiveHeight&&os.list){var us=os.list.querySelector('[data-index="'.concat(os.state.currentSlide,'"]'));os.list.style.height=(0,_innerSliderUtils.getHeight)(us)+"px"}}),_defineProperty(_assertThisInitialized(os),"componentDidMount",function(){if(os.props.onInit&&os.props.onInit(),os.props.lazyLoad){var us=(0,_innerSliderUtils.getOnDemandLazySlides)(_objectSpread(_objectSpread({},os.props),os.state));us.length>0&&(os.setState(function(hs){return{lazyLoadedList:hs.lazyLoadedList.concat(us)}}),os.props.onLazyLoad&&os.props.onLazyLoad(us))}var ds=_objectSpread({listRef:os.list,trackRef:os.track},os.props);os.updateState(ds,!0,function(){os.adaptHeight(),os.props.autoplay&&os.autoPlay("update")}),os.props.lazyLoad==="progressive"&&(os.lazyLoadTimer=setInterval(os.progressiveLazyLoad,1e3)),os.ro=new _resizeObserverPolyfill.default(function(){os.state.animating?(os.onWindowResized(!1),os.callbackTimers.push(setTimeout(function(){return os.onWindowResized()},os.props.speed))):os.onWindowResized()}),os.ro.observe(os.list),document.querySelectorAll&&Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"),function(hs){hs.onfocus=os.props.pauseOnFocus?os.onSlideFocus:null,hs.onblur=os.props.pauseOnFocus?os.onSlideBlur:null}),window.addEventListener?window.addEventListener("resize",os.onWindowResized):window.attachEvent("onresize",os.onWindowResized)}),_defineProperty(_assertThisInitialized(os),"componentWillUnmount",function(){os.animationEndCallback&&clearTimeout(os.animationEndCallback),os.lazyLoadTimer&&clearInterval(os.lazyLoadTimer),os.callbackTimers.length&&(os.callbackTimers.forEach(function(us){return clearTimeout(us)}),os.callbackTimers=[]),window.addEventListener?window.removeEventListener("resize",os.onWindowResized):window.detachEvent("onresize",os.onWindowResized),os.autoplayTimer&&clearInterval(os.autoplayTimer),os.ro.disconnect()}),_defineProperty(_assertThisInitialized(os),"componentDidUpdate",function(us){if(os.checkImagesLoad(),os.props.onReInit&&os.props.onReInit(),os.props.lazyLoad){var ds=(0,_innerSliderUtils.getOnDemandLazySlides)(_objectSpread(_objectSpread({},os.props),os.state));ds.length>0&&(os.setState(function(io){return{lazyLoadedList:io.lazyLoadedList.concat(ds)}}),os.props.onLazyLoad&&os.props.onLazyLoad(ds))}os.adaptHeight();var hs=_objectSpread(_objectSpread({listRef:os.list,trackRef:os.track},os.props),os.state),ps=os.didPropsChange(us);ps&&os.updateState(hs,ps,function(){os.state.currentSlide>=_react.default.Children.count(os.props.children)&&os.changeSlide({message:"index",index:_react.default.Children.count(os.props.children)-os.props.slidesToShow,currentSlide:os.state.currentSlide}),os.props.autoplay?os.autoPlay("update"):os.pause("paused")})}),_defineProperty(_assertThisInitialized(os),"onWindowResized",function(us){os.debouncedResize&&os.debouncedResize.cancel(),os.debouncedResize=(0,_lodash.default)(function(){return os.resizeWindow(us)},50),os.debouncedResize()}),_defineProperty(_assertThisInitialized(os),"resizeWindow",function(){var us=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,ds=!!(os.track&&os.track.node);if(ds){var hs=_objectSpread(_objectSpread({listRef:os.list,trackRef:os.track},os.props),os.state);os.updateState(hs,us,function(){os.props.autoplay?os.autoPlay("update"):os.pause("paused")}),os.setState({animating:!1}),clearTimeout(os.animationEndCallback),delete os.animationEndCallback}}),_defineProperty(_assertThisInitialized(os),"updateState",function(us,ds,hs){var ps=(0,_innerSliderUtils.initializedState)(us);us=_objectSpread(_objectSpread(_objectSpread({},us),ps),{},{slideIndex:ps.currentSlide});var io=(0,_innerSliderUtils.getTrackLeft)(us);us=_objectSpread(_objectSpread({},us),{},{left:io});var fo=(0,_innerSliderUtils.getTrackCSS)(us);(ds||_react.default.Children.count(os.props.children)!==_react.default.Children.count(us.children))&&(ps.trackStyle=fo),os.setState(ps,hs)}),_defineProperty(_assertThisInitialized(os),"ssrInit",function(){if(os.props.variableWidth){var us=0,ds=0,hs=[],ps=(0,_innerSliderUtils.getPreClones)(_objectSpread(_objectSpread(_objectSpread({},os.props),os.state),{},{slideCount:os.props.children.length})),io=(0,_innerSliderUtils.getPostClones)(_objectSpread(_objectSpread(_objectSpread({},os.props),os.state),{},{slideCount:os.props.children.length}));os.props.children.forEach(function(Sl){hs.push(Sl.props.style.width),us+=Sl.props.style.width});for(var fo=0;fo<ps;fo++)ds+=hs[hs.length-1-fo],us+=hs[hs.length-1-fo];for(var mo=0;mo<io;mo++)us+=hs[mo];for(var Ao=0;Ao<os.state.currentSlide;Ao++)ds+=hs[Ao];var $o={width:us+"px",left:-ds+"px"};if(os.props.centerMode){var Lo="".concat(hs[os.state.currentSlide],"px");$o.left="calc(".concat($o.left," + (100% - ").concat(Lo,") / 2 ) ")}return{trackStyle:$o}}var Go=_react.default.Children.count(os.props.children),Yo=_objectSpread(_objectSpread(_objectSpread({},os.props),os.state),{},{slideCount:Go}),Wo=(0,_innerSliderUtils.getPreClones)(Yo)+(0,_innerSliderUtils.getPostClones)(Yo)+Go,Jo=100/os.props.slidesToShow*Wo,xl=100/Wo,_l=-xl*((0,_innerSliderUtils.getPreClones)(Yo)+os.state.currentSlide)*Jo/100;os.props.centerMode&&(_l+=(100-xl*Jo/100)/2);var Tl={width:Jo+"%",left:_l+"%"};return{slideWidth:xl+"%",trackStyle:Tl}}),_defineProperty(_assertThisInitialized(os),"checkImagesLoad",function(){var us=os.list&&os.list.querySelectorAll&&os.list.querySelectorAll(".slick-slide img")||[],ds=us.length,hs=0;Array.prototype.forEach.call(us,function(ps){var io=function(){return++hs&&hs>=ds&&os.onWindowResized()};if(!ps.onclick)ps.onclick=function(){return ps.parentNode.focus()};else{var fo=ps.onclick;ps.onclick=function(){fo(),ps.parentNode.focus()}}ps.onload||(os.props.lazyLoad?ps.onload=function(){os.adaptHeight(),os.callbackTimers.push(setTimeout(os.onWindowResized,os.props.speed))}:(ps.onload=io,ps.onerror=function(){io(),os.props.onLazyLoadError&&os.props.onLazyLoadError()}))})}),_defineProperty(_assertThisInitialized(os),"progressiveLazyLoad",function(){for(var us=[],ds=_objectSpread(_objectSpread({},os.props),os.state),hs=os.state.currentSlide;hs<os.state.slideCount+(0,_innerSliderUtils.getPostClones)(ds);hs++)if(os.state.lazyLoadedList.indexOf(hs)<0){us.push(hs);break}for(var ps=os.state.currentSlide-1;ps>=-(0,_innerSliderUtils.getPreClones)(ds);ps--)if(os.state.lazyLoadedList.indexOf(ps)<0){us.push(ps);break}us.length>0?(os.setState(function(io){return{lazyLoadedList:io.lazyLoadedList.concat(us)}}),os.props.onLazyLoad&&os.props.onLazyLoad(us)):os.lazyLoadTimer&&(clearInterval(os.lazyLoadTimer),delete os.lazyLoadTimer)}),_defineProperty(_assertThisInitialized(os),"slideHandler",function(us){var ds=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,hs=os.props,ps=hs.asNavFor,io=hs.beforeChange,fo=hs.onLazyLoad,mo=hs.speed,Ao=hs.afterChange,$o=os.state.currentSlide,Lo=(0,_innerSliderUtils.slideHandler)(_objectSpread(_objectSpread(_objectSpread({index:us},os.props),os.state),{},{trackRef:os.track,useCSS:os.props.useCSS&&!ds})),Go=Lo.state,Yo=Lo.nextState;if(Go){io&&io($o,Go.currentSlide);var Wo=Go.lazyLoadedList.filter(function(Jo){return os.state.lazyLoadedList.indexOf(Jo)<0});fo&&Wo.length>0&&fo(Wo),!os.props.waitForAnimate&&os.animationEndCallback&&(clearTimeout(os.animationEndCallback),Ao&&Ao($o),delete os.animationEndCallback),os.setState(Go,function(){ps&&os.asNavForIndex!==us&&(os.asNavForIndex=us,ps.innerSlider.slideHandler(us)),Yo&&(os.animationEndCallback=setTimeout(function(){var Jo=Yo.animating,xl=_objectWithoutProperties(Yo,["animating"]);os.setState(xl,function(){os.callbackTimers.push(setTimeout(function(){return os.setState({animating:Jo})},10)),Ao&&Ao(Go.currentSlide),delete os.animationEndCallback})},mo))})}}),_defineProperty(_assertThisInitialized(os),"changeSlide",function(us){var ds=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,hs=_objectSpread(_objectSpread({},os.props),os.state),ps=(0,_innerSliderUtils.changeSlide)(hs,us);if(!(ps!==0&&!ps)&&(ds===!0?os.slideHandler(ps,ds):os.slideHandler(ps),os.props.autoplay&&os.autoPlay("update"),os.props.focusOnSelect)){var io=os.list.querySelectorAll(".slick-current");io[0]&&io[0].focus()}}),_defineProperty(_assertThisInitialized(os),"clickHandler",function(us){os.clickable===!1&&(us.stopPropagation(),us.preventDefault()),os.clickable=!0}),_defineProperty(_assertThisInitialized(os),"keyHandler",function(us){var ds=(0,_innerSliderUtils.keyHandler)(us,os.props.accessibility,os.props.rtl);ds!==""&&os.changeSlide({message:ds})}),_defineProperty(_assertThisInitialized(os),"selectHandler",function(us){os.changeSlide(us)}),_defineProperty(_assertThisInitialized(os),"disableBodyScroll",function(){var us=function(hs){hs=hs||window.event,hs.preventDefault&&hs.preventDefault(),hs.returnValue=!1};window.ontouchmove=us}),_defineProperty(_assertThisInitialized(os),"enableBodyScroll",function(){window.ontouchmove=null}),_defineProperty(_assertThisInitialized(os),"swipeStart",function(us){os.props.verticalSwiping&&os.disableBodyScroll();var ds=(0,_innerSliderUtils.swipeStart)(us,os.props.swipe,os.props.draggable);ds!==""&&os.setState(ds)}),_defineProperty(_assertThisInitialized(os),"swipeMove",function(us){var ds=(0,_innerSliderUtils.swipeMove)(us,_objectSpread(_objectSpread(_objectSpread({},os.props),os.state),{},{trackRef:os.track,listRef:os.list,slideIndex:os.state.currentSlide}));ds&&(ds.swiping&&(os.clickable=!1),os.setState(ds))}),_defineProperty(_assertThisInitialized(os),"swipeEnd",function(us){var ds=(0,_innerSliderUtils.swipeEnd)(us,_objectSpread(_objectSpread(_objectSpread({},os.props),os.state),{},{trackRef:os.track,listRef:os.list,slideIndex:os.state.currentSlide}));if(ds){var hs=ds.triggerSlideHandler;delete ds.triggerSlideHandler,os.setState(ds),hs!==void 0&&(os.slideHandler(hs),os.props.verticalSwiping&&os.enableBodyScroll())}}),_defineProperty(_assertThisInitialized(os),"touchEnd",function(us){os.swipeEnd(us),os.clickable=!0}),_defineProperty(_assertThisInitialized(os),"slickPrev",function(){os.callbackTimers.push(setTimeout(function(){return os.changeSlide({message:"previous"})},0))}),_defineProperty(_assertThisInitialized(os),"slickNext",function(){os.callbackTimers.push(setTimeout(function(){return os.changeSlide({message:"next"})},0))}),_defineProperty(_assertThisInitialized(os),"slickGoTo",function(us){var ds=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(us=Number(us),isNaN(us))return"";os.callbackTimers.push(setTimeout(function(){return os.changeSlide({message:"index",index:us,currentSlide:os.state.currentSlide},ds)},0))}),_defineProperty(_assertThisInitialized(os),"play",function(){var us;if(os.props.rtl)us=os.state.currentSlide-os.props.slidesToScroll;else if((0,_innerSliderUtils.canGoNext)(_objectSpread(_objectSpread({},os.props),os.state)))us=os.state.currentSlide+os.props.slidesToScroll;else return!1;os.slideHandler(us)}),_defineProperty(_assertThisInitialized(os),"autoPlay",function(us){os.autoplayTimer&&clearInterval(os.autoplayTimer);var ds=os.state.autoplaying;if(us==="update"){if(ds==="hovered"||ds==="focused"||ds==="paused")return}else if(us==="leave"){if(ds==="paused"||ds==="focused")return}else if(us==="blur"&&(ds==="paused"||ds==="hovered"))return;os.autoplayTimer=setInterval(os.play,os.props.autoplaySpeed+50),os.setState({autoplaying:"playing"})}),_defineProperty(_assertThisInitialized(os),"pause",function(us){os.autoplayTimer&&(clearInterval(os.autoplayTimer),os.autoplayTimer=null);var ds=os.state.autoplaying;us==="paused"?os.setState({autoplaying:"paused"}):us==="focused"?(ds==="hovered"||ds==="playing")&&os.setState({autoplaying:"focused"}):ds==="playing"&&os.setState({autoplaying:"hovered"})}),_defineProperty(_assertThisInitialized(os),"onDotsOver",function(){return os.props.autoplay&&os.pause("hovered")}),_defineProperty(_assertThisInitialized(os),"onDotsLeave",function(){return os.props.autoplay&&os.state.autoplaying==="hovered"&&os.autoPlay("leave")}),_defineProperty(_assertThisInitialized(os),"onTrackOver",function(){return os.props.autoplay&&os.pause("hovered")}),_defineProperty(_assertThisInitialized(os),"onTrackLeave",function(){return os.props.autoplay&&os.state.autoplaying==="hovered"&&os.autoPlay("leave")}),_defineProperty(_assertThisInitialized(os),"onSlideFocus",function(){return os.props.autoplay&&os.pause("focused")}),_defineProperty(_assertThisInitialized(os),"onSlideBlur",function(){return os.props.autoplay&&os.state.autoplaying==="focused"&&os.autoPlay("blur")}),_defineProperty(_assertThisInitialized(os),"render",function(){var us=(0,_classnames.default)("slick-slider",os.props.className,{"slick-vertical":os.props.vertical,"slick-initialized":!0}),ds=_objectSpread(_objectSpread({},os.props),os.state),hs=(0,_innerSliderUtils.extractObject)(ds,["fade","cssEase","speed","infinite","centerMode","focusOnSelect","currentSlide","lazyLoad","lazyLoadedList","rtl","slideWidth","slideHeight","listHeight","vertical","slidesToShow","slidesToScroll","slideCount","trackStyle","variableWidth","unslick","centerPadding","targetSlide","useCSS"]),ps=os.props.pauseOnHover;hs=_objectSpread(_objectSpread({},hs),{},{onMouseEnter:ps?os.onTrackOver:null,onMouseLeave:ps?os.onTrackLeave:null,onMouseOver:ps?os.onTrackOver:null,focusOnSelect:os.props.focusOnSelect&&os.clickable?os.selectHandler:null});var io;if(os.props.dots===!0&&os.state.slideCount>=os.props.slidesToShow){var fo=(0,_innerSliderUtils.extractObject)(ds,["dotsClass","slideCount","slidesToShow","currentSlide","slidesToScroll","clickHandler","children","customPaging","infinite","appendDots"]),mo=os.props.pauseOnDotsHover;fo=_objectSpread(_objectSpread({},fo),{},{clickHandler:os.changeSlide,onMouseEnter:mo?os.onDotsLeave:null,onMouseOver:mo?os.onDotsOver:null,onMouseLeave:mo?os.onDotsLeave:null}),io=_react.default.createElement(_dots.Dots,fo)}var Ao,$o,Lo=(0,_innerSliderUtils.extractObject)(ds,["infinite","centerMode","currentSlide","slideCount","slidesToShow","prevArrow","nextArrow"]);Lo.clickHandler=os.changeSlide,os.props.arrows&&(Ao=_react.default.createElement(_arrows.PrevArrow,Lo),$o=_react.default.createElement(_arrows.NextArrow,Lo));var Go=null;os.props.vertical&&(Go={height:os.state.listHeight});var Yo=null;os.props.vertical===!1?os.props.centerMode===!0&&(Yo={padding:"0px "+os.props.centerPadding}):os.props.centerMode===!0&&(Yo={padding:os.props.centerPadding+" 0px"});var Wo=_objectSpread(_objectSpread({},Go),Yo),Jo=os.props.touchMove,xl={className:"slick-list",style:Wo,onClick:os.clickHandler,onMouseDown:Jo?os.swipeStart:null,onMouseMove:os.state.dragging&&Jo?os.swipeMove:null,onMouseUp:Jo?os.swipeEnd:null,onMouseLeave:os.state.dragging&&Jo?os.swipeEnd:null,onTouchStart:Jo?os.swipeStart:null,onTouchMove:os.state.dragging&&Jo?os.swipeMove:null,onTouchEnd:Jo?os.touchEnd:null,onTouchCancel:os.state.dragging&&Jo?os.swipeEnd:null,onKeyDown:os.props.accessibility?os.keyHandler:null},_l={className:us,dir:"ltr",style:os.props.style};return os.props.unslick&&(xl={className:"slick-list"},_l={className:us}),_react.default.createElement("div",_l,os.props.unslick?"":Ao,_react.default.createElement("div",_extends({ref:os.listRefHandler},xl),_react.default.createElement(_track.Track,_extends({ref:os.trackRefHandler},hs),os.props.children)),os.props.unslick?"":$o,os.props.unslick?"":io)}),os.list=null,os.track=null,os.state=_objectSpread(_objectSpread({},_initialState.default),{},{currentSlide:os.props.initialSlide,slideCount:_react.default.Children.count(os.props.children)}),os.callbackTimers=[],os.clickable=!0,os.debouncedResize=null;var as=os.ssrInit();return os.state=_objectSpread(_objectSpread({},os.state),as),os}return _createClass(rs,[{key:"didPropsChange",value:function(os){for(var as=!1,us=0,ds=Object.keys(this.props);us<ds.length;us++){var hs=ds[us];if(!os.hasOwnProperty(hs)){as=!0;break}if(!(_typeof(os[hs])==="object"||typeof os[hs]=="function")&&os[hs]!==this.props[hs]){as=!0;break}}return as||_react.default.Children.count(this.props.children)!==_react.default.Children.count(os.children)}}]),rs}(_react.default.Component);innerSlider.InnerSlider=InnerSlider;var defaultProps$1={};(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.default=void 0;var Mn=rs(reactExports);function rs(as){return as&&as.__esModule?as:{default:as}}var is={accessibility:!0,adaptiveHeight:!1,afterChange:null,appendDots:function(us){return Mn.default.createElement("ul",{style:{display:"block"}},us)},arrows:!0,autoplay:!1,autoplaySpeed:3e3,beforeChange:null,centerMode:!1,centerPadding:"50px",className:"",cssEase:"ease",customPaging:function(us){return Mn.default.createElement("button",null,us+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:null,nextArrow:null,onEdge:null,onInit:null,onLazyLoadError:null,onReInit:null,pauseOnDotsHover:!1,pauseOnFocus:!1,pauseOnHover:!0,prevArrow:null,responsive:null,rows:1,rtl:!1,slide:"div",slidesPerRow:1,slidesToScroll:1,slidesToShow:1,speed:500,swipe:!0,swipeEvent:null,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,waitForAnimate:!0},os=is;Fn.default=os})(defaultProps$1);var QueryHandler_1,hasRequiredQueryHandler;function requireQueryHandler(){if(hasRequiredQueryHandler)return QueryHandler_1;hasRequiredQueryHandler=1;function Fn(Mn){this.options=Mn,!Mn.deferSetup&&this.setup()}return Fn.prototype={constructor:Fn,setup:function(){this.options.setup&&this.options.setup(),this.initialised=!0},on:function(){!this.initialised&&this.setup(),this.options.match&&this.options.match()},off:function(){this.options.unmatch&&this.options.unmatch()},destroy:function(){this.options.destroy?this.options.destroy():this.off()},equals:function(Mn){return this.options===Mn||this.options.match===Mn}},QueryHandler_1=Fn,QueryHandler_1}var Util,hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return Util;hasRequiredUtil=1;function Fn(is,os){var as=0,us=is.length,ds;for(as;as<us&&(ds=os(is[as],as),ds!==!1);as++);}function Mn(is){return Object.prototype.toString.apply(is)==="[object Array]"}function rs(is){return typeof is=="function"}return Util={isFunction:rs,isArray:Mn,each:Fn},Util}var MediaQuery_1,hasRequiredMediaQuery;function requireMediaQuery(){if(hasRequiredMediaQuery)return MediaQuery_1;hasRequiredMediaQuery=1;var Fn=requireQueryHandler(),Mn=requireUtil().each;function rs(is,os){this.query=is,this.isUnconditional=os,this.handlers=[],this.mql=window.matchMedia(is);var as=this;this.listener=function(us){as.mql=us.currentTarget||us,as.assess()},this.mql.addListener(this.listener)}return rs.prototype={constuctor:rs,addHandler:function(is){var os=new Fn(is);this.handlers.push(os),this.matches()&&os.on()},removeHandler:function(is){var os=this.handlers;Mn(os,function(as,us){if(as.equals(is))return as.destroy(),!os.splice(us,1)})},matches:function(){return this.mql.matches||this.isUnconditional},clear:function(){Mn(this.handlers,function(is){is.destroy()}),this.mql.removeListener(this.listener),this.handlers.length=0},assess:function(){var is=this.matches()?"on":"off";Mn(this.handlers,function(os){os[is]()})}},MediaQuery_1=rs,MediaQuery_1}var MediaQueryDispatch_1,hasRequiredMediaQueryDispatch;function requireMediaQueryDispatch(){if(hasRequiredMediaQueryDispatch)return MediaQueryDispatch_1;hasRequiredMediaQueryDispatch=1;var Fn=requireMediaQuery(),Mn=requireUtil(),rs=Mn.each,is=Mn.isFunction,os=Mn.isArray;function as(){if(!window.matchMedia)throw new Error("matchMedia not present, legacy browsers require a polyfill");this.queries={},this.browserIsIncapable=!window.matchMedia("only all").matches}return as.prototype={constructor:as,register:function(us,ds,hs){var ps=this.queries,io=hs&&this.browserIsIncapable;return ps[us]||(ps[us]=new Fn(us,io)),is(ds)&&(ds={match:ds}),os(ds)||(ds=[ds]),rs(ds,function(fo){is(fo)&&(fo={match:fo}),ps[us].addHandler(fo)}),this},unregister:function(us,ds){var hs=this.queries[us];return hs&&(ds?hs.removeHandler(ds):(hs.clear(),delete this.queries[us])),this}},MediaQueryDispatch_1=as,MediaQueryDispatch_1}var src,hasRequiredSrc;function requireSrc(){if(hasRequiredSrc)return src;hasRequiredSrc=1;var Fn=requireMediaQueryDispatch();return src=new Fn,src}(function(Fn){function Mn($l){"@babel/helpers - typeof";return Mn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pl){return typeof Pl}:function(Pl){return Pl&&typeof Symbol=="function"&&Pl.constructor===Symbol&&Pl!==Symbol.prototype?"symbol":typeof Pl},Mn($l)}Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.default=void 0;var rs=ds(reactExports),is=innerSlider,os=ds(json2mq_1),as=ds(defaultProps$1),us=innerSliderUtils;function ds($l){return $l&&$l.__esModule?$l:{default:$l}}function hs(){return hs=Object.assign||function($l){for(var Pl=1;Pl<arguments.length;Pl++){var Dl=arguments[Pl];for(var Ol in Dl)Object.prototype.hasOwnProperty.call(Dl,Ol)&&($l[Ol]=Dl[Ol])}return $l},hs.apply(this,arguments)}function ps($l,Pl){var Dl=Object.keys($l);if(Object.getOwnPropertySymbols){var Ol=Object.getOwnPropertySymbols($l);Pl&&(Ol=Ol.filter(function(Rl){return Object.getOwnPropertyDescriptor($l,Rl).enumerable})),Dl.push.apply(Dl,Ol)}return Dl}function io($l){for(var Pl=1;Pl<arguments.length;Pl++){var Dl=arguments[Pl]!=null?arguments[Pl]:{};Pl%2?ps(Object(Dl),!0).forEach(function(Ol){_l($l,Ol,Dl[Ol])}):Object.getOwnPropertyDescriptors?Object.defineProperties($l,Object.getOwnPropertyDescriptors(Dl)):ps(Object(Dl)).forEach(function(Ol){Object.defineProperty($l,Ol,Object.getOwnPropertyDescriptor(Dl,Ol))})}return $l}function fo($l,Pl){if(!($l instanceof Pl))throw new TypeError("Cannot call a class as a function")}function mo($l,Pl){for(var Dl=0;Dl<Pl.length;Dl++){var Ol=Pl[Dl];Ol.enumerable=Ol.enumerable||!1,Ol.configurable=!0,"value"in Ol&&(Ol.writable=!0),Object.defineProperty($l,Ol.key,Ol)}}function Ao($l,Pl,Dl){return Pl&&mo($l.prototype,Pl),Object.defineProperty($l,"prototype",{writable:!1}),$l}function $o($l,Pl){if(typeof Pl!="function"&&Pl!==null)throw new TypeError("Super expression must either be null or a function");$l.prototype=Object.create(Pl&&Pl.prototype,{constructor:{value:$l,writable:!0,configurable:!0}}),Object.defineProperty($l,"prototype",{writable:!1}),Pl&&Lo($l,Pl)}function Lo($l,Pl){return Lo=Object.setPrototypeOf||function(Ol,Rl){return Ol.__proto__=Rl,Ol},Lo($l,Pl)}function Go($l){var Pl=Jo();return function(){var Ol=xl($l),Rl;if(Pl){var Vo=xl(this).constructor;Rl=Reflect.construct(Ol,arguments,Vo)}else Rl=Ol.apply(this,arguments);return Yo(this,Rl)}}function Yo($l,Pl){if(Pl&&(Mn(Pl)==="object"||typeof Pl=="function"))return Pl;if(Pl!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wo($l)}function Wo($l){if($l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $l}function Jo(){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 xl($l){return xl=Object.setPrototypeOf?Object.getPrototypeOf:function(Dl){return Dl.__proto__||Object.getPrototypeOf(Dl)},xl($l)}function _l($l,Pl,Dl){return Pl in $l?Object.defineProperty($l,Pl,{value:Dl,enumerable:!0,configurable:!0,writable:!0}):$l[Pl]=Dl,$l}var Tl=(0,us.canUseDOM)()&&requireSrc(),Sl=function($l){$o(Dl,$l);var Pl=Go(Dl);function Dl(Ol){var Rl;return fo(this,Dl),Rl=Pl.call(this,Ol),_l(Wo(Rl),"innerSliderRefHandler",function(Vo){return Rl.innerSlider=Vo}),_l(Wo(Rl),"slickPrev",function(){return Rl.innerSlider.slickPrev()}),_l(Wo(Rl),"slickNext",function(){return Rl.innerSlider.slickNext()}),_l(Wo(Rl),"slickGoTo",function(Vo){var jo=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Rl.innerSlider.slickGoTo(Vo,jo)}),_l(Wo(Rl),"slickPause",function(){return Rl.innerSlider.pause("paused")}),_l(Wo(Rl),"slickPlay",function(){return Rl.innerSlider.autoPlay("play")}),Rl.state={breakpoint:null},Rl._responsiveMediaHandlers=[],Rl}return Ao(Dl,[{key:"media",value:function(Rl,Vo){Tl.register(Rl,Vo),this._responsiveMediaHandlers.push({query:Rl,handler:Vo})}},{key:"componentDidMount",value:function(){var Rl=this;if(this.props.responsive){var Vo=this.props.responsive.map(function(Ho){return Ho.breakpoint});Vo.sort(function(Ho,Qo){return Ho-Qo}),Vo.forEach(function(Ho,Qo){var El;Qo===0?El=(0,os.default)({minWidth:0,maxWidth:Ho}):El=(0,os.default)({minWidth:Vo[Qo-1]+1,maxWidth:Ho}),(0,us.canUseDOM)()&&Rl.media(El,function(){Rl.setState({breakpoint:Ho})})});var jo=(0,os.default)({minWidth:Vo.slice(-1)[0]});(0,us.canUseDOM)()&&this.media(jo,function(){Rl.setState({breakpoint:null})})}}},{key:"componentWillUnmount",value:function(){this._responsiveMediaHandlers.forEach(function(Rl){Tl.unregister(Rl.query,Rl.handler)})}},{key:"render",value:function(){var Rl=this,Vo,jo;this.state.breakpoint?(jo=this.props.responsive.filter(function(Gl){return Gl.breakpoint===Rl.state.breakpoint}),Vo=jo[0].settings==="unslick"?"unslick":io(io(io({},as.default),this.props),jo[0].settings)):Vo=io(io({},as.default),this.props),Vo.centerMode&&(Vo.slidesToScroll>1,Vo.slidesToScroll=1),Vo.fade&&(Vo.slidesToShow>1,Vo.slidesToScroll>1,Vo.slidesToShow=1,Vo.slidesToScroll=1);var Ho=rs.default.Children.toArray(this.props.children);Ho=Ho.filter(function(Gl){return typeof Gl=="string"?!!Gl.trim():!!Gl}),Vo.variableWidth&&(Vo.rows>1||Vo.slidesPerRow>1)&&(console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1"),Vo.variableWidth=!1);for(var Qo=[],El=null,Xo=0;Xo<Ho.length;Xo+=Vo.rows*Vo.slidesPerRow){for(var Al=[],wl=Xo;wl<Xo+Vo.rows*Vo.slidesPerRow;wl+=Vo.slidesPerRow){for(var yl=[],Il=wl;Il<wl+Vo.slidesPerRow&&(Vo.variableWidth&&Ho[Il].props.style&&(El=Ho[Il].props.style.width),!(Il>=Ho.length));Il+=1)yl.push(rs.default.cloneElement(Ho[Il],{key:100*Xo+10*wl+Il,tabIndex:-1,style:{width:"".concat(100/Vo.slidesPerRow,"%"),display:"inline-block"}}));Al.push(rs.default.createElement("div",{key:10*Xo+wl},yl))}Vo.variableWidth?Qo.push(rs.default.createElement("div",{key:Xo,style:{width:El}},Al)):Qo.push(rs.default.createElement("div",{key:Xo},Al))}if(Vo==="unslick"){var Bl="regular slider "+(this.props.className||"");return rs.default.createElement("div",{className:Bl},Ho)}else Qo.length<=Vo.slidesToShow&&(Vo.unslick=!0);return rs.default.createElement(is.InnerSlider,hs({style:this.props.style,ref:this.innerSliderRefHandler},Vo),Qo)}}]),Dl}(rs.default.Component);Fn.default=Sl})(slider);(function(Fn){Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.default=void 0;var Mn=rs(slider);function rs(os){return os&&os.__esModule?os:{default:os}}var is=Mn.default;Fn.default=is})(lib$1);const Slider=getDefaultExportFromCjs(lib$1),ChevronLeft="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='M15%2018L9%2012L15%206'%20stroke='%23107569'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ChevronRight="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='M9%2018L15%2012L9%206'%20stroke='%23107569'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ChevronLeftDark="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='M15%2018L9%2012L15%206'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",ChevronRightDark="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='M9%2018L15%2012L9%206'%20stroke='%232ED3B7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";var loadScript=function Fn(Mn,rs,is){var os=document.head||document.getElementsByTagName("head")[0],as=document.createElement("script");typeof rs=="function"&&(is=rs,rs={}),rs=rs||{},is=is||function(){},as.type=rs.type||"text/javascript",as.charset=rs.charset||"utf8",as.async="async"in rs?!!rs.async:!0,as.src=Mn,rs.attrs&&setAttributes(as,rs.attrs),rs.text&&(as.text=""+rs.text);var us="onload"in as?stdOnEnd:ieOnEnd;us(as,is),as.onload||stdOnEnd(as,is),os.appendChild(as)};function setAttributes(Fn,Mn){for(var rs in Mn)Fn.setAttribute(rs,Mn[rs])}function stdOnEnd(Fn,Mn){Fn.onload=function(){this.onerror=this.onload=null,Mn(null,Fn)},Fn.onerror=function(){this.onerror=this.onload=null,Mn(new Error("Failed to load "+this.src),Fn)}}function ieOnEnd(Fn,Mn){Fn.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,Mn(null,Fn))}}var isMergeableObject=function Fn(Mn){return isNonNullObject(Mn)&&!isSpecial(Mn)};function isNonNullObject(Fn){return!!Fn&&typeof Fn=="object"}function isSpecial(Fn){var Mn=Object.prototype.toString.call(Fn);return Mn==="[object RegExp]"||Mn==="[object Date]"||isReactElement(Fn)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(Fn){return Fn.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(Fn){return Array.isArray(Fn)?[]:{}}function cloneUnlessOtherwiseSpecified(Fn,Mn){return Mn.clone!==!1&&Mn.isMergeableObject(Fn)?deepmerge(emptyTarget(Fn),Fn,Mn):Fn}function defaultArrayMerge(Fn,Mn,rs){return Fn.concat(Mn).map(function(is){return cloneUnlessOtherwiseSpecified(is,rs)})}function getMergeFunction(Fn,Mn){if(!Mn.customMerge)return deepmerge;var rs=Mn.customMerge(Fn);return typeof rs=="function"?rs:deepmerge}function getEnumerableOwnPropertySymbols(Fn){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(Fn).filter(function(Mn){return Object.propertyIsEnumerable.call(Fn,Mn)}):[]}function getKeys(Fn){return Object.keys(Fn).concat(getEnumerableOwnPropertySymbols(Fn))}function propertyIsOnObject(Fn,Mn){try{return Mn in Fn}catch{return!1}}function propertyIsUnsafe(Fn,Mn){return propertyIsOnObject(Fn,Mn)&&!(Object.hasOwnProperty.call(Fn,Mn)&&Object.propertyIsEnumerable.call(Fn,Mn))}function mergeObject(Fn,Mn,rs){var is={};return rs.isMergeableObject(Fn)&&getKeys(Fn).forEach(function(os){is[os]=cloneUnlessOtherwiseSpecified(Fn[os],rs)}),getKeys(Mn).forEach(function(os){propertyIsUnsafe(Fn,os)||(propertyIsOnObject(Fn,os)&&rs.isMergeableObject(Mn[os])?is[os]=getMergeFunction(os,rs)(Fn[os],Mn[os],rs):is[os]=cloneUnlessOtherwiseSpecified(Mn[os],rs))}),is}function deepmerge(Fn,Mn,rs){rs=rs||{},rs.arrayMerge=rs.arrayMerge||defaultArrayMerge,rs.isMergeableObject=rs.isMergeableObject||isMergeableObject,rs.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var is=Array.isArray(Mn),os=Array.isArray(Fn),as=is===os;return as?is?rs.arrayMerge(Fn,Mn,rs):mergeObject(Fn,Mn,rs):cloneUnlessOtherwiseSpecified(Mn,rs)}deepmerge.all=function Fn(Mn,rs){if(!Array.isArray(Mn))throw new Error("first argument should be an array");return Mn.reduce(function(is,os){return deepmerge(is,os,rs)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1,__create$4=Object.create,__defProp$6=Object.defineProperty,__getOwnPropDesc$6=Object.getOwnPropertyDescriptor,__getOwnPropNames$6=Object.getOwnPropertyNames,__getProtoOf$4=Object.getPrototypeOf,__hasOwnProp$6=Object.prototype.hasOwnProperty,__export$6=(Fn,Mn)=>{for(var rs in Mn)__defProp$6(Fn,rs,{get:Mn[rs],enumerable:!0})},__copyProps$6=(Fn,Mn,rs,is)=>{if(Mn&&typeof Mn=="object"||typeof Mn=="function")for(let os of __getOwnPropNames$6(Mn))!__hasOwnProp$6.call(Fn,os)&&os!==rs&&__defProp$6(Fn,os,{get:()=>Mn[os],enumerable:!(is=__getOwnPropDesc$6(Mn,os))||is.enumerable});return Fn},__toESM$4=(Fn,Mn,rs)=>(rs=Fn!=null?__create$4(__getProtoOf$4(Fn)):{},__copyProps$6(!Fn||!Fn.__esModule?__defProp$6(rs,"default",{value:Fn,enumerable:!0}):rs,Fn)),__toCommonJS$6=Fn=>__copyProps$6(__defProp$6({},"__esModule",{value:!0}),Fn),utils_exports={};__export$6(utils_exports,{callPlayer:()=>callPlayer,getConfig:()=>getConfig,getSDK:()=>getSDK,isBlobUrl:()=>isBlobUrl,isMediaStream:()=>isMediaStream,lazy:()=>lazy,omit:()=>omit,parseEndTime:()=>parseEndTime,parseStartTime:()=>parseStartTime,queryString:()=>queryString,randomString:()=>randomString,supportsWebKitPresentationMode:()=>supportsWebKitPresentationMode});var utils=__toCommonJS$6(utils_exports),import_react$2=__toESM$4(reactExports),import_load_script=__toESM$4(loadScript),import_deepmerge$1=__toESM$4(cjs);const lazy=Fn=>import_react$2.default.lazy(async()=>{const Mn=await Fn();return typeof Mn.default=="function"?Mn:Mn.default}),MATCH_START_QUERY=/[?&#](?:start|t)=([0-9hms]+)/,MATCH_END_QUERY=/[?&#]end=([0-9hms]+)/,MATCH_START_STAMP=/(\d+)(h|m|s)/g,MATCH_NUMERIC=/^\d+$/;function parseTimeParam(Fn,Mn){if(Fn instanceof Array)return;const rs=Fn.match(Mn);if(rs){const is=rs[1];if(is.match(MATCH_START_STAMP))return parseTimeString(is);if(MATCH_NUMERIC.test(is))return parseInt(is)}}function parseTimeString(Fn){let Mn=0,rs=MATCH_START_STAMP.exec(Fn);for(;rs!==null;){const[,is,os]=rs;os==="h"&&(Mn+=parseInt(is,10)*60*60),os==="m"&&(Mn+=parseInt(is,10)*60),os==="s"&&(Mn+=parseInt(is,10)),rs=MATCH_START_STAMP.exec(Fn)}return Mn}function parseStartTime(Fn){return parseTimeParam(Fn,MATCH_START_QUERY)}function parseEndTime(Fn){return parseTimeParam(Fn,MATCH_END_QUERY)}function randomString(){return Math.random().toString(36).substr(2,5)}function queryString(Fn){return Object.keys(Fn).map(Mn=>`${Mn}=${Fn[Mn]}`).join("&")}function getGlobal(Fn){return window[Fn]?window[Fn]:window.exports&&window.exports[Fn]?window.exports[Fn]:window.module&&window.module.exports&&window.module.exports[Fn]?window.module.exports[Fn]:null}const requests={},getSDK=function Fn(Mn,rs,is=null,os=()=>!0,as=import_load_script.default){const us=getGlobal(rs);return us&&os(us)?Promise.resolve(us):new Promise((ds,hs)=>{if(requests[Mn]){requests[Mn].push({resolve:ds,reject:hs});return}requests[Mn]=[{resolve:ds,reject:hs}];const ps=io=>{requests[Mn].forEach(fo=>fo.resolve(io))};if(is){const io=window[is];window[is]=function(){io&&io(),ps(getGlobal(rs))}}as(Mn,io=>{io?(requests[Mn].forEach(fo=>fo.reject(io)),requests[Mn]=null):is||ps(getGlobal(rs))})})};function getConfig(Fn,Mn){return(0,import_deepmerge$1.default)(Mn.config,Fn.config)}function omit(Fn,...Mn){const rs=[].concat(...Mn),is={},os=Object.keys(Fn);for(const as of os)rs.indexOf(as)===-1&&(is[as]=Fn[as]);return is}function callPlayer(Fn,...Mn){if(!this.player||!this.player[Fn]){let rs=`ReactPlayer: ${this.constructor.displayName} player could not call %c${Fn}%c – `;return this.player?this.player[Fn]||(rs+="The method was not available"):rs+="The player was not available",console.warn(rs,"font-weight: bold",""),null}return this.player[Fn](...Mn)}function isMediaStream(Fn){return typeof window<"u"&&typeof window.MediaStream<"u"&&Fn instanceof window.MediaStream}function isBlobUrl(Fn){return/^blob:/.test(Fn)}function supportsWebKitPresentationMode(Fn=document.createElement("video")){const Mn=/iPhone|iPod/.test(navigator.userAgent)===!1;return Fn.webkitSupportsPresentationMode&&typeof Fn.webkitSetPresentationMode=="function"&&Mn}function enableStubOn(Fn){return Fn}var __defProp$5=Object.defineProperty,__getOwnPropDesc$5=Object.getOwnPropertyDescriptor,__getOwnPropNames$5=Object.getOwnPropertyNames,__hasOwnProp$5=Object.prototype.hasOwnProperty,__export$5=(Fn,Mn)=>{for(var rs in Mn)__defProp$5(Fn,rs,{get:Mn[rs],enumerable:!0})},__copyProps$5=(Fn,Mn,rs,is)=>{if(Mn&&typeof Mn=="object"||typeof Mn=="function")for(let os of __getOwnPropNames$5(Mn))!__hasOwnProp$5.call(Fn,os)&&os!==rs&&__defProp$5(Fn,os,{get:()=>Mn[os],enumerable:!(is=__getOwnPropDesc$5(Mn,os))||is.enumerable});return Fn},__toCommonJS$5=Fn=>__copyProps$5(__defProp$5({},"__esModule",{value:!0}),Fn),patterns_exports={};__export$5(patterns_exports,{AUDIO_EXTENSIONS:()=>AUDIO_EXTENSIONS,DASH_EXTENSIONS:()=>DASH_EXTENSIONS,FLV_EXTENSIONS:()=>FLV_EXTENSIONS,HLS_EXTENSIONS:()=>HLS_EXTENSIONS,MATCH_URL_DAILYMOTION:()=>MATCH_URL_DAILYMOTION,MATCH_URL_FACEBOOK:()=>MATCH_URL_FACEBOOK,MATCH_URL_FACEBOOK_WATCH:()=>MATCH_URL_FACEBOOK_WATCH,MATCH_URL_KALTURA:()=>MATCH_URL_KALTURA,MATCH_URL_MIXCLOUD:()=>MATCH_URL_MIXCLOUD,MATCH_URL_MUX:()=>MATCH_URL_MUX,MATCH_URL_SOUNDCLOUD:()=>MATCH_URL_SOUNDCLOUD,MATCH_URL_STREAMABLE:()=>MATCH_URL_STREAMABLE,MATCH_URL_TWITCH_CHANNEL:()=>MATCH_URL_TWITCH_CHANNEL,MATCH_URL_TWITCH_VIDEO:()=>MATCH_URL_TWITCH_VIDEO,MATCH_URL_VIDYARD:()=>MATCH_URL_VIDYARD,MATCH_URL_VIMEO:()=>MATCH_URL_VIMEO,MATCH_URL_WISTIA:()=>MATCH_URL_WISTIA,MATCH_URL_YOUTUBE:()=>MATCH_URL_YOUTUBE,VIDEO_EXTENSIONS:()=>VIDEO_EXTENSIONS,canPlay:()=>canPlay});var patterns=__toCommonJS$5(patterns_exports),import_utils$3=utils;const MATCH_URL_YOUTUBE=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,MATCH_URL_SOUNDCLOUD=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,MATCH_URL_VIMEO=/vimeo\.com\/(?!progressive_redirect).+/,MATCH_URL_MUX=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,MATCH_URL_FACEBOOK=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,MATCH_URL_FACEBOOK_WATCH=/^https?:\/\/fb\.watch\/.+$/,MATCH_URL_STREAMABLE=/streamable\.com\/([a-z0-9]+)$/,MATCH_URL_WISTIA=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,MATCH_URL_TWITCH_VIDEO=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,MATCH_URL_TWITCH_CHANNEL=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,MATCH_URL_DAILYMOTION=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,MATCH_URL_MIXCLOUD=/mixcloud\.com\/([^/]+\/[^/]+)/,MATCH_URL_VIDYARD=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,MATCH_URL_KALTURA=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,AUDIO_EXTENSIONS=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,VIDEO_EXTENSIONS=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,HLS_EXTENSIONS=/\.(m3u8)($|\?)/i,DASH_EXTENSIONS=/\.(mpd)($|\?)/i,FLV_EXTENSIONS=/\.(flv)($|\?)/i,canPlayFile=Fn=>{if(Fn instanceof Array){for(const Mn of Fn)if(typeof Mn=="string"&&canPlayFile(Mn)||canPlayFile(Mn.src))return!0;return!1}return(0,import_utils$3.isMediaStream)(Fn)||(0,import_utils$3.isBlobUrl)(Fn)?!0:AUDIO_EXTENSIONS.test(Fn)||VIDEO_EXTENSIONS.test(Fn)||HLS_EXTENSIONS.test(Fn)||DASH_EXTENSIONS.test(Fn)||FLV_EXTENSIONS.test(Fn)},canPlay={youtube:Fn=>Fn instanceof Array?Fn.every(Mn=>MATCH_URL_YOUTUBE.test(Mn)):MATCH_URL_YOUTUBE.test(Fn),soundcloud:Fn=>MATCH_URL_SOUNDCLOUD.test(Fn)&&!AUDIO_EXTENSIONS.test(Fn),vimeo:Fn=>MATCH_URL_VIMEO.test(Fn)&&!VIDEO_EXTENSIONS.test(Fn)&&!HLS_EXTENSIONS.test(Fn),mux:Fn=>MATCH_URL_MUX.test(Fn),facebook:Fn=>MATCH_URL_FACEBOOK.test(Fn)||MATCH_URL_FACEBOOK_WATCH.test(Fn),streamable:Fn=>MATCH_URL_STREAMABLE.test(Fn),wistia:Fn=>MATCH_URL_WISTIA.test(Fn),twitch:Fn=>MATCH_URL_TWITCH_VIDEO.test(Fn)||MATCH_URL_TWITCH_CHANNEL.test(Fn),dailymotion:Fn=>MATCH_URL_DAILYMOTION.test(Fn),mixcloud:Fn=>MATCH_URL_MIXCLOUD.test(Fn),vidyard:Fn=>MATCH_URL_VIDYARD.test(Fn),kaltura:Fn=>MATCH_URL_KALTURA.test(Fn),file:canPlayFile};var __defProp$4=Object.defineProperty,__getOwnPropDesc$4=Object.getOwnPropertyDescriptor,__getOwnPropNames$4=Object.getOwnPropertyNames,__hasOwnProp$4=Object.prototype.hasOwnProperty,__export$4=(Fn,Mn)=>{for(var rs in Mn)__defProp$4(Fn,rs,{get:Mn[rs],enumerable:!0})},__copyProps$4=(Fn,Mn,rs,is)=>{if(Mn&&typeof Mn=="object"||typeof Mn=="function")for(let os of __getOwnPropNames$4(Mn))!__hasOwnProp$4.call(Fn,os)&&os!==rs&&__defProp$4(Fn,os,{get:()=>Mn[os],enumerable:!(is=__getOwnPropDesc$4(Mn,os))||is.enumerable});return Fn},__toCommonJS$4=Fn=>__copyProps$4(__defProp$4({},"__esModule",{value:!0}),Fn),players_exports={};__export$4(players_exports,{default:()=>players_default});var players=__toCommonJS$4(players_exports),import_utils$2=utils,import_patterns=patterns,players_default=[{key:"youtube",name:"YouTube",canPlay:import_patterns.canPlay.youtube,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./YouTube-DsP83pK8.js").then(Fn=>Fn.Y),[]))},{key:"soundcloud",name:"SoundCloud",canPlay:import_patterns.canPlay.soundcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./SoundCloud-CMezdLMj.js").then(Fn=>Fn.S),[]))},{key:"vimeo",name:"Vimeo",canPlay:import_patterns.canPlay.vimeo,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vimeo-1IXiWDoe.js").then(Fn=>Fn.V),[]))},{key:"mux",name:"Mux",canPlay:import_patterns.canPlay.mux,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mux-DnIVID87.js").then(Fn=>Fn.M),[]))},{key:"facebook",name:"Facebook",canPlay:import_patterns.canPlay.facebook,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Facebook-BpPY16ym.js").then(Fn=>Fn.F),[]))},{key:"streamable",name:"Streamable",canPlay:import_patterns.canPlay.streamable,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Streamable-BXIcVdeH.js").then(Fn=>Fn.S),[]))},{key:"wistia",name:"Wistia",canPlay:import_patterns.canPlay.wistia,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Wistia-DdZZjQC5.js").then(Fn=>Fn.W),[]))},{key:"twitch",name:"Twitch",canPlay:import_patterns.canPlay.twitch,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Twitch-D0Qi2XSG.js").then(Fn=>Fn.T),[]))},{key:"dailymotion",name:"DailyMotion",canPlay:import_patterns.canPlay.dailymotion,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./DailyMotion-DeFXrHzZ.js").then(Fn=>Fn.D),[]))},{key:"mixcloud",name:"Mixcloud",canPlay:import_patterns.canPlay.mixcloud,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Mixcloud-DSTF6v1T.js").then(Fn=>Fn.M),[]))},{key:"vidyard",name:"Vidyard",canPlay:import_patterns.canPlay.vidyard,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Vidyard-DTWcjZkG.js").then(Fn=>Fn.V),[]))},{key:"kaltura",name:"Kaltura",canPlay:import_patterns.canPlay.kaltura,lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./Kaltura-C6V1K30I.js").then(Fn=>Fn.K),[]))},{key:"file",name:"FilePlayer",canPlay:import_patterns.canPlay.file,canEnablePIP:Fn=>import_patterns.canPlay.file(Fn)&&(document.pictureInPictureEnabled||(0,import_utils$2.supportsWebKitPresentationMode)())&&!import_patterns.AUDIO_EXTENSIONS.test(Fn),lazyPlayer:(0,import_utils$2.lazy)(()=>__vitePreload(()=>import("./FilePlayer-BFlEPMtm.js").then(Fn=>Fn.F),[]))}],safeIsNaN=Number.isNaN||function Fn(Mn){return typeof Mn=="number"&&Mn!==Mn};function isEqual(Fn,Mn){return!!(Fn===Mn||safeIsNaN(Fn)&&safeIsNaN(Mn))}function areInputsEqual(Fn,Mn){if(Fn.length!==Mn.length)return!1;for(var rs=0;rs<Fn.length;rs++)if(!isEqual(Fn[rs],Mn[rs]))return!1;return!0}function memoizeOne(Fn,Mn){Mn===void 0&&(Mn=areInputsEqual);var rs,is=[],os,as=!1;function us(){for(var ds=[],hs=0;hs<arguments.length;hs++)ds[hs]=arguments[hs];return as&&rs===this&&Mn(ds,is)||(os=Fn.apply(this,ds),as=!0,rs=this,is=ds),os}return us}const memoizeOne_esm=Object.freeze(Object.defineProperty({__proto__:null,default:memoizeOne},Symbol.toStringTag,{value:"Module"})),require$$2=getAugmentedNamespace(memoizeOne_esm);var hasElementType=typeof Element<"u",hasMap=typeof Map=="function",hasSet=typeof Set=="function",hasArrayBuffer=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function equal(Fn,Mn){if(Fn===Mn)return!0;if(Fn&&Mn&&typeof Fn=="object"&&typeof Mn=="object"){if(Fn.constructor!==Mn.constructor)return!1;var rs,is,os;if(Array.isArray(Fn)){if(rs=Fn.length,rs!=Mn.length)return!1;for(is=rs;is--!==0;)if(!equal(Fn[is],Mn[is]))return!1;return!0}var as;if(hasMap&&Fn instanceof Map&&Mn instanceof Map){if(Fn.size!==Mn.size)return!1;for(as=Fn.entries();!(is=as.next()).done;)if(!Mn.has(is.value[0]))return!1;for(as=Fn.entries();!(is=as.next()).done;)if(!equal(is.value[1],Mn.get(is.value[0])))return!1;return!0}if(hasSet&&Fn instanceof Set&&Mn instanceof Set){if(Fn.size!==Mn.size)return!1;for(as=Fn.entries();!(is=as.next()).done;)if(!Mn.has(is.value[0]))return!1;return!0}if(hasArrayBuffer&&ArrayBuffer.isView(Fn)&&ArrayBuffer.isView(Mn)){if(rs=Fn.length,rs!=Mn.length)return!1;for(is=rs;is--!==0;)if(Fn[is]!==Mn[is])return!1;return!0}if(Fn.constructor===RegExp)return Fn.source===Mn.source&&Fn.flags===Mn.flags;if(Fn.valueOf!==Object.prototype.valueOf&&typeof Fn.valueOf=="function"&&typeof Mn.valueOf=="function")return Fn.valueOf()===Mn.valueOf();if(Fn.toString!==Object.prototype.toString&&typeof Fn.toString=="function"&&typeof Mn.toString=="function")return Fn.toString()===Mn.toString();if(os=Object.keys(Fn),rs=os.length,rs!==Object.keys(Mn).length)return!1;for(is=rs;is--!==0;)if(!Object.prototype.hasOwnProperty.call(Mn,os[is]))return!1;if(hasElementType&&Fn instanceof Element)return!1;for(is=rs;is--!==0;)if(!((os[is]==="_owner"||os[is]==="__v"||os[is]==="__o")&&Fn.$$typeof)&&!equal(Fn[os[is]],Mn[os[is]]))return!1;return!0}return Fn!==Fn&&Mn!==Mn}var reactFastCompare=function Fn(Mn,rs){try{return equal(Mn,rs)}catch(is){if((is.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw is}},__create$3=Object.create,__defProp$3=Object.defineProperty,__getOwnPropDesc$3=Object.getOwnPropertyDescriptor,__getOwnPropNames$3=Object.getOwnPropertyNames,__getProtoOf$3=Object.getPrototypeOf,__hasOwnProp$3=Object.prototype.hasOwnProperty,__export$3=(Fn,Mn)=>{for(var rs in Mn)__defProp$3(Fn,rs,{get:Mn[rs],enumerable:!0})},__copyProps$3=(Fn,Mn,rs,is)=>{if(Mn&&typeof Mn=="object"||typeof Mn=="function")for(let os of __getOwnPropNames$3(Mn))!__hasOwnProp$3.call(Fn,os)&&os!==rs&&__defProp$3(Fn,os,{get:()=>Mn[os],enumerable:!(is=__getOwnPropDesc$3(Mn,os))||is.enumerable});return Fn},__toESM$3=(Fn,Mn,rs)=>(rs=Fn!=null?__create$3(__getProtoOf$3(Fn)):{},__copyProps$3(!Fn||!Fn.__esModule?__defProp$3(rs,"default",{value:Fn,enumerable:!0}):rs,Fn)),__toCommonJS$3=Fn=>__copyProps$3(__defProp$3({},"__esModule",{value:!0}),Fn),props_exports={};__export$3(props_exports,{defaultProps:()=>defaultProps,propTypes:()=>propTypes});var props=__toCommonJS$3(props_exports),import_prop_types=__toESM$3(propTypesExports);const{string,bool,number,array,oneOfType,shape,object,func,node}=import_prop_types.default,propTypes={url:oneOfType([string,array,object]),playing:bool,loop:bool,controls:bool,volume:number,muted:bool,playbackRate:number,width:oneOfType([string,number]),height:oneOfType([string,number]),style:object,progressInterval:number,playsinline:bool,pip:bool,stopOnUnmount:bool,light:oneOfType([bool,string,object]),playIcon:node,previewTabIndex:number,previewAriaLabel:string,fallback:node,oEmbedUrl:string,wrapper:oneOfType([string,func,shape({render:func.isRequired})]),config:shape({soundcloud:shape({options:object}),youtube:shape({playerVars:object,embedOptions:object,onUnstarted:func}),facebook:shape({appId:string,version:string,playerId:string,attributes:object}),dailymotion:shape({params:object}),vimeo:shape({playerOptions:object,title:string}),mux:shape({attributes:object,version:string}),file:shape({attributes:object,tracks:array,forceVideo:bool,forceAudio:bool,forceHLS:bool,forceSafariHLS:bool,forceDisableHls:bool,forceDASH:bool,forceFLV:bool,hlsOptions:object,hlsVersion:string,dashVersion:string,flvVersion:string}),wistia:shape({options:object,playerId:string,customControls:array}),mixcloud:shape({options:object}),twitch:shape({options:object,playerId:string}),vidyard:shape({options:object})}),onReady:func,onStart:func,onPlay:func,onPause:func,onBuffer:func,onBufferEnd:func,onEnded:func,onError:func,onDuration:func,onSeek:func,onPlaybackRateChange:func,onPlaybackQualityChange:func,onProgress:func,onClickPreview:func,onEnablePIP:func,onDisablePIP:func},noop=()=>{},defaultProps={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:noop},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},mux:{attributes:{},version:"2"},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:noop,onStart:noop,onPlay:noop,onPause:noop,onBuffer:noop,onBufferEnd:noop,onEnded:noop,onError:noop,onDuration:noop,onSeek:noop,onPlaybackRateChange:noop,onPlaybackQualityChange:noop,onProgress:noop,onClickPreview:noop,onEnablePIP:noop,onDisablePIP:noop};var __create$2=Object.create,__defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__getOwnPropNames$2=Object.getOwnPropertyNames,__getProtoOf$2=Object.getPrototypeOf,__hasOwnProp$2=Object.prototype.hasOwnProperty,__defNormalProp$1=(Fn,Mn,rs)=>Mn in Fn?__defProp$2(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,__export$2=(Fn,Mn)=>{for(var rs in Mn)__defProp$2(Fn,rs,{get:Mn[rs],enumerable:!0})},__copyProps$2=(Fn,Mn,rs,is)=>{if(Mn&&typeof Mn=="object"||typeof Mn=="function")for(let os of __getOwnPropNames$2(Mn))!__hasOwnProp$2.call(Fn,os)&&os!==rs&&__defProp$2(Fn,os,{get:()=>Mn[os],enumerable:!(is=__getOwnPropDesc$2(Mn,os))||is.enumerable});return Fn},__toESM$2=(Fn,Mn,rs)=>(rs=Fn!=null?__create$2(__getProtoOf$2(Fn)):{},__copyProps$2(!Fn||!Fn.__esModule?__defProp$2(rs,"default",{value:Fn,enumerable:!0}):rs,Fn)),__toCommonJS$2=Fn=>__copyProps$2(__defProp$2({},"__esModule",{value:!0}),Fn),__publicField$1=(Fn,Mn,rs)=>(__defNormalProp$1(Fn,typeof Mn!="symbol"?Mn+"":Mn,rs),rs),Player_exports={};__export$2(Player_exports,{default:()=>Player});var Player_1=__toCommonJS$2(Player_exports),import_react$1=__toESM$2(reactExports),import_react_fast_compare$1=__toESM$2(reactFastCompare),import_props$1=props,import_utils$1=utils;const SEEK_ON_PLAY_EXPIRY=5e3;class Player extends import_react$1.Component{constructor(){super(...arguments),__publicField$1(this,"mounted",!1),__publicField$1(this,"isReady",!1),__publicField$1(this,"isPlaying",!1),__publicField$1(this,"isLoading",!0),__publicField$1(this,"loadOnReady",null),__publicField$1(this,"startOnPlay",!0),__publicField$1(this,"seekOnPlay",null),__publicField$1(this,"onDurationCalled",!1),__publicField$1(this,"handlePlayerMount",Mn=>{if(this.player){this.progress();return}this.player=Mn,this.player.load(this.props.url),this.progress()}),__publicField$1(this,"getInternalPlayer",Mn=>this.player?this.player[Mn]:null),__publicField$1(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const Mn=this.getCurrentTime()||0,rs=this.getSecondsLoaded(),is=this.getDuration();if(is){const os={playedSeconds:Mn,played:Mn/is};rs!==null&&(os.loadedSeconds=rs,os.loaded=rs/is),(os.playedSeconds!==this.prevPlayed||os.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(os),this.prevPlayed=os.playedSeconds,this.prevLoaded=os.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),__publicField$1(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:Mn,playing:rs,volume:is,muted:os}=this.props;Mn(),!os&&is!==null&&this.player.setVolume(is),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):rs&&this.player.play(),this.handleDurationCheck()}),__publicField$1(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:Mn,onPlay:rs,playbackRate:is}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&is!==1&&this.player.setPlaybackRate(is),Mn(),this.startOnPlay=!1),rs(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),__publicField$1(this,"handlePause",Mn=>{this.isPlaying=!1,this.isLoading||this.props.onPause(Mn)}),__publicField$1(this,"handleEnded",()=>{const{activePlayer:Mn,loop:rs,onEnded:is}=this.props;Mn.loopOnEnded&&rs&&this.seekTo(0),rs||(this.isPlaying=!1,is())}),__publicField$1(this,"handleError",(...Mn)=>{this.isLoading=!1,this.props.onError(...Mn)}),__publicField$1(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const Mn=this.getDuration();Mn?this.onDurationCalled||(this.props.onDuration(Mn),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),__publicField$1(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(Mn){if(!this.player)return;const{url:rs,playing:is,volume:os,muted:as,playbackRate:us,pip:ds,loop:hs,activePlayer:ps,disableDeferredLoading:io}=this.props;if(!(0,import_react_fast_compare$1.default)(Mn.url,rs)){if(this.isLoading&&!ps.forceLoad&&!io&&!(0,import_utils$1.isMediaStream)(rs)){console.warn(`ReactPlayer: the attempt to load ${rs} is being deferred until the player has loaded`),this.loadOnReady=rs;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(rs,this.isReady)}!Mn.playing&&is&&!this.isPlaying&&this.player.play(),Mn.playing&&!is&&this.isPlaying&&this.player.pause(),!Mn.pip&&ds&&this.player.enablePIP&&this.player.enablePIP(),Mn.pip&&!ds&&this.player.disablePIP&&this.player.disablePIP(),Mn.volume!==os&&os!==null&&this.player.setVolume(os),Mn.muted!==as&&(as?this.player.mute():(this.player.unmute(),os!==null&&setTimeout(()=>this.player.setVolume(os)))),Mn.playbackRate!==us&&this.player.setPlaybackRate&&this.player.setPlaybackRate(us),Mn.loop!==hs&&this.player.setLoop&&this.player.setLoop(hs)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(Mn,rs,is){if(!this.isReady){Mn!==0&&(this.seekOnPlay=Mn,setTimeout(()=>{this.seekOnPlay=null},SEEK_ON_PLAY_EXPIRY));return}if(rs?rs==="fraction":Mn>0&&Mn<1){const as=this.player.getDuration();if(!as){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(as*Mn,is);return}this.player.seekTo(Mn,is)}render(){const Mn=this.props.activePlayer;return Mn?import_react$1.default.createElement(Mn,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}__publicField$1(Player,"displayName","Player");__publicField$1(Player,"propTypes",import_props$1.propTypes);__publicField$1(Player,"defaultProps",import_props$1.defaultProps);var __create$1=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__getOwnPropNames$1=Object.getOwnPropertyNames,__getProtoOf$1=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__defNormalProp=(Fn,Mn,rs)=>Mn in Fn?__defProp$1(Fn,Mn,{enumerable:!0,configurable:!0,writable:!0,value:rs}):Fn[Mn]=rs,__export$1=(Fn,Mn)=>{for(var rs in Mn)__defProp$1(Fn,rs,{get:Mn[rs],enumerable:!0})},__copyProps$1=(Fn,Mn,rs,is)=>{if(Mn&&typeof Mn=="object"||typeof Mn=="function")for(let os of __getOwnPropNames$1(Mn))!__hasOwnProp$1.call(Fn,os)&&os!==rs&&__defProp$1(Fn,os,{get:()=>Mn[os],enumerable:!(is=__getOwnPropDesc$1(Mn,os))||is.enumerable});return Fn},__toESM$1=(Fn,Mn,rs)=>(rs=Fn!=null?__create$1(__getProtoOf$1(Fn)):{},__copyProps$1(!Fn||!Fn.__esModule?__defProp$1(rs,"default",{value:Fn,enumerable:!0}):rs,Fn)),__toCommonJS$1=Fn=>__copyProps$1(__defProp$1({},"__esModule",{value:!0}),Fn),__publicField=(Fn,Mn,rs)=>(__defNormalProp(Fn,typeof Mn!="symbol"?Mn+"":Mn,rs),rs),ReactPlayer_exports={};__export$1(ReactPlayer_exports,{createReactPlayer:()=>createReactPlayer});var ReactPlayer$1=__toCommonJS$1(ReactPlayer_exports),import_react=__toESM$1(reactExports),import_deepmerge=__toESM$1(cjs),import_memoize_one=__toESM$1(require$$2),import_react_fast_compare=__toESM$1(reactFastCompare),import_props=props,import_utils=utils,import_Player=__toESM$1(Player_1);const Preview=(0,import_utils.lazy)(()=>__vitePreload(()=>import("./Preview-CO_zqvsv.js").then(Fn=>Fn.P),[])),IS_BROWSER=typeof window<"u"&&window.document&&typeof document<"u",IS_GLOBAL=typeof commonjsGlobal<"u"&&commonjsGlobal.window&&commonjsGlobal.window.document,SUPPORTED_PROPS=Object.keys(import_props.propTypes),UniversalSuspense=IS_BROWSER||IS_GLOBAL?import_react.Suspense:()=>null,customPlayers=[],createReactPlayer=(Fn,Mn)=>{var rs;return rs=class extends import_react.Component{constructor(){super(...arguments),__publicField(this,"state",{showPreview:!!this.props.light}),__publicField(this,"references",{wrapper:is=>{this.wrapper=is},player:is=>{this.player=is}}),__publicField(this,"handleClickPreview",is=>{this.setState({showPreview:!1}),this.props.onClickPreview(is)}),__publicField(this,"showPreview",()=>{this.setState({showPreview:!0})}),__publicField(this,"getDuration",()=>this.player?this.player.getDuration():null),__publicField(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),__publicField(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),__publicField(this,"getInternalPlayer",(is="player")=>this.player?this.player.getInternalPlayer(is):null),__publicField(this,"seekTo",(is,os,as)=>{if(!this.player)return null;this.player.seekTo(is,os,as)}),__publicField(this,"handleReady",()=>{this.props.onReady(this)}),__publicField(this,"getActivePlayer",(0,import_memoize_one.default)(is=>{for(const os of[...customPlayers,...Fn])if(os.canPlay(is))return os;return Mn||null})),__publicField(this,"getConfig",(0,import_memoize_one.default)((is,os)=>{const{config:as}=this.props;return import_deepmerge.default.all([import_props.defaultProps.config,import_props.defaultProps.config[os]||{},as,as[os]||{}])})),__publicField(this,"getAttributes",(0,import_memoize_one.default)(is=>(0,import_utils.omit)(this.props,SUPPORTED_PROPS))),__publicField(this,"renderActivePlayer",is=>{if(!is)return null;const os=this.getActivePlayer(is);if(!os)return null;const as=this.getConfig(is,os.key);return import_react.default.createElement(import_Player.default,{...this.props,key:os.key,ref:this.references.player,config:as,activePlayer:os.lazyPlayer||os,onReady:this.handleReady})})}shouldComponentUpdate(is,os){return!(0,import_react_fast_compare.default)(this.props,is)||!(0,import_react_fast_compare.default)(this.state,os)}componentDidUpdate(is){const{light:os}=this.props;!is.light&&os&&this.setState({showPreview:!0}),is.light&&!os&&this.setState({showPreview:!1})}renderPreview(is){if(!is)return null;const{light:os,playIcon:as,previewTabIndex:us,oEmbedUrl:ds,previewAriaLabel:hs}=this.props;return import_react.default.createElement(Preview,{url:is,light:os,playIcon:as,previewTabIndex:us,previewAriaLabel:hs,oEmbedUrl:ds,onClick:this.handleClickPreview})}render(){const{url:is,style:os,width:as,height:us,fallback:ds,wrapper:hs}=this.props,{showPreview:ps}=this.state,io=this.getAttributes(is),fo=typeof hs=="string"?this.references.wrapper:void 0;return import_react.default.createElement(hs,{ref:fo,style:{...os,width:as,height:us},...io},import_react.default.createElement(UniversalSuspense,{fallback:ds},ps?this.renderPreview(is):this.renderActivePlayer(is)))}},__publicField(rs,"displayName","ReactPlayer"),__publicField(rs,"propTypes",import_props.propTypes),__publicField(rs,"defaultProps",import_props.defaultProps),__publicField(rs,"addCustomPlayer",is=>{customPlayers.push(is)}),__publicField(rs,"removeCustomPlayers",()=>{customPlayers.length=0}),__publicField(rs,"canPlay",is=>{for(const os of[...customPlayers,...Fn])if(os.canPlay(is))return!0;return!1}),__publicField(rs,"canEnablePIP",is=>{for(const os of[...customPlayers,...Fn])if(os.canEnablePIP&&os.canEnablePIP(is))return!0;return!1}),rs};var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(Fn,Mn)=>{for(var rs in Mn)__defProp(Fn,rs,{get:Mn[rs],enumerable:!0})},__copyProps=(Fn,Mn,rs,is)=>{if(Mn&&typeof Mn=="object"||typeof Mn=="function")for(let os of __getOwnPropNames(Mn))!__hasOwnProp.call(Fn,os)&&os!==rs&&__defProp(Fn,os,{get:()=>Mn[os],enumerable:!(is=__getOwnPropDesc(Mn,os))||is.enumerable});return Fn},__toESM=(Fn,Mn,rs)=>(rs=Fn!=null?__create(__getProtoOf(Fn)):{},__copyProps(!Fn||!Fn.__esModule?__defProp(rs,"default",{value:Fn,enumerable:!0}):rs,Fn)),__toCommonJS=Fn=>__copyProps(__defProp({},"__esModule",{value:!0}),Fn),src_exports={};__export(src_exports,{default:()=>src_default});var lib=__toCommonJS(src_exports),import_players=__toESM(players),import_ReactPlayer=ReactPlayer$1;const fallback=import_players.default[import_players.default.length-1];var src_default=(0,import_ReactPlayer.createReactPlayer)(import_players.default,fallback);const ReactPlayer=getDefaultExportFromCjs(lib),SwitchVideo=Fn=>{const{isDarkMode:Mn}=useStore(),rs=["https://youtu.be/iSXug-oGRRM?si=vW1bg7rfsPvqhdIE","https://youtu.be/z5qe0F0cRy8?si=s5jTo14giH1zgVVc","https://youtu.be/dfvQOvJlXk8?si=EQP-8-lKPq1t-Itg","https://youtu.be/8H65UinCUBI?si=SGDhFjl9BGrbMSaY"],[is,os]=reactExports.useState(0),as=reactExports.useRef(null),us=reactExports.useRef(null),ds={dots:!1,arrows:!1,infinite:!0,speed:500,slidesToShow:1,slidesToScroll:1},hs=()=>{var Ao;const mo=is===0?rs.length-1:is-1;os(mo),(Ao=as.current)==null||Ao.slickPrev(),io()},ps=()=>{var Ao;const mo=is===rs.length-1?0:is+1;os(mo),(Ao=as.current)==null||Ao.slickNext()},io=()=>{us.current&&(us.current.pause(),us.current.currentTime=0)},fo=()=>{Fn.onClose()};return jsxRuntimeExports.jsx("div",{className:"fixed z-[4] inset-0 h-full w-full backdrop-blur-lg flex flex-row justify-center font-inter items-center",children:jsxRuntimeExports.jsx(c$9,{onClickAway:fo,children:jsxRuntimeExports.jsxs("div",{className:`${Mn?"bg-[rgba(0,0,0,0.70)] border-[#DAECEF] ":"bg-[rgba(0,0,0,0.70)] border-[#1e1f22]"} xxl:w-[50rem] bxl:w-[50rem] xl:w-[50rem] sxl:w-[50rem] lg:w-[50rem] md:w-full sm:w-full xd:w-full h-auto  backdrop-blur-[54.36563491821289px] border-2 rounded-[1.2rem]`,children:[jsxRuntimeExports.jsxs("div",{className:`flex flex-row justify-between items-center py-5 rounded-t-[1rem] px-6 ${Mn?"bg-[#F6FEFC]":"bg-[rgba(255,255,255,0.06)]"}`,children:[jsxRuntimeExports.jsx("div",{className:`${Mn?"text-[#000000]":"text-[white]"} font-inter text-xl font-bold`,children:"Switch quick walkthrough"}),jsxRuntimeExports.jsx("div",{className:`w-auto text-xs font-extrabold p-[8px_16px] rounded-lg border  flex  ${Mn?"text-[#107569] hover:shadow-custom border-[#107569]":"text-[#2ED3B7] border-[#2ED3B7] hover:bg-black"} cursor-pointer `,onClick:()=>{Fn.onClose()},children:"Close"})]}),jsxRuntimeExports.jsxs("div",{className:`relative ${Mn?"bg-[rgba(252,253,254,0.70)]":"bg-transparent"} rounded-b-[1rem] h-full`,children:[jsxRuntimeExports.jsx(Slider,{ref:as,...ds,children:rs.map((mo,Ao)=>jsxRuntimeExports.jsx("div",{className:"h-full w-full",children:jsxRuntimeExports.jsx(ReactPlayer,{url:mo,width:"796px",height:"448px",controls:!0,playing:Ao===is,muted:Ao==is,onEnded:ps})},Ao))}),jsxRuntimeExports.jsxs("div",{className:`${Mn?"bg-white":"bg-[rgba(255,255,255,0.06)]"} rounded-b-[1rem] text-xs font-manrope font-bold p-4 h-full w-full flex flex-row justify-between items-center`,children:[is===0?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}):jsxRuntimeExports.jsxs("div",{onClick:hs,className:`  ${Mn?" text-[#107569]  ":"  text-[#2ED3B7] "} flex flex-row justify-center items-center gap-2 cursor-pointer `,children:[jsxRuntimeExports.jsx("img",{src:`${Mn?` ${ChevronLeft}  `:`  ${ChevronLeftDark} `} `,alt:""}),"Previous"]}),jsxRuntimeExports.jsx("div",{className:"flex justify-center gap-3 w-full",children:rs.map((mo,Ao)=>jsxRuntimeExports.jsx("div",{onClick:()=>{var $o;os(Ao),($o=as.current)==null||$o.slickGoTo(Ao),io()},className:`rounded-full w-2 h-2 cursor-pointer ${Ao===is?"bg-[#0E9384]":"bg-[#D2D2D2]"} `},"circle"+Ao))}),is===rs.length-1?jsxRuntimeExports.jsxs("div",{onClick:()=>{Fn.onClose()},className:`  ${Mn?` ${is===rs.length-1,"text-[#107569]"}  `:`  ${is===rs.length-1,"text-[#2ED3B7]"} `} cursor-pointer flex flex-row justify-center items-center gap-2 `,children:["Close",jsxRuntimeExports.jsx("img",{src:`${Mn?` ${is===rs.length-1,ChevronRight}  `:`  ${is===rs.length-1,ChevronRightDark} `} `,alt:""})]}):jsxRuntimeExports.jsxs("div",{onClick:ps,className:`  ${Mn?` ${is===rs.length-1,"text-[#107569]"}  `:`  ${is===rs.length-1,"text-[#2ED3B7]"} `} cursor-pointer flex flex-row justify-center items-center gap-2 `,children:["Next",jsxRuntimeExports.jsx("img",{src:`${Mn?` ${is===rs.length-1,ChevronRight}  `:`  ${is===rs.length-1,ChevronRightDark} `} `,alt:""})]})]})]})]})})})},Learn=()=>{const[Fn,Mn]=staticMethods.useNotification(),{isDarkMode:rs}=useStore(),is=useNavigate(),[os,as]=reactExports.useState(!1),us=async()=>{as(!1)};return jsxRuntimeExports.jsxs("div",{className:`${rs?"bg-[#E4F2F3]":"bg-[#ffffff0f]"} min-h-screen h-full font-inter flex !w-full`,children:[Mn,jsxRuntimeExports.jsx("div",{className:" xxl:inline bxl:inline xl:inline sxl:inline lg:hidden md:hidden sm:hidden xd:hidden w-[5%]  "}),jsxRuntimeExports.jsx("div",{className:"w-full flex flex-row justify-center items-center",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col  xxl:!w-[1600px] bxl:!w-[1600px] xl:!w-[88%] sxl:!w-[94%] lg:!w-[96%] md:!w-full sm:!w-full xd:!w-full    ",children:[jsxRuntimeExports.jsx(LearnHeader,{}),jsxRuntimeExports.jsx("div",{className:"mt-28 mb-4  w-full md:px-4 sm:px-4 xd:px-4 ",children:jsxRuntimeExports.jsxs("div",{className:"p-[0.8rem] my-4  gap-4 flex xxl:flex-row xl:flex-row lg:flex-row md:flex-col-reverse sm:flex-col-reverse max-sm:flex-col-reverse  w-full",children:[jsxRuntimeExports.jsxs("div",{className:"xxl:w-[70%] bxl:w-[70%] xl:w-[70%] sxl:w-[70%] lg:w-[70%] md:w-full sm:w-full max-sm:w-full",children:[jsxRuntimeExports.jsx("div",{className:"flex xxl:flex-row xl:flex-row lg:flex-row md:flex-col sm:flex-col max-sm:flex-col  justify-between items-start w-full",children:jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[#000]":"!text-[#fff] "} font-manrope text-[1.5rem] font-extrabold `,children:"Learn Switch"})}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"How SWITCH Works"}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:"Switch operates on a pool-versus-pool model, creating a zero-sum game. Long Switch (LS) holders pay a premium at a predetermined rate (m) to Short Switch (SS) holders, receiving protection against a declining market price of the underlying asset. Time is divided into cycles of fixed* duration, typically 2 hours. At the end of each cycle, there's a settlement where Switch tokens are transferred, either from the Long Switch Pool to the Short Switch Pool or vice versa, depending on the direction of the underlying asset's price movement."}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"Cycle Example:"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Premium (m): 3% (for the cycle of 2 hours)"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Long Switch Tokens (LS): 1,000,000"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Short Switch Tokens (SS): 5,000,000"]})]}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"Settlement in Different Market Conditions:"}),jsxRuntimeExports.jsxs("div",{className:"flex xxl:flex-row xl:flex-row lg:flex-row md:flex-col sm:flex-col max-sm:flex-col justify-between items-start w-full py-2",children:[jsxRuntimeExports.jsxs("div",{className:"xxl:w-[49%] xl:w-[49%] lg:w-[49%] md:w-full sm:w-full max-sm:w-full",children:[jsxRuntimeExports.jsx("div",{className:" text-[#2CE] text-[0.9rem] font-extrabold font-manrope",children:"Market Falls:"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify  `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"1."}),"3% of tokens are transferred from the Long Pool to the Short Pool as a premium. [30,000 Tokens] (1,000,000(LS) * 3%(m) = 30,000 tokens)"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"2."})," 1.5% of tokens are transferred from the Short Pool to the Long Pool due to the market fall. [75,000 Tokens] (5,000,000(SS) * 1.5%(market fall) = 75,000 Tokens)"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"3."})," A net total of 45,000 tokens is transferred from the Short Pool to the Long Pool."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"4."})," Long Switch holders gain 4.5%, and Short Switch holders incur a loss of 0.9% in this cycle."]})]})]}),jsxRuntimeExports.jsxs("div",{className:"xxl:w-[49%] xl:w-[49%] lg:w-[49%] md:w-full sm:w-full max-sm:w-full",children:[jsxRuntimeExports.jsx("div",{className:" text-[#2CE] text-[0.9rem] font-extrabold font-manrope",children:"Stable or Rising Market:"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"1."})," 3% of tokens are transferred from the Long Pool to the Short Pool as a premium. [30,000 Tokens] (1,000,000(LS) * 3%(m) = 30,000 Tokens)"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"2."})," No other transfers occur as the market remains stable or rises."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"3."})," A net total of 30,000 tokens is transferred from the Long Pool to the Short Pool."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"4."})," Long Switch holders incur a loss of 3%, and Short Switch holders gain 0.6% in this cycle."]})]})]})]}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"*Protection Against Large Market Moves:"}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:"In the event of significant market shifts, Short Switch (SS) holders may be at risk of substantial losses within a single cycle. To safeguard users against such market volatility, Switch incorporates an inbuilt mechanism. The cycle concludes if the market moves either up or down by a certain percentage (e.g., 2.5%). This mechanism helps protect against excessive losses."}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"Protection Against Large Market Moves:"}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:"In the event of substantial market shifts, the settlement process appears as follows:"}),jsxRuntimeExports.jsxs("div",{className:"flex xxl:flex-row xl:flex-row lg:flex-row md:flex-col sm:flex-col max-sm:flex-col justify-between items-start w-full py-2",children:[jsxRuntimeExports.jsxs("div",{className:"xxl:w-[49%] xl:w-[49%] lg:w-[49%] md:w-full sm:w-full max-sm:w-full",children:[jsxRuntimeExports.jsx("div",{className:" text-[#2CE] text-[0.9rem] font-extrabold font-manrope",children:"Market Decline by 2.5% (30 minutes after cycle start):"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify  `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"1."})," 1.5% (calculated as 3% * sqrt(30 minutes / 2 hours)) of tokens are transferred from the Long Pool to the Short Pool as a premium. [15,000 Tokens] (1,000,000(LS) * 1.5%(m) = 15,000 Tokens)"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"2."})," 2.5% of tokens are transferred from the Short Pool to the Long Pool due to the market fall. [125,000 Tokens] (5,000,000(SS) * 2.5%(market fall) = 125,000 Tokens)"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"3."})," A net total of 110,000 tokens is transferred from the Short Pool to the Long Pool."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"4."})," Long Switch holders gain 11%, while Short Switch holders incur a loss of 2.2% in this cycle."]})]})]}),jsxRuntimeExports.jsxs("div",{className:"xxl:w-[49%] xl:w-[49%] lg:w-[49%] md:w-full sm:w-full max-sm:w-full",children:[jsxRuntimeExports.jsx("div",{className:" text-[#2CE] text-[0.9rem] font-extrabold font-manrope",children:"Market Increase by 2.5% (30 minutes after cycle start):"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"1."})," 1.5% (calculated as 3% * sqrt(30 minutes / 2 hours)) of tokens are transferred from the Long Pool to the Short Pool as a premium. [15,000 Tokens] (1,000,000(LS) * 1.5%(m) = 15,000 Tokens)"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"2."})," No other transfers occur since the market did not fall."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"3."})," A net total of 15,000 tokens is transferred from the Long Pool to the Short Pool."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"pr-1",children:"4."}),"Long Switch holders incur a loss of 1.5%, while Short Switch holders gain 0.3% in this cycle."]})]})]})]}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"Why use OPerps?"}),jsxRuntimeExports.jsx("div",{className:" text-[#2CE] text-[0.9rem] font-extrabold font-manrope",children:"Long Switch"}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:"If you hold assets like ETH and anticipate long-term growth but are concerned about potential short-term declines in their value, Long Switch offers a solution. By purchasing Long Switch tokens, you can safeguard your assets in a falling market while still maintaining exposure to the upside potential. To secure this protection, you pay a fixed premium. If the market rises, you profit from your asset holdings, and if it falls, you receive compensation in Long Switch tokens, ensuring that the combined value of your assets and Long Switch holdings remains consistent (excluding the premium paid)."}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-2 `,children:"Note"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify`,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Switch tokens are available for purchase in both small and large amounts without restrictions."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"While this example uses ETH, Switch will be initially launched for ETH and BTC, and it can be applied to any volatile asset."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"You can profit from falling markets with Long Switch, even without holding the underlying volatile asset."]})]}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-2 `,children:"Example"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Holding: 10 ETH"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"ETH Price: $2,000"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Premium (m): 3% (for the cycle of 2 hours)"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Long Switch Tokens: 1,000,000 (of which you hold 2,000, or 0.2%)"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Short Switch Tokens: 10,000,000"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Large Move Barrier: 10%"]})]}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:"To safeguard your $20,000 exposure (10 ETH * $2,000/ETH), you would acquire $2,000 worth of Long Switch (equivalent to 2,000 tokens) in this scenario. If the market falls by 5% by the end of the cycle (ETH price = $1,900), a net transfer of 470,000 tokens (5% * 10,000,000 - 3% * 1,000,000) occurs from the Short Pool to the Long Pool. Consequently, the Long Pool contains 1,470,000 tokens, translating to a 0.2% ownership of 2,940 tokens. This results in a profit of $940 in Long Switch holdings, effectively offsetting your $1,000 loss in ETH (10 * ($2,000 - $1,900)), minus the $60 premium paid for protection."}),jsxRuntimeExports.jsx("div",{className:" text-[#2CE] text-[0.9rem] font-extrabold font-manrope mt-6",children:"Short Switch"}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:"If you anticipate that ETH will experience an increase or remain stable in the near future, Short Switch is an option to earn a consistent premium each cycle. You receive the premium in its entirety each cycle, and if the market declines, you compensate the Longs for the market's fall."}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-2 `,children:"Example"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Premium (m): 3% (for the cycle of 2 hours)"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Long Switch Tokens: 1,000,000"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Short Switch Tokens: 10,000,000"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Large Move Barrier: 10%"]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Over the course of the next 5 cycles, ETH returns as follows: 0.2%, 0.3%, -0.1%, 0%, -0.2%."]})]}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:"After these 5 cycles, the Short Pool contains approximately 10,111,591.5 tokens, resulting in a return of ~1.1% in just 10 hours."}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:"This example illustrates how Short Switch can generate a return of 1.1% within a relatively short period, even when the market experiences various price changes."})]}),jsxRuntimeExports.jsx("div",{className:"xxl:w-[30%] bxl:w-[30%]  xl:w-[30%]  sxl:w-[30%]  lg:w-[30%] md:w-full sm:w-full max-sm:w-full",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-2",children:[jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[#000]":"!text-[#fff] "} text-[24px] font-extrabold font-manrope pb-4`,children:"Useful links"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[#107569] border-[#107569]":"!text-[#2ED3B7] border-[rgba(1,252,206,0.20)] "} !w-full cursor-pointer rounded-lg text-xs font-bold font-inter p-[0.5rem_1rem] flex flex-row justify-between items-center border`,onClick:()=>as(!0),children:["Watch Video",rs?jsxRuntimeExports.jsx("img",{src:LinkExternalDark,alt:""}):jsxRuntimeExports.jsx("img",{src:LinkExternal,alt:""})]}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[#107569] border-[#107569]":"!text-[#2ED3B7] border-[rgba(1,252,206,0.20)] "} !w-full cursor-pointer rounded-lg text-xs font-bold font-inter p-[0.5rem_1rem] flex flex-row justify-between items-center border`,onClick:()=>is("/faq"),children:["FAQs",rs?jsxRuntimeExports.jsx("img",{src:LinkExternalDark,alt:""}):jsxRuntimeExports.jsx("img",{src:LinkExternal,alt:""})]}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[#107569] border-[#107569]":"!text-[#2ED3B7] border-[rgba(1,252,206,0.20)] "} !w-full cursor-pointer rounded-lg text-xs font-bold font-inter p-[0.5rem_1rem] flex flex-row justify-between items-center border`,onClick:()=>is("/"),children:["Try Switch",rs?jsxRuntimeExports.jsx("img",{src:LinkExternalDark,alt:""}):jsxRuntimeExports.jsx("img",{src:LinkExternal,alt:""})]}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[#107569] border-[#107569]":"!text-[#2ED3B7] border-[rgba(1,252,206,0.20)] "} !w-full cursor-pointer rounded-lg text-xs font-bold font-inter p-[0.5rem_1rem] flex flex-row justify-between items-center border`,onClick:()=>window.open(LINKS.TELEGRAM),children:["Contact Us",rs?jsxRuntimeExports.jsx("img",{src:LinkExternalDark,alt:""}):jsxRuntimeExports.jsx("img",{src:LinkExternal,alt:""})]})]})})]})})]})}),os&&jsxRuntimeExports.jsx(SwitchVideo,{onClose:us})]})},Faq=()=>{const[Fn,Mn]=staticMethods.useNotification(),{isDarkMode:rs,selectedCrypto:is}=useStore(),os=useNavigate(),[as,us]=reactExports.useState(!1),ds=async()=>{us(!1)};return jsxRuntimeExports.jsxs("div",{className:`${rs?"bg-[#E4F2F3]":"bg-[#ffffff0f]"} min-h-screen h-full font-inter flex !w-full`,children:[Mn,jsxRuntimeExports.jsx("div",{className:" xxl:inline bxl:inline xl:inline sxl:inline lg:hidden md:hidden sm:hidden xd:hidden w-[5%]  "}),jsxRuntimeExports.jsx("div",{className:"w-full flex flex-row justify-center items-start",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col  xxl:!w-[1600px] bxl:!w-[1600px] xl:!w-[88%] sxl:!w-[94%] lg:!w-[96%] md:!w-full sm:!w-full xd:!w-full    ",children:[jsxRuntimeExports.jsx(FaqHeader,{}),jsxRuntimeExports.jsx("div",{className:"mt-28 mb-4   md:px-4 sm:px-4 xd:px-4 w-full ",children:jsxRuntimeExports.jsxs("div",{className:"p-[0.8rem] my-4  gap-4 flex xxl:flex-row xl:flex-row lg:flex-row md:flex-col-reverse sm:flex-col-reverse max-sm:flex-col-reverse  w-full",children:[jsxRuntimeExports.jsxs("div",{className:"xxl:w-[70%] bxl:w-[70%] xl:w-[70%] sxl:w-[70%] lg:w-[70%] md:w-full sm:w-full max-sm:w-full",children:[jsxRuntimeExports.jsx("div",{className:"flex xxl:flex-row xl:flex-row lg:flex-row md:flex-col sm:flex-col max-sm:flex-col  justify-between items-start w-full",children:jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[#000]":"!text-[#fff] "} font-manrope text-[1.5rem] font-extrabold `,children:"Switch FAQ Document"})}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"Who should buy Long Switch tokens (LS) and Short Switch tokens (SS)?"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"LS: If you anticipate market decline, LS tokens are your choice."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"SS: Opt for SS tokens if you expect the market to stay stable or rise in value."]})]}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"What are Switch tokens, i.e. LS/SS? How much does it cost?"}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 text-justify  `,children:jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"LS/SS is an ERC-20 token, embedded with a perpetual put option and leverage (to note. leverage varies based on the ratio of LS to SS tokens). Each LS/SS token is equivalent to $1 or 1 USDC."]})}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"What is a Cycle in Switch?"}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 `,children:jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"A cycle in Switch typically lasts 2 hours, running 12 times within 24 hours. This allows you to enter or exit positions at the beginning or end of a cycle. Settlement happens at the end of every cycle. To protect your investment, a cycle may also end if the market fluctuates more than 2.5% in either direction within those 2 hours."]})}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"What is the Premium in Switch? Is it fixed?"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Long Switch: LS holders pay a fixed premium of 3% to SS holders every cycle. This acts as insurance, and when the market drops beyond the break-even price, SS starts compensating LS."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"Short Switch: SS holders receive premiums from LS each cycle. You'll continue to earn positive returns unless the market starts to fall, at which point you'll need to compensate LS holders."]})]}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"How much do short holders pay to long holders when the market falls?"}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 `,children:jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[jsxRuntimeExports.jsx("span",{className:"  pr-2  "}),"Short holders pay an amount equal to the percentage decline in the underlying asset. For example, if there is a 2% decline in the markets, 2% of the Short Switch tokens are transferred to the Long Switch pool, which are then distributed proportionally among Long Switch holders."]})})]})}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"What is Last Day’s Return?"}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 `,children:jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"LS/SS: This is the average return LS/SS holders earned in the last 12 cycles of Switch trading respectively."]})}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"What is the Break-even Price Drop?"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"LS: % price movement of ",is," when premium paid = profit earned."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),"SS: % price movement of ",is," when premium received = loss incurred."]})]}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"Not sure how much to buy?"}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 `,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsx("span",{className:"   ",children:jsxRuntimeExports.jsx("li",{})}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[jsxRuntimeExports.jsx("span",{className:"  pr-2  ",children:jsxRuntimeExports.jsx("b",{children:"a."})})," ",'LS: We offer two calculators for your convenience:"Earn from Falling Markets": Use this to estimate earnings based on expected ',is," price drops."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[jsxRuntimeExports.jsxs("span",{className:"  pr-2  ",children:[jsxRuntimeExports.jsx("b",{children:"b."})," "]}),'"Protect Your Holdings": Input your current ',is," holdings to find out how much LS you need to offset potential losses."]})]})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[" ",jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),'SS: Check out our "Earn from Neutral/Rising Markets" calculator to simulate your potential profits and losses based on current market conditions.']})]}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-extrabold pt-6 `,children:"What fees are charged for using SWITCH?"}),jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[rgba(0,0,0,0.70)]":"!text-[rgba(255,255,255,0.70)] "} font-manrope text-[0.9rem] font-normal pt-2 `,children:jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start",children:[jsxRuntimeExports.jsxs("span",{className:"   ",children:[jsxRuntimeExports.jsx("li",{})," "]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[jsxRuntimeExports.jsx("span",{className:"  pr-2  "}),"On the testnet, we charge a 0.1% fee on every buy/sell transaction. Additionally, a 0.002% fee is charged on the user's Switch balance at every settlement."]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-row justify-start items-start text-justify ",children:[jsxRuntimeExports.jsx("span",{className:"  pr-2  ",children:" "}),"Please note that these are dummy numbers, and the actual fees on the mainnet will be lower than this."]})]})]})})]}),jsxRuntimeExports.jsx("div",{className:"xxl:w-[30%] bxl:w-[30%] xl:w-[30%] sxl:w-[30%]  lg:w-[30%] md:w-full sm:w-full max-sm:w-full",children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col justify-start items-start w-full gap-2",children:[" ",jsxRuntimeExports.jsx("div",{className:`${rs?"!text-[#000]":"!text-[#fff] "} text-[24px] font-extrabold font-manrope pb-4`,children:"Useful links"}),jsxRuntimeExports.jsxs("div",{className:`border ${rs?"!text-[#107569] border-[#107569]":"!text-[#2ED3B7] border-[rgba(1,252,206,0.20)] "} !w-full cursor-pointer rounded-lg text-xs font-bold font-inter p-[0.5rem_1rem] flex flex-row justify-between items-center`,onClick:()=>us(!0),children:["Watch Video",rs?jsxRuntimeExports.jsx("img",{src:LinkExternalDark,alt:""}):jsxRuntimeExports.jsx("img",{src:LinkExternal,alt:""})]}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[#107569] border-[#107569]":"!text-[#2ED3B7] border-[rgba(1,252,206,0.20)] "} border !w-full cursor-pointer rounded-lg text-xs font-bold font-inter p-[0.5rem_1rem] flex flex-row justify-between items-center`,onClick:()=>window.open(LINKS.GITBOOK),children:["Learn Switch",rs?jsxRuntimeExports.jsx("img",{src:LinkExternalDark,alt:""}):jsxRuntimeExports.jsx("img",{src:LinkExternal,alt:""})]}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[#107569] border-[#107569]":"!text-[#2ED3B7] border-[rgba(1,252,206,0.20)] "} border !w-full cursor-pointer rounded-lg text-xs font-bold font-inter p-[0.5rem_1rem] flex flex-row justify-between items-center`,onClick:()=>os("/"),children:["Try Switch",rs?jsxRuntimeExports.jsx("img",{src:LinkExternalDark,alt:""}):jsxRuntimeExports.jsx("img",{src:LinkExternal,alt:""})]}),jsxRuntimeExports.jsxs("div",{className:`${rs?"!text-[#107569] border-[#107569]":"!text-[#2ED3B7] border-[rgba(1,252,206,0.20)] "} border !w-full cursor-pointer rounded-lg text-xs font-bold font-inter p-[0.5rem_1rem] flex flex-row justify-between items-center`,onClick:()=>window.open(LINKS.TELEGRAM),children:["Contact Us",rs?jsxRuntimeExports.jsx("img",{src:LinkExternalDark,alt:""}):jsxRuntimeExports.jsx("img",{src:LinkExternal,alt:""})]})]})})]})})]})}),as&&jsxRuntimeExports.jsx(SwitchVideo,{onClose:ds})]})},usePriceStore=create(Fn=>({candleStickData:[],setCandleStickData:Mn=>Fn({candleStickData:Mn})})),useGetPrice=()=>{const{setCandleStickData:Fn,candleStickData:Mn}=usePriceStore(),{selectedCrypto:rs,isSelectedChain:is,updateSelectedTokenPrice:os}=useStore(),as=reactExports.useCallback(async()=>{try{let us=CHAIN_PARAMS_CONFIG[is].candle_interval,ds=Math.floor(Date.now()/1e3),hs=Math.floor(Date.now()/(us*60*1e3))*(us*60)-us*60*79,ps="Crypto."+rs+"/USD";const io=await axios.get("https://benchmarks.pyth.network/v1/shims/tradingview/history",{params:{symbol:ps,resolution:us,from:hs,to:ds}});let fo=io.data.c.length;const mo=[];for(let Ao=0;Ao<fo;Ao++)mo.push({time:io.data.t[Ao],open:io.data.o[Ao],high:io.data.h[Ao],low:io.data.l[Ao],close:io.data.c[Ao]});Fn(mo)}catch(us){console.error("Error fetching candlestick data:",us)}},[is,rs,os]);reactExports.useEffect(()=>{(Mn.length===0||is||rs)&&as();const us=setInterval(as,5e3);return()=>clearInterval(us)},[Mn.length,as,is,rs])},App=()=>(useGetPrice(),staticMethods.config({placement:"bottomRight",maxCount:1}),localStorage.getItem("isShowPopup")===null&&localStorage.setItem("isShowPopup","false"),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"flex",children:jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"/leaderboard",element:jsxRuntimeExports.jsx(LeaderBoard,{})}),jsxRuntimeExports.jsx(Route,{path:"/",element:jsxRuntimeExports.jsx(Dashboard,{})}),jsxRuntimeExports.jsx(Route,{path:"/learn",element:jsxRuntimeExports.jsx(Learn,{})}),jsxRuntimeExports.jsx(Route,{path:"/faq",element:jsxRuntimeExports.jsx(Faq,{})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(NotFoundPage,{})})]})})})})),queryClient=new QueryClient,root=client.createRoot(document.getElementById("root"));root.render(jsxRuntimeExports.jsx(WagmiProvider,{config:wagmiConfig,children:jsxRuntimeExports.jsx(QueryClientProvider,{client:queryClient,children:jsxRuntimeExports.jsx(App,{})})}));export{WuiCardSelect as $,AccountController as A,Buffer as B,ChainController as C,WuiCard as D,EventsController as E,WuiIcon as F,WuiImage as G,WuiLoadingHexagon as H,WuiLoadingSpinner as I,WuiLoadingThumbnail as J,WuiShimmer as K,WuiText as L,ModalController as M,WuiVisual as N,OptionsController as O,WuiAccountButton as P,WuiAllWalletsImage as Q,RouterController as R,SnackController as S,TransactionUtil as T,UiHelperUtil as U,Vi as V,W3mFrameRpcConstants as W,WuiAvatar as X,Yi as Y,WuiButton as Z,WuiCardSelectLoader as _,subscribe as a,ConstantsUtil$3 as a$,WuiChip as a0,WuiConnectButton as a1,WuiCtaButton as a2,WuiDetailsGroup as a3,WuiDetailsGroupItem as a4,WuiDropdownMenu as a5,WuiEmailInput as a6,WuiEnsInput as a7,WuiIconBox as a8,WuiIconLink as a9,WuiListAccordion as aA,WuiListContent as aB,WuiListNetwork as aC,WuiListWalletTransaction as aD,WuiPromo as aE,WuiBalance as aF,WuiProfileButton as aG,WuiProfileButtonV2 as aH,WuiChipButton as aI,WuiCompatibleNetwork as aJ,WuiBanner as aK,WuiBannerImg as aL,WuiListToken as aM,WuiListDescription as aN,WuiInputAmount as aO,WuiPreviewItem as aP,WuiListAccount as aQ,WuiIconButton as aR,WuiListButton as aS,WuiListSocial as aT,WuiSelect as aU,WuiFlex as aV,WuiGrid as aW,WuiSeparator as aX,ApiController as aY,__vitePreload as aZ,CoreHelperUtil as a_,WuiInputElement as aa,WuiInputNumeric as ab,WuiInputText as ac,WuiLink as ad,WuiListItem as ae,WuiTransactionListItem as af,WuiTransactionListItemLoader as ag,WuiListWallet as ah,WuiLogoSelect as ai,WuiLogo as aj,WuiNetworkButton as ak,WuiNetworkImage as al,WuiOtp as am,WuiQrCode as an,WuiSearchBar as ao,WuiSnackbar as ap,WuiAlertBar as aq,WuiTabs as ar,WuiTokenButton as as,WuiTag as at,WuiTooltip as au,WuiTokenListItem as av,WuiTransactionVisual as aw,WuiVisualThumbnail as ax,WuiWalletImage as ay,WuiNoticeCard as az,r$5 as b,ThemeController as b0,isAddress as b1,InvalidAddressError as b2,BaseError$3 as b3,getUrl$1 as b4,stringify$1 as b5,decodeErrorResult as b6,call as b7,concat$3 as b8,encodeAbiParameters as b9,HttpRequestError as ba,isHex as bb,reactExports as bc,utils as bd,patterns as be,Hash as bf,hash$7 as bg,toBytes as bh,exists as bi,bytes as bj,concatBytes as bk,randomBytes as bl,sha256$3 as bm,customElement as c,ConnectionController as d,Wf as e,commonjsGlobal as f,getDefaultExportFromCjs as g,h$3 as h,i$4 as i,eventemitter3Exports as j,ke as k,bnExports$1 as l,eventsExports as m,getAugmentedNamespace as n,browser$1$1 as o,proxy as p,buffer as q,ref as r,subscribeKey as s,require$$3 as t,inherits_browserExports as u,Oe$1 as v,MathUtil as w,initializeTheming as x,setColorTheme as y,setThemeVariables as z};
